import "./index.css";
import { defineStore, storeToRefs, createPinia, getActivePinia, setActivePinia } from "pinia";
import { readonly, reactive, computed, shallowRef, defineComponent, openBlock, createBlock, unref, withCtx, renderSlot, createElementVNode, createElementBlock, normalizeStyle, normalizeClass, createCommentVNode, useAttrs, mergeProps, Fragment, renderList, ref, onMounted, watch, onBeforeUnmount, withDirectives, vShow, createVNode, toDisplayString, createTextVNode, withModifiers, useSlots, provide, inject, nextTick, markRaw, vModelText, onUpdated, vModelSelect, createSlots, h, Transition, useCssVars, createStaticVNode, onUnmounted, resolveComponent, normalizeProps, guardReactiveProps, toRaw, resolveDynamicComponent, vModelCheckbox, vModelRadio, withKeys, Teleport } from "vue";
import uPlot from "uplot";
import "uplot/dist/uPlot.min.css";
import { Button, Modal, Select, Form, Input, Switch, Checkbox, Tabs, TabPane, Drawer, Tooltip, Table, Radio, RadioGroup, RadioButton, Pagination, Popover, FormItem, Textarea, Slider, InputNumber, AutoComplete, RangePicker } from "ant-design-vue";
import { useRouter, useRoute } from "vue-router";
import { ArrowLeftOutlined } from "@ant-design/icons-vue";
import { GridLayout, GridItem } from "vue-grid-layout-v3";
import dayjs from "dayjs";
import { parser } from "@prometheus-io/lezer-promql";
import axios from "axios";
import Map$1 from "ol/Map";
import View from "ol/View";
import Tile from "ol/layer/Tile";
import Vector from "ol/layer/Vector";
import Heatmap from "ol/layer/Heatmap";
import OSM from "ol/source/OSM";
import XYZ from "ol/source/XYZ";
import Vector$1 from "ol/source/Vector";
import Feature from "ol/Feature";
import Point from "ol/geom/Point";
import LineString from "ol/geom/LineString";
import Polygon from "ol/geom/Polygon";
import { fromLonLat, toLonLat } from "ol/proj";
import { getArea, getLength } from "ol/sphere";
import { Circle, Fill, Stroke, Style, Text } from "ol/style";
import { defaults } from "ol/control";
import Zoom from "ol/control/Zoom";
import ScaleLine from "ol/control/ScaleLine";
import Attribution from "ol/control/Attribution";
import Draw from "ol/interaction/Draw";
import GeoJSON from "ol/format/GeoJSON";
import "ol/ol.css";
const LoadingStateEnum = {
  Loading: "Loading",
  Done: "Done",
  Error: "Error",
  NotStarted: "NotStarted",
  Streaming: "Streaming"
};
function createDataFrame(opts) {
  const fields = opts.fields.map((f) => ({
    name: f.name,
    type: f.type ?? inferType$1(f.values),
    config: f.config ?? {},
    values: f.values,
    labels: f.labels
  }));
  const length = fields.reduce((max, f) => Math.max(max, f.values.length), 0);
  return {
    refId: opts.refId,
    name: opts.name,
    fields,
    length,
    meta: opts.meta
  };
}
function inferType$1(values) {
  const sample = values.find((v) => v != null);
  if (typeof sample === "number") return "number";
  if (typeof sample === "boolean") return "boolean";
  if (sample instanceof Date) return "time";
  if (typeof sample === "string" && !Number.isNaN(Date.parse(sample)) && /\d{4}-\d{2}-\d{2}/.test(sample)) {
    return "time";
  }
  return typeof sample === "string" ? "string" : "other";
}
const TIME_SERIES_VALUE_FIELD_NAME = "Value";
const TIME_SERIES_TIME_FIELD_NAME = "Time";
function formatLabels(labels) {
  if (!labels) return "";
  return Object.entries(labels).filter(([, v]) => v != null && v !== "").map(([k, v]) => `${k}=${v}`).join(", ");
}
function getFieldDisplayName(field, frame, allFrames) {
  const name = calculateFieldDisplayName(field, frame, allFrames);
  if (field.state?.displayName !== name) {
    field.state = { ...field.state || {}, displayName: name };
  }
  return name;
}
function isGenericValueName(s) {
  const t2 = s.trim();
  if (!t2 || t2 === TIME_SERIES_VALUE_FIELD_NAME) return true;
  if (/^Value\s*\{/.test(t2)) return true;
  return false;
}
function calculateFieldDisplayName(field, frame, allFrames) {
  const cfg = field.config ?? {};
  if (cfg.displayName && String(cfg.displayName).length && !isGenericValueName(String(cfg.displayName))) {
    return String(cfg.displayName);
  }
  if (cfg.displayNameFromDS && String(cfg.displayNameFromDS).length && !isGenericValueName(String(cfg.displayNameFromDS))) {
    return String(cfg.displayNameFromDS);
  }
  if (field.type === "time" && !field.labels) {
    return field.name || TIME_SERIES_TIME_FIELD_NAME;
  }
  const frames = allFrames?.length ? allFrames : frame ? [frame] : [];
  let frameNamesDiffer = false;
  if (frames.length > 1) {
    for (let i = 1; i < frames.length; i++) {
      if (frames[i].name !== frames[i - 1].name) {
        frameNamesDiffer = true;
        break;
      }
    }
  }
  const parts = [];
  let frameNameAdded = false;
  let labelsAdded = false;
  if (frameNamesDiffer && frame?.name) {
    parts.push(frame.name);
    frameNameAdded = true;
  }
  if (field.name && !isGenericValueName(field.name)) {
    parts.push(field.name);
  }
  if (field.labels && Object.keys(field.labels).length) {
    const singleLabel = getSingleLabelName(
      frames.length ? frames : frame ? [frame] : []
    );
    if (singleLabel && field.labels[singleLabel] != null && field.labels[singleLabel] !== "") {
      parts.push(String(field.labels[singleLabel]));
      labelsAdded = true;
    } else {
      const allLabels = formatLabels(field.labels);
      if (allLabels) {
        parts.push(allLabels);
        labelsAdded = true;
      }
    }
  }
  if (frame && !frameNameAdded && !labelsAdded && isGenericValueName(field.name || "")) {
    if (frame.name) {
      parts.push(frame.name);
      frameNameAdded = true;
    }
  }
  if (parts.length) return parts.join(" ");
  if (field.name) return field.name;
  if (frame?.name) return frame.name;
  return TIME_SERIES_VALUE_FIELD_NAME;
}
function getSingleLabelName(frames) {
  const keys = /* @__PURE__ */ new Set();
  for (const fr of frames) {
    for (const f of fr.fields) {
      if (!f.labels) continue;
      for (const k of Object.keys(f.labels)) keys.add(k);
      if (keys.size > 1) return null;
    }
  }
  if (keys.size === 1) return [...keys][0];
  return null;
}
function toDataFrameDTO(frame) {
  return {
    ...frame,
    fields: frame.fields.map((f) => ({
      ...f,
      values: [...f.values],
      config: { ...f.config }
    }))
  };
}
function cloneValue(v) {
  if (v == null || typeof v !== "object") return v;
  if (Array.isArray(v)) return v.map(cloneValue);
  return { ...v };
}
function asStringLabels(labels) {
  if (!labels) return void 0;
  const out = {};
  for (const [k, v] of Object.entries(labels)) {
    if (v == null) continue;
    out[String(k)] = String(v);
  }
  return out;
}
function isUint64String(v) {
  if (!/^\d+$/.test(v)) return false;
  if (v.length > 15) return true;
  try {
    const n = Number(v);
    return Number.isFinite(n) && !Number.isSafeInteger(n);
  } catch {
    return true;
  }
}
function normalizeTimeValue(v, trackNs) {
  if (v == null || v === "") return null;
  if (typeof v === "number") {
    if (!Number.isFinite(v)) return null;
    if (v > 1e15) {
      trackNs();
      return Math.floor(v / 1e6);
    }
    if (v > 0 && v < 1e11) return Math.floor(v * 1e3);
    return v;
  }
  if (v instanceof Date) return v.getTime();
  if (typeof v === "string" && /^\d+$/.test(v)) {
    if (v.length > 15) {
      trackNs();
      const ms = Number(v.slice(0, -6));
      return Number.isFinite(ms) ? ms : null;
    }
    const n2 = Number(v);
    if (Number.isFinite(n2)) return normalizeTimeValue(n2, trackNs);
  }
  const n = Number(v);
  if (Number.isFinite(n)) return normalizeTimeValue(n, trackNs);
  const d = Date.parse(String(v));
  return Number.isFinite(d) ? d : null;
}
function padField(f, len) {
  const values = f.values.slice(0, len);
  while (values.length < len) values.push(null);
  return {
    name: f.name,
    type: f.type,
    config: { ...f.config || {} },
    values,
    labels: asStringLabels(f.labels),
    state: f.state ? { ...f.state } : void 0
  };
}
function normalizeDataFrames(frames, ctx) {
  return (frames ?? []).map((frame) => {
    const refId = ctx?.refId ?? frame.refId;
    const fieldsIn = frame.fields ?? [];
    const len = fieldsIn.reduce(
      (m, f) => Math.max(m, f.values?.length ?? 0),
      0
    );
    const uint64Fields = /* @__PURE__ */ new Set();
    const nanosecondFields = /* @__PURE__ */ new Set();
    const fields = fieldsIn.map((f) => {
      let type = f.type;
      let values = (f.values ?? []).map((v) => v);
      if (type === "time" || /^time$/i.test(f.name)) {
        type = "time";
        values = values.map(
          (v) => normalizeTimeValue(v, () => {
            nanosecondFields.add(f.name);
          })
        );
      } else if (type === "number") {
        values = values.map((v) => {
          if (v == null || v === "") return null;
          if (typeof v === "number") return v;
          if (typeof v === "bigint") {
            const s = v.toString();
            if (isUint64String(s) || v > BigInt(Number.MAX_SAFE_INTEGER) || v < BigInt(Number.MIN_SAFE_INTEGER)) {
              uint64Fields.add(f.name);
              return s;
            }
            return Number(v);
          }
          if (typeof v === "string") {
            if (v === "NaN") return NaN;
            if (v === "+Inf" || v === "Infinity") return Infinity;
            if (v === "-Inf" || v === "-Infinity") return -Infinity;
            if (isUint64String(v)) {
              uint64Fields.add(f.name);
              return v;
            }
            const n2 = Number(v);
            return Number.isFinite(n2) || n2 === Infinity || n2 === -Infinity || Number.isNaN(n2) ? n2 : null;
          }
          const n = Number(v);
          return Number.isFinite(n) || n === Infinity || n === -Infinity || Number.isNaN(n) ? n : null;
        });
      }
      return padField(
        {
          name: f.name,
          type,
          config: { ...f.config || {} },
          values,
          labels: asStringLabels(f.labels),
          state: f.state
        },
        len
      );
    });
    const prevMeta = frame.meta ? cloneValue(frame.meta) : {};
    const prevCustom = prevMeta.custom && typeof prevMeta.custom === "object" && !Array.isArray(prevMeta.custom) ? { ...prevMeta.custom } : {};
    const custom = { ...prevCustom };
    if (ctx?.source != null) custom.source = ctx.source;
    if (ctx?.datasourceUid != null) custom.datasourceUid = ctx.datasourceUid;
    if (ctx?.profile != null) custom.profile = ctx.profile;
    if (ctx?.signal != null) custom.signal = ctx.signal;
    if (ctx?.requestId != null) custom.requestId = ctx.requestId;
    if (ctx?.semanticKind != null) custom.semanticKind = ctx.semanticKind;
    if (ctx?.preferredVisualisationType != null) {
      custom.preferredVisualisationType = ctx.preferredVisualisationType;
    }
    if (uint64Fields.size > 0) {
      const existing = Array.isArray(prevCustom.uint64Fields) ? prevCustom.uint64Fields : [];
      custom.uint64Fields = Array.from(/* @__PURE__ */ new Set([...existing, ...uint64Fields]));
    }
    if (nanosecondFields.size > 0) {
      const existing = Array.isArray(prevCustom.nanosecondFields) ? prevCustom.nanosecondFields : [];
      custom.nanosecondFields = Array.from(
        /* @__PURE__ */ new Set([...existing, ...nanosecondFields])
      );
    }
    const meta2 = { ...prevMeta };
    if (Object.keys(custom).length > 0) {
      meta2.custom = custom;
    }
    if (ctx?.preferredVisualisationType != null && meta2.preferredVisualisationType == null) {
      meta2.preferredVisualisationType = ctx.preferredVisualisationType;
    }
    return createDataFrame({
      refId,
      name: frame.name,
      meta: Object.keys(meta2).length > 0 ? meta2 : void 0,
      fields: fields.map((f) => ({
        name: f.name,
        type: f.type,
        values: f.values,
        config: f.config,
        labels: f.labels
      }))
    });
  });
}
function frameFingerprint(frames) {
  return JSON.stringify(
    frames.map((fr) => ({
      name: fr.name,
      refId: fr.refId,
      len: fr.length,
      fields: fr.fields.map((f) => ({
        name: f.name,
        type: f.type,
        labels: f.labels ?? {},
        config: {
          displayName: f.config?.displayName,
          unit: f.config?.unit,
          displayNameFromDS: f.config?.displayNameFromDS
        },
        n: f.values.length,
        head: f.values.slice(0, 3),
        tail: f.values.slice(-2)
      })),
      meta: fr.meta ?? {}
    }))
  );
}
function dateTime(input) {
  if (input == null) return /* @__PURE__ */ new Date();
  return new Date(input);
}
function rangeUtil_parse(raw, now = /* @__PURE__ */ new Date()) {
  const from = parseRelative(raw.from, now);
  const to = parseRelative(raw.to, now);
  return { from, to, raw };
}
function parseRelative(value, now, _edge) {
  if (value instanceof Date) return value;
  if (value === "now") return new Date(now);
  const m = /^now-(\d+)([smhdwMy])$/.exec(value);
  if (m) {
    const n = Number(m[1]);
    const unit = m[2];
    const d = new Date(now);
    switch (unit) {
      case "s":
        d.setSeconds(d.getSeconds() - n);
        break;
      case "m":
        d.setMinutes(d.getMinutes() - n);
        break;
      case "h":
        d.setHours(d.getHours() - n);
        break;
      case "d":
        d.setDate(d.getDate() - n);
        break;
      case "w":
        d.setDate(d.getDate() - n * 7);
        break;
      case "M":
        d.setMonth(d.getMonth() - n);
        break;
      case "y":
        d.setFullYear(d.getFullYear() - n);
        break;
    }
    return d;
  }
  return new Date(value);
}
function getInterval(range, resolution = 1e3) {
  const ms = Math.max(1, range.to.getTime() - range.from.getTime());
  const step = Math.max(1e3, Math.floor(ms / resolution));
  if (step < 6e4) return `${Math.round(step / 1e3)}s`;
  if (step < 36e5) return `${Math.round(step / 6e4)}m`;
  return `${Math.round(step / 36e5)}h`;
}
const defaultRefreshIntervals = [
  "5s",
  "10s",
  "30s",
  "1m",
  "5m",
  "15m",
  "30m",
  "1h",
  "2h",
  "1d"
];
function intervalToMs(input) {
  const raw = String(input ?? "").trim();
  if (!raw || raw.toLowerCase() === "off") return 0;
  if (raw === "LIVE" || raw.toLowerCase() === "auto") return 0;
  if (/^\d+$/.test(raw)) {
    const n = Number(raw);
    return Number.isFinite(n) && n > 0 ? n : 0;
  }
  const m = raw.match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/i);
  if (!m) return 0;
  const v = Number(m[1]);
  if (!Number.isFinite(v) || v <= 0) return 0;
  const u = m[2].toLowerCase();
  if (u === "ms") return v;
  if (u === "s") return v * 1e3;
  if (u === "m") return v * 6e4;
  if (u === "h") return v * 36e5;
  if (u === "d") return v * 864e5;
  return 0;
}
const stringToMs = intervalToMs;
const registry$3 = /* @__PURE__ */ new Map();
function registerTransformer(id, fn) {
  registry$3.set(id, fn);
}
function getTransformer(id) {
  return registry$3.get(id);
}
function listTransformerIds$1() {
  return [...registry$3.keys()];
}
const ALIASES$2 = {
  // filterFieldsByName is first-class; filterByName is internal alias
  filterByName: "filterFieldsByName",
  filterFramesByRefId: "filterByRefId",
  seriesToColumns: "joinByField"
};
const DEFAULT_OPTIONS = {
  limit: { limitField: 10 },
  sortBy: { sort: [] },
  reduce: { reducers: ["sum"] },
  histogram: { bucketCount: 10 },
  smoothing: { windowSize: 3 },
  filterByValue: { type: "include", filters: [] },
  prepareTimeSeries: { format: "multi" }
};
function resolveTransformerId(id) {
  return ALIASES$2[id] ?? id;
}
function deepCloneFrames(frames) {
  return frames.map(
    (frame) => createDataFrame({
      refId: frame.refId,
      name: frame.name,
      meta: frame.meta ? { ...frame.meta } : void 0,
      fields: frame.fields.map((f) => ({
        name: f.name,
        type: f.type,
        config: { ...f.config || {} },
        values: [...f.values],
        labels: f.labels ? { ...f.labels } : void 0
      }))
    })
  );
}
function interpolateOptions(value, interpolate) {
  if (!interpolate) return value;
  if (typeof value === "string") return interpolate(value);
  if (Array.isArray(value))
    return value.map((v) => interpolateOptions(v, interpolate));
  if (value && typeof value === "object") {
    const out = {};
    for (const [k, v] of Object.entries(value)) {
      out[k] = interpolateOptions(v, interpolate);
    }
    return out;
  }
  return value;
}
function patternFromFilterOptions(options) {
  if (options == null) return "";
  if (typeof options === "string" || typeof options === "number")
    return String(options);
  if (typeof options === "object") {
    const o = options;
    if (o.pattern != null) return String(o.pattern);
    if (o.refId != null) return String(o.refId);
    if (o.value != null) return String(o.value);
    if (Array.isArray(o.names))
      return o.names.map(String).join("|");
  }
  return String(options);
}
function compileMatcher(raw) {
  const s = raw.trim();
  if (!s) return () => true;
  const m = s.match(/^\/(.+)\/([gimsuy]*)$/);
  if (m) {
    try {
      const re = new RegExp(m[1], m[2]);
      return (v) => re.test(v);
    } catch {
      return (v) => v === s;
    }
  }
  try {
    const re = new RegExp(`^(?:${s})$`);
    return (v) => re.test(v);
  } catch {
    return (v) => v === s;
  }
}
function matchFrameFilter(frame, filter2) {
  if (filter2 == null || filter2 === "") return true;
  if (typeof filter2 === "string") {
    const hit2 = compileMatcher(filter2);
    return hit2(String(frame.refId ?? "")) || hit2(String(frame.name ?? ""));
  }
  const id = String(filter2.id || "byRefId");
  const pattern = patternFromFilterOptions(filter2.options);
  const hit = compileMatcher(pattern);
  if (id === "byName" || id === "byFrameName") {
    return hit(String(frame.name ?? ""));
  }
  if (id === "byRefId" || id === "byFrameRefID" || id === "byFrameRefId") {
    return hit(String(frame.refId ?? ""));
  }
  return hit(String(frame.refId ?? "")) || hit(String(frame.name ?? ""));
}
function applyWithFrameFilter(frames, filter2, fn, options) {
  if (filter2 == null || filter2 === "") {
    return fn(frames, options);
  }
  const matched = [];
  const passthrough = /* @__PURE__ */ new Map();
  frames.forEach((f, i) => {
    if (matchFrameFilter(f, filter2)) {
      matched.push(f);
    } else {
      passthrough.set(i, f);
    }
  });
  if (!matched.length) return frames;
  const transformed = fn(matched, options);
  const out = [];
  let inserted = false;
  for (let i = 0; i < frames.length; i++) {
    if (passthrough.has(i)) {
      out.push(passthrough.get(i));
    } else if (!inserted) {
      out.push(...transformed);
      inserted = true;
      transformed.length;
    }
  }
  if (!inserted) out.push(...transformed);
  return out;
}
function snapshotFrames(frames) {
  return {
    frameCount: frames.length,
    fieldNames: frames.flatMap((f) => f.fields.map((field) => field.name)),
    rowCounts: frames.map((f) => f.length ?? f.fields[0]?.values?.length ?? 0)
  };
}
function applyTransformationsWithTrace(frames, transformations = [], context) {
  const diagnostics = [];
  const steps = [];
  let acc = deepCloneFrames(frames);
  steps.push({
    id: "__input__",
    resolvedId: "__input__",
    frameCount: acc.length,
    fieldNames: acc.flatMap((f) => f.fields.map((field) => field.name)),
    rowCounts: acc.map((f) => f.length ?? f.fields[0]?.values?.length ?? 0),
    optionKeys: []
  });
  for (const t2 of transformations) {
    const resolvedId = resolveTransformerId(t2.id);
    if (t2.disabled) {
      steps.push({
        id: t2.id,
        resolvedId,
        disabled: true,
        ...snapshotFrames(acc),
        optionKeys: Object.keys(t2.options || {})
      });
      continue;
    }
    const fn = getTransformer(resolvedId) ?? getTransformer(t2.id);
    if (!fn) {
      diagnostics.push({
        id: t2.id,
        level: "warn",
        message: `Unknown transformation: ${t2.id}`
      });
      steps.push({
        id: t2.id,
        resolvedId,
        ...snapshotFrames(acc),
        error: `Unknown transformation: ${t2.id}`,
        optionKeys: Object.keys(t2.options || {})
      });
      continue;
    }
    const defaults2 = DEFAULT_OPTIONS[resolvedId] ?? DEFAULT_OPTIONS[t2.id] ?? {};
    const merged = interpolateOptions(
      { ...defaults2, ...t2.options || {} },
      context?.interpolate
    );
    try {
      const before = acc;
      const next = applyWithFrameFilter(
        acc,
        t2.filter,
        fn,
        merged
      );
      acc = deepCloneFrames(next);
      steps.push({
        id: t2.id,
        resolvedId,
        ...snapshotFrames(acc),
        optionKeys: Object.keys(t2.options || {}),
        filtered: t2.filter != null && t2.filter !== ""
      });
      void before;
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      diagnostics.push({ id: t2.id, level: "error", message: msg });
      steps.push({
        id: t2.id,
        resolvedId,
        ...snapshotFrames(acc),
        error: msg,
        optionKeys: Object.keys(t2.options || {})
      });
      throw e;
    }
  }
  return { frames: acc, steps, diagnostics };
}
function applyTransformations(frames, transformations = [], diagnostics, context) {
  const result = applyTransformationsWithTrace(
    frames,
    transformations,
    context
  );
  if (diagnostics) diagnostics.push(...result.diagnostics);
  return result.frames;
}
function listTransformerIds() {
  return listTransformerIds$1();
}
function listStandardTransformers() {
  return listTransformerIds();
}
const standardTransformers = listStandardTransformers();
const V1_SCHEMA_VERSION = 42;
function clone$1(v) {
  return JSON.parse(JSON.stringify(v));
}
function identity$1(to, id) {
  return { id, to, migrate: (d) => d };
}
function mapPanels(dashboard, fn) {
  const panels2 = Array.isArray(dashboard.panels) ? dashboard.panels.map((p) => {
    const next = fn({ ...p });
    if (Array.isArray(next.panels)) {
      next.panels = next.panels.map((c) => fn({ ...c }));
    }
    return next;
  }) : dashboard.panels;
  return { ...dashboard, panels: panels2 };
}
function normalizePanel(panel2) {
  let type = panel2.type || "timeseries";
  if (type === "graph") type = "timeseries";
  if (type === "singlestat") type = "stat";
  return {
    ...panel2,
    id: panel2.id ?? 0,
    type,
    gridPos: panel2.gridPos ?? { x: 0, y: 0, w: 12, h: 8 },
    targets: panel2.targets ?? [],
    options: panel2.options ?? {},
    fieldConfig: panel2.fieldConfig ?? { defaults: {}, overrides: [] }
  };
}
const migrateTo2 = {
  id: "graphite-target-forms",
  to: 2,
  migrate: (dashboard) => dashboard
};
const migrateTo3 = identity$1(3, "panel-id-assignment-moved-to-model");
const migrateTo4 = identity$1(4, "inbound-pulldown-nav-alias");
const migrateTo6 = {
  id: "annotations-list-shape",
  to: 6,
  migrate: (dashboard) => {
    const annotations = dashboard.annotations;
    if (!annotations) return { ...dashboard, annotations: { list: [] } };
    if (Array.isArray(annotations))
      return { ...dashboard, annotations: { list: annotations } };
    if (!annotations.list)
      return { ...dashboard, annotations: { ...annotations, list: [] } };
    return dashboard;
  }
};
const migrateTo7 = identity$1(7, "nav-removed");
const migrateTo8 = {
  id: "panel-links-array",
  to: 8,
  migrate: (dashboard) => mapPanels(dashboard, (p) => {
    if (p.links && !Array.isArray(p.links)) return { ...p, links: [] };
    return p;
  })
};
const migrateTo9 = identity$1(9, "pulldowns-nav-cleanup");
const migrateTo10 = {
  id: "template-variable-refresh",
  to: 10,
  migrate: (dashboard) => {
    const list = dashboard.templating?.list ?? (Array.isArray(dashboard.templating) ? dashboard.templating : []);
    return {
      ...dashboard,
      templating: {
        list: list.map((v) => ({
          ...v,
          refresh: v.refresh === true ? 1 : v.refresh === false ? 0 : v.refresh ?? 0
        }))
      }
    };
  }
};
const migrateTo12 = {
  id: "time-picker-and-y-axis",
  to: 12,
  migrate: (dashboard) => dashboard
};
const migrateTo13 = identity$1(13, "table-styles-moved");
const migrateTo14 = {
  id: "shared-crosshair-to-graph-tooltip",
  to: 14,
  migrate: (dashboard) => ({
    ...dashboard,
    graphTooltip: dashboard.sharedCrosshair ? 1 : dashboard.graphTooltip ?? 0
  })
};
const migrateTo16 = {
  id: "rows-to-panels",
  to: 16,
  migrate: (dashboard) => {
    const rows = dashboard.rows;
    if (!rows?.length || (dashboard.panels?.length ?? 0) > 0) {
      const next2 = { ...dashboard };
      delete next2.rows;
      return next2;
    }
    const panels2 = [];
    let y = 0;
    let id = 1;
    for (const row of rows) {
      panels2.push({
        id: id++,
        type: "row",
        title: row.title ?? "Row",
        gridPos: { x: 0, y, w: 24, h: 1 },
        collapsed: !!row.collapse,
        panels: row.panels ?? [],
        targets: []
      });
      y += 1;
      for (const p of row.panels ?? []) {
        panels2.push({
          ...p,
          id: p.id ?? id++,
          gridPos: p.gridPos ?? { x: 0, y, w: 12, h: 8 }
        });
        y += p.gridPos?.h ?? 8;
      }
    }
    const next = { ...dashboard, panels: panels2 };
    delete next.rows;
    return next;
  }
};
const migrateTo17 = {
  id: "min-span-to-max-per-row",
  to: 17,
  migrate: (dashboard) => mapPanels(dashboard, (p) => {
    if (p.minSpan != null && p.maxPerRow == null) {
      const { minSpan, ...rest } = p;
      return {
        ...rest,
        maxPerRow: Math.floor(24 / Number(minSpan)) || void 0
      };
    }
    return p;
  })
};
const migrateTo18 = {
  id: "gauge-options",
  to: 18,
  migrate: (dashboard) => dashboard
};
const migrateTo19 = {
  id: "panel-links-url",
  to: 19,
  migrate: (dashboard) => mapPanels(dashboard, (p) => {
    if (!Array.isArray(p.links)) return p;
    return {
      ...p,
      links: p.links.map((l) => {
        if (l.url != null) return l;
        if (l.dashboard) return { ...l, url: `dashboard/db/${l.dashboard}` };
        return l;
      })
    };
  })
};
const migrateTo20 = {
  id: "variable-tags",
  to: 20,
  migrate: (dashboard) => dashboard
};
const migrateTo21 = {
  id: "data-links",
  to: 21,
  migrate: (dashboard) => dashboard
};
const migrateTo22 = {
  id: "table-styles-to-field-config-prep",
  to: 22,
  migrate: (dashboard) => dashboard
};
const migrateTo23 = {
  id: "variable-multi-align",
  to: 23,
  migrate: (dashboard) => dashboard
};
const migrateTo24 = {
  id: "angular-table-text-link",
  to: 24,
  migrate: (dashboard) => dashboard
};
const migrateTo25 = {
  id: "constant-variables-hide",
  to: 25,
  migrate: (dashboard) => {
    const list = dashboard.templating?.list ?? [];
    return {
      ...dashboard,
      templating: {
        list: list.map(
          (v) => v.type === "constant" ? { ...v, hide: v.hide ?? 2 } : v
        )
      }
    };
  }
};
const migrateTo26 = {
  id: "text-panel-options",
  to: 26,
  migrate: (dashboard) => mapPanels(dashboard, (p) => {
    if (p.type !== "text") return p;
    if (p.options?.content != null) return p;
    return {
      ...p,
      options: {
        mode: p.mode ?? p.options?.mode ?? "markdown",
        content: p.content ?? p.options?.content ?? ""
      }
    };
  })
};
const migrateTo27 = {
  id: "variable-refresh-on-load",
  to: 27,
  migrate: (dashboard) => dashboard
};
const migrateTo28 = {
  id: "remove-variable-tags",
  to: 28,
  migrate: (dashboard) => {
    const list = dashboard.templating?.list ?? [];
    return {
      ...dashboard,
      templating: {
        list: list.map((v) => {
          const next = { ...v };
          delete next.tags;
          delete next.tagsQuery;
          delete next.tagValuesQuery;
          delete next.useTags;
          return next;
        })
      }
    };
  }
};
const migrateTo29 = {
  id: "query-variable-refresh",
  to: 29,
  migrate: (dashboard) => dashboard
};
const migrateTo30 = {
  id: "normalize-panels-field-config",
  to: 30,
  migrate: (dashboard) => mapPanels(dashboard, normalizePanel)
};
const migrateTo31 = {
  id: "panel-title-placeholders",
  to: 31,
  migrate: (dashboard) => dashboard
};
const migrateTo32 = {
  id: "timeseries-area-opacity",
  to: 32,
  migrate: (dashboard) => dashboard
};
const migrateTo33 = {
  id: "templating-list-shape",
  to: 33,
  migrate: (dashboard) => {
    const list = dashboard.templating?.list ?? (Array.isArray(dashboard.templating) ? dashboard.templating : []);
    return { ...dashboard, templating: { list } };
  }
};
const migrateTo34 = {
  id: "cloudwatch-query-type",
  to: 34,
  migrate: (dashboard) => dashboard
};
const migrateTo35 = {
  id: "ensure-field-config-overrides",
  to: 35,
  migrate: (dashboard) => mapPanels(dashboard, (p) => ({
    ...p,
    fieldConfig: {
      defaults: p.fieldConfig?.defaults ?? {},
      overrides: p.fieldConfig?.overrides ?? []
    }
  }))
};
const migrateTo36 = {
  id: "datasource-refs-object",
  to: 36,
  migrate: (dashboard) => mapPanels(dashboard, (p) => {
    let next = p;
    if (typeof p.datasource === "string") {
      next = {
        ...next,
        datasource: { type: "prometheus", uid: p.datasource }
      };
    }
    if (Array.isArray(next.targets)) {
      next = {
        ...next,
        targets: next.targets.map(
          (t2) => typeof t2.datasource === "string" ? { ...t2, datasource: { type: "prometheus", uid: t2.datasource } } : t2
        )
      };
    }
    return next;
  })
};
const migrateTo37 = {
  id: "legend-options-alignment",
  to: 37,
  migrate: (dashboard) => dashboard
};
const migrateTo38 = {
  id: "fiscal-year-start-month",
  to: 38,
  migrate: (dashboard) => ({
    ...dashboard,
    fiscalYearStartMonth: dashboard.fiscalYearStartMonth ?? 0
  })
};
const migrateTo39 = {
  id: "refresh-boolean-to-string",
  to: 39,
  migrate: (dashboard) => {
    if (typeof dashboard.refresh === "boolean") {
      return { ...dashboard, refresh: dashboard.refresh ? "30s" : "" };
    }
    return dashboard;
  }
};
const migrateTo40 = {
  id: "timezone-browser-default",
  to: 40,
  migrate: (dashboard) => ({
    ...dashboard,
    timezone: dashboard.timezone ?? ""
  })
};
const migrateTo41 = {
  id: "schema-41-identity",
  to: 41,
  migrate: (dashboard) => dashboard
};
const migrateTo42 = {
  id: "hide-from-functionality",
  to: 42,
  migrate: (dashboard) => mapPanels(dashboard, (p) => {
    const defaults2 = p.fieldConfig?.defaults ?? {};
    const custom = defaults2.custom ?? {};
    if (custom.hideFrom) return p;
    if (Object.keys(custom).length === 0 && !p.fieldConfig) return p;
    return {
      ...p,
      fieldConfig: {
        defaults: {
          ...defaults2,
          custom: {
            ...custom,
            hideFrom: custom.hideFrom ?? {
              legend: false,
              tooltip: false,
              viz: false
            }
          }
        },
        overrides: p.fieldConfig?.overrides ?? []
      }
    };
  })
};
const v1Migrations = [
  migrateTo2,
  migrateTo3,
  migrateTo4,
  migrateTo6,
  migrateTo7,
  migrateTo8,
  migrateTo9,
  migrateTo10,
  migrateTo12,
  migrateTo13,
  migrateTo14,
  migrateTo16,
  migrateTo17,
  migrateTo18,
  migrateTo19,
  migrateTo20,
  migrateTo21,
  migrateTo22,
  migrateTo23,
  migrateTo24,
  migrateTo25,
  migrateTo26,
  migrateTo27,
  migrateTo28,
  migrateTo29,
  migrateTo30,
  migrateTo31,
  migrateTo32,
  migrateTo33,
  migrateTo34,
  migrateTo35,
  migrateTo36,
  migrateTo37,
  migrateTo38,
  migrateTo39,
  migrateTo40,
  migrateTo41,
  migrateTo42
];
function runMigrations(input, migrations) {
  let dashboard = clone$1(input);
  const applied = [];
  for (const migration of [...migrations].sort((a, b) => a.to - b.to)) {
    if (Number(dashboard.schemaVersion ?? 0) >= migration.to) continue;
    const from = Number(dashboard.schemaVersion ?? 0);
    dashboard = migration.migrate(dashboard);
    dashboard.schemaVersion = migration.to;
    applied.push({ id: migration.id, from, to: migration.to });
  }
  return { dashboard, applied };
}
function normalizeDashboard(dashboard) {
  return {
    ...dashboard,
    title: String(dashboard.title ?? "New dashboard"),
    schemaVersion: Math.max(
      Number(dashboard.schemaVersion ?? 0),
      V1_SCHEMA_VERSION
    ),
    time: dashboard.time ?? { from: "now-6h", to: "now" },
    templating: dashboard.templating ?? { list: [] },
    annotations: dashboard.annotations ?? { list: [] },
    panels: Array.isArray(dashboard.panels) ? dashboard.panels : []
  };
}
function migrateV1Dashboard(input) {
  const result = runMigrations(input, v1Migrations);
  if (Number(result.dashboard.schemaVersion ?? 0) < V1_SCHEMA_VERSION) {
    result.dashboard.schemaVersion = V1_SCHEMA_VERSION;
  } else {
    result.dashboard.schemaVersion = V1_SCHEMA_VERSION;
  }
  return {
    dashboard: normalizeDashboard(result.dashboard),
    applied: result.applied
  };
}
function migrateDashboard(input) {
  const result = migrateV1Dashboard(input);
  return result.dashboard;
}
function dashboardRoundTrip(input) {
  const migrated = migrateDashboard(input);
  return migrateDashboard(
    JSON.parse(JSON.stringify(migrated))
  );
}
function preserveUnknownFields(original, migrated) {
  const known = /* @__PURE__ */ new Set([
    "uid",
    "title",
    "description",
    "tags",
    "timezone",
    "schemaVersion",
    "version",
    "editable",
    "graphTooltip",
    "time",
    "timepicker",
    "refresh",
    "panels",
    "templating",
    "annotations",
    "links",
    "fiscalYearStartMonth",
    "weekStart",
    "liveNow",
    "rows",
    "style",
    "gnetId"
  ]);
  for (const [k, v] of Object.entries(original)) {
    if (!known.has(k) && !(k in migrated)) {
      migrated[k] = v;
    }
  }
  for (const [k, v] of Object.entries(original)) {
    if (k.startsWith("x-") || k.startsWith("__")) {
      migrated[k] = v;
    }
  }
  return migrated;
}
function formattedValueToString(val) {
  return `${val.prefix ?? ""}${val.text}${val.suffix ?? ""}`;
}
function toFixed(value, decimals) {
  if (decimals == null) {
    if (!Number.isFinite(value)) return String(value);
    if (Number.isInteger(value) || Math.abs(value - Math.round(value)) < 1e-9) {
      return String(Math.round(value));
    }
    const abs = Math.abs(value);
    const d = abs >= 100 ? 0 : abs >= 1 ? 1 : abs >= 0.01 ? 2 : 3;
    return String(Number(value.toFixed(d)));
  }
  return value.toFixed(Math.max(0, Math.min(10, Math.floor(decimals))));
}
function toFixedUnit(unit = "") {
  return (value, decimals) => ({
    text: toFixed(value, decimals),
    suffix: unit ? ` ${unit}` : void 0
  });
}
function scaledUnits(factor, extArray, offset = 0) {
  return (value, decimals) => {
    if (value === null || value === void 0 || Number.isNaN(value)) {
      return { text: "" };
    }
    let si = offset;
    let v = Math.abs(value);
    while (v >= factor && si < extArray.length - 1) {
      v /= factor;
      si += 1;
    }
    const sign = value < 0 ? "-" : "";
    return {
      // When decimals is null/undefined, toFixed uses auto precision (Grafana axis ticks).
      text: `${sign}${toFixed(v, decimals)}`,
      suffix: extArray[si] ? ` ${extArray[si]}` : void 0
    };
  };
}
function booleanValueFormatter(t2 = "True", f = "False") {
  return (value) => ({ text: value ? t2 : f });
}
function locale(value, decimals) {
  try {
    return {
      text: value.toLocaleString(void 0, {
        maximumFractionDigits: decimals ?? 2,
        minimumFractionDigits: decimals ?? void 0
      })
    };
  } catch {
    return { text: toFixed(value, decimals) };
  }
}
function stringFormatter(value) {
  return { text: value == null ? "" : String(value) };
}
function dateTimeAsIso(value) {
  try {
    return { text: new Date(value).toISOString() };
  } catch {
    return { text: String(value) };
  }
}
function dateTimeAsSystem(value, _decimals, _scaled, timeZone) {
  try {
    const d = new Date(value);
    if (Number.isNaN(d.getTime())) return { text: String(value) };
    const pad = (n) => String(n).padStart(2, "0");
    const tz = String(timeZone || "browser").toLowerCase();
    const useUtc = tz === "utc" || tz === "gmt" || tz === "etc/utc";
    const Y = useUtc ? d.getUTCFullYear() : d.getFullYear();
    const M = useUtc ? d.getUTCMonth() + 1 : d.getMonth() + 1;
    const D = useUtc ? d.getUTCDate() : d.getDate();
    const h2 = useUtc ? d.getUTCHours() : d.getHours();
    const m = useUtc ? d.getUTCMinutes() : d.getMinutes();
    const s = useUtc ? d.getUTCSeconds() : d.getSeconds();
    const text = `${Y}-${pad(M)}-${pad(D)} ${pad(h2)}:${pad(m)}:${pad(s)}`;
    return { text };
  } catch {
    return { text: String(value) };
  }
}
const index$3 = /* @__PURE__ */ new Map();
function register$3(id, fn) {
  index$3.set(id, fn);
}
function build() {
  if (index$3.size) return;
  register$3("none", (v, d) => {
    if (d != null) return { text: Number(v).toFixed(d) };
    if (!Number.isFinite(v)) return { text: String(v) };
    if (Number.isInteger(v) || Math.abs(v - Math.round(v)) < 1e-9)
      return { text: String(Math.round(v)) };
    const abs = Math.abs(v);
    if (abs >= 100 && Math.abs(v - Math.round(v)) < 0.5)
      return { text: String(Math.round(v)) };
    const decimals = abs >= 1e3 ? 0 : abs >= 1 ? 1 : abs >= 0.01 ? 2 : 3;
    return { text: String(Number(v.toFixed(decimals))) };
  });
  register$3("short", scaledUnits(1e3, ["", "K", "Mil", "Bil", "Tri"]));
  register$3("percent", (v, d) => ({
    text: d == null ? String(v) : v.toFixed(d),
    suffix: "%"
  }));
  register$3("percentunit", (v, d) => {
    const p = v * 100;
    return {
      text: d == null ? String(Number(p.toPrecision(12))) : p.toFixed(d),
      suffix: "%"
    };
  });
  register$3("locale", (v, d) => locale(v, d));
  register$3("string", (_v) => stringFormatter(_v));
  register$3("bool", booleanValueFormatter());
  register$3("boolean", booleanValueFormatter());
  for (const u of ["ns", "µs", "ms", "s", "m", "h", "d"]) {
    register$3(u, toFixedUnit(u));
  }
  register$3(
    "bytes",
    scaledUnits(1024, ["B", "KiB", "MiB", "GiB", "TiB", "PiB"])
  );
  register$3("decbytes", scaledUnits(1e3, ["B", "kB", "MB", "GB", "TB", "PB"]));
  register$3("bits", scaledUnits(1e3, ["b", "Kbit", "Mbit", "Gbit", "Tbit"]));
  register$3("decbits", scaledUnits(1e3, ["b", "Kbit", "Mbit", "Gbit", "Tbit"]));
  register$3("kbytes", scaledUnits(1024, ["KiB", "MiB", "GiB", "TiB"]));
  register$3("mbytes", scaledUnits(1024, ["MiB", "GiB", "TiB"]));
  for (const u of [
    "cps",
    "ops",
    "reqps",
    "rps",
    "wps",
    "iops",
    "binBps",
    "Bps",
    "pps"
  ]) {
    register$3(u, toFixedUnit(u));
  }
  register$3("dateTimeAsIso", (v) => dateTimeAsIso(v));
  register$3("dateTimeAsSystem", (v) => dateTimeAsSystem(v));
  register$3("sci", (v, d) => ({ text: v.toExponential(d ?? 2) }));
  register$3("humidity", toFixedUnit("%H"));
  register$3("dB", toFixedUnit("dB"));
  register$3("dBm", toFixedUnit("dBm"));
  register$3("celsius", toFixedUnit("°C"));
  register$3("fahrenheit", toFixedUnit("°F"));
  register$3("farenheit", toFixedUnit("°F"));
  register$3("lengthm", toFixedUnit("m"));
  register$3("lengthmm", toFixedUnit("mm"));
  register$3("velocityms", toFixedUnit("m/s"));
}
function getValueFormat(id) {
  build();
  if (!id) return toFixedUnit("");
  if (index$3.has(id)) return index$3.get(id);
  if (id.startsWith("currency")) {
    const sym = id.split(":")[1] || "$";
    return (v, d) => ({
      text: (d == null ? v : Number(v.toFixed(d))).toString(),
      prefix: sym
    });
  }
  if (id.startsWith("time:")) {
    return (v) => dateTimeAsIso(v);
  }
  return toFixedUnit(id);
}
function listValueFormatIds() {
  build();
  return [...index$3.keys()].sort();
}
function formatValueWithUnit(value, unit, decimals) {
  return getValueFormat(unit)(value, decimals);
}
function sortThresholds(steps) {
  return [...steps].sort((a, b) => a.value - b.value);
}
function getActiveThreshold(value, thresholds) {
  if (!thresholds?.steps?.length) return void 0;
  const steps = sortThresholds(thresholds.steps);
  let active = steps[0];
  for (const step of steps) {
    if (value >= step.value) active = step;
  }
  return active;
}
function applyValueMappings(value, mappings) {
  if (!mappings?.length) return void 0;
  for (const m of mappings) {
    if (m.type === "value") {
      const opts = m.options;
      const key = String(value);
      if (opts[key]?.text != null) return opts[key].text;
    }
    if (m.type === "range") {
      const opts = m.options;
      const n = Number(value);
      if (!Number.isNaN(n) && (opts.from == null || n >= opts.from) && (opts.to == null || n <= opts.to)) {
        return opts.result?.text;
      }
    }
    if (m.type === "regex") {
      const opts = m.options;
      if (opts.pattern) {
        try {
          if (new RegExp(opts.pattern).test(String(value ?? "")))
            return opts.result?.text;
        } catch {
        }
      }
    }
    if (m.type === "special") {
      const opts = m.options;
      if (opts.match === "null" && (value == null || value === ""))
        return opts.result?.text;
      if (opts.match === "nan" && typeof value === "number" && Number.isNaN(value))
        return opts.result?.text;
      if (opts.match === "true" && value === true) return opts.result?.text;
      if (opts.match === "false" && value === false) return opts.result?.text;
      if (opts.match === "empty" && value === "") return opts.result?.text;
    }
  }
  return void 0;
}
const NAMED_VIZ_COLORS = {
  green: "#73BF69",
  red: "#F2495C",
  yellow: "#FADE2A",
  orange: "#FF9830",
  blue: "#5794F2",
  purple: "#B877D9",
  gray: "#808080",
  grey: "#808080",
  "super-light-text": "#CCCCDC",
  text: "#CCCCDC"
};
const DEFAULT_THRESHOLDS_STEPS = [
  { value: Number.NEGATIVE_INFINITY, color: "green" },
  { value: 80, color: "red" }
];
function resolveVizColor(color) {
  if (!color) return void 0;
  if (color.startsWith("#") || color.startsWith("rgb")) return color;
  return NAMED_VIZ_COLORS[color] ?? NAMED_VIZ_COLORS[color.toLowerCase()] ?? color;
}
const GRYLRD_STOPS = [
  [115, 191, 105],
  // green #73BF69
  [226, 192, 61],
  // mid (Grafana fieldColor.test calcFn(_, 0.5))
  [242, 73, 92]
  // red #F2495C
];
function continuousGrYlRd(percent) {
  const t2 = Math.max(0, Math.min(1, percent));
  const stops = GRYLRD_STOPS;
  const x = t2 * (stops.length - 1);
  const i = Math.min(Math.floor(x), stops.length - 2);
  const f = x - i;
  const a = stops[i];
  const b = stops[i + 1];
  const r = Math.round(a[0] + (b[0] - a[0]) * f);
  const g = Math.round(a[1] + (b[1] - a[1]) * f);
  const bl = Math.round(a[2] + (b[2] - a[2]) * f);
  return `rgb(${r}, ${g}, ${bl})`;
}
function getFieldColor(value, config = {}) {
  if (config.color?.mode === "fixed" && config.color.fixedColor) {
    return resolveVizColor(config.color.fixedColor);
  }
  if (config.color?.mode === "palette-classic") {
    return "#7EB26D";
  }
  if (config.color?.mode === "continuous-GrYlRd" || config.color?.mode === "continuous-RdYlGr") {
    const min = config.min ?? 0;
    const max = config.max ?? 100;
    const delta = max - min || 1;
    let percent = (value - min) / delta;
    if (!Number.isFinite(percent)) percent = 0;
    percent = Math.max(0, Math.min(1, percent));
    if (config.color?.mode === "continuous-RdYlGr") percent = 1 - percent;
    return continuousGrYlRd(percent);
  }
  const thresholds = config.thresholds?.steps?.length ? config.thresholds : { steps: DEFAULT_THRESHOLDS_STEPS };
  return resolveVizColor(getActiveThreshold(value, thresholds)?.color);
}
function anyToNumber(value) {
  if (value == null || value === "") return NaN;
  if (typeof value === "number") return value;
  if (typeof value === "boolean") return value ? 1 : 0;
  const n = Number(value);
  return n;
}
function toStringProcessor(value) {
  return {
    text: value == null ? "" : String(value),
    numeric: anyToNumber(value)
  };
}
function getDisplayProcessor(options) {
  if (!options?.field) return toStringProcessor;
  const field = options.field;
  const config = field.config ?? {};
  let unit = config.unit;
  if (field.type === "time" && !unit) unit = "dateTimeAsSystem";
  if (field.type === "boolean" && !unit) unit = "bool";
  if (field.type === "string" && !unit) unit = "string";
  const formatFunc = getValueFormat(unit || "none");
  return (value, adjacentDecimals) => {
    const mappedText = applyValueMappings(value, config.mappings);
    const mappedColor = getMappingColor(value, config.mappings);
    if (unit === "string") {
      return {
        text: mappedText ?? (value == null ? "" : String(value)),
        numeric: NaN,
        color: mappedColor ?? getFieldColor(anyToNumber(value), config)
      };
    }
    const numeric = anyToNumber(value);
    if (mappedText != null) {
      return {
        text: mappedText,
        numeric,
        color: mappedColor ?? (Number.isFinite(numeric) ? getFieldColor(numeric, config) : void 0)
      };
    }
    if (value == null || value === "") {
      return {
        text: config.noValue != null ? String(config.noValue) : "-",
        numeric: NaN
      };
    }
    if (typeof value === "number" && Number.isNaN(value)) {
      return { text: "NaN", numeric: NaN };
    }
    if (value === Infinity || value === -Infinity) {
      return { text: String(value), numeric: value };
    }
    const decimals = adjacentDecimals ?? config.decimals;
    let text;
    let prefix;
    let suffix;
    if (Number.isFinite(numeric)) {
      let fv;
      if (unit === "dateTimeAsSystem" || unit === "dateTimeAsIso") {
        fv = dateTimeAsSystem(
          numeric,
          decimals,
          void 0,
          options?.timeZone
        );
        if (unit === "dateTimeAsIso") {
          try {
            fv = { text: new Date(numeric).toISOString() };
          } catch {
            fv = dateTimeAsSystem(
              numeric,
              decimals,
              void 0,
              options?.timeZone
            );
          }
        }
      } else {
        fv = formatFunc(numeric, decimals);
      }
      text = fv.text;
      prefix = fv.prefix;
      suffix = fv.suffix;
    } else {
      text = String(value);
    }
    let percent;
    if (Number.isFinite(numeric) && config.min != null && config.max != null && config.max !== config.min) {
      percent = (numeric - Number(config.min)) / (Number(config.max) - Number(config.min));
      percent = Math.max(0, Math.min(1, percent));
    }
    let color = mappedColor;
    if (!color && Number.isFinite(numeric)) {
      if (config.thresholds?.mode === "percentage" && percent != null) {
        color = getActiveThreshold(percent * 100, {
          steps: sortThresholds(config.thresholds.steps).map((s) => ({
            ...s
            // steps already 0-100 in percentage mode
          }))
        })?.color;
      } else {
        color = getFieldColor(numeric, config);
      }
    }
    const display = {
      text,
      numeric: Number.isFinite(numeric) ? numeric : NaN,
      prefix,
      suffix,
      color,
      percent
    };
    return display;
  };
}
function getRawDisplayProcessor() {
  return (value) => ({
    text: value == null ? "" : String(value),
    numeric: anyToNumber(value)
  });
}
function getMappingColor(value, mappings) {
  if (!mappings?.length) return void 0;
  for (const m of mappings) {
    if (m.type === "value") {
      const opts = m.options;
      const hit = opts[String(value)];
      if (hit?.color) return hit.color;
    }
    if (m.type === "range") {
      const opts = m.options;
      const n = Number(value);
      if (!Number.isNaN(n) && (opts.from == null || n >= opts.from) && (opts.to == null || n <= opts.to)) {
        if (opts.result?.color) return opts.result.color;
      }
    }
  }
  return void 0;
}
function displayValueToString(v) {
  return formattedValueToString(v);
}
var ReducerID = /* @__PURE__ */ ((ReducerID2) => {
  ReducerID2["sum"] = "sum";
  ReducerID2["max"] = "max";
  ReducerID2["min"] = "min";
  ReducerID2["mean"] = "mean";
  ReducerID2["last"] = "last";
  ReducerID2["first"] = "first";
  ReducerID2["count"] = "count";
  ReducerID2["lastNotNull"] = "lastNotNull";
  ReducerID2["firstNotNull"] = "firstNotNull";
  ReducerID2["range"] = "range";
  ReducerID2["diff"] = "diff";
  ReducerID2["diffperc"] = "diffperc";
  ReducerID2["delta"] = "delta";
  ReducerID2["step"] = "step";
  ReducerID2["variance"] = "variance";
  ReducerID2["stdDev"] = "stdDev";
  ReducerID2["median"] = "median";
  ReducerID2["allIsZero"] = "allIsZero";
  ReducerID2["allIsNull"] = "allIsNull";
  ReducerID2["changeCount"] = "changeCount";
  ReducerID2["distinctCount"] = "distinctCount";
  ReducerID2["logmin"] = "logmin";
  return ReducerID2;
})(ReducerID || {});
function numericValues(field) {
  return field.values.map((v) => v == null || v === "" ? null : Number(v)).filter((v) => v != null && !Number.isNaN(v));
}
function reduceField$1(field, reducers = [
  "lastNotNull"
  /* lastNotNull */
]) {
  const nums = numericValues(field);
  const out = {};
  for (const r of reducers) {
    if (r === "count") {
      out[r] = nums.length;
      continue;
    }
    if (r === "allIsNull") {
      out[r] = field.values.every((v) => v == null || v === "");
      continue;
    }
    if (r === "allIsZero") {
      out[r] = nums.length > 0 && nums.every((n) => n === 0);
      continue;
    }
    if (r === "distinctCount") {
      out[r] = new Set(nums).size;
      continue;
    }
    if (r === "changeCount") {
      let c = 0;
      for (let i = 1; i < nums.length; i++) if (nums[i] !== nums[i - 1]) c++;
      out[r] = c;
      continue;
    }
    if (!nums.length) {
      out[r] = null;
      continue;
    }
    switch (r) {
      case "last":
        out[r] = Number(field.values[field.values.length - 1]);
        break;
      case "lastNotNull":
        out[r] = nums[nums.length - 1];
        break;
      case "first":
        out[r] = Number(field.values[0]);
        break;
      case "firstNotNull":
        out[r] = nums[0];
        break;
      case "min":
        out[r] = Math.min(...nums);
        break;
      case "max":
        out[r] = Math.max(...nums);
        break;
      case "mean":
        out[r] = nums.reduce((a, b) => a + b, 0) / nums.length;
        break;
      case "sum":
        out[r] = nums.reduce((a, b) => a + b, 0);
        break;
      case "range":
        out[r] = Math.max(...nums) - Math.min(...nums);
        break;
      case "diff":
        out[r] = nums[nums.length - 1] - nums[0];
        break;
      case "diffperc": {
        const a = nums[0];
        out[r] = a === 0 ? null : (nums[nums.length - 1] - a) / Math.abs(a) * 100;
        break;
      }
      case "delta": {
        let d = 0;
        for (let i = 1; i < nums.length; i++) {
          const step = nums[i] - nums[i - 1];
          if (step > 0) d += step;
        }
        out[r] = d;
        break;
      }
      case "step": {
        let maxStep = 0;
        for (let i = 1; i < nums.length; i++)
          maxStep = Math.max(maxStep, Math.abs(nums[i] - nums[i - 1]));
        out[r] = maxStep;
        break;
      }
      case "variance": {
        const mean = nums.reduce((a, b) => a + b, 0) / nums.length;
        out[r] = nums.reduce((a, b) => a + (b - mean) ** 2, 0) / nums.length;
        break;
      }
      case "stdDev": {
        const mean = nums.reduce((a, b) => a + b, 0) / nums.length;
        const v = nums.reduce((a, b) => a + (b - mean) ** 2, 0) / nums.length;
        out[r] = Math.sqrt(v);
        break;
      }
      case "median": {
        const s = [...nums].sort((a, b) => a - b);
        const mid = Math.floor(s.length / 2);
        out[r] = s.length % 2 ? s[mid] : (s[mid - 1] + s[mid]) / 2;
        break;
      }
      case "logmin": {
        const pos = nums.filter((n) => n > 0);
        out[r] = pos.length ? Math.min(...pos) : null;
        break;
      }
      default:
        out[r] = nums[nums.length - 1];
    }
  }
  return out;
}
function listReducerIds() {
  return Object.values(ReducerID);
}
const CLASSIC_PALETTE_DARK = [
  "#73BF69",
  // green
  "#F2CC0C",
  // semi-dark-yellow
  "#5794F2",
  // blue
  "#FF9830",
  // orange
  "#F2495C",
  // red
  "#B877D9",
  // purple
  "#37872D",
  // dark-green
  "#E0B400",
  // dark-yellow
  "#1F60C4",
  // dark-blue
  "#FA6400",
  // dark-orange
  "#C4162A",
  // dark-red
  "#8F3BB8",
  // dark-purple
  "#C8F2C2",
  // super-light-green
  "#FFF899",
  // super-light-yellow
  "#C0D8FF"
  // super-light-blue
];
const CLASSIC_PALETTE_LIGHT = [
  "#56A64B",
  // green (one notch darker)
  "#E0B400",
  // semi-dark-yellow → dark-yellow
  "#3274D9",
  // blue
  "#FF780A",
  // orange
  "#E02F44",
  // red
  "#A352CC",
  // purple
  "#19730E",
  // dark-green
  "#CC9D00",
  // dark-yellow
  "#1250B0",
  // dark-blue
  "#E55400",
  // dark-orange
  "#AD0317",
  // dark-red
  "#7C2EA3",
  // dark-purple
  "#96D98D",
  // super-light-green
  "#FFEE52",
  // super-light-yellow
  "#8AB8FF"
  // super-light-blue
];
const CLASSIC_PALETTE = CLASSIC_PALETTE_DARK;
function resolveThemeModeHint(mode2) {
  if (mode2 === "light" || mode2 === "dark") return mode2;
  if (typeof document !== "undefined") {
    const t2 = document.documentElement.getAttribute("data-theme") || document.documentElement.dataset.theme || document.body?.dataset?.theme || "";
    if (String(t2).toLowerCase() === "light") return "light";
  }
  return "dark";
}
function getClassicPalette$1(mode2) {
  return resolveThemeModeHint(mode2) === "light" ? CLASSIC_PALETTE_LIGHT : CLASSIC_PALETTE_DARK;
}
function resolveNamedColor(color, ctx) {
  if (!color) return color;
  if (color.startsWith("#") || color.startsWith("rgb") || color.startsWith("hsl") || color.startsWith("var(")) {
    return color;
  }
  if (ctx?.getColorByName) return ctx.getColorByName(color);
  const mode2 = resolveThemeModeHint(ctx?.mode);
  const table = mode2 === "light" ? CLASSIC_PALETTE_LIGHT : CLASSIC_PALETTE_DARK;
  const names = [
    "green",
    "semi-dark-yellow",
    "blue",
    "orange",
    "red",
    "purple",
    "dark-green",
    "dark-yellow",
    "dark-blue",
    "dark-orange",
    "dark-red",
    "dark-purple",
    "super-light-green",
    "super-light-yellow",
    "super-light-blue"
  ];
  const idx = names.indexOf(color);
  if (idx >= 0) return table[idx];
  return color;
}
function getFieldSeriesColor(fieldName, seriesIndex, config = {}, theme) {
  const ctx = typeof theme === "string" ? { mode: theme } : theme ?? {};
  const palette2 = getClassicPalette$1(ctx.mode);
  if (config.color?.mode === "fixed" && config.color.fixedColor) {
    return resolveNamedColor(config.color.fixedColor, ctx);
  }
  if (config.color?.mode === "palette-classic" || !config.color?.mode) {
    return palette2[seriesIndex % palette2.length];
  }
  return palette2[Math.abs(hash(fieldName)) % palette2.length];
}
function hash(s) {
  let h2 = 0;
  for (let i = 0; i < s.length; i++) h2 = h2 * 31 + s.charCodeAt(i) | 0;
  return h2;
}
function getThresholdColor(value, config, theme) {
  const ctx = typeof theme === "string" ? { mode: theme } : theme ?? {};
  const c = getActiveThreshold(value, config.thresholds)?.color;
  return c ? resolveNamedColor(c, ctx) : void 0;
}
function formatUnit(value, unit, decimals = 2) {
  return formattedValueToString(formatValueWithUnit(value, unit, decimals));
}
function formatValue(value, config = {}) {
  const processor = getDisplayProcessor({
    field: {
      name: "v",
      type: typeof value === "string" ? "string" : "number",
      config,
      values: []
    }
  });
  return formattedValueToString(processor(value));
}
function reduceField(field, reducers = ["lastNotNull"]) {
  const r = reduceField$1(field, reducers);
  const out = {};
  for (const [k, v] of Object.entries(r)) {
    if (typeof v === "boolean") out[k] = v ? 1 : 0;
    else if (Array.isArray(v)) out[k] = v.length;
    else out[k] = v;
  }
  return out;
}
var FieldMatcherID = /* @__PURE__ */ ((FieldMatcherID2) => {
  FieldMatcherID2["numeric"] = "numeric";
  FieldMatcherID2["time"] = "time";
  FieldMatcherID2["first"] = "first";
  FieldMatcherID2["firstTimeField"] = "firstTimeField";
  FieldMatcherID2["byType"] = "byType";
  FieldMatcherID2["byTypes"] = "byTypes";
  FieldMatcherID2["byName"] = "byName";
  FieldMatcherID2["byNames"] = "byNames";
  FieldMatcherID2["byRegexp"] = "byRegexp";
  FieldMatcherID2["byRegexpOrNames"] = "byRegexpOrNames";
  FieldMatcherID2["byFrameRefID"] = "byFrameRefID";
  FieldMatcherID2["byValue"] = "byValue";
  return FieldMatcherID2;
})(FieldMatcherID || {});
function asNames(options) {
  if (Array.isArray(options)) return options.map(String);
  if (options && typeof options === "object" && Array.isArray(options.names)) {
    return options.names.map(String);
  }
  return String(options?.names ?? options ?? "").split(",").map((s) => s.trim()).filter(Boolean);
}
function safeRegExp(pattern) {
  try {
    return new RegExp(String(pattern ?? ""));
  } catch {
    return null;
  }
}
const MATCHERS = [
  {
    id: "byName",
    name: "字段名称为",
    pickerDefault: true,
    get: (options) => (field) => field.name === options
  },
  {
    id: "byNames",
    name: "字段名称为（列表）",
    pickerDefault: true,
    get: (options) => (field) => {
      const names = asNames(options);
      const hit = names.includes(field.name);
      const mode2 = typeof options === "object" && options && !Array.isArray(options) ? options.mode || "include" : "include";
      return mode2 === "exclude" ? !hit : hit;
    }
  },
  {
    id: "byRegexp",
    name: "字段名匹配正则",
    pickerDefault: true,
    get: (options) => {
      const re = safeRegExp(options);
      return (field) => re ? re.test(field.name) : false;
    }
  },
  {
    id: "byRegexpOrNames",
    name: "字段名匹配正则或列表",
    pickerDefault: false,
    get: (options) => {
      const opts = options;
      const pattern = typeof opts === "string" ? opts : opts?.pattern ?? "";
      const names = typeof opts === "object" && opts ? asNames(opts) : [];
      const re = safeRegExp(pattern);
      return (field) => names.includes(field.name) || !!re && re.test(field.name);
    }
  },
  {
    id: "byType",
    name: "字段类型为",
    pickerDefault: true,
    get: (options) => (field) => field.type === options
  },
  {
    id: "byTypes",
    name: "字段类型为（列表）",
    pickerDefault: false,
    get: (options) => {
      const types = Array.isArray(options) ? options.map(String) : String(options ?? "").split(",").map((s) => s.trim()).filter(Boolean);
      return (field) => types.includes(String(field.type));
    }
  },
  {
    id: "byFrameRefID",
    name: "查询返回的字段",
    pickerDefault: true,
    get: (options) => (_field, frame) => (frame?.refId ?? "") === String(options ?? "")
  },
  {
    id: "byValue",
    name: "值为",
    pickerDefault: true,
    get: (options) => (field) => {
      if (options && typeof options === "object" && "op" in options) {
        const n2 = Number(options.value);
        return field.values.some((v) => Number(v) === n2);
      }
      const n = Number(options);
      if (!Number.isNaN(n) && String(options).trim() !== "") {
        return field.values.some((v) => Number(v) === n);
      }
      return field.values.some((v) => String(v) === String(options ?? ""));
    }
  },
  {
    id: "numeric",
    name: "数值字段",
    pickerDefault: false,
    get: () => (field) => field.type === "number"
  },
  {
    id: "time",
    name: "时间字段",
    pickerDefault: false,
    get: () => (field) => field.type === "time"
  },
  {
    id: "first",
    name: "第一个字段",
    pickerDefault: false,
    get: () => (field, frame) => !!frame && frame.fields[0] === field
  },
  {
    id: "firstTimeField",
    name: "第一个时间字段",
    pickerDefault: false,
    get: () => (field, frame) => {
      if (!frame) return field.type === "time";
      const first = frame.fields.find((f) => f.type === "time");
      return first === field;
    }
  }
];
const byId$1 = new Map(MATCHERS.map((m) => [m.id, m]));
function listFieldMatchers() {
  return [...MATCHERS];
}
function listOverridePickerMatchers() {
  return MATCHERS.filter((m) => m.pickerDefault);
}
function getFieldMatcherInfo(id) {
  return byId$1.get(id);
}
function getFieldMatcher(config) {
  const info = byId$1.get(config.id);
  if (!info) {
    return () => false;
  }
  return info.get(config.options);
}
function matchFieldWithRegistry(field, matcher, frame, allFrames) {
  return getFieldMatcher(matcher)(field, frame, allFrames);
}
function identity(v) {
  return v;
}
function numberOrUndefined(v) {
  if (v === "" || v === null || v === void 0) return void 0;
  const n = Number(v);
  return Number.isFinite(n) ? n : void 0;
}
const STANDARD_OVERRIDE_PROCESSORS = [
  {
    id: "unit",
    name: "单位",
    path: "unit",
    process: (v) => v == null || v === "" ? void 0 : String(v)
  },
  {
    id: "decimals",
    name: "小数位",
    path: "decimals",
    process: numberOrUndefined
  },
  { id: "min", name: "最小值", path: "min", process: numberOrUndefined },
  { id: "max", name: "最大值", path: "max", process: numberOrUndefined },
  {
    id: "fieldMinMax",
    name: "字段最小/最大",
    path: "fieldMinMax",
    process: (v) => v == null ? void 0 : Boolean(v)
  },
  {
    id: "displayName",
    name: "显示名称",
    path: "displayName",
    process: (v) => v == null || v === "" ? void 0 : String(v)
  },
  {
    id: "noValue",
    name: "空值显示",
    path: "noValue",
    process: (v) => v == null ? void 0 : String(v)
  },
  { id: "color", name: "颜色", path: "color", process: identity },
  { id: "thresholds", name: "阈值", path: "thresholds", process: identity },
  { id: "mappings", name: "值映射", path: "mappings", process: identity },
  { id: "links", name: "数据链接", path: "links", process: identity },
  { id: "actions", name: "动作", path: "actions", process: identity },
  {
    id: "filterable",
    name: "可过滤",
    path: "filterable",
    process: (v) => v == null ? void 0 : Boolean(v)
  }
];
const processorById = new Map(
  STANDARD_OVERRIDE_PROCESSORS.map((p) => [p.id, p])
);
function getOverrideProcessor(id) {
  if (processorById.has(id)) return processorById.get(id);
  if (id.startsWith("custom.")) {
    return {
      id,
      name: id.slice(7),
      path: id,
      process: identity
    };
  }
  return {
    id,
    name: id,
    path: id,
    process: identity,
    shouldApply: () => false
  };
}
function processOverrideValue(id, value) {
  return getOverrideProcessor(id).process(value);
}
function isKnownOverrideProperty(id) {
  return processorById.has(id) || id.startsWith("custom.");
}
function applyProcessedProperty(config, id, raw) {
  const processor = getOverrideProcessor(id);
  if (processor.shouldApply === void 0 && !isKnownOverrideProperty(id) && !id.startsWith("custom.")) {
    return config;
  }
  const value = processor.process(raw);
  if (value === void 0) {
    const next = { ...config };
    if (id.startsWith("custom.")) {
      const custom = { ...config.custom ?? {} };
      delete custom[id.slice(7)];
      return { ...config, custom };
    }
    delete next[id];
    return next;
  }
  if (id.startsWith("custom.")) {
    const key = id.slice(7);
    return { ...config, custom: { ...config.custom ?? {}, [key]: value } };
  }
  return { ...config, [id]: value };
}
function matchField(field, matcher, frame) {
  return matchFieldWithRegistry(field, matcher, frame);
}
function normalizePropId(id) {
  if (id === "unit" || id === "decimals" || id === "displayName" || id === "min" || id === "max" || id === "noValue" || id === "fieldMinMax" || id === "filterable" || id === "color" || id === "thresholds" || id === "mappings" || id === "links" || id === "actions") {
    return id;
  }
  if (id.startsWith("standardOptions."))
    return id.slice("standardOptions.".length);
  if (id.startsWith("custom.")) return id;
  const customKeys = [
    "drawStyle",
    "lineInterpolation",
    "lineWidth",
    "fillOpacity",
    "gradientMode",
    "spanNulls",
    "showPoints",
    "pointSize",
    "stacking",
    "axisPlacement",
    "axisLabel",
    "axisSoftMin",
    "axisSoftMax",
    "axisCenteredZero",
    "hideFrom",
    "scaleDistribution",
    "thresholdsStyle",
    "barAlignment",
    "lineStyle",
    "insertNulls",
    "barWidthFactor"
  ];
  if (customKeys.includes(id)) return `custom.${id}`;
  return id;
}
function setNested(config, path, value) {
  if (path.startsWith("custom.")) {
    const rest = path.slice(7);
    const custom = { ...config.custom ?? {} };
    const parts = rest.split(".");
    let cur = custom;
    for (let i = 0; i < parts.length - 1; i++) {
      cur[parts[i]] = cur[parts[i]] && typeof cur[parts[i]] === "object" ? { ...cur[parts[i]] } : {};
      cur = cur[parts[i]];
    }
    cur[parts[parts.length - 1]] = value;
    return { ...config, custom };
  }
  if (path.includes(".")) {
    const parts = path.split(".");
    const root = { ...config };
    let cur = root;
    for (let i = 0; i < parts.length - 1; i++) {
      cur[parts[i]] = cur[parts[i]] && typeof cur[parts[i]] === "object" ? { ...cur[parts[i]] } : {};
      cur = cur[parts[i]];
    }
    cur[parts[parts.length - 1]] = value;
    return root;
  }
  return { ...config, [path]: value };
}
function applyFieldOverrides(frames, defaults2 = {}, overrides = []) {
  return frames.map((frame) => ({
    ...frame,
    fields: frame.fields.map((field) => {
      let config = { ...defaults2, ...field.config };
      for (const rule of overrides) {
        if (!matchFieldWithRegistry(field, rule.matcher, frame, frames))
          continue;
        for (const prop of rule.properties) {
          const id = normalizePropId(prop.id);
          if (!isKnownOverrideProperty(id) && !id.includes(".")) {
            continue;
          }
          const processed = processOverrideValue(id, prop.value);
          if (id.startsWith("custom.") || !isKnownOverrideProperty(id)) {
            config = setNested(config, id, processed);
          } else {
            config = applyProcessedProperty(config, id, prop.value);
          }
          if (id === "color" && prop.value && typeof prop.value === "object" && prop.value.fixedColor) {
            config = {
              ...config,
              color: {
                ...config.color,
                ...prop.value,
                mode: prop.value.mode ?? "fixed"
              }
            };
          }
        }
      }
      return { ...field, config };
    })
  }));
}
var VariableOrigin = /* @__PURE__ */ ((VariableOrigin2) => {
  VariableOrigin2["Series"] = "series";
  VariableOrigin2["Field"] = "field";
  VariableOrigin2["Fields"] = "fields";
  VariableOrigin2["Value"] = "value";
  VariableOrigin2["BuiltIn"] = "built-in";
  VariableOrigin2["Template"] = "template";
  return VariableOrigin2;
})(VariableOrigin || {});
var VariableSuggestionsScope = /* @__PURE__ */ ((VariableSuggestionsScope2) => {
  VariableSuggestionsScope2["Values"] = "values";
  return VariableSuggestionsScope2;
})(VariableSuggestionsScope || {});
const DataLinkBuiltInVars = {
  keepTime: "__url_time_range",
  timeRangeFrom: "__from",
  timeRangeTo: "__to",
  includeVars: "__all_variables",
  seriesName: "__series.name",
  fieldName: "__field.name",
  fieldDisplayName: "__field.displayName",
  valueTime: "__value.time",
  valueNumeric: "__value.numeric",
  valueText: "__value.text",
  valueRaw: "__value.raw",
  valueCalc: "__value.calc"
};
const timeRangeVars = [
  {
    value: DataLinkBuiltInVars.keepTime,
    label: "Time range",
    documentation: "Adds current time range",
    origin: "built-in"
    /* BuiltIn */
  },
  {
    value: DataLinkBuiltInVars.timeRangeFrom,
    label: "Time range: from",
    documentation: "Adds current time range's from value",
    origin: "built-in"
    /* BuiltIn */
  },
  {
    value: DataLinkBuiltInVars.timeRangeTo,
    label: "Time range: to",
    documentation: "Adds current time range's to value",
    origin: "built-in"
    /* BuiltIn */
  }
];
const seriesVars = [
  {
    value: DataLinkBuiltInVars.seriesName,
    label: "Name",
    documentation: "Name of the series",
    origin: "series"
    /* Series */
  }
];
const valueVars = [
  {
    value: DataLinkBuiltInVars.valueNumeric,
    label: "Numeric",
    documentation: "Numeric representation of selected value",
    origin: "value"
    /* Value */
  },
  {
    value: DataLinkBuiltInVars.valueText,
    label: "Text",
    documentation: "Text representation of selected value",
    origin: "value"
    /* Value */
  },
  {
    value: DataLinkBuiltInVars.valueRaw,
    label: "Raw",
    documentation: "Raw value",
    origin: "value"
    /* Value */
  }
];
const valueTimeVar = {
  value: DataLinkBuiltInVars.valueTime,
  label: "Time",
  documentation: "Time value of the clicked datapoint (in ms epoch)",
  origin: "value"
  /* Value */
};
function buildLabelPath(label) {
  return label.includes(".") || label.trim().includes(" ") ? `["${label}"]` : `.${label}`;
}
function getFieldVars(dataFrames) {
  const labels = /* @__PURE__ */ new Set();
  for (const df of dataFrames) {
    for (const f of df.fields) {
      if (f.labels) {
        for (const k of Object.keys(f.labels)) labels.add(k);
      }
    }
  }
  return [
    {
      value: DataLinkBuiltInVars.fieldName,
      label: "Name",
      documentation: "Field name of the clicked datapoint",
      origin: "field"
      /* Field */
    },
    {
      value: DataLinkBuiltInVars.fieldDisplayName,
      label: "Display name",
      documentation: "Display name of the field (includes overrides and transformations)",
      origin: "field"
      /* Field */
    },
    ...[...labels].map((label) => ({
      value: `__field.labels${buildLabelPath(label)}`,
      label: `labels.${label}`,
      documentation: `${label} label value`,
      origin: "field"
      /* Field */
    }))
  ];
}
function getDataFrameVars(dataFrames) {
  if (dataFrames.length !== 1) return [];
  const suggestions = [];
  const keys = /* @__PURE__ */ new Set();
  const frame = dataFrames[0];
  let numericName;
  let titleName;
  for (const field of frame.fields) {
    if (String(field.type) === "nestedFrames") continue;
    const disp = getFieldDisplayName(field, frame, dataFrames);
    if (keys.has(disp)) continue;
    keys.add(disp);
    const path = buildLabelPath(disp);
    suggestions.push({
      value: `__data.fields${path}`,
      label: disp,
      documentation: `Formatted value for ${disp} on the same row`,
      origin: "fields"
      /* Fields */
    });
    if (!numericName && field.type === "number") {
      numericName = disp;
    }
    if (!titleName && field.config?.displayName && field.config.displayName !== field.name) {
      titleName = disp;
    }
  }
  if (suggestions.length) {
    suggestions.push({
      value: `__data.fields[0]`,
      label: "Select by index",
      documentation: "Enter the field order",
      origin: "fields"
      /* Fields */
    });
  }
  if (numericName) {
    const path = buildLabelPath(numericName);
    suggestions.push({
      value: `__data.fields${path}.numeric`,
      label: "Show numeric value",
      documentation: "the numeric field value",
      origin: "fields"
      /* Fields */
    });
    suggestions.push({
      value: `__data.fields${path}.text`,
      label: "Show text value",
      documentation: "the text value",
      origin: "fields"
      /* Fields */
    });
  }
  if (titleName) {
    suggestions.push({
      value: `__data.fields${buildLabelPath(titleName)}`,
      label: "Select by title",
      documentation: "Use the title to pick the field",
      origin: "fields"
      /* Fields */
    });
  }
  return suggestions;
}
function getTemplateVariableSuggestions(varNames = [], propertyPaths = {}) {
  const fromVars = [];
  for (const name of varNames) {
    fromVars.push({
      value: name,
      label: name,
      origin: "template"
      /* Template */
    });
    for (const p of propertyPaths[name] ?? []) {
      const value = p.startsWith(name + ".") || p === name ? p : `${name}.${p}`;
      fromVars.push({
        value,
        label: value,
        origin: "template"
        /* Template */
      });
    }
  }
  return [
    ...fromVars,
    {
      value: DataLinkBuiltInVars.includeVars,
      label: "All variables",
      documentation: "Adds current variables",
      origin: "template"
      /* Template */
    }
  ];
}
function getDataLinksVariableSuggestions(dataFrames = [], options) {
  const includeValueVars = options?.scope === "values" || options?.scope === "values";
  const panelLinks = [
    ...getTemplateVariableSuggestions(
      options?.templateVars ?? [],
      options?.templateVarProperties ?? {}
    ),
    ...timeRangeVars
  ];
  return includeValueVars ? [
    ...seriesVars,
    ...getFieldVars(dataFrames),
    ...valueVars,
    valueTimeVar,
    ...getDataFrameVars(dataFrames),
    ...panelLinks
  ] : [
    ...seriesVars,
    ...getFieldVars(dataFrames),
    ...getDataFrameVars(dataFrames),
    ...panelLinks
  ];
}
function formatSuggestionToken(s) {
  return `\${${s.value}}`;
}
function frameHasName(name, names) {
  if (!name) return false;
  if (names.display.has(name) || names.raw.has(name)) return true;
  if (names.fields.has(name)) return true;
  const trimmed = name.trim();
  if (trimmed !== name && (names.display.has(trimmed) || names.raw.has(trimmed)))
    return true;
  return false;
}
function getFrameFieldsDisplayNames(data, filter2, existing, parentData = data) {
  const names = existing ?? {
    display: /* @__PURE__ */ new Set(),
    raw: /* @__PURE__ */ new Set(),
    fields: /* @__PURE__ */ new Map()
  };
  for (const frame of data) {
    for (const field of frame.fields) {
      if (filter2 && !filter2(field)) continue;
      if (String(field.type) === "nestedFrames" && Array.isArray(field.values)) {
        for (const nested of field.values) {
          if (Array.isArray(nested)) {
            getFrameFieldsDisplayNames(
              nested,
              filter2,
              names,
              parentData
            );
          } else if (nested && typeof nested === "object" && Array.isArray(nested.fields)) {
            getFrameFieldsDisplayNames(
              [nested],
              filter2,
              names,
              parentData
            );
          }
        }
        continue;
      }
      const disp = getFieldDisplayName(field, frame, parentData);
      names.display.add(disp);
      names.fields.set(disp, field);
      if (field.name && disp !== field.name) {
        names.raw.add(field.name);
        names.fields.set(field.name, field);
      }
    }
  }
  return names;
}
function getFieldNameOptions(dataFrames, filter2) {
  const out = [];
  const seen = /* @__PURE__ */ new Set();
  const multi = dataFrames.length > 1;
  const walkFrames = (frames, parent) => {
    for (const frame of frames) {
      const frameName = frame.name || frame.refId || void 0;
      const refId = frame.refId || void 0;
      for (const field of frame.fields) {
        if (filter2 && !filter2(field)) continue;
        if (String(field.type) === "nestedFrames" && Array.isArray(field.values)) {
          for (const nested of field.values) {
            if (Array.isArray(nested))
              walkFrames(nested, parent);
            else if (nested && typeof nested === "object" && Array.isArray(nested.fields)) {
              walkFrames([nested], parent);
            }
          }
          continue;
        }
        const disp = getFieldDisplayName(field, frame, parent);
        let value = disp;
        if (seen.has(value) && multi && frameName) {
          value = `${disp} (${frameName})`;
        }
        if (seen.has(value)) continue;
        seen.add(value);
        out.push({
          label: value === disp ? disp : value,
          value,
          type: field.type,
          rawName: field.name,
          frameName,
          refId
        });
        if (field.name && field.name !== disp && !seen.has(field.name)) {
          seen.add(field.name);
          out.push({
            label: field.name,
            value: field.name,
            type: field.type,
            rawName: field.name,
            frameName,
            refId
          });
        }
      }
    }
  };
  walkFrames(dataFrames, dataFrames);
  return out;
}
function plain(v) {
  return v == null ? "" : String(v);
}
function enc(v) {
  if (v == null) return "";
  return encodeURIComponent(String(v));
}
function toEpochMs(v) {
  if (v == null || v === "") return null;
  if (typeof v === "number" && Number.isFinite(v)) {
    if (v >= 1e9 && v < 1e11) return Math.round(v * 1e3);
    return Math.round(v);
  }
  if (v instanceof Date) return v.getTime();
  const s = String(v);
  if (/^\d{10,13}$/.test(s)) {
    const n = Number(s);
    return s.length === 10 ? n * 1e3 : n;
  }
  if (/^now/i.test(s)) return null;
  const d = Date.parse(s);
  return Number.isFinite(d) ? d : null;
}
function buildDataLinkVars(ctx) {
  const field = ctx.field;
  const value = ctx.value;
  const row = ctx.rowIndex ?? 0;
  const frame = ctx.frame;
  const frames = ctx.frames ?? (frame ? [frame] : []);
  const num2 = typeof value === "number" ? value : Number(value);
  const text = plain(value);
  const displayName = field ? getFieldDisplayName(field, frame, frames) : "";
  const vars = {
    value: text,
    field: field?.name,
    [DataLinkBuiltInVars.valueRaw]: text,
    [DataLinkBuiltInVars.valueText]: text,
    [DataLinkBuiltInVars.valueNumeric]: Number.isFinite(num2) ? num2 : text,
    [DataLinkBuiltInVars.valueTime]: "",
    [DataLinkBuiltInVars.valueCalc]: ctx.calc ? String(ctx.calc) : "",
    [DataLinkBuiltInVars.fieldName]: field?.name ?? "",
    [DataLinkBuiltInVars.fieldDisplayName]: displayName,
    [DataLinkBuiltInVars.seriesName]: ctx.seriesName ?? frame?.name ?? displayName,
    [DataLinkBuiltInVars.keepTime]: "",
    [DataLinkBuiltInVars.timeRangeFrom]: "",
    [DataLinkBuiltInVars.timeRangeTo]: "",
    [DataLinkBuiltInVars.includeVars]: ""
  };
  if (ctx.timeRange) {
    const rawFrom = ctx.timeRange.raw?.from ?? ctx.timeRange.from;
    const rawTo = ctx.timeRange.raw?.to ?? ctx.timeRange.to;
    const fromMs = toEpochMs(rawFrom);
    const toMs2 = toEpochMs(rawTo);
    if (fromMs != null)
      vars[DataLinkBuiltInVars.timeRangeFrom] = String(fromMs);
    if (toMs2 != null) vars[DataLinkBuiltInVars.timeRangeTo] = String(toMs2);
    if (fromMs != null && toMs2 != null) {
      vars[DataLinkBuiltInVars.keepTime] = `from=${fromMs}&to=${toMs2}`;
    } else if (rawFrom != null || rawTo != null) {
      vars[DataLinkBuiltInVars.keepTime] = `from=${plain(rawFrom)}&to=${plain(rawTo)}`;
      vars[DataLinkBuiltInVars.timeRangeFrom] = plain(rawFrom);
      vars[DataLinkBuiltInVars.timeRangeTo] = plain(rawTo);
    }
  }
  if (frame) {
    const timeF = frame.fields.find((f) => f.type === "time");
    if (timeF) {
      vars[DataLinkBuiltInVars.valueTime] = plain(timeF.values[row]);
    }
    frame.fields.forEach((f, i) => {
      const disp = getFieldDisplayName(f, frame, frames);
      const raw = f.values[row];
      vars[`__data.fields.${disp}`] = plain(raw);
      vars[`__data.fields["${disp}"]`] = plain(raw);
      vars[`__data.fields[${i}]`] = plain(raw);
      if (f.name !== disp) vars[`__data.fields.${f.name}`] = plain(raw);
      if (f.type === "number") {
        vars[`__data.fields.${disp}.numeric`] = Number(raw);
        vars[`__data.fields.${disp}.text`] = plain(raw);
        vars[`__data.fields["${disp}"].numeric`] = Number(raw);
        vars[`__data.fields["${disp}"].text`] = plain(raw);
      }
    });
  }
  if (field?.labels) {
    for (const [k, v] of Object.entries(field.labels)) {
      vars[`__field.labels.${k}`] = v;
      vars[`__field.labels["${k}"]`] = v;
    }
  }
  if (ctx.templateVars) {
    for (const [k, v] of Object.entries(ctx.templateVars)) {
      vars[k] = v;
      vars[k.replace(/^\$/, "")] = v;
    }
    const parts = [];
    for (const [k, v] of Object.entries(ctx.templateVars)) {
      const name = k.replace(/^\$/, "").replace(/^var-/, "");
      if (!name || name.startsWith("__")) continue;
      const vals = Array.isArray(v) ? v : [v];
      for (const one of vals) {
        if (one == null || one === "") continue;
        parts.push(
          `var-${encodeURIComponent(name)}=${encodeURIComponent(String(one))}`
        );
      }
    }
    if (parts.length) {
      vars[DataLinkBuiltInVars.includeVars] = parts.join("&");
    }
  }
  return vars;
}
const RAW_QUERY_FRAGMENT_KEYS = /* @__PURE__ */ new Set([
  DataLinkBuiltInVars.keepTime,
  // __url_time_range → from=…&to=…
  DataLinkBuiltInVars.includeVars
  // __all_variables
]);
function interpolateDataLinkString(template, vars, encodeValues = false) {
  if (!template) return "";
  const sub = (key) => {
    const k = key.trim();
    if (Object.prototype.hasOwnProperty.call(vars, k)) {
      const v = vars[k];
      if (encodeValues && !RAW_QUERY_FRAGMENT_KEYS.has(k)) return enc(v);
      return plain(v);
    }
    return "";
  };
  let out = template.replace(/\$\{([^}]+)\}/g, (_, key) => sub(key));
  out = out.replace(/\$([a-zA-Z_][\w]*)/g, (match, key) => {
    if (Object.prototype.hasOwnProperty.call(vars, key)) {
      const v = vars[key];
      if (encodeValues && !RAW_QUERY_FRAGMENT_KEYS.has(key)) return enc(v);
      return plain(v);
    }
    return match;
  });
  return out;
}
function buildDataLinkUrl(link, vars = {}) {
  return interpolateDataLinkString(link.url ?? "", vars, false);
}
function resolveDataLink(link, ctx) {
  const vars = buildDataLinkVars(ctx);
  let title = interpolateDataLinkString(link.title || "", vars, false);
  let href = interpolateDataLinkString(link.url || "", vars, true);
  if (ctx.replaceVariables) {
    title = ctx.replaceVariables(title);
    href = ctx.replaceVariables(href);
  }
  return {
    title: title || "Link",
    href,
    targetBlank: link.targetBlank
  };
}
function getFieldLinks(field, valueIndex, replace = (s) => s, frame, frames, extras) {
  const links = field.config.links ?? field.links ?? [];
  const raw = field.values[valueIndex];
  return links.map(
    (link) => resolveDataLink(link, {
      value: raw,
      field,
      frame,
      frames,
      rowIndex: valueIndex,
      replaceVariables: replace,
      ...extras
    })
  );
}
function getDashboardLinkUrl(link, ctx = {}) {
  let url = link.url ?? "";
  const keepToken = "${" + DataLinkBuiltInVars.keepTime + "}";
  const varsToken = "${" + DataLinkBuiltInVars.includeVars + "}";
  if (link.keepTime && !url.includes(keepToken) && !url.includes(DataLinkBuiltInVars.keepTime)) {
    url += (url.includes("?") ? "&" : "?") + keepToken;
  }
  if (link.includeVars && !url.includes(varsToken) && !url.includes(DataLinkBuiltInVars.includeVars)) {
    url += (url.includes("?") ? "&" : "?") + varsToken;
  }
  return resolveDataLink({ title: link.title || "", url }, ctx).href;
}
function isV2Dashboard(input) {
  if (!input || typeof input !== "object") return false;
  const o = input;
  return o.kind === "Dashboard" || String(o.apiVersion ?? "").includes("dashboard.grafana.app");
}
function asDict(v) {
  return v && typeof v === "object" && !Array.isArray(v) ? v : {};
}
function asArr(v) {
  return Array.isArray(v) ? v : [];
}
function resolveV2Datasource(ref2) {
  if (!ref2) return void 0;
  if (typeof ref2 === "string") {
    if (ref2 === "grafana" || ref2 === "-- Grafana --")
      return { type: "grafana", uid: "grafana" };
    return { uid: ref2 };
  }
  const d = asDict(ref2);
  const name = String(d.name ?? d.uid ?? "");
  if (!name) return void 0;
  if (name === "grafana" || name === "-- Grafana --")
    return { type: "grafana", uid: "grafana" };
  const type = d.type != null ? String(d.type) : void 0;
  return type ? { uid: name, type } : { uid: name };
}
function groupToDatasourceType(group) {
  const g = String(group ?? "");
  if (!g || g === "datasource" || g === "grafana")
    return g === "grafana" ? "grafana" : void 0;
  return g;
}
function convertQuerySpec(qNode) {
  const node = asDict(qNode);
  if (node.kind === "PanelQuery" || node.spec) {
    const spec = asDict(node.spec);
    const hidden = !!spec.hidden;
    const refId = String(spec.refId ?? "A");
    const inner = asDict(spec.query);
    const innerSpec = asDict(inner.spec);
    let ds2 = resolveV2Datasource(inner.datasource ?? spec.datasource);
    const inferred = groupToDatasourceType(inner.group);
    if (ds2 && !ds2.type && inferred) ds2 = { ...ds2, type: inferred };
    if (!ds2 && inferred)
      ds2 = {
        type: inferred,
        uid: inferred === "grafana" ? "grafana" : void 0
      };
    const { __legacyStringValue, ...restSpec } = innerSpec;
    const target = {
      refId,
      hide: hidden,
      ...ds2 ? { datasource: ds2 } : {},
      ...restSpec
    };
    if (__legacyStringValue != null && target.expr == null && target.query == null) ;
    return target;
  }
  return { ...node };
}
function convertTransform(t2) {
  const node = asDict(t2);
  const spec = asDict(node.spec);
  let id = "noop";
  if (node.group != null) id = String(node.group);
  else if (node.kind && node.kind !== "Transformation") id = String(node.kind);
  else if (spec.id != null) id = String(spec.id);
  else if (node.id != null) id = String(node.id);
  const options = asDict(spec.options ?? node.options);
  const out = { id, options };
  if (spec.disabled != null) out.disabled = !!spec.disabled;
  if (spec.filter) out.filter = spec.filter;
  if (spec.topic != null) out.topic = spec.topic;
  return out;
}
function convertPanelElement(key, element, gridPos, repeat) {
  const el = asDict(element);
  const kind2 = String(el.kind ?? "");
  const spec = asDict(el.spec ?? el);
  if (kind2 === "LibraryPanel" || spec.libraryPanel) {
    const lp = asDict(spec.libraryPanel);
    const rawId2 = Number(
      spec.id ?? el.id ?? (String(key).replace(/\D+/g, "") || 0)
    );
    const id2 = rawId2 || hashId(key);
    return {
      id: id2,
      type: "library-panel-ref",
      title: String(spec.title ?? el.title ?? lp.name ?? key),
      gridPos: { x: gridPos.x, y: gridPos.y, w: gridPos.w, h: gridPos.h },
      libraryPanel: {
        name: String(lp.name ?? ""),
        uid: String(lp.uid ?? "")
      },
      targets: [],
      options: {},
      fieldConfig: { defaults: {}, overrides: [] },
      transformations: [],
      ...repeat ?? {}
    };
  }
  const viz = asDict(spec.vizConfig);
  const vizSpec = asDict(viz.spec);
  const data = asDict(spec.data);
  const dataSpec = asDict(data.spec ?? data);
  const queries = asArr(dataSpec.queries).map(convertQuerySpec);
  const transformations = asArr(dataSpec.transformations).map(convertTransform);
  const queryOptions = asDict(dataSpec.queryOptions);
  const type = String(
    viz.group ?? viz.type ?? spec.type ?? el.type ?? "timeseries"
  );
  const rawId = Number(
    spec.id ?? el.id ?? (String(key).replace(/\D+/g, "") || 0)
  );
  const id = rawId || hashId(key);
  const fieldConfig = asDict(vizSpec.fieldConfig ?? spec.fieldConfig);
  if (!fieldConfig.defaults) fieldConfig.defaults = {};
  if (!fieldConfig.overrides) fieldConfig.overrides = [];
  const panel2 = {
    id,
    type,
    title: String(spec.title ?? el.title ?? key),
    description: spec.description != null ? String(spec.description) : void 0,
    transparent: !!spec.transparent,
    links: asArr(spec.links),
    gridPos: { x: gridPos.x, y: gridPos.y, w: gridPos.w, h: gridPos.h },
    options: asDict(vizSpec.options ?? spec.options),
    fieldConfig,
    targets: queries,
    transformations,
    pluginVersion: viz.version != null ? String(viz.version) : void 0
  };
  if (queryOptions.maxDataPoints != null)
    panel2.maxDataPoints = queryOptions.maxDataPoints;
  if (queryOptions.interval != null) panel2.interval = queryOptions.interval;
  if (queryOptions.timeFrom != null) panel2.timeFrom = queryOptions.timeFrom;
  if (queryOptions.timeShift != null) panel2.timeShift = queryOptions.timeShift;
  if (queryOptions.hideTimeOverride != null)
    panel2.hideTimeOverride = queryOptions.hideTimeOverride;
  if (queryOptions.cacheTimeout != null)
    panel2.cacheTimeout = queryOptions.cacheTimeout;
  if (queryOptions.queryCachingTTL != null)
    panel2.queryCachingTTL = queryOptions.queryCachingTTL;
  const firstDs = asDict(asDict(queries[0]).datasource);
  if (firstDs.uid || firstDs.type) {
    panel2.datasource = firstDs;
  }
  if (repeat) Object.assign(panel2, repeat);
  return panel2;
}
function hashId(key) {
  let h2 = 0;
  for (let i = 0; i < key.length; i++) h2 = h2 * 31 + key.charCodeAt(i) >>> 0;
  return h2 % 9e5 + 1;
}
function mapRepeat(repeat) {
  const r = asDict(repeat);
  if (!r || !r.value && !r.mode && !r.variable) return void 0;
  const variable = String(r.value ?? r.variable ?? "");
  if (!variable) return void 0;
  const out = { repeat: variable };
  if (r.direction != null) out.repeatDirection = String(r.direction);
  if (r.maxPerRow != null) out.maxPerRow = Number(r.maxPerRow);
  return out;
}
function flattenV2Layout(layout, yOffset = 0) {
  const items = [];
  const rows = [];
  let rowIdSeq = 1e5;
  function isWrapperRowTitle(title, depth) {
    if (depth <= 0) return false;
    const t2 = title.trim();
    return t2 === "" || /^new row$/i.test(t2);
  }
  function walk(node, baseY, depth) {
    const n = asDict(node);
    const kind2 = String(n.kind ?? "");
    const spec = asDict(n.spec);
    if (kind2 === "GridLayout" || !kind2 && asArr(spec.items).length && !asArr(spec.rows).length && !asArr(spec.tabs).length) {
      let localMax = baseY;
      for (const raw of asArr(spec.items)) {
        const it = asDict(raw);
        const is = asDict(it.spec ?? it);
        const el = asDict(is.element);
        const name = String(el.name ?? is.element ?? "");
        const x = Number(is.x ?? 0);
        const y = Number(is.y ?? 0) + baseY;
        const w = Number(is.width ?? is.w ?? 12);
        const h2 = Number(is.height ?? is.h ?? 8);
        if (name) {
          items.push({
            elementName: name,
            x,
            y,
            w,
            h: h2,
            repeat: mapRepeat(is.repeat)
          });
        }
        localMax = Math.max(localMax, y + h2);
      }
      return localMax;
    }
    if (kind2 === "AutoGridLayout") {
      const maxCols = Math.max(1, Number(spec.maxColumnCount ?? 4));
      const colW = Math.max(1, Math.floor(24 / maxCols));
      const rowH = Math.max(1, Number(spec.rowHeight ?? 8));
      let i = 0;
      let localMax = baseY;
      for (const raw of asArr(spec.items)) {
        const it = asDict(raw);
        const is = asDict(it.spec ?? it);
        const el = asDict(is.element);
        const name = String(el.name ?? is.element ?? "");
        const col2 = i % maxCols;
        const row = Math.floor(i / maxCols);
        const x = col2 * colW;
        const y = baseY + row * rowH;
        const w = Number(is.width ?? colW);
        const h2 = Number(is.height ?? rowH);
        if (name) {
          items.push({
            elementName: name,
            x,
            y,
            w,
            h: h2,
            repeat: mapRepeat(is.repeat)
          });
          localMax = Math.max(localMax, y + h2);
        }
        i += 1;
      }
      return localMax;
    }
    if (kind2 === "RowsLayout") {
      let cursorY = baseY;
      for (const raw of asArr(spec.rows)) {
        const row = asDict(raw);
        const rs = asDict(row.spec ?? row);
        const title = String(rs.title ?? "");
        const collapsed = !!rs.collapse || !!rs.collapsed;
        const skipMarker = isWrapperRowTitle(title, depth);
        if (!skipMarker) {
          const id = rowIdSeq++;
          rows.push({ title: title || "Row", y: cursorY, collapsed, id });
          cursorY += 1;
        }
        const childLayout = rs.layout;
        if (childLayout) {
          const childMax = walk(childLayout, cursorY, depth + 1);
          cursorY = Math.max(cursorY, childMax);
        }
      }
      return cursorY;
    }
    if (kind2 === "TabsLayout") {
      let cursorY = baseY;
      for (const raw of asArr(spec.tabs)) {
        const tab = asDict(raw);
        const ts = asDict(tab.spec ?? tab);
        const title = String(ts.title ?? "Tab");
        const id = rowIdSeq++;
        rows.push({ title: `Tab: ${title}`, y: cursorY, collapsed: false, id });
        cursorY += 1;
        if (ts.layout)
          cursorY = Math.max(cursorY, walk(ts.layout, cursorY, depth + 1));
      }
      return cursorY;
    }
    if (asArr(spec.items).length)
      return walk({ kind: "GridLayout", spec }, baseY, depth);
    if (asArr(spec.rows).length)
      return walk({ kind: "RowsLayout", spec }, baseY, depth);
    if (asArr(spec.tabs).length)
      return walk({ kind: "TabsLayout", spec }, baseY, depth);
    return baseY;
  }
  const maxY = walk(layout, yOffset, 0);
  return { items, rows, maxY };
}
function convertVariable(v) {
  const node = asDict(v);
  const kind2 = String(node.kind ?? "");
  const spec = asDict(node.spec ?? node);
  const base = {
    name: String(spec.name ?? ""),
    label: spec.label != null ? String(spec.label) : void 0,
    hide: mapHide(spec.hide),
    multi: !!spec.multi,
    includeAll: !!spec.includeAll,
    skipUrlSync: !!spec.skipUrlSync,
    current: spec.current,
    options: asArr(spec.options),
    description: spec.description,
    allValue: spec.allValue,
    regex: spec.regex,
    sort: mapSort(spec.sort),
    allowCustomValue: spec.allowCustomValue !== false
  };
  if (kind2 === "DatasourceVariable" || spec.pluginId && !kind2.includes("Query")) {
    return {
      ...base,
      type: "datasource",
      query: String(spec.pluginId ?? spec.query ?? ""),
      refresh: mapRefresh(spec.refresh),
      regex: String(spec.regex ?? "")
    };
  }
  if (kind2 === "QueryVariable" || kind2 === "query") {
    const q = asDict(spec.query);
    const qSpec = asDict(q.spec);
    const queryStr = String(
      spec.definition ?? qSpec.__legacyStringValue ?? qSpec.query ?? q.query ?? (typeof spec.query === "string" ? spec.query : "") ?? ""
    );
    let ds2 = resolveV2Datasource(q.datasource ?? spec.datasource);
    const inferred = groupToDatasourceType(q.group);
    if (ds2 && !ds2.type && inferred) ds2 = { ...ds2, type: inferred };
    return {
      ...base,
      type: "query",
      definition: String(spec.definition ?? queryStr),
      query: queryStr,
      datasource: ds2,
      refresh: mapRefresh(spec.refresh),
      regex: String(spec.regex ?? ""),
      // regexApplyTo is v2-only; stash for round-trip
      ...spec.regexApplyTo != null ? { regexApplyTo: spec.regexApplyTo } : {}
    };
  }
  if (kind2 === "CustomVariable" || kind2 === "custom") {
    return { ...base, type: "custom", query: String(spec.query ?? "") };
  }
  if (kind2 === "ConstantVariable" || kind2 === "constant") {
    const current = asDict(spec.current);
    return {
      ...base,
      type: "constant",
      query: String(spec.query ?? current.value ?? "")
    };
  }
  if (kind2 === "IntervalVariable" || kind2 === "interval") {
    return {
      ...base,
      type: "interval",
      query: String(spec.query ?? "1m,5m,10m,1h"),
      auto: !!spec.auto,
      auto_count: spec.auto_count ?? spec.autoCount,
      auto_min: spec.auto_min ?? spec.autoMin
    };
  }
  if (kind2 === "TextBoxVariable" || kind2 === "textbox") {
    const current = asDict(spec.current);
    return {
      ...base,
      type: "textbox",
      query: String(spec.query ?? current.value ?? "")
    };
  }
  if (kind2 === "AdhocVariable" || kind2 === "adhoc") {
    return {
      ...base,
      type: "adhoc",
      datasource: resolveV2Datasource(spec.datasource),
      filters: asArr(spec.filters),
      baseFilters: asArr(spec.baseFilters)
    };
  }
  if (kind2 === "GroupByVariable" || kind2 === "groupby") {
    return {
      ...base,
      type: "groupby",
      datasource: resolveV2Datasource(spec.datasource)
    };
  }
  return {
    ...base,
    type: String(
      spec.type ?? (kind2.replace(/Variable$/i, "").toLowerCase() || "custom")
    ),
    query: typeof spec.query === "string" ? spec.query : String(spec.definition ?? "")
  };
}
function mapHide(h2) {
  if (h2 === "hideLabel" || h2 === 1) return 1;
  if (h2 === "hideVariable" || h2 === 2) return 2;
  return 0;
}
function mapRefresh(r) {
  if (r === "onTimeRangeChanged" || r === 2) return 2;
  if (r === "onDashboardLoad" || r === 1) return 1;
  if (r === "never" || r === 0) return 0;
  return 1;
}
function mapSort(s) {
  if (s === "alphabeticalAsc" || s === 1) return 1;
  if (s === "alphabeticalDesc" || s === 2) return 2;
  if (s === "numericalAsc" || s === 3) return 3;
  if (s === "numericalDesc" || s === 4) return 4;
  if (s === "alphabeticalCaseInsensitiveAsc" || s === 5) return 5;
  if (s === "alphabeticalCaseInsensitiveDesc" || s === 6) return 6;
  return 0;
}
function convertAnnotation(a) {
  const node = asDict(a);
  const spec = asDict(node.spec ?? node);
  const q = asDict(spec.query);
  const qSpec = asDict(q.spec);
  let ds2 = resolveV2Datasource(q.datasource ?? spec.datasource);
  const inferred = groupToDatasourceType(q.group);
  if (ds2 && !ds2.type && inferred) ds2 = { ...ds2, type: inferred };
  return {
    name: String(spec.name ?? "Annotation"),
    enable: spec.enable !== false,
    hide: !!spec.hide,
    iconColor: String(spec.iconColor ?? "rgba(0, 211, 255, 1)"),
    builtIn: spec.builtIn ? 1 : 0,
    type: String(qSpec.type ?? "dashboard"),
    datasource: ds2 ?? { type: "grafana", uid: "grafana" },
    target: Object.keys(qSpec).length ? qSpec : void 0,
    ...qSpec.limit != null ? { limit: qSpec.limit } : {},
    ...qSpec.tags ? { tags: qSpec.tags } : {},
    ...qSpec.matchAny != null ? { matchAny: qSpec.matchAny } : {},
    ...spec.filter ? { filter: spec.filter } : {}
  };
}
function convertV2DashboardToV1(input) {
  if (!input || typeof input !== "object") {
    throw new Error("Invalid v2 dashboard: expected object");
  }
  const root = input;
  const meta2 = asDict(root.metadata);
  const spec = asDict(root.spec ?? root);
  const elements = asDict(spec.elements ?? root.elements);
  const layout = spec.layout ?? root.layout;
  const { items, rows, maxY } = flattenV2Layout(layout);
  const panelByKey = /* @__PURE__ */ new Map();
  for (const [key, el] of Object.entries(elements)) {
    panelByKey.set(key, el);
  }
  const panels2 = [];
  const used = /* @__PURE__ */ new Set();
  if (items.length) {
    for (const it of items) {
      const el = panelByKey.get(it.elementName);
      if (!el) continue;
      used.add(it.elementName);
      panels2.push(
        convertPanelElement(
          it.elementName,
          el,
          { x: it.x, y: it.y, w: it.w, h: it.h },
          it.repeat
        )
      );
    }
  }
  let orphanY = maxY;
  for (const [key, el] of Object.entries(elements)) {
    if (used.has(key)) continue;
    panels2.push(
      convertPanelElement(key, el, { x: 0, y: orphanY, w: 12, h: 8 })
    );
    orphanY += 8;
  }
  for (const r of rows) {
    const nextRowY2 = rows.filter((x) => x.y > r.y).reduce((m, x) => Math.min(m, x.y), Number.POSITIVE_INFINITY);
    const childPanels = panels2.filter((p) => {
      if (p.type === "row") return false;
      const y = Number(asDict(p.gridPos).y ?? 0);
      return y > r.y && y < nextRowY2;
    });
    panels2.push({
      id: r.id,
      type: "row",
      title: r.title,
      collapsed: r.collapsed,
      gridPos: { x: 0, y: r.y, w: 24, h: 1 },
      // Grafana nests children when collapsed; keep a copy for scene/compat.
      // Top-level copies remain so DashboardGrid collapse-by-y still works.
      panels: r.collapsed ? childPanels.map((p) => JSON.parse(JSON.stringify(p))) : []
    });
  }
  panels2.sort((a, b) => {
    const ay = Number(asDict(a.gridPos).y ?? 0);
    const by = Number(asDict(b.gridPos).y ?? 0);
    if (ay !== by) return ay - by;
    return Number(asDict(a.gridPos).x ?? 0) - Number(asDict(b.gridPos).x ?? 0);
  });
  const timeSettings = asDict(spec.timeSettings);
  const variables = asArr(spec.variables).map(convertVariable);
  const annotations = asArr(spec.annotations).map(convertAnnotation);
  let graphTooltip = 0;
  const cursor = String(spec.cursorSync ?? "");
  if (cursor === "Crosshair") graphTooltip = 1;
  else if (cursor === "Tooltip") graphTooltip = 2;
  const title = String(spec.title ?? meta2.name ?? "Dashboard");
  const uid = String(meta2.name ?? meta2.uid ?? spec.uid ?? "");
  return {
    uid,
    title,
    description: spec.description != null ? String(spec.description) : void 0,
    tags: asArr(spec.tags),
    editable: spec.editable !== false,
    graphTooltip,
    schemaVersion: 42,
    version: Number(meta2.generation ?? meta2.resourceVersion ?? 1) || 1,
    timezone: String(timeSettings.timezone ?? "browser"),
    time: {
      from: String(timeSettings.from ?? "now-6h"),
      to: String(timeSettings.to ?? "now")
    },
    refresh: String(timeSettings.autoRefresh ?? ""),
    timepicker: {
      refresh_intervals: asArr(timeSettings.autoRefreshIntervals).length ? asArr(timeSettings.autoRefreshIntervals) : void 0,
      hidden: !!timeSettings.hideTimepicker,
      nowDelay: timeSettings.nowDelay
    },
    fiscalYearStartMonth: timeSettings.fiscalYearStartMonth ?? 0,
    weekStart: timeSettings.weekStart,
    liveNow: !!spec.liveNow,
    preload: !!spec.preload,
    links: asArr(spec.links),
    panels: panels2,
    templating: { list: variables },
    annotations: { list: annotations },
    // keep v2 originals for round-trip/debug
    __v2: {
      apiVersion: root.apiVersion,
      kind: root.kind,
      layoutKind: asDict(layout).kind,
      maxY,
      elementCount: Object.keys(elements).length,
      layoutItemCount: items.length,
      rowCount: rows.length
    }
  };
}
function v2ResourceToV1(input) {
  return convertV2DashboardToV1(input);
}
const FORBIDDEN$1 = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
function parsePath(path) {
  if (!path || path === "/") return [];
  const raw = path.startsWith("/") ? path.slice(1) : path;
  return raw.split(/\.|\//).filter(Boolean).map((seg) => {
    if (FORBIDDEN$1.has(seg)) throw new Error(`Forbidden path segment: ${seg}`);
    if (/^\d+$/.test(seg)) return Number(seg);
    return seg;
  });
}
function getAtPath(source, path) {
  const segs = parsePath(path);
  let cur = source;
  for (const s of segs) {
    if (cur == null) return void 0;
    cur = cur[s];
  }
  return cur;
}
function setAtPath(source, path, value) {
  const segs = parsePath(path);
  if (!segs.length) return value;
  const root = Array.isArray(source) ? [...source] : { ...source };
  let cur = root;
  for (let i = 0; i < segs.length - 1; i++) {
    const s = segs[i];
    const next = cur[s];
    const copy = Array.isArray(next) ? [...next] : next && typeof next === "object" ? { ...next } : {};
    cur[s] = copy;
    cur = copy;
  }
  cur[segs[segs.length - 1]] = value;
  return root;
}
function removeAtPath(source, path) {
  const segs = parsePath(path);
  if (!segs.length) return source;
  const root = Array.isArray(source) ? [...source] : { ...source };
  let cur = root;
  for (let i = 0; i < segs.length - 1; i++) {
    const s = segs[i];
    const next = cur[s];
    if (next == null) return root;
    const copy = Array.isArray(next) ? [...next] : { ...next };
    cur[s] = copy;
    cur = copy;
  }
  const last = segs[segs.length - 1];
  if (Array.isArray(cur) && typeof last === "number") cur.splice(last, 1);
  else delete cur[last];
  return root;
}
function applyJsonPatch(source, ops) {
  let cur = source;
  for (const op of ops) {
    if (op.op === "remove") cur = removeAtPath(cur, op.path);
    else cur = setAtPath(cur, op.path, op.value);
  }
  return cur;
}
function diffJsonPaths(a, b, base = "") {
  if (Object.is(a, b)) return [];
  if (typeof a !== typeof b) return [base || "/"];
  if (a == null || b == null) return [base || "/"];
  if (typeof a !== "object") return a === b ? [] : [base || "/"];
  if (Array.isArray(a) || Array.isArray(b)) {
    if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length)
      return [base || "/"];
    const out2 = [];
    for (let i = 0; i < a.length; i++)
      out2.push(...diffJsonPaths(a[i], b[i], `${base}/${i}`));
    return out2;
  }
  const ak = Object.keys(a);
  const bk = Object.keys(b);
  const keys = /* @__PURE__ */ new Set([...ak, ...bk]);
  const out = [];
  for (const k of keys) {
    out.push(...diffJsonPaths(a[k], b[k], `${base}/${k}`));
  }
  return out;
}
function detectSourceKind(input) {
  if (!input || typeof input !== "object") return "unknown";
  const obj = input;
  if (obj.dashboard && typeof obj.dashboard === "object") {
    if (obj.meta?.isSnapshot || obj.snapshot) return "snapshot";
    return "export-wrapper";
  }
  if (obj.kind === "Dashboard" || obj.apiVersion?.toString?.().includes("dashboard.grafana.app")) {
    return "v2";
  }
  if (obj.panels || obj.schemaVersion != null || obj.title) return "v1";
  return "unknown";
}
function extractV2Spec(obj) {
  return convertV2DashboardToV1(obj);
}
function parseDashboardDocument(input) {
  const diagnostics = [];
  if (!input || typeof input !== "object") {
    throw new Error("Invalid dashboard JSON: expected object");
  }
  const original = JSON.parse(JSON.stringify(input));
  const sourceKind = detectSourceKind(input);
  const obj = input;
  let rawDash;
  let meta2;
  let inputs;
  let requires;
  if (sourceKind === "export-wrapper" || sourceKind === "snapshot") {
    rawDash = obj.dashboard;
    meta2 = obj.meta ?? void 0;
    inputs = Array.isArray(obj.__inputs) ? obj.__inputs : rawDash.__inputs;
    requires = Array.isArray(obj.__requires) ? obj.__requires : rawDash.__requires;
  } else if (sourceKind === "v2") {
    rawDash = extractV2Spec(obj);
    diagnostics.push({
      level: "info",
      code: "v2-compat",
      message: "v2 dashboard reduced to v1 runtime shape"
    });
  } else if (sourceKind === "v1") {
    rawDash = obj;
    inputs = obj.__inputs;
    requires = obj.__requires;
  } else {
    throw new Error(
      "Not a dashboard JSON (missing panels/title/schemaVersion or dashboard wrapper)"
    );
  }
  if (sourceKind === "v2") {
    const migrated2 = migrateV1Dashboard(rawDash);
    const dashboard2 = preserveUnknownFields(rawDash, migrated2.dashboard);
    const v2meta = rawDash.__v2;
    diagnostics.push({
      level: "info",
      code: "v2-migrated",
      message: `v2→v1 normalized (panels=${Array.isArray(dashboard2.panels) ? dashboard2.panels.length : 0}, elements=${v2meta?.elementCount ?? "?"}, layout=${v2meta?.layoutKind ?? "?"}, rows=${v2meta?.rowCount ?? "?"})`
    });
    return {
      sourceKind,
      dashboard: dashboard2,
      original,
      meta: meta2,
      inputs,
      requires,
      migrations: migrated2.applied,
      diagnostics
    };
  }
  const migrated = migrateV1Dashboard(rawDash);
  const dashboard = preserveUnknownFields(rawDash, migrated.dashboard);
  return {
    sourceKind,
    dashboard,
    original,
    meta: meta2,
    inputs,
    requires,
    migrations: migrated.applied,
    diagnostics
  };
}
function applyDocumentPatches(envelope, patches) {
  const nextDash = applyJsonPatch(
    envelope.dashboard,
    patches
  );
  return {
    ...envelope,
    dashboard: nextDash,
    patches: [...envelope.patches ?? [], ...patches]
  };
}
function toSerializableDashboard(envelope) {
  return JSON.parse(JSON.stringify(envelope.dashboard));
}
var DataTransformerID = /* @__PURE__ */ ((DataTransformerID2) => {
  DataTransformerID2["append"] = "append";
  DataTransformerID2["reduce"] = "reduce";
  DataTransformerID2["order"] = "order";
  DataTransformerID2["organize"] = "organize";
  DataTransformerID2["rename"] = "rename";
  DataTransformerID2["calculateField"] = "calculateField";
  DataTransformerID2["seriesToColumns"] = "seriesToColumns";
  DataTransformerID2["seriesToRows"] = "seriesToRows";
  DataTransformerID2["merge"] = "merge";
  DataTransformerID2["concatenate"] = "concatenate";
  DataTransformerID2["labelsToFields"] = "labelsToFields";
  DataTransformerID2["filterFields"] = "filterFields";
  DataTransformerID2["filterFieldsByName"] = "filterFieldsByName";
  DataTransformerID2["filterFrames"] = "filterFrames";
  DataTransformerID2["filterByRefId"] = "filterByRefId";
  DataTransformerID2["renameByRegex"] = "renameByRegex";
  DataTransformerID2["filterByValue"] = "filterByValue";
  DataTransformerID2["noop"] = "noop";
  DataTransformerID2["ensureColumns"] = "ensureColumns";
  DataTransformerID2["groupBy"] = "groupBy";
  DataTransformerID2["sortBy"] = "sortBy";
  DataTransformerID2["histogram"] = "histogram";
  DataTransformerID2["configFromData"] = "configFromData";
  DataTransformerID2["rowsToFields"] = "rowsToFields";
  DataTransformerID2["prepareTimeSeries"] = "prepareTimeSeries";
  DataTransformerID2["convertFieldType"] = "convertFieldType";
  DataTransformerID2["convertFrameType"] = "convertFrameType";
  DataTransformerID2["fieldLookup"] = "fieldLookup";
  DataTransformerID2["heatmap"] = "heatmap";
  DataTransformerID2["spatial"] = "spatial";
  DataTransformerID2["joinByField"] = "joinByField";
  DataTransformerID2["joinByLabels"] = "joinByLabels";
  DataTransformerID2["extractFields"] = "extractFields";
  DataTransformerID2["groupingToMatrix"] = "groupingToMatrix";
  DataTransformerID2["limit"] = "limit";
  DataTransformerID2["partitionByValues"] = "partitionByValues";
  DataTransformerID2["timeSeriesTable"] = "timeSeriesTable";
  DataTransformerID2["transpose"] = "transpose";
  DataTransformerID2["formatTime"] = "formatTime";
  DataTransformerID2["formatString"] = "formatString";
  DataTransformerID2["regression"] = "regression";
  DataTransformerID2["smoothing"] = "smoothing";
  DataTransformerID2["groupToNestedTable"] = "groupToNestedTable";
  return DataTransformerID2;
})(DataTransformerID || {});
const DATA_TRANSFORMER_IDS = Object.values(DataTransformerID);
var FieldNamePickerBaseNameMode = /* @__PURE__ */ ((FieldNamePickerBaseNameMode2) => {
  FieldNamePickerBaseNameMode2["Default"] = "default";
  FieldNamePickerBaseNameMode2["OnlyBaseNames"] = "OnlyBaseNames";
  FieldNamePickerBaseNameMode2["ExcludeBaseNames"] = "ExcludeBaseNames";
  return FieldNamePickerBaseNameMode2;
})(FieldNamePickerBaseNameMode || {});
function normalizeBaseNameMode(mode2) {
  const m = String(mode2 ?? "default");
  if (m === "OnlyBaseNames" || m === "only")
    return "only";
  if (m === "ExcludeBaseNames" || m === "exclude")
    return "exclude";
  return "default";
}
function groupLabelForScope(scope) {
  switch (scope) {
    case "nested":
      return "Nested";
    case "annotation":
      return "Annotations";
    case "exemplar":
      return "Exemplars";
    case "series":
    default:
      return "Dataframe";
  }
}
function preProcessPanelData(data, lastResult) {
  const state2 = String(data.state);
  const seriesEmpty = !data.series?.length;
  const isLoading = state2 === "Loading" || state2 === "Streaming";
  if (isLoading && seriesEmpty && lastResult?.series?.length) {
    return {
      ...data,
      series: lastResult.series,
      annotations: data.annotations?.length ? data.annotations : lastResult.annotations,
      // preserve request identity from current
      state: data.state,
      timeRange: data.timeRange ?? lastResult.timeRange,
      requestId: data.requestId,
      structureRev: data.structureRev ?? lastResult.structureRev
    };
  }
  if (state2 === "Error" && seriesEmpty && lastResult?.series?.length) {
    return {
      ...data,
      series: lastResult.series,
      annotations: data.annotations ?? lastResult.annotations,
      error: data.error
    };
  }
  if (lastResult?.requestId && data.requestId && lastResult.requestId !== data.requestId && isLoading && seriesEmpty) ;
  return data;
}
function clamp$1(value, min = 0, max = 1) {
  return Math.min(Math.max(min, value), max);
}
function hexToRgb(color) {
  color = color.slice(1);
  const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, "g");
  let result = color.match(re);
  if (!result) return "";
  let colors = Array.from(result);
  if (colors[0].length === 1) {
    colors = colors.map((n) => n + n);
  }
  return `rgb${colors.length === 4 ? "a" : ""}(${colors.map(
    (n, index2) => index2 < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1e3) / 1e3
  ).join(", ")})`;
}
function intToHex(int) {
  const hex = Math.round(int).toString(16);
  return hex.length === 1 ? `0${hex}` : hex;
}
function rgbToHex(color) {
  if (color.indexOf("#") === 0) return color;
  const { values } = decomposeColor(color);
  return `#${values.map((n) => intToHex(n)).join("")}`;
}
function asHexString(color) {
  if (color[0] === "#") return color;
  try {
    const parts = decomposeColor(color);
    const rgb = parts.type.indexOf("hsl") !== -1 ? decomposeColor(hslToRgb(color)).values : parts.values;
    const a = rgb[3];
    const hex = `#${intToHex(rgb[0])}${intToHex(rgb[1])}${intToHex(rgb[2])}`;
    if (a === void 0 || a === 1) return hex;
    return hex + intToHex(Math.round(a * 255));
  } catch {
    return color;
  }
}
function asRgbString(color) {
  if (color.startsWith("rgb")) return color;
  try {
    const parts = decomposeColor(color);
    if (parts.type.indexOf("hsl") !== -1) return hslToRgb(color);
    return recomposeColor(parts);
  } catch {
    return color;
  }
}
function hslToRgb(color) {
  const parts = decomposeColor(color);
  const { values } = parts;
  const h2 = values[0];
  const s = values[1] / 100;
  const l = values[2] / 100;
  const a = s * Math.min(l, 1 - l);
  const f = (n, k = (n + h2 / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);
  let type = "rgb";
  const rgb = [
    Math.round(f(0) * 255),
    Math.round(f(8) * 255),
    Math.round(f(4) * 255)
  ];
  if (parts.type === "hsla") {
    type += "a";
    rgb.push(values[3]);
  }
  return recomposeColor({ type, values: rgb });
}
function decomposeColor(color) {
  if (typeof color !== "string") return color;
  if (color.charAt(0) === "#") return decomposeColor(hexToRgb(color));
  const marker = color.indexOf("(");
  if (marker === -1) throw new Error(`Unsupported '${color}' color.`);
  const type = color.substring(0, marker);
  if (["rgb", "rgba", "hsl", "hsla", "color"].indexOf(type) === -1) {
    throw new Error(`Unsupported '${color}' color.`);
  }
  let values = color.substring(marker + 1, color.length - 1);
  let colorSpace;
  if (type === "color") {
    values = values.split(" ");
    colorSpace = values.shift();
    if (values.length === 4 && values[3].charAt(0) === "/")
      values[3] = values[3].slice(1);
  } else {
    values = values.split(",");
  }
  values = values.map((value) => parseFloat(value));
  return { type, values, colorSpace };
}
function recomposeColor(color) {
  const { type, colorSpace } = color;
  let values = color.values;
  if (type.indexOf("rgb") !== -1) {
    values = values.map(
      (n, i) => i < 3 ? parseInt(String(n), 10) : n
    );
  } else if (type.indexOf("hsl") !== -1) {
    values[1] = `${values[1]}%`;
    values[2] = `${values[2]}%`;
  }
  if (type.indexOf("color") !== -1) {
    values = `${colorSpace} ${values.join(" ")}`;
  } else {
    values = `${values.join(", ")}`;
  }
  return `${type}(${values})`;
}
function getContrastRatio(foreground, background, canvas) {
  const lumA = getLuminance(foreground);
  const lumB = getLuminance(background, canvas);
  return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);
}
function getLuminance(color, background) {
  const parts = decomposeColor(color);
  let rgb = parts.type === "hsl" ? decomposeColor(hslToRgb(color)).values : parts.values;
  if (background && parts.type === "rgba") {
    const backgroundParts = decomposeColor(background);
    const alphaVal = rgb[3];
    rgb[0] = rgb[0] * alphaVal + backgroundParts.values[0] * (1 - alphaVal);
    rgb[1] = rgb[1] * alphaVal + backgroundParts.values[1] * (1 - alphaVal);
    rgb[2] = rgb[2] * alphaVal + backgroundParts.values[2] * (1 - alphaVal);
  }
  const rgbNumbers = rgb.map((val) => {
    if (parts.type !== "color") val /= 255;
    return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;
  });
  return Number(
    (0.2126 * rgbNumbers[0] + 0.7152 * rgbNumbers[1] + 0.0722 * rgbNumbers[2]).toFixed(3)
  );
}
function emphasize(color, coefficient = 0.15) {
  return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);
}
function alpha$1(color, value) {
  if (color === "") return "#000000";
  value = clamp$1(value);
  if (color[0] === "#") {
    if (color.length === 9) color = color.substring(0, 7);
    else if (color.length <= 5) {
      let c = "#";
      for (let i = 1; i < 4; i++) c += color[i] + color[i];
      color = c;
    }
    return color + Math.round(value * 255).toString(16).padStart(2, "0");
  } else if (color[3] === "(") {
    return color.replace(")", `, ${value})`);
  } else if (color[4] === "(") {
    return color.substring(0, color.lastIndexOf(",")) + `, ${value})`;
  }
  const parts = decomposeColor(color);
  if (parts.type === "color") parts.values[3] = `/${value}`;
  else parts.values[3] = value;
  return recomposeColor(parts);
}
function darken(color, coefficient) {
  const parts = decomposeColor(color);
  coefficient = clamp$1(coefficient);
  if (parts.type.indexOf("hsl") !== -1) {
    parts.values[2] *= 1 - coefficient;
  } else if (parts.type.indexOf("rgb") !== -1 || parts.type.indexOf("color") !== -1) {
    for (let i = 0; i < 3; i += 1) parts.values[i] *= 1 - coefficient;
  }
  return recomposeColor(parts);
}
function lighten(color, coefficient) {
  const parts = decomposeColor(color);
  coefficient = clamp$1(coefficient);
  if (parts.type.indexOf("hsl") !== -1) {
    parts.values[2] += (100 - parts.values[2]) * coefficient;
  } else if (parts.type.indexOf("rgb") !== -1) {
    for (let i = 0; i < 3; i += 1)
      parts.values[i] += (255 - parts.values[i]) * coefficient;
  } else if (parts.type.indexOf("color") !== -1) {
    for (let i = 0; i < 3; i += 1)
      parts.values[i] += (1 - parts.values[i]) * coefficient;
  }
  return recomposeColor(parts);
}
function getContrastText(background, darkText = "#ffffff", lightText = "#000000", threshold = 3) {
  return getContrastRatio(darkText, background) >= threshold ? darkText : lightText;
}
const colorManipulator = {
  hexToRgb,
  rgbToHex,
  asHexString,
  asRgbString,
  hslToRgb,
  decomposeColor,
  recomposeColor,
  getContrastRatio,
  getLuminance,
  emphasize,
  alpha: alpha$1,
  darken,
  lighten,
  getContrastText
};
const palette = {
  white: "#ffffff",
  black: "#000000",
  gray05: "#111217",
  gray10: "#181b1f",
  gray15: "#22252b",
  gray20: "#2c2f35",
  gray25: "#383b42",
  gray30: "#44474e",
  gray35: "#51555b",
  gray40: "#5f6268",
  gray45: "#6e7177",
  gray50: "#7d8085",
  gray55: "#8c8f94",
  gray60: "#9c9fa3",
  gray65: "#ababaf",
  gray70: "#babcbe",
  gray75: "#c8cacc",
  gray80: "#d6d7d9",
  gray85: "#e1e2e3",
  gray90: "#ececed",
  gray95: "#f4f5f5",
  gray100: "#fbfbfb",
  blueDarkMain: "#3d71d9",
  blueDarkText: "#6e9fff",
  redDarkMain: "#d10e5c",
  redDarkText: "#ff5286",
  greenDarkMain: "#1a7f4b",
  greenDarkText: "#6ccf8e",
  orangeDarkMain: "#ff9900",
  orangeDarkText: "#fbad37",
  purpleDarkMain: "#C27AFF",
  purpleDarkText: "#D4A0FF",
  blueLightMain: "#3871dc",
  blueLightText: "#1f62e0",
  redLightMain: "#e0226e",
  redLightText: "#cf0e5B",
  greenLightMain: "#1b855e",
  greenLightText: "#0a764e",
  orangeLightMain: "#ff9900",
  orangeLightText: "#B04E0C",
  purpleLightMain: "#A24BC8",
  purpleLightText: "#7c2ea3"
};
function darkBase() {
  const whiteBase = "204, 204, 220";
  const text = {
    primary: `rgb(${whiteBase})`,
    secondary: `rgba(${whiteBase}, 0.65)`,
    disabled: `rgba(${whiteBase}, 0.61)`,
    link: palette.blueDarkText,
    maxContrast: palette.white
  };
  return {
    mode: "dark",
    border: {
      weak: "rgb(54, 57, 64)",
      medium: "rgb(68, 70, 78)",
      strong: "rgb(85, 87, 96)"
    },
    text,
    primary: {
      main: palette.blueDarkMain,
      text: palette.blueDarkText,
      border: palette.blueDarkText
    },
    secondary: {
      main: palette.gray20,
      shade: palette.gray25,
      transparent: `rgba(${whiteBase}, 0.08)`,
      text: text.primary,
      contrastText: `rgb(${whiteBase})`,
      border: `rgba(${whiteBase}, 0.08)`
    },
    tertiary: { main: palette.purpleDarkMain, text: palette.purpleDarkText },
    accent: {
      main: palette.blueDarkMain,
      text: palette.blueDarkText,
      border: palette.blueDarkText
    },
    info: { main: palette.blueDarkMain, text: palette.blueDarkText },
    error: {
      main: palette.redDarkMain,
      text: palette.redDarkText,
      border: palette.redDarkText
    },
    success: { main: palette.greenDarkMain, text: palette.greenDarkText },
    warning: { main: palette.orangeDarkMain, text: palette.orangeDarkText },
    background: {
      canvas: palette.gray05,
      page: palette.gray10,
      primary: palette.gray10,
      secondary: palette.gray15,
      elevated: palette.gray15
    },
    action: {
      hover: `rgba(${whiteBase}, 0.16)`,
      selected: `rgba(${whiteBase}, 0.12)`,
      selectedBorder: palette.orangeDarkMain,
      hoverOpacity: 0.08,
      focus: `rgba(${whiteBase}, 0.16)`,
      disabledBackground: `rgba(${whiteBase}, 0.04)`,
      disabledText: text.disabled,
      disabledOpacity: 0.38
    },
    gradients: {
      brandHorizontal: "linear-gradient(270deg, #F55F3E 0%, #FF8833 100%)",
      brandVertical: "linear-gradient(0.01deg, #F55F3E 0.01%, #FF8833 99.99%)"
    },
    scrollbar: `rgba(${whiteBase}, 0.3)`,
    contrastThreshold: 3,
    hoverFactor: 0.03,
    tonalOffset: 0.15
  };
}
function lightBase() {
  const blackBase = "36, 41, 46";
  const primary = {
    main: palette.blueLightMain,
    border: palette.blueLightText,
    text: palette.blueLightText
  };
  const text = {
    primary: `rgba(${blackBase}, 1)`,
    secondary: `rgba(${blackBase}, 0.75)`,
    disabled: `rgba(${blackBase}, 0.65)`,
    link: primary.text,
    maxContrast: palette.black
  };
  const border = {
    weak: "rgb(229, 229, 230)",
    medium: "rgb(189, 191, 192)",
    strong: "rgb(167, 169, 171)"
  };
  return {
    mode: "light",
    primary,
    text,
    border,
    secondary: {
      main: palette.gray90,
      shade: palette.gray85,
      transparent: `rgba(${blackBase}, 0.08)`,
      contrastText: `rgba(${blackBase}, 1)`,
      text: text.primary,
      border: border.weak
    },
    tertiary: { main: palette.purpleLightMain, text: palette.purpleLightText },
    accent: primary,
    info: { main: palette.blueLightMain, text: palette.blueLightText },
    error: {
      main: palette.redLightMain,
      text: palette.redLightText,
      border: palette.redLightText
    },
    success: { main: palette.greenLightMain, text: palette.greenLightText },
    warning: { main: palette.orangeLightMain, text: palette.orangeLightText },
    background: {
      canvas: palette.gray100,
      page: palette.white,
      primary: palette.white,
      secondary: palette.gray95,
      elevated: palette.white
    },
    action: {
      hover: `rgba(${blackBase}, 0.12)`,
      selected: `rgba(${blackBase}, 0.08)`,
      selectedBorder: palette.orangeLightMain,
      hoverOpacity: 0.08,
      focus: `rgba(${blackBase}, 0.12)`,
      disabledBackground: `rgba(${blackBase}, 0.04)`,
      disabledText: text.disabled,
      disabledOpacity: 0.38
    },
    gradients: {
      brandHorizontal: "linear-gradient(90deg, #FF8833 0%, #F53E4C 100%)",
      brandVertical: "linear-gradient(0.01deg, #F53E4C -31.2%, #FF8833 113.07%)"
    },
    scrollbar: `rgba(${blackBase}, 0.3)`,
    contrastThreshold: 3,
    hoverFactor: 0.03,
    tonalOffset: 0.2
  };
}
function createColors(mode2) {
  const base = mode2 === "light" ? lightBase() : darkBase();
  const tonalOffset = base.tonalOffset;
  const hoverFactor = base.hoverFactor;
  const contrastThreshold = base.contrastThreshold;
  function getContrastText2(background, threshold = contrastThreshold) {
    const dark = darkBase();
    const light = lightBase();
    return getContrastRatio(
      dark.text.maxContrast,
      background,
      base.background.primary
    ) >= threshold ? dark.text.maxContrast : light.text.maxContrast;
  }
  function getRichColor(color, name) {
    const result = { ...color, name };
    if (!result.main) result.main = base[name].main;
    if (!result.text) result.text = result.main;
    if (!result.border) result.border = result.text;
    if (!result.shade) {
      result.shade = base.mode === "light" ? darken(result.main, tonalOffset) : lighten(result.main, tonalOffset);
    }
    if (!result.transparent) result.transparent = alpha$1(result.main, 0.15);
    if (!result.contrastText)
      result.contrastText = getContrastText2(result.main);
    if (!result.borderTransparent)
      result.borderTransparent = alpha$1(result.border, 0.25);
    return result;
  }
  return {
    mode: base.mode,
    text: base.text,
    background: base.background,
    border: base.border,
    gradients: base.gradients,
    action: base.action,
    scrollbar: base.scrollbar,
    hoverFactor,
    contrastThreshold,
    tonalOffset,
    primary: getRichColor(base.primary, "primary"),
    secondary: getRichColor(base.secondary, "secondary"),
    tertiary: getRichColor(base.tertiary, "tertiary"),
    accent: getRichColor(base.accent, "accent"),
    info: getRichColor(base.info, "info"),
    error: getRichColor(base.error, "error"),
    success: getRichColor(base.success, "success"),
    warning: getRichColor(base.warning, "warning"),
    getContrastText: getContrastText2,
    emphasize: (color, factor) => emphasize(color, factor ?? hoverFactor)
  };
}
const FALLBACK_COLOR = "#808080";
function createVisualizationColors(colors) {
  const baseHues = colors.mode === "light" ? getLightHues() : getDarkHues();
  const hues = baseHues;
  const byNameIndex = {};
  for (const hue of hues) {
    for (const shade of hue.shades) {
      byNameIndex[shade.name] = shade.color;
      if (shade.aliases) {
        for (const alias of shade.aliases) byNameIndex[alias] = shade.color;
      }
    }
  }
  byNameIndex["transparent"] = colors.mode === "light" ? "rgba(255, 255, 255, 0)" : "rgba(0,0,0,0)";
  byNameIndex["panel-bg"] = colors.background.primary;
  byNameIndex["text"] = colors.text.primary;
  const palette2 = getClassicPalette().map((name) => {
    if (name.startsWith("#")) return name;
    return byNameIndex[name] ?? name;
  });
  const getColorByName = (colorName) => {
    if (!colorName) return FALLBACK_COLOR;
    const realColor = byNameIndex[colorName];
    if (realColor) return realColor;
    if (colorName[0] === "#") return colorName;
    if (colorName.indexOf("rgb") > -1) return colorName;
    const nativeColor = nativeColorNames[colorName.toLowerCase()];
    if (nativeColor) {
      byNameIndex[colorName] = nativeColor;
      return nativeColor;
    }
    return colorName;
  };
  return { hues, palette: palette2, getColorByName };
}
function getDarkHues() {
  return [
    {
      name: "red",
      shades: [
        { color: "#FFA6B0", name: "super-light-red" },
        { color: "#FF7383", name: "light-red" },
        { color: "#F2495C", name: "red", primary: true },
        { color: "#E02F44", name: "semi-dark-red" },
        { color: "#C4162A", name: "dark-red" }
      ]
    },
    {
      name: "orange",
      shades: [
        { color: "#FFCB7D", name: "super-light-orange" },
        { color: "#FFB357", name: "light-orange" },
        { color: "#FF9830", name: "orange", primary: true },
        { color: "#FF780A", name: "semi-dark-orange" },
        { color: "#FA6400", name: "dark-orange" }
      ]
    },
    {
      name: "yellow",
      shades: [
        { color: "#FFF899", name: "super-light-yellow" },
        { color: "#FFEE52", name: "light-yellow" },
        { color: "#FADE2A", name: "yellow", primary: true },
        { color: "#F2CC0C", name: "semi-dark-yellow" },
        { color: "#E0B400", name: "dark-yellow" }
      ]
    },
    {
      name: "green",
      shades: [
        { color: "#C8F2C2", name: "super-light-green" },
        { color: "#96D98D", name: "light-green" },
        { color: "#73BF69", name: "green", primary: true },
        { color: "#56A64B", name: "semi-dark-green" },
        { color: "#37872D", name: "dark-green" }
      ]
    },
    {
      name: "blue",
      shades: [
        { color: "#C0D8FF", name: "super-light-blue" },
        { color: "#8AB8FF", name: "light-blue" },
        { color: "#5794F2", name: "blue", primary: true },
        { color: "#3274D9", name: "semi-dark-blue" },
        { color: "#1F60C4", name: "dark-blue" }
      ]
    },
    {
      name: "purple",
      shades: [
        { color: "#DEB6F2", name: "super-light-purple" },
        { color: "#CA95E5", name: "light-purple" },
        { color: "#B877D9", name: "purple", primary: true },
        { color: "#A352CC", name: "semi-dark-purple" },
        { color: "#8F3BB8", name: "dark-purple" }
      ]
    }
  ];
}
function getLightHues() {
  return [
    {
      name: "red",
      shades: [
        { color: "#FF7383", name: "super-light-red" },
        { color: "#F2495C", name: "light-red" },
        { color: "#E02F44", name: "red", primary: true },
        { color: "#C4162A", name: "semi-dark-red" },
        { color: "#AD0317", name: "dark-red" }
      ]
    },
    {
      name: "orange",
      shades: [
        { color: "#FFB357", name: "super-light-orange" },
        { color: "#FF9830", name: "light-orange" },
        { color: "#FF780A", name: "orange", primary: true },
        { color: "#FA6400", name: "semi-dark-orange" },
        { color: "#E55400", name: "dark-orange" }
      ]
    },
    {
      name: "yellow",
      shades: [
        { color: "#FFEE52", name: "super-light-yellow" },
        { color: "#FADE2A", name: "light-yellow" },
        { color: "#F2CC0C", name: "yellow", primary: true },
        { color: "#E0B400", name: "semi-dark-yellow" },
        { color: "#CC9D00", name: "dark-yellow" }
      ]
    },
    {
      name: "green",
      shades: [
        { color: "#96D98D", name: "super-light-green" },
        { color: "#73BF69", name: "light-green" },
        { color: "#56A64B", name: "green", primary: true },
        { color: "#37872D", name: "semi-dark-green" },
        { color: "#19730E", name: "dark-green" }
      ]
    },
    {
      name: "blue",
      shades: [
        { color: "#8AB8FF", name: "super-light-blue" },
        { color: "#5794F2", name: "light-blue" },
        { color: "#3274D9", name: "blue", primary: true },
        { color: "#1F60C4", name: "semi-dark-blue" },
        { color: "#1250B0", name: "dark-blue" }
      ]
    },
    {
      name: "purple",
      shades: [
        { color: "#CA95E5", name: "super-light-purple" },
        { color: "#B877D9", name: "light-purple" },
        { color: "#A352CC", name: "purple", primary: true },
        { color: "#8F3BB8", name: "semi-dark-purple" },
        { color: "#7C2EA3", name: "dark-purple" }
      ]
    }
  ];
}
function getClassicPalette() {
  return [
    "green",
    "semi-dark-yellow",
    "blue",
    "orange",
    "red",
    "purple",
    "dark-green",
    "dark-yellow",
    "dark-blue",
    "dark-orange",
    "dark-red",
    "dark-purple",
    "super-light-green",
    "super-light-yellow",
    "super-light-blue",
    "super-light-orange",
    "super-light-red",
    "super-light-purple",
    "#447EBC",
    "#C15C17",
    "#890F02",
    "#0A437C",
    "#6D1F62",
    "#584477",
    "#B7DBAB",
    "#F4D598",
    "#70DBED",
    "#F9BA8F",
    "#F29191",
    "#82B5D8",
    "#E5A8E2",
    "#AEA2E0",
    "#629E51",
    "#E5AC0E",
    "#64B0C8",
    "#E0752D",
    "#BF1B00",
    "#0A50A1",
    "#962D82",
    "#614D93",
    "#9AC48A",
    "#F2C96D",
    "#65C5DB",
    "#F9934E",
    "#EA6460",
    "#5195CE",
    "#D683CE",
    "#806EB7",
    "#3F6833",
    "#967302",
    "#2F575E",
    "#99440A",
    "#58140C",
    "#052B51",
    "#511749",
    "#3F2B5B",
    "#E0F9D7",
    "#FCEACA",
    "#CFFAFF",
    "#F9E2D2",
    "#FCE2DE",
    "#BADFF4",
    "#F9D9F9",
    "#DEDAF7"
  ];
}
const nativeColorNames = {
  black: "#000000",
  white: "#ffffff",
  red: "#ff0000",
  green: "#008000",
  blue: "#0000ff",
  yellow: "#ffff00",
  orange: "#ffa500",
  purple: "#800080",
  gray: "#808080",
  grey: "#808080",
  transparent: "rgba(0,0,0,0)"
};
function createComponents(colors, shadows) {
  const elevated = colors.background.elevated;
  const inputBackground = colors.mode === "dark" ? colors.background.canvas : colors.background.primary;
  return {
    height: { sm: 24, md: 32, lg: 48 },
    input: {
      background: inputBackground,
      text: colors.text.primary,
      borderColor: colors.border.medium,
      borderHover: colors.border.strong
    },
    panel: {
      background: colors.background.primary,
      borderColor: colors.border.weak,
      padding: 8,
      contentBg: colors.background.secondary
    },
    dropdown: {
      background: elevated,
      borderColor: colors.border.weak,
      selectedBackground: colors.action.selected
    },
    tooltip: {
      background: elevated,
      text: colors.text.primary,
      borderColor: colors.border.weak
    },
    overlay: {
      background: colors.mode === "dark" ? "rgba(63, 62, 62, 0.5)" : "rgba(208, 209, 211, 0.5)",
      borderColor: colors.border.weak,
      boxShadow: shadows.z3 ?? shadows.z2 ?? "none"
    },
    table: {
      headerBackground: colors.background.secondary,
      rowHoverBackground: colors.action.hover,
      rowSelectedBackground: colors.action.selected
    },
    drawer: {
      background: colors.background.primary,
      borderColor: colors.border.weak
    },
    menu: {
      background: elevated,
      activeBackground: colors.action.selected,
      activeText: colors.text.primary
    }
  };
}
function createSpacing(gridSize = 8) {
  const spacing = ((factor = 1) => `${gridSize * factor}px`);
  spacing.gridSize = gridSize;
  return spacing;
}
function createTheme(options = {}) {
  const mode2 = options.colors?.mode === "light" ? "light" : "dark";
  const colors = createColors(mode2);
  const visualization = createVisualizationColors(colors);
  const typography = {
    fontFamily: "'Inter', 'Helvetica', 'Arial', sans-serif",
    fontFamilyMonospace: "'Roboto Mono', monospace",
    fontSize: 14,
    fontWeightLight: 300,
    fontWeightRegular: 400,
    fontWeightMedium: 500,
    fontWeightBold: 500,
    h1: {
      fontSize: "28px",
      fontWeight: 400,
      lineHeight: 32 / 28,
      letterSpacing: `${-0.25 / 28}em`
    },
    h2: {
      fontSize: "24px",
      fontWeight: 400,
      lineHeight: 28 / 24,
      letterSpacing: "0em"
    },
    h3: {
      fontSize: "22px",
      fontWeight: 400,
      lineHeight: 24 / 22,
      letterSpacing: "0em"
    },
    h4: {
      fontSize: "18px",
      fontWeight: 400,
      lineHeight: 22 / 18,
      letterSpacing: `${0.25 / 18}em`
    },
    h5: {
      fontSize: "16px",
      fontWeight: 400,
      lineHeight: 22 / 16,
      letterSpacing: "0em"
    },
    h6: {
      fontSize: "14px",
      fontWeight: 500,
      lineHeight: 22 / 14,
      letterSpacing: `${0.15 / 14}em`
    },
    body: {
      fontSize: "14px",
      fontWeight: 400,
      lineHeight: 22 / 14,
      letterSpacing: `${0.15 / 14}em`
    },
    bodySmall: {
      fontSize: "12px",
      fontWeight: 400,
      lineHeight: 18 / 12,
      letterSpacing: `${0.15 / 12}em`
    }
  };
  const bp = { xs: 0, sm: 544, md: 769, lg: 992, xl: 1200, xxl: 1440 };
  const shadows = mode2 === "dark" ? {
    z1: "0px 1px 2px rgba(1, 4, 9, 0.75)",
    z2: "0px 4px 8px rgba(1, 4, 9, 0.75)",
    z3: "0px 8px 24px rgb(1, 4, 9)"
  } : {
    z1: "0px 1px 2px rgba(24, 26, 27, 0.2)",
    z2: "0px 4px 8px rgba(24, 26, 27, 0.2)",
    z3: "0px 13px 20px 1px rgba(24, 26, 27, 0.18)"
  };
  return {
    name: options.name ?? (mode2 === "dark" ? "Dark" : "Light"),
    isDark: mode2 === "dark",
    isLight: mode2 === "light",
    colors,
    spacing: createSpacing(8),
    shape: {
      radius: {
        default: "6px",
        sm: "4px",
        md: "6px",
        lg: "10px",
        pill: "9999px",
        circle: "100%"
      }
    },
    typography,
    zIndex: {
      content: 1,
      activePanel: 999,
      dropdown: 1030,
      typeahead: 1030,
      navbarFixed: 1e3,
      sidemenu: 1020,
      tooltip: 1040,
      modalBackdrop: 1050,
      modal: 1060,
      portal: 1061
    },
    shadows,
    transitions: {
      duration: { short: "100ms", medium: "200ms", long: "300ms" },
      easing: { easeInOut: "cubic-bezier(0.4, 0, 0.2, 1)" }
    },
    visualization,
    components: createComponents(colors, shadows),
    flags: { visualDesignRefresh: options.flags?.visualDesignRefresh },
    breakpoints: {
      values: bp,
      up: (key) => `@media (min-width: ${bp[key] ?? 0}px)`,
      down: (key) => `@media (max-width: ${(bp[key] ?? 0) - 0.02}px)`
    }
  };
}
function applyTheme2CssVars(theme, el = document.documentElement) {
  const { colors, typography, spacing, shape, shadows } = theme;
  const map = {
    // legacy / short aliases (compat with existing components)
    "--grafana-bg": colors.background.canvas,
    "--grafana-panel-bg": colors.background.primary,
    "--grafana-canvas-bg": colors.background.canvas,
    "--grafana-dashboard-bg": colors.background.canvas,
    "--grafana-border-color-weak": colors.border.weak,
    "--grafana-border-color-medium": colors.border.medium,
    "--grafana-border-color-strong": colors.border.strong,
    "--grafana-text": colors.text.primary,
    "--grafana-text-secondary": colors.text.secondary,
    "--grafana-primary": colors.primary.main,
    "--grafana-border": colors.border.medium,
    "--grafana-error": colors.error.main,
    "--grafana-success": colors.success.main,
    "--grafana-warning": colors.warning.main,
    "--grafana-hover": colors.action.hover,
    "--grafana-input-bg": theme.components.input.background,
    // background hierarchy
    "--grafana-bg-canvas": colors.background.canvas,
    "--grafana-bg-page": colors.background.page,
    "--grafana-bg-primary": colors.background.primary,
    "--grafana-bg-secondary": colors.background.secondary,
    "--grafana-bg-elevated": colors.background.elevated,
    // text
    "--grafana-text-primary": colors.text.primary,
    "--grafana-text-disabled": colors.text.disabled,
    "--grafana-text-link": colors.text.link,
    "--grafana-text-max-contrast": colors.text.maxContrast,
    // borders
    "--grafana-border-weak": colors.border.weak,
    // legacy alias used by older scoped CSS (Zabbix etc.)
    "--border-weak": colors.border.weak,
    "--grafana-border-medium": colors.border.medium,
    "--grafana-border-strong": colors.border.strong,
    // action
    "--grafana-action-hover": colors.action.hover,
    "--grafana-action-selected": colors.action.selected,
    "--grafana-action-focus": colors.action.focus,
    "--grafana-action-disabled-bg": colors.action.disabledBackground,
    "--grafana-action-disabled-text": colors.action.disabledText,
    "--grafana-action-selected-border": colors.action.selectedBorder,
    // rich colors
    "--grafana-primary-main": colors.primary.main,
    "--grafana-primary-text": colors.primary.text,
    "--grafana-primary-border": colors.primary.border,
    "--grafana-primary-shade": colors.primary.shade,
    "--grafana-primary-transparent": colors.primary.transparent,
    "--grafana-primary-contrast": colors.primary.contrastText,
    "--grafana-secondary-main": colors.secondary.main,
    "--grafana-secondary-text": colors.secondary.text,
    "--grafana-secondary-border": colors.secondary.border,
    "--grafana-secondary-transparent": colors.secondary.transparent,
    "--grafana-error-main": colors.error.main,
    "--grafana-error-text": colors.error.text,
    "--grafana-error-border": colors.error.border,
    "--grafana-error-transparent": colors.error.transparent,
    "--grafana-error-contrast": colors.error.contrastText,
    "--grafana-success-main": colors.success.main,
    "--grafana-success-text": colors.success.text,
    "--grafana-success-transparent": colors.success.transparent,
    "--grafana-warning-main": colors.warning.main,
    "--grafana-warning-text": colors.warning.text,
    "--grafana-warning-transparent": colors.warning.transparent,
    "--grafana-info-main": colors.info.main,
    "--grafana-info-text": colors.info.text,
    // shadows
    "--grafana-shadow-z1": shadows.z1 ?? "",
    "--grafana-shadow-z2": shadows.z2 ?? "",
    "--grafana-shadow-z3": shadows.z3 ?? "",
    // gradients
    "--grafana-gradient-brand-horizontal": colors.gradients.brandHorizontal,
    "--grafana-gradient-brand-vertical": colors.gradients.brandVertical,
    // scrollbar
    "--grafana-scrollbar": colors.scrollbar,
    // typography / shape
    "--grafana-font-family": typography.fontFamily,
    "--grafana-font-size": `${typography.fontSize}px`,
    "--grafana-spacing-grid": `${spacing.gridSize}px`,
    "--grafana-radius": shape.radius.default,
    // panel
    "--grafana-panel-border": theme.components.panel.borderColor,
    "--grafana-panel-padding": `${theme.components.panel.padding}px`,
    "--grafana-panel-content-bg": theme.components.panel.contentBg,
    // component states (from theme.components only)
    "--grafana-input-border-hover": theme.components.input.borderHover,
    "--grafana-dropdown-bg": theme.components.dropdown.background,
    "--grafana-dropdown-border": theme.components.dropdown.borderColor,
    "--grafana-dropdown-selected-bg": theme.components.dropdown.selectedBackground,
    "--grafana-tooltip-bg": theme.components.tooltip.background,
    "--grafana-tooltip-text": theme.components.tooltip.text,
    "--grafana-tooltip-border": theme.components.tooltip.borderColor,
    "--grafana-overlay-bg": theme.components.overlay.background,
    "--grafana-overlay-border": theme.components.overlay.borderColor,
    "--grafana-overlay-shadow": theme.components.overlay.boxShadow,
    "--grafana-table-header-bg": theme.components.table.headerBackground,
    "--grafana-table-row-hover-bg": theme.components.table.rowHoverBackground,
    "--grafana-table-row-selected-bg": theme.components.table.rowSelectedBackground,
    "--grafana-drawer-bg": theme.components.drawer.background,
    "--grafana-drawer-border": theme.components.drawer.borderColor,
    "--grafana-menu-bg": theme.components.menu.background,
    "--grafana-menu-active-bg": theme.components.menu.activeBackground,
    "--grafana-menu-active-text": theme.components.menu.activeText
  };
  for (const [k, v] of Object.entries(map)) {
    if (v !== void 0 && v !== null) el.style.setProperty(k, v);
  }
  el.dataset.theme = colors.mode;
  el.style.colorScheme = colors.mode;
  el.classList.remove("theme-light", "theme-dark");
  el.classList.add(`theme-${colors.mode}`);
  if (theme.flags.visualDesignRefresh) el.dataset.visualDesignRefresh = "true";
  else delete el.dataset.visualDesignRefresh;
  if (el === document.documentElement && document.body) {
    document.body.dataset.theme = colors.mode;
    document.body.classList.remove("theme-light", "theme-dark");
    document.body.classList.add(`theme-${colors.mode}`);
    document.body.style.background = colors.background.canvas;
    document.body.style.color = colors.text.primary;
  }
}
function headingCss(selector, v) {
  return `
${selector} {
  margin: 0;
  margin-bottom: 0.45em;
  font-size: ${v.fontSize};
  font-weight: ${v.fontWeight};
  line-height: ${v.lineHeight};
  font-family: inherit;
  ${v.letterSpacing ? `letter-spacing: ${v.letterSpacing};` : ""}
}`;
}
function createGlobalStyles(theme) {
  const { colors, typography } = theme;
  return `
html {
  box-sizing: border-box;
  height: 100%;
  font-size: ${typography.fontSize}px;
  font-family: ${typography.fontFamily};
  line-height: ${typography.body.lineHeight};
  font-kerning: normal;
}
html, body {
  margin: 0;
  padding: 0;
}
body {
  height: 100%;
  width: 100%;
  background: ${colors.background.canvas};
  color: ${colors.text.primary};
  font-family: ${typography.fontFamily};
  font-size: ${typography.body.fontSize};
  font-weight: ${typography.body.fontWeight};
  line-height: ${typography.body.lineHeight};
  letter-spacing: ${typography.body.letterSpacing ?? "0"};
  font-variant-ligatures: no-contextual;
}
*, *::before, *::after { box-sizing: inherit; }
:focus-visible {
  outline: 2px solid ${colors.primary.main};
  outline-offset: 2px;
}
${headingCss("h1, .h1", typography.h1)}
${headingCss("h2, .h2", typography.h2)}
${headingCss("h3, .h3", typography.h3)}
${headingCss("h4, .h4", typography.h4)}
${headingCss("h5, .h5", typography.h5)}
${headingCss("h6, .h6", typography.h6)}
p {
  margin: 0 0 16px;
}
code, pre, kbd {
  font-family: ${typography.fontFamilyMonospace};
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb {
  background: ${colors.border.medium};
  border-radius: 4px;
}
body * {
  scrollbar-color: ${colors.scrollbar} transparent;
  scrollbar-width: thin;
}
::selection {
  background: ${colors.action.selected};
  color: ${colors.text.primary};
}
a {
  color: ${colors.text.link};
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}
a.external-link, .text-link, .link {
  color: ${colors.text.link};
}
`;
}
function applyGlobalStyles(theme, doc = document) {
  const id = "grafana-vue-global-styles";
  let el = doc.getElementById(id);
  if (!el) {
    el = doc.createElement("style");
    el.id = id;
    doc.head.appendChild(el);
  }
  el.textContent = createGlobalStyles(theme);
}
function resolveThemeMode(pref, mql) {
  if (pref === "light" || pref === "dark") return pref;
  const dark = mql?.matches ?? (typeof window !== "undefined" && window.matchMedia?.("(prefers-color-scheme: dark)").matches);
  return dark ? "dark" : "light";
}
function createThemeFromPreference(pref, options = {}) {
  const mode2 = resolveThemeMode(pref);
  return createTheme({
    ...options,
    colors: { mode: mode2 },
    flags: {
      visualDesignRefresh: options.visualDesignRefresh ?? options.flags?.visualDesignRefresh
    }
  });
}
function applyResolvedTheme(theme, el = document.documentElement) {
  applyTheme2CssVars(theme, el);
  applyGlobalStyles(theme, el.ownerDocument);
}
function watchSystemTheme(cb) {
  if (typeof window === "undefined" || !window.matchMedia) return () => {
  };
  const mql = window.matchMedia("(prefers-color-scheme: dark)");
  const handler = () => cb(mql.matches ? "dark" : "light");
  mql.addEventListener?.("change", handler);
  return () => mql.removeEventListener?.("change", handler);
}
function assertSignalSupported(caps2, signal) {
  if (!caps2?.signals?.includes(signal)) {
    const err = new Error(
      `UNSUPPORTED_QUERY_API: signal "${signal}" is not supported by this datasource`
    );
    err.code = "UNSUPPORTED_QUERY_API";
    throw err;
  }
}
const panels = /* @__PURE__ */ new Map();
const datasources = /* @__PURE__ */ new Map();
function registerPanelPlugin(plugin2, opts = {}) {
  if (panels.has(plugin2.meta.id) && !opts.overwrite) {
    panels.set(plugin2.meta.id, plugin2);
    return;
  }
  panels.set(plugin2.meta.id, plugin2);
}
function registerDataSourcePlugin(plugin2, opts = {}) {
  if (datasources.has(plugin2.meta.id) && !opts.overwrite) {
    datasources.set(plugin2.meta.id, plugin2);
    return;
  }
  datasources.set(plugin2.meta.id, plugin2);
}
function getPanelPlugin(id) {
  return panels.get(id);
}
function getDataSourcePlugin(id) {
  return datasources.get(id);
}
function listPanelPlugins() {
  return [...panels.values()];
}
function listDataSourcePlugins() {
  return [...datasources.values()];
}
function clearPluginRegistries() {
  panels.clear();
  datasources.clear();
}
function assertNoReactPlugins(modules2) {
  const react = modules2.filter((m) => m.framework === "react");
  if (react.length) {
    throw new Error(
      `React plugins are not supported: ${react.map((r) => r.id).join(", ")}`
    );
  }
}
function createEmptyEditorContext(partial = {}) {
  return {
    data: partial.data ?? [],
    annotations: partial.annotations ?? [],
    replaceVariables: partial.replaceVariables,
    eventBus: partial.eventBus,
    getSuggestions: partial.getSuggestions,
    options: partial.options,
    instanceState: partial.instanceState,
    isOverride: partial.isOverride ?? false
  };
}
function assignPathDefault$1(target, path, value) {
  const parts = path.split(".");
  let cur = target;
  for (let i = 0; i < parts.length - 1; i++) {
    const key = parts[i];
    const next = cur[key];
    if (!next || typeof next !== "object") {
      cur[key] = {};
    }
    cur = cur[key];
  }
  cur[parts[parts.length - 1]] = value;
}
class OptionsUIBuilder {
  descriptors = [];
  defaults = {};
  orderSeq = 0;
  getItems() {
    return this.descriptors;
  }
  add(d, defaultValue) {
    const order = d.order ?? this.orderSeq++;
    const editorKey = d.editorKey ?? d.editor;
    const desc = {
      ...d,
      category: d.category ?? [],
      editorKey,
      order,
      defaultValue: defaultValue !== void 0 ? defaultValue : d.defaultValue,
      id: d.id || d.path
    };
    this.descriptors.push(desc);
    const dv = defaultValue !== void 0 ? defaultValue : d.defaultValue;
    if (dv !== void 0) {
      assignPathDefault$1(this.defaults, d.path, dv);
    }
    return this;
  }
  addBoolean(d, defaultValue) {
    return this.add({ ...d, editor: "boolean" }, defaultValue);
  }
  addRadio(d, defaultValue) {
    return this.add({ ...d, editor: "radio" }, defaultValue);
  }
  addSelect(d, defaultValue) {
    return this.add({ ...d, editor: "select" }, defaultValue);
  }
  addMultiSelect(d, defaultValue) {
    return this.add({ ...d, editor: "multi-select" }, defaultValue);
  }
  addNumber(d, defaultValue) {
    return this.add({ ...d, editor: "number" }, defaultValue);
  }
  addSlider(d, defaultValue) {
    return this.add({ ...d, editor: "slider" }, defaultValue);
  }
  addText(d, defaultValue) {
    return this.add({ ...d, editor: "text" }, defaultValue);
  }
  addTextArea(d, defaultValue) {
    return this.add({ ...d, editor: "textarea" }, defaultValue);
  }
  addStrings(d, defaultValue) {
    return this.add({ ...d, editor: "strings" }, defaultValue);
  }
  addColor(d, defaultValue) {
    return this.add({ ...d, editor: "color" }, defaultValue);
  }
  addUnit(d, defaultValue) {
    return this.add({ ...d, editor: "unit" }, defaultValue);
  }
  addFieldColor(d, defaultValue) {
    return this.add({ ...d, editor: "fieldColor" }, defaultValue);
  }
  addThresholds(d, defaultValue) {
    return this.add({ ...d, editor: "thresholds" }, defaultValue);
  }
  addMappings(d, defaultValue) {
    return this.add({ ...d, editor: "mappings" }, defaultValue);
  }
  addLinks(d, defaultValue) {
    return this.add({ ...d, editor: "links" }, defaultValue);
  }
  addActions(d, defaultValue) {
    return this.add({ ...d, editor: "actions" }, defaultValue);
  }
  addStatsPicker(d, defaultValue) {
    return this.add({ ...d, editor: "stats-picker" }, defaultValue);
  }
  addTimezone(d, defaultValue) {
    return this.add({ ...d, editor: "timezone" }, defaultValue);
  }
  addFieldName(d, defaultValue) {
    return this.add({ ...d, editor: "field-name" }, defaultValue);
  }
  addDashboardUid(d, defaultValue) {
    return this.add({ ...d, editor: "dashboard-uid" }, defaultValue);
  }
  addCustomEditor(d, defaultValue) {
    return this.add(
      {
        ...d,
        editor: d.editor ?? "custom",
        editorKey: d.editorKey ?? "custom",
        customEditor: d.customEditor
      },
      defaultValue
    );
  }
  /**
   * Back-compat: full descriptor with explicit editor (used by commonBuilders / panels).
   */
  addCustom(d, defaultValue) {
    const editor = d.editor ?? "custom";
    return this.add(
      {
        ...d,
        editor,
        editorKey: d.editorKey ?? editor
      },
      defaultValue !== void 0 ? defaultValue : d.defaultValue
    );
  }
  /**
   * Nested option group — stores nested descriptor; children resolved by consumer via nested.build.
   */
  addNestedOptions(cfg) {
    return this.add(
      {
        id: `nested.${cfg.path}`,
        path: cfg.path,
        name: cfg.category?.[0] ?? cfg.path,
        category: cfg.category ?? [],
        editor: "nested",
        editorKey: "nested",
        nested: cfg,
        defaultValue: cfg.defaultValue
      },
      cfg.defaultValue
    );
  }
  /** Filter visible descriptors for a live context */
  static filterVisible(items, options, context) {
    return items.filter((d) => {
      if (d.hideFromDefaults && !context.isOverride) return false;
      if (d.hideFromOverrides && context.isOverride) return false;
      if (d.showIf) {
        const show = d.showIf(options, context.data, context.annotations);
        if (show === false) return false;
      }
      return true;
    });
  }
  static isDisabled(d, options, context) {
    if (!d.disableIf) return false;
    return !!d.disableIf(options, context.data, context.annotations);
  }
}
const STANDARD_ITEMS = [
  {
    id: "unit",
    path: "unit",
    name: "单位",
    category: ["Standard options"],
    editor: "unit",
    editorKey: "unit",
    override: true
  },
  {
    id: "min",
    path: "min",
    name: "最小值",
    category: ["Standard options"],
    editor: "number",
    editorKey: "number",
    override: true
  },
  {
    id: "max",
    path: "max",
    name: "最大值",
    category: ["Standard options"],
    editor: "number",
    editorKey: "number",
    override: true
  },
  {
    id: "fieldMinMax",
    path: "fieldMinMax",
    name: "字段最小/最大",
    description: "根据数据计算最小/最大值",
    category: ["Standard options"],
    editor: "boolean",
    editorKey: "boolean",
    override: true
  },
  {
    id: "decimals",
    path: "decimals",
    name: "小数位",
    category: ["Standard options"],
    editor: "number",
    editorKey: "number",
    override: true
  },
  {
    id: "displayName",
    path: "displayName",
    name: "显示名称",
    category: ["Standard options"],
    editor: "text",
    editorKey: "text",
    override: true
  },
  {
    id: "noValue",
    path: "noValue",
    name: "空值显示",
    category: ["Standard options"],
    editor: "text",
    editorKey: "text",
    override: true
  },
  {
    id: "color",
    path: "color",
    name: "颜色方案",
    category: ["Standard options"],
    editor: "fieldColor",
    editorKey: "fieldColor",
    override: true
  },
  {
    id: "thresholds",
    path: "thresholds",
    name: "阈值",
    category: ["Thresholds"],
    editor: "thresholds",
    editorKey: "thresholds",
    override: true
  },
  {
    id: "mappings",
    path: "mappings",
    name: "值映射",
    category: ["Value mappings"],
    editor: "mappings",
    editorKey: "mappings",
    override: true
  },
  {
    id: "links",
    path: "links",
    name: "数据链接",
    category: ["Data links and actions"],
    editor: "links",
    editorKey: "links",
    override: true
  },
  {
    id: "actions",
    path: "actions",
    name: "动作",
    category: ["Data links and actions"],
    editor: "actions",
    editorKey: "actions",
    override: true
  },
  {
    id: "filterable",
    path: "filterable",
    name: "可过滤",
    category: ["Standard options"],
    editor: "boolean",
    editorKey: "boolean",
    override: true,
    hideFromDefaults: true
  }
];
function buildStandardFieldConfigDescriptors(opts = {}) {
  const disabled = new Set(opts.disableStandardOptions ?? []);
  const patches = opts.standardOptions ?? {};
  return STANDARD_ITEMS.filter((item) => !disabled.has(item.id)).map((item) => {
    const patch = patches[item.id] ?? {};
    return {
      id: item.id,
      path: item.path,
      name: patch.name ?? item.name,
      description: patch.description ?? item.description,
      category: patch.category ?? item.category,
      editor: item.editor,
      editorKey: item.editorKey,
      override: item.override ?? true,
      hideFromDefaults: item.hideFromDefaults,
      hideFromOverrides: item.hideFromOverrides,
      defaultValue: patch.defaultValue ?? item.defaultValue,
      settings: patch.settings
    };
  });
}
function listStandardOverridePropertyOptions() {
  return STANDARD_ITEMS.filter(
    (i) => i.override !== false && !i.hideFromOverrides
  ).map((i) => ({
    value: i.id,
    label: i.name
  }));
}
function createPanelPlugin(meta2, panel2, extras = {}) {
  const plugin2 = { meta: meta2, panel: panel2, ...extras };
  registerPanelPlugin(plugin2);
  return plugin2;
}
function createDataSourcePlugin(module) {
  registerDataSourcePlugin(module);
  return module;
}
function buildPluginMeta(id, name, rest = {}) {
  return { id, name, ...rest };
}
const STANDARD_FIELD_CONFIG = buildStandardFieldConfigDescriptors();
function applyStandardFieldConfig(opts) {
  const fieldBuilder = new FieldConfigBuilder();
  opts.useCustomConfig?.(fieldBuilder);
  const disabled = new Set(opts.disableStandardOptions ?? []);
  let standard = [];
  if (opts.standard !== false) {
    for (const base of STANDARD_FIELD_CONFIG) {
      if (disabled.has(base.id)) continue;
      let item = { ...base };
      const patch = opts.standardOptions?.[base.id];
      if (patch) {
        if (patch.defaultValue !== void 0)
          item = { ...item, defaultValue: patch.defaultValue };
        if (patch.settings)
          item = {
            ...item,
            settings: { ...item.settings ?? {}, ...patch.settings }
          };
        if (patch.hideFromDefaults !== void 0)
          item = { ...item, hideFromDefaults: patch.hideFromDefaults };
      }
      standard.push(item);
    }
  }
  const custom = fieldBuilder.descriptors.map((d) => ({
    ...d,
    isCustom: true,
    path: d.path.startsWith("custom.") ? d.path : `custom.${d.path}`,
    id: d.id.startsWith("custom.") ? d.id : `custom.${d.id}`
  }));
  return {
    descriptors: [...standard, ...custom],
    customDefaults: fieldBuilder.customDefaults
  };
}
function assignPathDefault(target, path, value) {
  const parts = path.split(".");
  let cur = target;
  for (let i = 0; i < parts.length - 1; i++) {
    cur[parts[i]] = cur[parts[i]] ?? {};
    cur = cur[parts[i]];
  }
  cur[parts[parts.length - 1]] = value;
}
class FieldConfigBuilder {
  descriptors = [];
  customDefaults = {};
  addCustom(d) {
    this.descriptors.push({
      ...d,
      isCustom: true,
      override: d.override !== false
    });
    if (d.defaultValue !== void 0) {
      const p = d.path.startsWith("custom.") ? d.path.slice("custom.".length) : d.path;
      assignPathDefault(this.customDefaults, p, d.defaultValue);
    }
    return this;
  }
  addBoolean(d, defaultValue) {
    return this.addCustom({ ...d, editor: "boolean", defaultValue });
  }
  addRadio(d, defaultValue) {
    return this.addCustom({ ...d, editor: "radio", defaultValue });
  }
  addSelect(d, defaultValue) {
    return this.addCustom({ ...d, editor: "select", defaultValue });
  }
  addNumber(d, defaultValue) {
    return this.addCustom({ ...d, editor: "number", defaultValue });
  }
  addSlider(d, defaultValue) {
    return this.addCustom({ ...d, editor: "slider", defaultValue });
  }
  addText(d, defaultValue) {
    return this.addCustom({ ...d, editor: "text", defaultValue });
  }
}
class VuePanelPlugin {
  module;
  optionsSupplier;
  constructor(meta2, panel2) {
    this.module = {
      meta: meta2,
      panel: panel2,
      optionDescriptors: [],
      fieldConfigDescriptors: [],
      standardFieldConfig: true,
      noPadding: false
    };
  }
  setPanel(panel2) {
    this.module.panel = panel2;
    return this;
  }
  setNoPadding() {
    this.module.noPadding = true;
    return this;
  }
  setDataSupport(_support) {
    this.module.dataSupport = _support;
    return this;
  }
  useFieldConfig(opts = {}) {
    this.module.standardFieldConfig = opts.standard !== false;
    const applied = applyStandardFieldConfig(opts);
    this.module.fieldConfigDescriptors = applied.descriptors;
    this.module.defaultFieldConfigCustom = applied.customDefaults;
    return this;
  }
  /**
   * Grafana-compatible setPanelOptions(builder, context).
   * Supplier is stored; defaults/descriptors resolved once with empty context at register.
   */
  setPanelOptions(builderFn) {
    this.optionsSupplier = (builder2, context) => {
      builderFn(builder2, context);
    };
    const builder = new OptionsUIBuilder();
    this.optionsSupplier(builder, createEmptyEditorContext());
    this.module.optionDescriptors = builder.descriptors;
    this.module.defaultOptions = builder.defaults;
    this.module.optionsSupplier = this.optionsSupplier;
    return this;
  }
  /** Re-resolve descriptors with live StandardEditorContext (showIf/disableIf with data). */
  resolveOptionDescriptors(context = createEmptyEditorContext()) {
    if (!this.optionsSupplier) {
      return this.module.optionDescriptors ?? [];
    }
    const builder = new OptionsUIBuilder();
    this.optionsSupplier(builder, context);
    return builder.descriptors;
  }
  setMigrationHandler(fn) {
    this.module.migrateOptions = fn;
    return this;
  }
  setPanelMigrationHandler(fn) {
    this.module.migratePanel = fn;
    return this;
  }
  setPanelChangeHandler(fn) {
    this.module.panelChangeHandler = fn;
    return this;
  }
  setRuntimeConsumedPaths(paths) {
    this.module.runtimeConsumedPaths = paths;
    return this;
  }
  setOptionsEditor(editor) {
    this.module.optionsEditor = editor;
    return this;
  }
  setFieldConfigEditor(editor) {
    this.module.fieldConfigEditor = editor;
    return this;
  }
  register() {
    return createPanelPlugin(this.module.meta, this.module.panel, {
      defaultOptions: this.module.defaultOptions,
      optionsEditor: this.module.optionsEditor,
      fieldConfigEditor: this.module.fieldConfigEditor,
      migrateOptions: this.module.migrateOptions,
      migratePanel: this.module.migratePanel,
      panelChangeHandler: this.module.panelChangeHandler,
      optionDescriptors: this.module.optionDescriptors,
      fieldConfigDescriptors: this.module.fieldConfigDescriptors,
      standardFieldConfig: this.module.standardFieldConfig,
      runtimeConsumedPaths: this.module.runtimeConsumedPaths,
      defaultFieldConfigCustom: this.module.defaultFieldConfigCustom,
      dataSupport: this.module.dataSupport,
      noPadding: this.module.noPadding,
      optionsSupplier: this.module.optionsSupplier
    });
  }
  getModule() {
    return this.module;
  }
}
function resolvePluginOptionDescriptors(plugin2, context = createEmptyEditorContext()) {
  const supplier = plugin2.optionsSupplier;
  if (!supplier) return plugin2.optionDescriptors ?? [];
  const builder = new OptionsUIBuilder();
  supplier(builder, context);
  return builder.descriptors;
}
const VUE_PLUGIN_ABI_MAJOR = 1;
function assertVuePluginAbi(manifest, expectedMajor = VUE_PLUGIN_ABI_MAJOR) {
  const major = manifest.dependencies?.vueSdkMajor;
  if (major == null) {
    throw new Error(
      `Plugin ${manifest.id ?? "<unknown>"} missing dependencies.vueSdkMajor (required Vue ABI)`
    );
  }
  if (major !== expectedMajor) {
    throw new Error(
      `Plugin ${manifest.id ?? "<unknown>"} Vue ABI major ${major} incompatible with host ${expectedMajor}`
    );
  }
}
function isVuePluginManifest(manifest) {
  try {
    assertVuePluginAbi(manifest);
    return true;
  } catch {
    return false;
  }
}
const FORBIDDEN = /* @__PURE__ */ new Set(["__proto__", "prototype", "constructor"]);
function splitOptionPath(path) {
  return path.replace(/\[(\d+)\]/g, ".$1").split(".").filter(Boolean).map((seg) => {
    if (FORBIDDEN.has(seg)) throw new Error(`Forbidden path segment: ${seg}`);
    if (/^\d+$/.test(seg)) {
      const n = Number(seg);
      if (n < 0) throw new Error(`Invalid array index: ${seg}`);
      return n;
    }
    return seg;
  });
}
function getOptionPath(source, path) {
  const segs = splitOptionPath(path);
  let cur = source;
  for (const s of segs) {
    if (cur == null) return void 0;
    cur = cur[s];
  }
  return cur;
}
function setOptionPath(source, path, value) {
  const segs = splitOptionPath(path);
  if (!segs.length) return value;
  const root = Array.isArray(source) ? [...source] : { ...source };
  let cur = root;
  for (let i = 0; i < segs.length - 1; i++) {
    const s = segs[i];
    const next = cur[s];
    const copy = Array.isArray(next) ? [...next] : next && typeof next === "object" ? { ...next } : {};
    cur[s] = copy;
    cur = copy;
  }
  cur[segs[segs.length - 1]] = value;
  return root;
}
function normalizeHideFrom(raw) {
  const base = { tooltip: false, viz: false, legend: false };
  if (raw == null) return base;
  if (typeof raw === "string") {
    if (raw === "tooltip" || raw === "viz" || raw === "legend") base[raw] = true;
    else if (raw === "graph") base.viz = true;
    return base;
  }
  if (Array.isArray(raw)) {
    for (const k of raw) {
      if (k === "tooltip" || k === "viz" || k === "legend") {
        base[k] = true;
      }
      if (k === "graph") base.viz = true;
    }
    return base;
  }
  if (typeof raw === "object") {
    const o = raw;
    return {
      tooltip: !!o.tooltip,
      viz: !!(o.viz ?? o.graph),
      legend: !!o.legend
    };
  }
  return base;
}
function normalizeScaleDistribution(raw) {
  if (raw == null) return { type: "linear" };
  if (typeof raw === "string") {
    const type = raw || "linear";
    return {
      type,
      log: type === "linear" ? void 0 : 10
    };
  }
  if (typeof raw === "object") {
    const o = raw;
    const type = String(o.type ?? "linear");
    return {
      type,
      log: o.log == null ? type === "linear" ? void 0 : 10 : Number(o.log),
      linearThreshold: o.linearThreshold == null ? void 0 : Number(o.linearThreshold)
    };
  }
  return { type: "linear" };
}
function normalizeStacking(raw) {
  if (raw == null) return { mode: "none", group: "A" };
  if (typeof raw === "string") return { mode: raw || "none", group: "A" };
  if (typeof raw === "object") {
    const o = raw;
    return {
      mode: String(o.mode ?? "none"),
      group: String(o.group ?? "A")
    };
  }
  return { mode: "none", group: "A" };
}
function normalizeThresholdsStyle(raw) {
  if (raw == null) return { mode: "off" };
  if (typeof raw === "string") return { mode: raw || "off" };
  if (typeof raw === "object" && raw.mode != null) {
    return { mode: String(raw.mode) };
  }
  return { mode: "off" };
}
function coerceFieldConfigEditorValue(path, value, previous) {
  if (path === "custom.stacking" || path.endsWith(".stacking")) {
    if (typeof value === "string") {
      const prev = normalizeStacking(previous);
      return { mode: value, group: prev.group || "A" };
    }
    return value;
  }
  if (path === "custom.scaleDistribution" || path.endsWith(".scaleDistribution")) {
    if (typeof value === "string") return normalizeScaleDistribution(value);
    return value;
  }
  if (path === "custom.thresholdsStyle" || path.endsWith(".thresholdsStyle")) {
    if (typeof value === "string") return { mode: value };
    return value;
  }
  if (path === "custom.hideFrom" || path.endsWith(".hideFrom")) {
    if (typeof value === "string" || Array.isArray(value)) {
      return normalizeHideFrom(value);
    }
    return value;
  }
  if (path === "custom.lineStyle" || path.endsWith(".lineStyle")) {
    if (typeof value === "string") return { fill: value };
    return value;
  }
  return value;
}
function radioDisplayValue(path, value) {
  if (value == null) return value;
  if (typeof value !== "object" || Array.isArray(value)) return value;
  const o = value;
  if (path === "custom.stacking" || path.endsWith(".stacking") || path === "custom.thresholdsStyle" || path.endsWith(".thresholdsStyle")) {
    return o.mode;
  }
  if (path === "custom.scaleDistribution" || path.endsWith(".scaleDistribution")) {
    return o.type;
  }
  if (path === "custom.lineStyle" || path.endsWith(".lineStyle")) {
    return o.fill ?? value;
  }
  return value;
}
function addLegendOptions(builder, includeCalcs = true, includeWidth = true) {
  const category = ["Legend"];
  builder.addBoolean(
    {
      id: "legend.showLegend",
      path: "legend.showLegend",
      name: "可见性",
      description: "显示图例",
      category,
      editor: "boolean"
    },
    true
  ).addRadio(
    {
      id: "legend.displayMode",
      path: "legend.displayMode",
      name: "模式",
      category,
      editor: "radio",
      settings: {
        options: [
          { label: "列表", value: "list" },
          { label: "表格", value: "table" }
        ]
      },
      showIf: (c) => c.legend?.showLegend !== false
    },
    "list"
  ).addRadio(
    {
      id: "legend.placement",
      path: "legend.placement",
      name: "位置",
      category,
      editor: "radio",
      settings: {
        options: [
          { label: "底部", value: "bottom" },
          { label: "右侧", value: "right" }
        ]
      },
      showIf: (c) => c.legend?.showLegend !== false
    },
    "bottom"
  );
  if (includeWidth) {
    builder.addNumber(
      {
        id: "legend.width",
        path: "legend.width",
        name: "宽度",
        category,
        editor: "number",
        showIf: (c) => c.legend?.showLegend !== false && c.legend?.placement === "right"
      },
      void 0
    );
  }
  builder.addSelect(
    {
      id: "legend.overflow",
      path: "legend.overflow",
      name: "溢出",
      category,
      editor: "select",
      settings: {
        options: [
          { label: "滚动", value: "scroll" },
          { label: "换行", value: "wrap" }
        ]
      },
      showIf: (c) => c.legend?.showLegend !== false
    },
    "scroll"
  ).addNumber(
    {
      id: "legend.limit",
      path: "legend.limit",
      name: "最大项数",
      category,
      editor: "number",
      showIf: (c) => c.legend?.showLegend !== false
    },
    void 0
  );
  if (includeCalcs) {
    builder.addCustom(
      {
        id: "legend.calcs",
        path: "legend.calcs",
        name: "取值",
        description: "图例表格中显示的计算值",
        category,
        editor: "stats-picker",
        settings: { allowMultiple: true },
        showIf: (c) => c.legend?.showLegend !== false && c.legend?.displayMode === "table"
      },
      []
    );
  }
  return builder;
}
function addTooltipOptions(builder, singleOnly = false, includeHideZeros = false) {
  const category = ["Tooltip"];
  const modes = singleOnly ? [
    { label: "单个", value: "single" },
    { label: "隐藏", value: "none" }
  ] : [
    { label: "单个", value: "single" },
    { label: "全部", value: "multi" },
    { label: "隐藏", value: "none" }
  ];
  builder.addRadio(
    {
      id: "tooltip.mode",
      path: "tooltip.mode",
      name: "提示模式",
      category,
      editor: "radio",
      settings: { options: modes }
    },
    "single"
  ).addRadio(
    {
      id: "tooltip.sort",
      path: "tooltip.sort",
      name: "数值排序",
      category,
      editor: "radio",
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "升序", value: "asc" },
          { label: "降序", value: "desc" }
        ]
      },
      showIf: (c) => c.tooltip?.mode === "multi"
    },
    "none"
  ).addNumber(
    {
      id: "tooltip.hoverProximity",
      path: "tooltip.hoverProximity",
      name: "悬停邻近",
      description: "光标需靠近数据点的距离",
      category,
      editor: "number",
      settings: { min: 0, max: 50 }
    },
    void 0
  ).addNumber(
    {
      id: "tooltip.maxWidth",
      path: "tooltip.maxWidth",
      name: "最大宽度",
      category,
      editor: "number"
    },
    void 0
  ).addNumber(
    {
      id: "tooltip.maxHeight",
      path: "tooltip.maxHeight",
      name: "最大高度",
      category,
      editor: "number",
      showIf: (c) => c.tooltip?.mode === "multi"
    },
    void 0
  );
  if (includeHideZeros) {
    builder.addBoolean(
      {
        id: "tooltip.hideZeros",
        path: "tooltip.hideZeros",
        name: "隐藏零值",
        category,
        editor: "boolean",
        showIf: (c) => c.tooltip?.mode === "multi"
      },
      false
    );
  }
  return builder;
}
function addAxisConfig(builder) {
  const category = ["Axis"];
  builder.addCustom({
    id: "custom.axisPlacement",
    path: "custom.axisPlacement",
    name: "位置",
    category,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "自动", value: "auto" },
        { label: "左侧", value: "left" },
        { label: "右侧", value: "right" },
        { label: "隐藏", value: "hidden" }
      ]
    },
    defaultValue: "auto"
  }).addCustom({
    id: "custom.axisLabel",
    path: "custom.axisLabel",
    name: "标签",
    category,
    editor: "text",
    isCustom: true,
    override: true
  }).addCustom({
    id: "custom.axisWidth",
    path: "custom.axisWidth",
    name: "宽度",
    category,
    editor: "number",
    isCustom: true,
    override: true
  }).addCustom({
    id: "custom.axisSoftMin",
    path: "custom.axisSoftMin",
    name: "软最小值",
    category,
    editor: "number",
    isCustom: true,
    override: true
  }).addCustom({
    id: "custom.axisSoftMax",
    path: "custom.axisSoftMax",
    name: "软最大值",
    category,
    editor: "number",
    isCustom: true,
    override: true
  }).addCustom({
    id: "custom.axisCenteredZero",
    path: "custom.axisCenteredZero",
    name: "零居中",
    category,
    editor: "boolean",
    isCustom: true,
    override: true,
    defaultValue: false
  }).addCustom({
    id: "custom.axisGridShow",
    path: "custom.axisGridShow",
    name: "显示网格线",
    category,
    editor: "boolean",
    isCustom: true,
    override: true
  }).addCustom({
    id: "custom.axisBorderShow",
    path: "custom.axisBorderShow",
    name: "显示边框",
    category,
    editor: "boolean",
    isCustom: true,
    override: true,
    defaultValue: false
  }).addCustom({
    id: "custom.axisColorMode",
    path: "custom.axisColorMode",
    name: "颜色",
    category,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "文本", value: "text" },
        { label: "序列", value: "series" }
      ]
    },
    defaultValue: "text"
  }).addCustom({
    id: "custom.scaleDistribution",
    path: "custom.scaleDistribution",
    name: "刻度",
    category,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "线性", value: "linear" },
        { label: "对数", value: "log" },
        { label: "对称对数", value: "symlog" }
      ]
    },
    defaultValue: { type: "linear" }
  });
  return builder;
}
function addStackingConfig(builder) {
  builder.addCustom({
    id: "custom.stacking",
    path: "custom.stacking",
    name: "堆叠序列",
    category: ["Graph styles"],
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "关闭", value: "none" },
        { label: "标准", value: "normal" },
        { label: "100%", value: "percent" }
      ]
    },
    defaultValue: { mode: "none", group: "A" }
  });
  return builder;
}
function addGraphFieldConfig(builder) {
  const styles = ["Graph styles"];
  builder.addCustom({
    id: "custom.drawStyle",
    path: "custom.drawStyle",
    name: "样式",
    category: styles,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "折线", value: "line" },
        { label: "柱状", value: "bars" },
        { label: "点", value: "points" }
      ]
    },
    defaultValue: "line"
  }).addCustom({
    id: "custom.lineInterpolation",
    path: "custom.lineInterpolation",
    name: "线插值",
    category: styles,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "线性", value: "linear" },
        { label: "平滑", value: "smooth" },
        { label: "阶梯前", value: "stepBefore" },
        { label: "阶梯后", value: "stepAfter" }
      ]
    },
    defaultValue: "linear",
    showIf: (cfg) => (cfg?.custom?.drawStyle ?? cfg?.drawStyle) !== "bars"
  }).addCustom({
    id: "custom.barAlignment",
    path: "custom.barAlignment",
    name: "柱对齐",
    category: styles,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "之前", value: -1 },
        { label: "居中", value: 0 },
        { label: "之后", value: 1 }
      ]
    },
    defaultValue: 0
  }).addCustom({
    id: "custom.barWidthFactor",
    path: "custom.barWidthFactor",
    name: "柱宽系数",
    category: styles,
    editor: "slider",
    isCustom: true,
    override: true,
    settings: { min: 0.1, max: 1, step: 0.1 },
    defaultValue: 0.6
  }).addCustom({
    id: "custom.lineWidth",
    path: "custom.lineWidth",
    name: "线宽",
    category: styles,
    editor: "slider",
    isCustom: true,
    override: true,
    settings: { min: 0, max: 10, step: 1 },
    defaultValue: 1
  }).addCustom({
    id: "custom.fillOpacity",
    path: "custom.fillOpacity",
    name: "填充不透明度",
    category: styles,
    editor: "slider",
    isCustom: true,
    override: true,
    settings: { min: 0, max: 100, step: 1 },
    defaultValue: 0
  }).addCustom({
    id: "custom.gradientMode",
    path: "custom.gradientMode",
    name: "渐变模式",
    category: styles,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "无", value: "none" },
        { label: "不透明度", value: "opacity" },
        { label: "色相", value: "hue" },
        { label: "色板", value: "scheme" }
      ]
    },
    defaultValue: "none"
  }).addCustom({
    id: "custom.fillBelowTo",
    path: "custom.fillBelowTo",
    name: "填充至",
    category: styles,
    editor: "field-name",
    isCustom: true,
    override: true
  }).addCustom({
    id: "custom.lineStyle",
    path: "custom.lineStyle",
    name: "线型",
    category: styles,
    editor: "select",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "实线", value: "solid" },
        { label: "虚线", value: "dash" },
        { label: "点线", value: "dots" }
      ]
    },
    defaultValue: "solid"
  }).addCustom({
    id: "custom.spanNulls",
    path: "custom.spanNulls",
    name: "连接空值",
    category: styles,
    editor: "boolean",
    isCustom: true,
    override: true,
    defaultValue: false
  }).addCustom({
    id: "custom.insertNulls",
    path: "custom.insertNulls",
    name: "断开数值",
    category: styles,
    editor: "boolean",
    isCustom: true,
    override: true,
    defaultValue: false
  }).addCustom({
    id: "custom.showPoints",
    path: "custom.showPoints",
    name: "显示数据点",
    category: styles,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "自动", value: "auto" },
        { label: "始终", value: "always" },
        { label: "从不", value: "never" }
      ]
    },
    defaultValue: "auto"
  }).addCustom({
    id: "custom.showValues",
    path: "custom.showValues",
    name: "显示数值",
    category: styles,
    editor: "boolean",
    isCustom: true,
    override: true,
    defaultValue: false
  }).addCustom({
    id: "custom.pointSize",
    path: "custom.pointSize",
    name: "点大小",
    category: styles,
    editor: "slider",
    isCustom: true,
    override: true,
    settings: { min: 1, max: 40, step: 1 },
    defaultValue: 5
  }).addCustom({
    id: "custom.transform",
    path: "custom.transform",
    name: "转换",
    category: styles,
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "常量", value: "constant" },
        { label: "负 Y", value: "negative-Y" }
      ]
    }
  }).addCustom({
    id: "custom.thresholdsStyle",
    path: "custom.thresholdsStyle",
    name: "显示阈值",
    category: ["Thresholds"],
    editor: "radio",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "关闭", value: "off" },
        { label: "线条", value: "line" },
        { label: "虚线", value: "dashed" },
        { label: "填充区域", value: "area" },
        { label: "填充区域与线条", value: "line+area" }
      ]
    },
    defaultValue: "off"
  }).addCustom({
    id: "custom.hideFrom",
    path: "custom.hideFrom",
    name: "隐藏区域",
    category: ["Series"],
    editor: "multi-select",
    isCustom: true,
    override: true,
    hideFromDefaults: true,
    settings: {
      options: [
        { label: "提示", value: "tooltip" },
        { label: "可视化", value: "viz" },
        { label: "图例", value: "legend" }
      ]
    },
    defaultValue: { tooltip: false, viz: false, legend: false }
  });
  addStackingConfig(builder);
  addAxisConfig(builder);
  return builder;
}
function addTextSizeOptions(builder, opts = {}) {
  const category = ["文本大小"];
  if (opts.withTitle) {
    builder.addNumber(
      {
        id: "text.titleSize",
        path: "text.titleSize",
        name: "标题",
        category,
        editor: "number",
        settings: { min: 1, placeholder: "自动" }
      },
      void 0
    );
  }
  if (opts.withValue !== false) {
    builder.addNumber(
      {
        id: "text.valueSize",
        path: "text.valueSize",
        name: "数值",
        category,
        editor: "number",
        settings: { min: 1, placeholder: "自动" }
      },
      void 0
    );
  }
  if (opts.withPercentChange) {
    builder.addNumber(
      {
        id: "text.percentSize",
        path: "text.percentSize",
        name: "百分比变化",
        category,
        editor: "number",
        settings: { min: 1, placeholder: "自动" }
      },
      void 0
    );
  }
  return builder;
}
function addHideFrom(builder) {
  builder.addCustom({
    id: "custom.hideFrom",
    path: "custom.hideFrom",
    name: "隐藏区域",
    category: ["Series"],
    editor: "multi-select",
    isCustom: true,
    override: true,
    settings: {
      options: [
        { label: "提示", value: "tooltip" },
        { label: "可视化", value: "viz" },
        { label: "图例", value: "legend" }
      ]
    },
    hideFromDefaults: true,
    defaultValue: { tooltip: false, viz: false, legend: false }
  });
  return builder;
}
function addAnnotationOptions(builder) {
  const category = ["注解"];
  builder.addBoolean(
    {
      id: "annotations.multiLane",
      path: "annotations.multiLane",
      name: "多行注解",
      description: "将每个注解 frame 拆到单独一行",
      category,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "annotations.clustering",
      path: "annotations.clustering",
      name: "注解聚合",
      description: "将高密度点注解合并为区间注解",
      category,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "annotations",
      path: "annotations",
      name: "隐藏指示线与区域",
      description: "隐藏注解指示线与阴影区域",
      category,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "annotations.show",
      path: "annotations.show",
      name: "显示注解",
      category,
      editor: "boolean"
    },
    true
  );
  return builder;
}
const runtimeDataSources = /* @__PURE__ */ new Map();
function registerRuntimeDataSource(uid, api) {
  const key = String(uid || "").trim();
  if (!key) throw new Error("Datasource uid is required");
  runtimeDataSources.set(key, api);
}
function getRuntimeDataSource(uid) {
  return runtimeDataSources.get(String(uid || "").trim());
}
function listRuntimeDataSources() {
  return [...runtimeDataSources.values()];
}
function unregisterRuntimeDataSource(uid) {
  runtimeDataSources.delete(String(uid || "").trim());
}
const registry$2 = /* @__PURE__ */ new Map();
const BUILTIN_OPTION_EDITOR_KEYS = [
  "boolean",
  "radio",
  "select",
  "multi-select",
  "number",
  "slider",
  "text",
  "textarea",
  "strings",
  "color",
  "fieldColor",
  "unit",
  "thresholds",
  "mappings",
  "links",
  "actions",
  "stats-picker",
  "timezone",
  "field-name",
  "dashboard-uid",
  "nested",
  "custom"
];
function isKnownEditorKey(editorKey, registeredOnly = false) {
  if (registry$2.has(editorKey)) return true;
  if (registeredOnly) return false;
  return BUILTIN_OPTION_EDITOR_KEYS.includes(editorKey);
}
const index$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BUILTIN_OPTION_EDITOR_KEYS,
  FieldConfigBuilder,
  OptionsBuilder: OptionsUIBuilder,
  OptionsUIBuilder,
  STANDARD_FIELD_CONFIG,
  VUE_PLUGIN_ABI_MAJOR,
  VuePanelPlugin,
  addAnnotationOptions,
  addAxisConfig,
  addGraphFieldConfig,
  addHideFrom,
  addLegendOptions,
  addStackingConfig,
  addTextSizeOptions,
  addTooltipOptions,
  assertNoReactPlugins,
  assertSignalSupported,
  assertVuePluginAbi,
  buildPluginMeta,
  buildStandardFieldConfigDescriptors,
  clearPluginRegistries,
  coerceFieldConfigEditorValue,
  createDataSourcePlugin,
  createEmptyEditorContext,
  createPanelPlugin,
  getDataSourcePlugin,
  getOptionPath,
  getPanelPlugin,
  getRuntimeDataSource,
  isKnownEditorKey,
  isVuePluginManifest,
  listDataSourcePlugins,
  listPanelPlugins,
  listRuntimeDataSources,
  listStandardOverridePropertyOptions,
  normalizeHideFrom,
  normalizeScaleDistribution,
  normalizeStacking,
  normalizeThresholdsStyle,
  radioDisplayValue,
  registerDataSourcePlugin,
  registerPanelPlugin,
  registerRuntimeDataSource,
  resolvePluginOptionDescriptors,
  setOptionPath,
  splitOptionPath,
  unregisterRuntimeDataSource
}, Symbol.toStringTag, { value: "Module" }));
const state$3 = reactive({ boot: null });
function setBootData(boot) {
  state$3.boot = boot;
}
function useBootData() {
  return readonly(state$3);
}
function getBootData() {
  if (!state$3.boot) {
    throw new Error("BootData not initialized");
  }
  return state$3.boot;
}
function createDefaultBootData(partial) {
  return {
    user: {
      id: 1,
      isSignedIn: true,
      login: "admin",
      email: "admin@localhost",
      name: "Admin",
      orgId: 1,
      orgName: "Main Org.",
      orgRole: "Admin",
      isGrafanaAdmin: true,
      timezone: "browser",
      weekStart: "monday",
      language: "en-US",
      theme: "dark",
      permissions: {
        "dashboards:read": true,
        "dashboards:write": true,
        "datasources:read": true,
        "datasources:write": true,
        "datasources:create": true,
        "datasources:delete": true
      },
      ...partial?.user ?? {}
    },
    settings: {
      appSubUrl: "",
      buildInfo: { version: "13.2.0-pre-vue", commit: "local", env: "dev" },
      featureToggles: {},
      datasources: {},
      panels: {},
      minRefreshInterval: "5s",
      ...partial?.settings ?? {}
    },
    navTree: partial?.navTree ?? []
  };
}
function ok(data, status = 200) {
  return {
    data,
    status,
    statusText: status === 200 ? "OK" : String(status),
    ok: status >= 200 && status < 300,
    headers: new Headers({ "content-type": "application/json" })
  };
}
function notFound(message) {
  const err = new Error(message);
  err.status = 404;
  err.data = { message };
  throw err;
}
const DASH_STORAGE_KEY = "grafana-vue-imported-dashboards";
const DS_STORAGE_KEY = "grafana-vue-offline-datasources";
function readJson(key, fallback) {
  if (typeof localStorage === "undefined") return fallback;
  try {
    const raw = localStorage.getItem(key);
    if (!raw) return fallback;
    return JSON.parse(raw);
  } catch {
    return fallback;
  }
}
function writeJson(key, value) {
  if (typeof localStorage === "undefined") return;
  localStorage.setItem(key, JSON.stringify(value));
}
function readDashMap() {
  return readJson(DASH_STORAGE_KEY, {});
}
function writeDashMap(map) {
  writeJson(DASH_STORAGE_KEY, map);
}
function resetOfflineStorage() {
  if (typeof localStorage === "undefined") return;
  localStorage.removeItem(DASH_STORAGE_KEY);
  localStorage.removeItem(DS_STORAGE_KEY);
}
const OFFLINE_STORAGE_KEYS = {
  dashboards: DASH_STORAGE_KEY,
  datasources: DS_STORAGE_KEY
};
let builders = {};
function registerLiveDashboardBuilders(next) {
  builders = { ...next };
}
function getLiveDashboardBuilders() {
  return builders;
}
function loadPluginDashboard(_pluginId, _file, uid, title) {
  try {
    const embedded = {
      "zabbix-overview": {
        uid: "zabbix-overview",
        title: "Zabbix 概览",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "timeseries",
            title: "CPU",
            gridPos: { x: 0, y: 0, w: 12, h: 8 },
            targets: [
              {
                refId: "A",
                queryType: "0",
                item: { filter: "system.cpu.util" }
              }
            ],
            datasource: {
              type: "alexanderzobnin-zabbix-datasource",
              uid: "zabbix"
            }
          },
          {
            id: 2,
            type: "alexanderzobnin-zabbix-triggers-panel",
            title: "问题",
            gridPos: { x: 12, y: 0, w: 12, h: 8 },
            schemaVersion: 8,
            targets: [{ refId: "A", queryType: 5 }],
            datasource: {
              type: "alexanderzobnin-zabbix-datasource",
              uid: "zabbix"
            }
          }
        ]
      },
      "zabbix-problems": {
        uid: "zabbix-problems",
        title: "Zabbix 问题",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "alexanderzobnin-zabbix-triggers-panel",
            title: "当前问题",
            gridPos: { x: 0, y: 0, w: 24, h: 16 },
            schemaVersion: 8,
            targets: [{ refId: "A", queryType: 5 }],
            datasource: {
              type: "alexanderzobnin-zabbix-datasource",
              uid: "zabbix"
            }
          }
        ]
      },
      "zabbix-host": {
        uid: "zabbix-host",
        title: "Zabbix 主机",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "timeseries",
            title: "主机指标",
            gridPos: { x: 0, y: 0, w: 24, h: 10 },
            targets: [{ refId: "A", queryType: "0" }],
            datasource: {
              type: "alexanderzobnin-zabbix-datasource",
              uid: "zabbix"
            }
          }
        ]
      },
      "signoz-metrics": {
        uid: "signoz-metrics",
        title: "SigNoz metrics",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "timeseries",
            title: "metrics",
            gridPos: { x: 0, y: 0, w: 24, h: 12 },
            targets: [{ refId: "A", signal: "metrics" }],
            datasource: { type: "signoz", uid: "signoz" }
          }
        ]
      },
      "signoz-services": {
        uid: "signoz-services",
        title: "SigNoz services",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "timeseries",
            title: "services",
            gridPos: { x: 0, y: 0, w: 24, h: 12 },
            targets: [{ refId: "A", signal: "metrics" }],
            datasource: { type: "signoz", uid: "signoz" }
          }
        ]
      },
      "signoz-logs": {
        uid: "signoz-logs",
        title: "SigNoz logs",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "logs",
            title: "logs",
            gridPos: { x: 0, y: 0, w: 24, h: 12 },
            targets: [{ refId: "A", signal: "logs" }],
            datasource: { type: "signoz", uid: "signoz" }
          }
        ]
      },
      "signoz-traces": {
        uid: "signoz-traces",
        title: "SigNoz traces",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "traces",
            title: "traces",
            gridPos: { x: 0, y: 0, w: 24, h: 12 },
            targets: [{ refId: "A", signal: "traces" }],
            datasource: { type: "signoz", uid: "signoz" }
          }
        ]
      },
      "signoz-issues": {
        uid: "signoz-issues",
        title: "SigNoz issues",
        schemaVersion: 39,
        panels: [
          {
            id: 1,
            type: "signoz-issues",
            title: "issues",
            gridPos: { x: 0, y: 0, w: 24, h: 12 },
            targets: [{ refId: "A", signal: "alerts" }],
            datasource: { type: "signoz", uid: "signoz" }
          }
        ]
      }
    };
    const doc = embedded[uid] || { uid, title, schemaVersion: 39, panels: [] };
    return { ...doc, uid, title };
  } catch {
    return { uid, title, schemaVersion: 39, panels: [] };
  }
}
function seedDemoDashboards() {
  const map = readDashMap();
  let dirty = false;
  const demos = [
    { uid: "vue-demo", title: "可视化全景演示（全部 Panel）" },
    { uid: "demo", title: "演示看板" },
    { uid: "v1-demo", title: "V1 演示看板" },
    { uid: "ds-catalog", title: "数据源测试中心", factory: dsCatalogDashboard },
    {
      uid: "ds-zabbix-full",
      title: "Zabbix Full（测试）",
      factory: (u, ti) => dsTypedDashboard(u, ti, "alexanderzobnin-zabbix-datasource", "zabbix")
    },
    {
      uid: "ds-zabbix-viz",
      title: "Zabbix 可视化矩阵",
      factory: (u, ti) => dsVizMatrixDashboard(
        u,
        ti,
        "alexanderzobnin-zabbix-datasource",
        "zabbix"
      )
    },
    {
      uid: "ds-signoz-full",
      title: "SigNoz Full（测试）",
      factory: (u, ti) => dsTypedDashboard(u, ti, "signoz", "signoz")
    },
    {
      uid: "ds-signoz-viz",
      title: "SigNoz 可视化矩阵",
      factory: (u, ti) => dsVizMatrixDashboard(u, ti, "signoz", "signoz")
    },
    {
      uid: "ds-signoz-native-full",
      title: "SigNoz Native Full（测试）",
      factory: (u, ti) => dsTypedDashboard(u, ti, "signoz", "signoz-native")
    },
    {
      uid: "test-panel-view-edit-live-signoz-native",
      title: "View/Edit × SigNoz Native",
      factory: (u, ti) => testViewEditDashboard(u, ti, "signoz-native", "signoz")
    },
    {
      uid: "ds-otel-full",
      title: "OpenTelemetry Full（测试）",
      factory: (u, ti) => dsTypedDashboard(u, ti, "opentelemetry", "opentelemetry")
    },
    {
      uid: "ds-prometheus",
      title: "Prometheus 测试",
      factory: (u, ti) => dsTypedDashboard(u, ti, "prometheus", "prometheus")
    },
    {
      uid: "ds-loki",
      title: "Loki 测试",
      factory: (u, ti) => dsTypedDashboard(u, ti, "loki", "loki")
    },
    {
      uid: "ds-tempo",
      title: "Tempo 测试",
      factory: (u, ti) => dsTypedDashboard(u, ti, "tempo", "tempo")
    },
    {
      uid: "ds-jaeger",
      title: "Jaeger 测试",
      factory: (u, ti) => dsTypedDashboard(u, ti, "jaeger", "jaeger")
    },
    {
      uid: "ds-testdata",
      title: "TestData 全 scenario",
      factory: dsTestdataDashboard
    },
    { uid: "ds-mixed", title: "Mixed 多数据源测试", factory: dsMixedDashboard },
    {
      uid: "test-panel-view-edit",
      title: "面板 View/Edit 联调",
      factory: testViewEditDashboard
    },
    {
      uid: "test-panel-view-edit-live-zabbix",
      title: "View/Edit × Zabbix live",
      factory: (u, ti) => testViewEditDashboard(
        u,
        ti,
        "zabbix",
        "alexanderzobnin-zabbix-datasource"
      )
    },
    {
      uid: "test-panel-view-edit-live-signoz",
      title: "View/Edit × SigNoz live",
      factory: (u, ti) => testViewEditDashboard(u, ti, "signoz", "signoz")
    },
    {
      uid: "test-time-variables",
      title: "时间与变量联调",
      factory: testTimeVariablesDashboard
    },
    {
      uid: "test-transforms-live",
      title: "Transform 联调",
      factory: testTransformsDashboard
    },
    {
      uid: "test-six-states",
      title: "面板六态",
      factory: testSixStatesDashboard
    },
    {
      uid: "test-solo-embed",
      title: "Solo Embed 测试",
      factory: (u, ti) => dsTypedDashboard(u, ti, "grafana-testdata-datasource", "testdata")
    },
    {
      uid: "test-inspect-query-body",
      title: "Inspect Query Body",
      factory: (u, ti) => testViewEditDashboard(
        u,
        ti,
        "zabbix",
        "alexanderzobnin-zabbix-datasource"
      )
    },
    {
      uid: "test-same-config-pixel",
      title: "同配置像素回归",
      factory: testSameConfigPixelDashboard
    },
    // Task 17 live observability pages (factory — no tokens)
    ...(() => {
      const builders2 = getLiveDashboardBuilders();
      return Object.keys(builders2).map((uid) => ({
        uid,
        title: String(builders2[uid]?.()?.title || uid),
        factory: (u) => builders2[u]?.() ?? { uid: u, title: u, panels: [] }
      }));
    })(),
    // Built-in plugin dashboards (Zabbix / SigNoz)
    {
      uid: "zabbix-overview",
      title: "Zabbix 概览",
      factory: (u, ti) => loadPluginDashboard(
        "alexanderzobnin-zabbix-datasource",
        "zabbix-overview.json",
        u,
        ti
      )
    },
    {
      uid: "zabbix-problems",
      title: "Zabbix 问题",
      factory: (u, ti) => loadPluginDashboard(
        "alexanderzobnin-zabbix-datasource",
        "zabbix-problems.json",
        u,
        ti
      )
    },
    {
      uid: "zabbix-host",
      title: "Zabbix 主机",
      factory: (u, ti) => loadPluginDashboard(
        "alexanderzobnin-zabbix-datasource",
        "zabbix-host.json",
        u,
        ti
      )
    },
    {
      uid: "signoz-metrics",
      title: "SigNoz metrics",
      factory: (u, ti) => loadPluginDashboard("signoz", "signoz-metrics.json", u, ti)
    },
    {
      uid: "signoz-services",
      title: "SigNoz services",
      factory: (u, ti) => loadPluginDashboard("signoz", "signoz-services.json", u, ti)
    },
    {
      uid: "signoz-logs",
      title: "SigNoz logs",
      factory: (u, ti) => loadPluginDashboard("signoz", "signoz-logs.json", u, ti)
    },
    {
      uid: "signoz-traces",
      title: "SigNoz traces",
      factory: (u, ti) => loadPluginDashboard("signoz", "signoz-traces.json", u, ti)
    },
    {
      uid: "signoz-issues",
      title: "SigNoz issues",
      factory: (u, ti) => loadPluginDashboard("signoz", "signoz-issues.json", u, ti)
    },
    {
      uid: "signoz-service-overview",
      title: "SigNoz Service Overview",
      factory: (u, ti) => loadPluginDashboard("signoz", "service-overview.json", u, ti)
    },
    {
      uid: "signoz-metrics-overview",
      title: "SigNoz Metrics Overview",
      factory: (u, ti) => loadPluginDashboard("signoz", "metrics-overview.json", u, ti)
    },
    {
      uid: "signoz-logs-errors",
      title: "SigNoz Logs and Errors",
      factory: (u, ti) => loadPluginDashboard("signoz", "logs-and-errors.json", u, ti)
    },
    {
      uid: "signoz-distributed-traces",
      title: "SigNoz Distributed Traces",
      factory: (u, ti) => loadPluginDashboard("signoz", "distributed-traces.json", u, ti)
    },
    {
      uid: "signoz-observability-issues",
      title: "SigNoz Observability Issues",
      factory: (u, ti) => loadPluginDashboard("signoz", "observability-issues.json", u, ti)
    }
  ];
  const liveBuilderUids = new Set(Object.keys(getLiveDashboardBuilders()));
  for (const d of demos) {
    const factory2 = d.factory ?? demoDashboard;
    const existing = map[d.uid];
    let needs = !existing;
    if (existing && d.factory) {
      const panels2 = Array.isArray(existing.raw?.panels) ? existing.raw.panels : [];
      const types = panels2.map((p) => p?.datasource?.type || p?.targets?.[0]?.datasource?.type).filter(Boolean);
      if (liveBuilderUids.has(d.uid)) {
        const fresh = factory2(d.uid, d.title);
        const fp = Array.isArray(fresh?.panels) ? fresh.panels : [];
        const a = JSON.stringify({
          time: existing.raw?.time ?? null,
          titles: panels2.map((x) => x?.title),
          draw: panels2.map(
            (x) => x?.fieldConfig?.defaults?.custom?.drawStyle ?? null
          ),
          trends: panels2.map(
            (x) => x?.targets?.[0]?.options?.useTrends ?? null
          )
        });
        const b = JSON.stringify({
          time: fresh?.time ?? null,
          titles: fp.map((x) => x?.title),
          draw: fp.map(
            (x) => x?.fieldConfig?.defaults?.custom?.drawStyle ?? null
          ),
          trends: fp.map(
            (x) => x?.targets?.[0]?.options?.useTrends ?? null
          )
        });
        needs = a !== b;
      } else if (d.uid.startsWith("ds-zabbix") || d.uid.includes("live-zabbix")) {
        needs = !types.some((t2) => String(t2).includes("zabbix"));
      } else if (d.uid.startsWith("ds-signoz") || d.uid.includes("live-signoz")) {
        needs = !types.some((t2) => String(t2) === "signoz");
      } else if (d.uid.startsWith("ds-") && panels2.length < 3) {
        needs = true;
      }
      if (d.uid === "ds-zabbix-full" && panels2.length < 6) needs = true;
      if (d.uid.startsWith("ds-") && String(existing.raw?.time?.from || "") === "now-1h")
        needs = true;
      if (d.uid === "ds-zabbix-full") {
        const tgt = JSON.stringify(
          existing.raw?.panels?.[0]?.targets || []
        );
        if (!tgt.includes("vfs.fs.size")) needs = true;
      }
    }
    if (!needs) continue;
    map[d.uid] = {
      uid: d.uid,
      title: d.title,
      savedAt: (/* @__PURE__ */ new Date()).toISOString(),
      version: (existing?.version ?? 0) + 1,
      raw: factory2(d.uid, d.title)
    };
    dirty = true;
  }
  if (dirty) writeDashMap(map);
}
const DEFAULT_OFFLINE_DATASOURCES = [
  {
    uid: "testdata",
    name: "TestData",
    type: "grafana-testdata-datasource",
    isDefault: false,
    access: "proxy",
    jsonData: {}
  },
  {
    uid: "prometheus",
    name: "Prometheus",
    type: "prometheus",
    access: "proxy",
    url: "http://localhost:9090",
    jsonData: {}
  },
  {
    uid: "loki",
    name: "Loki",
    type: "loki",
    access: "proxy",
    url: "http://localhost:3100",
    jsonData: {}
  },
  {
    uid: "tempo",
    name: "Tempo",
    type: "tempo",
    access: "proxy",
    url: "http://localhost:3200",
    jsonData: {}
  },
  {
    uid: "opentelemetry",
    name: "OpenTelemetry",
    type: "opentelemetry",
    access: "proxy",
    url: "http://localhost:4318",
    jsonData: {}
  },
  // Offline seed uses dataMode=fixture so demo/viz matrices render without live upstream.
  // Live App config / live UIDs override this when operator supplies real credentials.
  {
    uid: "signoz",
    name: "SigNoz SigNoz",
    type: "signoz",
    access: "proxy",
    url: "/signoz-api",
    jsonData: { apiProfile: "signoz-v5", dataMode: "fixture" }
  },
  {
    uid: "signoz-native",
    name: "SigNoz Native",
    type: "signoz",
    access: "proxy",
    url: "/signoz-api",
    jsonData: { apiProfile: "signoz-v3", dataMode: "fixture" }
  },
  {
    uid: "zabbix",
    name: "Zabbix",
    type: "alexanderzobnin-zabbix-datasource",
    access: "proxy",
    url: "/zabbix-api3",
    jsonData: { dataMode: "fixture" }
  },
  {
    uid: "zabbix-3",
    name: "Zabbix 50.3",
    type: "alexanderzobnin-zabbix-datasource",
    access: "proxy",
    url: "/zabbix-api3",
    jsonData: { dataMode: "fixture" }
  },
  {
    uid: "zabbix-14",
    name: "Zabbix 50.14",
    type: "alexanderzobnin-zabbix-datasource",
    access: "proxy",
    url: "/zabbix-api14",
    jsonData: { dataMode: "fixture" }
  },
  {
    uid: "postgres",
    name: "PostgreSQL",
    type: "grafana-postgresql-datasource",
    access: "proxy",
    url: "localhost:5432",
    jsonData: {}
  },
  {
    uid: "mysql",
    name: "MySQL",
    type: "mysql",
    access: "proxy",
    url: "localhost:3306",
    jsonData: {}
  },
  {
    uid: "mssql",
    name: "MSSQL",
    type: "mssql",
    access: "proxy",
    url: "localhost:1433",
    jsonData: {}
  },
  {
    uid: "influxdb",
    name: "InfluxDB",
    type: "influxdb",
    access: "proxy",
    url: "http://localhost:8086",
    jsonData: {}
  },
  {
    uid: "graphite",
    name: "Graphite",
    type: "graphite",
    access: "proxy",
    url: "http://localhost:8080",
    jsonData: {}
  },
  {
    uid: "elasticsearch",
    name: "Elasticsearch",
    type: "elasticsearch",
    access: "proxy",
    url: "http://localhost:9200",
    jsonData: {}
  },
  {
    uid: "jaeger",
    name: "Jaeger",
    type: "jaeger",
    access: "proxy",
    url: "http://localhost:16686",
    jsonData: {}
  },
  {
    uid: "pyroscope",
    name: "Pyroscope",
    type: "grafana-pyroscope-datasource",
    access: "proxy",
    url: "http://localhost:4040",
    jsonData: {}
  },
  {
    uid: "cloudwatch",
    name: "CloudWatch",
    type: "cloudwatch",
    access: "proxy",
    jsonData: { defaultRegion: "us-east-1" }
  },
  {
    uid: "azure",
    name: "Azure Monitor",
    type: "grafana-azure-monitor-datasource",
    access: "proxy",
    jsonData: {}
  },
  {
    uid: "alertmanager",
    name: "Alertmanager",
    type: "alertmanager",
    access: "proxy",
    url: "http://localhost:9093",
    jsonData: {}
  },
  { uid: "mixed", name: "Mixed", type: "mixed", access: "proxy", jsonData: {} },
  {
    uid: "-- Grafana --",
    name: "Grafana",
    type: "grafana",
    access: "proxy",
    jsonData: {}
  },
  {
    uid: "dashboard",
    name: "Dashboard",
    type: "dashboard",
    access: "proxy",
    jsonData: {}
  }
];
function readDatasources() {
  const list = readJson(DS_STORAGE_KEY, []);
  if (!list.length) {
    writeJson(DS_STORAGE_KEY, DEFAULT_OFFLINE_DATASOURCES);
    return [...DEFAULT_OFFLINE_DATASOURCES];
  }
  const byUid2 = new Map(list.map((d) => [d.uid, d]));
  let dirty = false;
  for (const seed of DEFAULT_OFFLINE_DATASOURCES) {
    if (!byUid2.has(seed.uid)) {
      byUid2.set(seed.uid, seed);
      dirty = true;
      continue;
    }
    const existing = byUid2.get(seed.uid);
    const seedMode = seed.jsonData?.dataMode;
    const existMode = existing.jsonData?.dataMode;
    if (seedMode === "fixture" && existMode !== "live" && existMode !== "fixture") {
      byUid2.set(seed.uid, {
        ...existing,
        jsonData: { ...existing.jsonData || {}, ...seed.jsonData || {} }
      });
      dirty = true;
    }
  }
  const merged = [...byUid2.values()];
  if (dirty) writeJson(DS_STORAGE_KEY, merged);
  return merged;
}
function writeDatasources(list) {
  writeJson(DS_STORAGE_KEY, list);
}
function toPublicDatasource(ds2) {
  const anyDs = ds2;
  const secureJsonData = anyDs.secureJsonData;
  const fields = { ...anyDs.secureJsonFields ?? {} };
  if (secureJsonData && typeof secureJsonData === "object") {
    for (const [k, v] of Object.entries(secureJsonData)) {
      if (v != null && v !== "") fields[k] = true;
    }
  }
  const { secureJsonData: _drop, ...rest } = anyDs;
  return { ...rest, secureJsonFields: fields };
}
function pathOf(url) {
  try {
    if (url.startsWith("http")) {
      const u = new URL(url);
      return u.pathname + u.search;
    }
  } catch {
  }
  const q = url.indexOf("?");
  return q >= 0 ? url.slice(0, q) : url;
}
function queryParams(url, params) {
  const out = {};
  try {
    const full = url.startsWith("http") ? url : `http://local${url.startsWith("/") ? "" : "/"}${url}`;
    const u = new URL(full);
    u.searchParams.forEach((v, k) => {
      out[k] = v;
    });
  } catch {
  }
  if (params) {
    for (const [k, v] of Object.entries(params)) {
      if (v !== void 0) out[k] = String(v);
    }
  }
  return out;
}
function demoPanelOptions(type) {
  switch (type) {
    case "text":
      return {
        mode: "markdown",
        content: "## Grafana-Vue 全可视化演示\n每种 Panel 均有演示数据（TestData / 离线 fixture）。编辑 → 查询 / 转换 / 面板选项 / 字段。"
      };
    case "stat":
      return {
        reduceOptions: { calcs: ["lastNotNull"], fields: "", values: false },
        colorMode: "background",
        graphMode: "area",
        textMode: "auto",
        orientation: "auto"
      };
    case "gauge":
      return {
        showThresholdMarkers: true,
        showThresholdLabels: false,
        orientation: "auto",
        sizing: "auto"
      };
    case "bargauge":
      return {
        reduceOptions: { calcs: ["lastNotNull"], values: false },
        displayMode: "gradient",
        orientation: "horizontal",
        valueMode: "color",
        showUnfilled: true
      };
    case "piechart":
      return {
        reduceOptions: { calcs: ["lastNotNull"], values: true },
        pieType: "donut",
        legend: { showLegend: true, displayMode: "list", placement: "right" },
        tooltip: { mode: "single" }
      };
    case "timeseries":
    case "trend":
      return {
        legend: {
          showLegend: true,
          displayMode: "list",
          placement: "bottom",
          calcs: []
        },
        tooltip: { mode: "single", sort: "none" }
      };
    case "barchart":
      return {
        orientation: "auto",
        showValue: "auto",
        stacking: "none",
        barWidth: 0.9,
        groupWidth: 0.7,
        xTickLabelRotation: -30,
        legend: { showLegend: true, displayMode: "list", placement: "bottom" },
        tooltip: { mode: "single" }
      };
    case "histogram":
      return {
        bucketCount: 20,
        combine: false,
        fillOpacity: 80,
        gradientMode: "hue",
        stacking: "none"
      };
    case "heatmap":
      return {
        calculate: true,
        cellGap: 2,
        color: {
          mode: "scheme",
          scheme: "Spectral",
          reverse: false,
          steps: 64
        },
        legend: { show: true },
        tooltip: { mode: "single", yHistogram: true, showColorScale: true },
        yAxis: { axisPlacement: "left" }
      };
    case "candlestick":
      return {
        mode: "candles+volume",
        candleStyle: "candles",
        colorStrategy: "open-close",
        colors: { up: "green", down: "red", flat: "gray" },
        includeAllFields: false
      };
    case "state-timeline":
    case "status-history":
      return {
        showValue: "auto",
        rowHeight: 0.9,
        legend: { showLegend: true, displayMode: "list", placement: "bottom" }
      };
    case "logs":
      return {
        showTime: true,
        showLabels: false,
        showCommonLabels: false,
        wrapLogMessage: false,
        prettifyLogMessage: false,
        enableLogDetails: true,
        sortOrder: "Descending",
        dedupStrategy: "none",
        showLevel: true
      };
    case "logstable":
      return {
        enableLogDetails: true,
        showControls: true,
        showCopyLogLink: true,
        allowDownload: false
      };
    case "nodeGraph":
      return { layoutAlgorithm: "layered", zoomMode: "cooperative" };
    case "geomap":
      return {
        view: { lat: 0, lon: 0, zoom: 1 },
        controls: {
          showZoom: true,
          mouseWheelZoom: true,
          showAttribution: true
        },
        tooltip: { mode: "details" }
      };
    case "canvas":
      return {
        inlineEditing: false,
        showAdvancedTypes: true,
        tooltip: { mode: "single" },
        root: {
          type: "frame",
          elements: [
            {
              type: "metric-value",
              name: "Metric",
              config: { align: "center" },
              placement: { top: 20, left: 20, width: 120, height: 40 }
            }
          ]
        }
      };
    case "news":
      return { feedUrl: "https://grafana.com/blog/index.xml", showImage: true };
    case "dashlist":
      return {
        showStarred: true,
        showRecentlyViewed: true,
        showSearch: true,
        showHeadings: true,
        maxItems: 10
      };
    case "alertlist":
      return {
        maxItems: 10,
        viewMode: "list",
        groupMode: "default",
        sortOrder: 3
      };
    case "annolist":
      return {
        limit: 10,
        onlyInTimeRange: true,
        showTags: true,
        showTime: true,
        showUser: true
      };
    case "live":
      return { channel: "grafana/live/demo", display: "json" };
    case "debug":
      return { mode: "render" };
    case "traces":
      return {
        showServiceName: true,
        showDuration: true,
        spanFilters: { criticalPathOnly: false, matchesOnly: false }
      };
    case "flamegraph":
      return { showTable: true, collapsing: true, stickyHeader: true };
    case "table":
      return { showHeader: true, cellHeight: "sm", footer: { show: false } };
    case "xychart":
      return {
        series: [],
        mapping: "auto",
        legend: { showLegend: true },
        tooltip: { mode: "single" }
      };
    default:
      return {};
  }
}
function panelBase(id, type, title, gridPos, ds2, targets, options = {}) {
  return {
    id,
    type,
    title,
    gridPos,
    targets,
    datasource: ds2,
    options: { ...demoPanelOptions(type), ...options },
    fieldConfig: { defaults: {}, overrides: [] }
  };
}
function sampleTarget(type, uid) {
  const ds2 = { type, uid };
  switch (type) {
    case "alexanderzobnin-zabbix-datasource":
      return {
        refId: "A",
        datasource: ds2,
        queryType: "metrics",
        group: { filter: "/.*/" },
        host: { filter: "/.*/" },
        // Prefer a common Zabbix key so live demos return history points quickly.
        // Prefer keys that typically have history on busy Zabbix farms
        item: {
          filter: "/vfs.fs.size|cpu.util|system.uptime|system.cpu.load/"
        }
      };
    case "signoz":
      return {
        refId: "A",
        datasource: ds2,
        signal: "metrics",
        expr: "up",
        query: "up",
        queryType: "promql"
      };
    case "opentelemetry":
      return { refId: "A", datasource: ds2, signal: "metrics", expr: "up" };
    case "prometheus":
      return {
        refId: "A",
        datasource: ds2,
        expr: "up",
        legendFormat: "{{job}}"
      };
    case "loki":
      return {
        refId: "A",
        datasource: ds2,
        expr: '{job=~".+"}',
        queryType: "range"
      };
    case "tempo":
      return { refId: "A", datasource: ds2, queryType: "traceql", query: "{}" };
    case "jaeger":
      return { refId: "A", datasource: ds2, queryType: "search", service: "" };
    case "grafana-testdata-datasource":
    default:
      return { refId: "A", datasource: ds2, scenarioId: "random_walk" };
  }
}
function dsCatalogDashboard(uid, title) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  const rows = [
    [
      "数据源测试中心",
      "打开下方链接进入各 DS 测试页；Zabbix/SigNoz 需 live 代理与 token。"
    ],
    ["ds-zabbix-full", "/d/ds-zabbix-full"],
    ["ds-signoz-full", "/d/ds-signoz-full"],
    ["ds-signoz-native-full", "/d/ds-signoz-native-full"],
    [
      "test-panel-view-edit-live-signoz-native",
      "/d/test-panel-view-edit-live-signoz-native"
    ],
    ["ds-otel-full", "/d/ds-otel-full"],
    ["ds-prometheus", "/d/ds-prometheus"],
    ["ds-testdata", "/d/ds-testdata"],
    ["test-panel-view-edit", "/d/test-panel-view-edit"],
    ["test-panel-view-edit-live-zabbix", "/d/test-panel-view-edit-live-zabbix"],
    ["test-panel-view-edit-live-signoz", "/d/test-panel-view-edit-live-signoz"]
  ];
  const content = rows.map((r, i) => i === 0 ? `## ${r[0]}\\n${r[1]}` : `- [${r[0]}](${r[1]})`).join("\\n");
  return {
    uid,
    title,
    tags: ["ds-test", "catalog"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: [
      panelBase(
        1,
        "text",
        "数据源测试中心",
        { x: 0, y: 0, w: 24, h: 10 },
        td,
        [],
        {
          mode: "markdown",
          content
        }
      ),
      panelBase(2, "stat", "TestData 探活", { x: 0, y: 10, w: 6, h: 6 }, td, [
        { refId: "A", datasource: td, scenarioId: "random_walk" }
      ])
    ],
    time: { from: "now-1h", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function dsTypedDashboard(uid, title, type, dsUid) {
  const ds2 = { type, uid: dsUid };
  const target = sampleTarget(type, dsUid);
  const panels2 = [
    panelBase(
      1,
      "timeseries",
      `${title} · timeseries`,
      { x: 0, y: 0, w: 16, h: 10 },
      ds2,
      [target]
    ),
    panelBase(2, "stat", `${title} · stat`, { x: 16, y: 0, w: 8, h: 5 }, ds2, [
      target
    ]),
    panelBase(3, "gauge", `${title} · gauge`, { x: 16, y: 5, w: 8, h: 5 }, ds2, [
      target
    ]),
    panelBase(
      4,
      "table",
      `${title} · table`,
      { x: 0, y: 10, w: 12, h: 8 },
      ds2,
      [target]
    ),
    panelBase(
      5,
      "bargauge",
      `${title} · bargauge`,
      { x: 12, y: 10, w: 12, h: 8 },
      ds2,
      [target]
    )
  ];
  if (type === "alexanderzobnin-zabbix-datasource") {
    panels2.push(
      panelBase(
        6,
        "table",
        "Zabbix problems",
        { x: 0, y: 18, w: 24, h: 8 },
        ds2,
        [
          {
            refId: "A",
            datasource: ds2,
            queryType: "problems",
            group: { filter: "/.*/" },
            host: { filter: "/.*/" }
          }
        ]
      )
    );
    const ds14 = { type, uid: "zabbix-14" };
    panels2.push(
      panelBase(
        7,
        "timeseries",
        "Zabbix 50.14 · dual",
        { x: 0, y: 26, w: 24, h: 8 },
        ds14,
        [
          {
            refId: "A",
            datasource: ds14,
            queryType: "metrics",
            group: { filter: "/.*/" },
            host: { filter: "/.*/" },
            // Prefer keys that typically have history on busy Zabbix farms
            item: {
              filter: "/vfs.fs.size|cpu.util|system.uptime|system.cpu.load/"
            }
          }
        ]
      )
    );
  }
  if (type === "signoz") {
    panels2.push(
      panelBase(6, "logs", "SigNoz logs", { x: 0, y: 18, w: 12, h: 10 }, ds2, [
        { refId: "A", datasource: ds2, signal: "logs", expr: "", query: "" }
      ]),
      panelBase(
        7,
        "traces",
        "SigNoz traces",
        { x: 12, y: 18, w: 12, h: 10 },
        ds2,
        [{ refId: "A", datasource: ds2, signal: "traces", expr: "", query: "" }]
      )
    );
  }
  return {
    uid,
    title,
    tags: ["ds-test", type],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: panels2,
    // Prefer 6h so Zabbix history/trend has points for sparse items
    time: { from: "now-6h", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function dsVizMatrixDashboard(uid, title, type, dsUid) {
  const ds2 = { type, uid: dsUid };
  const target = sampleTarget(type, dsUid);
  const types = [
    "timeseries",
    "stat",
    "gauge",
    "bargauge",
    "table",
    "barchart",
    "piechart",
    "heatmap"
  ];
  const panels2 = types.map(
    (pt, i) => panelBase(
      i + 1,
      pt,
      pt,
      { x: i % 4 * 6, y: Math.floor(i / 4) * 8, w: 6, h: 8 },
      ds2,
      [target]
    )
  );
  return {
    uid,
    title,
    tags: ["ds-test", "viz-matrix", type],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: panels2,
    time: { from: "now-6h", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function dsTestdataDashboard(uid, title) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  const scenarios = [
    "random_walk",
    "csv_metric_values",
    "random_walk_table",
    "logs",
    "trace",
    "node_graph",
    "flame_graph",
    "usa",
    "predictable_pulse",
    "predictable_csv_wave"
  ];
  const panels2 = scenarios.map(
    (s, i) => panelBase(
      i + 1,
      s === "logs" ? "logs" : s === "trace" ? "traces" : s === "node_graph" ? "nodeGraph" : s === "flame_graph" ? "flamegraph" : s === "random_walk_table" ? "table" : "timeseries",
      s,
      { x: i % 3 * 8, y: Math.floor(i / 3) * 8, w: 8, h: 8 },
      td,
      [{ refId: "A", datasource: td, scenarioId: s }]
    )
  );
  return {
    uid,
    title,
    tags: ["ds-test", "testdata"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: panels2,
    time: { from: "now-1h", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function dsMixedDashboard(uid, title) {
  const mixed = { type: "mixed", uid: "mixed" };
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  const prom = { type: "prometheus", uid: "prometheus" };
  return {
    uid,
    title,
    tags: ["ds-test", "mixed"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: [
      panelBase(
        1,
        "timeseries",
        "Mixed A+B",
        { x: 0, y: 0, w: 24, h: 10 },
        mixed,
        [
          { refId: "A", datasource: td, scenarioId: "random_walk" },
          { refId: "B", datasource: prom, expr: "up" }
        ]
      )
    ],
    time: { from: "now-1h", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function testSameConfigPixelDashboard(uid, title) {
  const ds2 = { type: "grafana-testdata-datasource", uid: "testdata" };
  const target = {
    refId: "A",
    datasource: ds2,
    scenarioId: "csv_metric_values",
    stringInput: "1,20,90,30,5,0,40,70,15,55"
  };
  const fc = {
    defaults: {
      unit: "short",
      thresholds: {
        mode: "absolute",
        steps: [
          { color: "green", value: null },
          { color: "red", value: 80 }
        ]
      }
    },
    overrides: []
  };
  return {
    uid,
    title,
    tags: ["ds-test", "pixel", "same-config"],
    schemaVersion: 39,
    timezone: "utc",
    version: 1,
    panels: [
      {
        ...panelBase(
          1,
          "stat",
          "pixel-stat",
          { x: 0, y: 0, w: 6, h: 6 },
          ds2,
          [target],
          {
            colorMode: "background",
            graphMode: "area",
            reduceOptions: {
              calcs: ["lastNotNull"],
              fields: "",
              values: false
            }
          }
        ),
        fieldConfig: fc
      },
      {
        ...panelBase(
          2,
          "gauge",
          "pixel-gauge",
          { x: 6, y: 0, w: 6, h: 6 },
          ds2,
          [target],
          {
            showThresholdMarkers: true,
            orientation: "auto"
          }
        ),
        fieldConfig: fc
      },
      {
        ...panelBase(
          3,
          "timeseries",
          "pixel-timeseries",
          { x: 12, y: 0, w: 12, h: 8 },
          ds2,
          [target],
          {
            legend: {
              showLegend: true,
              displayMode: "list",
              placement: "bottom"
            }
          }
        ),
        fieldConfig: {
          defaults: {
            ...fc.defaults,
            custom: {
              drawStyle: "line",
              lineWidth: 1,
              fillOpacity: 20,
              showPoints: "never"
            }
          },
          overrides: []
        }
      },
      {
        ...panelBase(
          4,
          "table",
          "pixel-table",
          { x: 0, y: 6, w: 12, h: 8 },
          ds2,
          [{ refId: "A", datasource: ds2, scenarioId: "random_walk_table" }]
        ),
        fieldConfig: { defaults: {}, overrides: [] }
      },
      {
        ...panelBase(
          5,
          "bargauge",
          "pixel-bargauge",
          { x: 12, y: 8, w: 12, h: 6 },
          ds2,
          [target],
          {
            displayMode: "gradient",
            orientation: "horizontal",
            reduceOptions: { calcs: ["lastNotNull"], values: false }
          }
        ),
        fieldConfig: fc
      }
    ],
    time: { from: "now-15m", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function testViewEditDashboard(uid, title, dsUid = "testdata", type = "grafana-testdata-datasource") {
  const ds2 = { type, uid: dsUid };
  const target = sampleTarget(type, dsUid);
  return {
    uid,
    title,
    tags: ["ds-test", "view-edit"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: [
      panelBase(
        1,
        "timeseries",
        "主面板（View/Edit）",
        { x: 0, y: 0, w: 16, h: 12 },
        ds2,
        [target]
      ),
      panelBase(2, "stat", "辅助 Stat", { x: 16, y: 0, w: 8, h: 6 }, ds2, [
        target
      ]),
      panelBase(3, "gauge", "辅助 Gauge", { x: 16, y: 6, w: 8, h: 6 }, ds2, [
        target
      ])
    ],
    time: { from: "now-15m", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function testTimeVariablesDashboard(uid, title) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  return {
    uid,
    title,
    tags: ["ds-test", "variables"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: [
      panelBase(1, "timeseries", "变量驱动", { x: 0, y: 0, w: 24, h: 10 }, td, [
        {
          refId: "A",
          datasource: td,
          scenarioId: "random_walk",
          alias: "$job"
        }
      ])
    ],
    time: { from: "now-1h", to: "now" },
    templating: {
      list: [
        {
          type: "custom",
          name: "job",
          label: "Job",
          query: "api,web,db",
          current: { text: "api", value: "api" },
          options: [
            { text: "api", value: "api", selected: true },
            { text: "web", value: "web", selected: false }
          ],
          multi: false,
          includeAll: false
        }
      ]
    },
    annotations: { list: [] }
  };
}
function testTransformsDashboard(uid, title) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  return {
    uid,
    title,
    tags: ["ds-test", "transform"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: [
      {
        ...panelBase(
          1,
          "table",
          "Reduce transform",
          { x: 0, y: 0, w: 24, h: 10 },
          td,
          [{ refId: "A", datasource: td, scenarioId: "random_walk" }]
        ),
        transformations: [
          { id: "reduce", options: { reducers: ["mean", "max"] } }
        ]
      }
    ],
    time: { from: "now-1h", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function testSixStatesDashboard(uid, title) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  return {
    uid,
    title,
    tags: ["ds-test", "six-states"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    panels: [
      panelBase(1, "stat", "success", { x: 0, y: 0, w: 8, h: 6 }, td, [
        { refId: "A", datasource: td, scenarioId: "random_walk" }
      ]),
      panelBase(2, "stat", "empty-ish", { x: 8, y: 0, w: 8, h: 6 }, td, [
        { refId: "A", datasource: td, scenarioId: "no_data_points" }
      ]),
      panelBase(
        3,
        "timeseries",
        "loading-refresh",
        { x: 16, y: 0, w: 8, h: 6 },
        td,
        [
          {
            refId: "A",
            datasource: td,
            scenarioId: "random_walk",
            stringInput: "slow"
          }
        ]
      )
    ],
    time: { from: "now-15m", to: "now" },
    templating: { list: [] },
    annotations: { list: [] }
  };
}
function demoDashboard(uid, title) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  const panelDefs = [
    { type: "text", title: "可视化全景演示", w: 24, h: 3 },
    { type: "stat", title: "Stat", scenario: "random_walk" },
    { type: "gauge", title: "Gauge", scenario: "random_walk" },
    { type: "bargauge", title: "Bar gauge", scenario: "csv_metric_values" },
    { type: "table", title: "Table", scenario: "random_walk_table" },
    {
      type: "piechart",
      title: "Pie chart",
      scenario: "csv_metric_values",
      stringInput: "10,25,40,15,30"
    },
    {
      type: "timeseries",
      title: "Time series",
      scenario: "random_walk",
      w: 12,
      h: 8
    },
    { type: "trend", title: "Trend", scenario: "linear_trend" },
    { type: "barchart", title: "Bar chart", scenario: "csv_metric_values" },
    { type: "histogram", title: "Histogram", scenario: "random_walk" },
    { type: "heatmap", title: "Heatmap", scenario: "random_walk" },
    {
      type: "candlestick",
      title: "Candlestick",
      scenario: "predictable_csv_wave"
    },
    {
      type: "state-timeline",
      title: "State timeline",
      scenario: "predictable_pulse",
      w: 12,
      h: 6
    },
    {
      type: "status-history",
      title: "Status history",
      scenario: "predictable_pulse",
      w: 12,
      h: 6
    },
    { type: "xychart", title: "XY chart", scenario: "random_walk" },
    { type: "geomap", title: "Geomap", scenario: "usa" },
    { type: "nodeGraph", title: "Node graph", scenario: "node_graph" },
    { type: "logs", title: "Logs", scenario: "logs", w: 12, h: 8 },
    { type: "logstable", title: "Logs table", scenario: "logs", w: 12, h: 8 },
    { type: "traces", title: "Traces", scenario: "trace", w: 12, h: 10 },
    {
      type: "flamegraph",
      title: "Flame graph",
      scenario: "flame_graph",
      w: 12,
      h: 10
    },
    { type: "canvas", title: "Canvas", scenario: "random_walk" },
    { type: "news", title: "News" },
    { type: "dashlist", title: "Dashboard list" },
    { type: "alertlist", title: "Alert list" },
    { type: "annolist", title: "Annotation list" },
    { type: "live", title: "Live" },
    { type: "debug", title: "Debug", scenario: "random_walk" },
    { type: "gettingstarted", title: "Getting started" },
    { type: "welcome", title: "Welcome" }
  ];
  let x = 0;
  let y = 0;
  let rowH = 0;
  const panels2 = panelDefs.map((d, idx) => {
    const w = d.w ?? 6;
    const h2 = d.h ?? 8;
    if (x + w > 24) {
      x = 0;
      y += rowH || 8;
      rowH = 0;
    }
    const gridPos = { x, y, w, h: h2 };
    x += w;
    rowH = Math.max(rowH, h2);
    const options = demoPanelOptions(d.type);
    return {
      id: idx + 1,
      type: d.type,
      title: d.title,
      gridPos,
      targets: d.scenario ? [
        {
          refId: "A",
          datasource: td,
          scenarioId: d.scenario,
          ...d.stringInput ? { stringInput: d.stringInput } : {},
          ...d.seriesCount ? { seriesCount: d.seriesCount } : {}
        }
      ] : [],
      datasource: td,
      options,
      fieldConfig: { defaults: {}, overrides: [] }
    };
  });
  return {
    uid,
    title: title || "可视化全景演示",
    tags: ["demo", "all-panels"],
    schemaVersion: 39,
    timezone: "browser",
    version: 1,
    refresh: "30s",
    panels: panels2,
    time: { from: "now-6h", to: "now" },
    templating: {
      list: [
        {
          type: "custom",
          name: "job",
          label: "Job",
          query: "api,web,db",
          current: { text: "api", value: "api" },
          options: [
            { text: "api", value: "api", selected: true },
            { text: "web", value: "web", selected: false }
          ],
          multi: false,
          includeAll: false
        },
        {
          type: "interval",
          name: "interval",
          label: "Interval",
          query: "1m,5m,10m,1h",
          current: { text: "1m", value: "1m" },
          auto: true,
          auto_count: 30,
          auto_min: "10s"
        }
      ]
    },
    annotations: { list: [] }
  };
}
async function offlineRequest(opts) {
  seedDemoDashboards();
  const method = (opts.method ?? (opts.data ? "POST" : "GET")).toUpperCase();
  const path = pathOf(opts.url);
  const params = queryParams(opts.url, opts.params);
  {
    const m = path.match(/^\/api\/dashboards\/uid\/([^/]+)\/?$/);
    if (method === "GET" && m) {
      const uid = decodeURIComponent(m[1]);
      const map = readDashMap();
      const rec = map[uid];
      const pluginDash = loadPluginDashboard(
        "",
        "",
        uid,
        rec?.title || uid
      );
      let dashboard = rec?.raw ?? (Array.isArray(pluginDash?.panels) && pluginDash.panels.length > 0 ? pluginDash : demoDashboard(uid, rec?.title));
      const panels2 = dashboard?.panels;
      const panelTypes = new Set(
        (Array.isArray(panels2) ? panels2 : []).map((p) => p?.type).filter(Boolean)
      );
      const hasFreshTrend = (Array.isArray(panels2) ? panels2 : []).some(
        (p) => p?.type === "trend" && Array.isArray(p.targets) && p.targets.some((tg) => tg?.scenarioId === "linear_trend")
      );
      const hasFreshPie = (Array.isArray(panels2) ? panels2 : []).some(
        (p) => p?.type === "piechart" && Array.isArray(p.targets) && p.targets.some(
          (tg) => String(tg?.stringInput || "").includes("10,25,40")
        )
      );
      const needsDemoUpgrade = !Array.isArray(panels2) || panels2.length < 25 || !panelTypes.has("news") || !panelTypes.has("timeseries") || !panels2.some(
        (p) => p && (p.title === "Welcome" || String(p.title || "").includes("可视化"))
      ) || !hasFreshTrend || !hasFreshPie;
      if (needsDemoUpgrade && (uid === "vue-demo" || uid === "demo" || uid === "v1-demo")) {
        dashboard = demoDashboard(
          uid,
          String(dashboard?.title || rec?.title || uid)
        );
        if (rec) {
          map[uid] = {
            ...rec,
            raw: dashboard,
            title: String(dashboard.title || rec.title)
          };
          writeDashMap(map);
        }
      }
      return ok({
        dashboard,
        meta: {
          canSave: true,
          canEdit: true,
          canAdmin: true,
          canStar: false,
          slug: String(dashboard.title || uid).toLowerCase().replace(/\s+/g, "-"),
          url: `/d/${uid}`,
          version: rec?.version ?? 1,
          folderTitle: "General"
        }
      });
    }
  }
  if (method === "POST" && /^\/api\/dashboards\/db\/?$/.test(path)) {
    const body = opts.data ?? {};
    const dash = { ...body.dashboard ?? {} };
    const uid = String(dash.uid || `local-${Date.now().toString(36)}`);
    const title = String(dash.title || "Untitled dashboard");
    const map = readDashMap();
    const prev = map[uid];
    const version = (prev?.version ?? Number(dash.version) ?? 0) + 1;
    const raw = { ...dash, uid, title, version };
    map[uid] = {
      uid,
      title,
      raw,
      savedAt: (/* @__PURE__ */ new Date()).toISOString(),
      version
    };
    writeDashMap(map);
    return ok({
      status: "success",
      slug: title.toLowerCase().replace(/\s+/g, "-"),
      version,
      id: version,
      uid,
      url: `/d/${uid}/${title.toLowerCase().replace(/\s+/g, "-")}`
    });
  }
  if (method === "GET" && /^\/api\/search\/?$/.test(path)) {
    const type = params.type;
    const query = (params.query || params.q || "").toLowerCase();
    const map = readDashMap();
    let items = Object.values(map).map((d) => ({
      id: 0,
      uid: d.uid,
      title: d.title,
      uri: `db/${d.uid}`,
      url: `/d/${d.uid}/${d.title.toLowerCase().replace(/\s+/g, "-")}`,
      type: "dash-db",
      tags: [],
      isStarred: false
    }));
    if (type && type !== "dash-db") {
      items = [];
    }
    if (query) {
      items = items.filter(
        (i) => i.title.toLowerCase().includes(query) || i.uid.includes(query)
      );
    }
    const starredParam = String(params.starred ?? "").toLowerCase();
    if (starredParam === "true" || starredParam === "1") {
      items = items.filter((i) => !!i.isStarred);
    }
    return ok(items);
  }
  if (method === "GET" && /^\/api\/datasources\/?$/.test(path)) {
    return ok(readDatasources().map(toPublicDatasource));
  }
  {
    const m = path.match(/^\/api\/datasources\/uid\/([^/]+)\/?$/);
    if (method === "GET" && m) {
      const uid = decodeURIComponent(m[1]);
      const ds2 = readDatasources().find((d) => d.uid === uid);
      if (!ds2) notFound(`Data source not found: ${uid}`);
      return ok(toPublicDatasource(ds2));
    }
  }
  {
    const m = path.match(/^\/api\/datasources\/uid\/([^/]+)\/health\/?$/);
    if (method === "GET" && m) {
      return ok({ status: "OK", message: "Offline fixture OK" });
    }
  }
  if (method === "POST" && /^\/api\/datasources\/?$/.test(path)) {
    const body = opts.data ?? {};
    const list = readDatasources();
    const uid = body.uid || `ds-${Date.now().toString(36)}`;
    const bodyAny = body;
    const fields = {
      ...bodyAny.secureJsonFields || {}
    };
    if (bodyAny.secureJsonData && typeof bodyAny.secureJsonData === "object") {
      for (const [k, v] of Object.entries(bodyAny.secureJsonData)) {
        if (v != null && v !== "") fields[k] = true;
      }
    }
    const { secureJsonData: _dropSecure, ...bodyRest } = bodyAny;
    const rec = {
      ...bodyRest,
      uid,
      name: body.name || uid,
      type: body.type || "grafana-testdata-datasource",
      access: body.access || "proxy",
      jsonData: body.jsonData || {},
      secureJsonFields: fields
    };
    list.push(rec);
    writeDatasources(list);
    return ok(toPublicDatasource(rec));
  }
  {
    const m = path.match(/^\/api\/datasources\/uid\/([^/]+)\/?$/);
    if (method === "PUT" && m) {
      const uid = decodeURIComponent(m[1]);
      const list = readDatasources();
      const idx = list.findIndex((d) => d.uid === uid);
      if (idx < 0) notFound(`Data source not found: ${uid}`);
      const body = opts.data ?? {};
      const prev = list[idx];
      const bodyAny = body;
      const fields = {
        ...prev.secureJsonFields ?? {},
        ...bodyAny.secureJsonFields ?? {}
      };
      if (bodyAny.secureJsonData && typeof bodyAny.secureJsonData === "object") {
        for (const [k, v] of Object.entries(bodyAny.secureJsonData)) {
          if (v != null && v !== "") fields[k] = true;
        }
      }
      const { secureJsonData: _dropSecure, ...bodyRest } = bodyAny;
      const { secureJsonData: _prevSecure, ...prevRest } = prev;
      list[idx] = {
        ...prevRest,
        ...bodyRest,
        uid,
        secureJsonFields: fields
      };
      writeDatasources(list);
      return ok(toPublicDatasource(list[idx]));
    }
  }
  {
    const m = path.match(/^\/api\/datasources\/uid\/([^/]+)\/?$/);
    if (method === "DELETE" && m) {
      const uid = decodeURIComponent(m[1]);
      writeDatasources(readDatasources().filter((d) => d.uid !== uid));
      return ok({ message: "Data source deleted" });
    }
  }
  if (method === "POST" && /^\/api\/ds\/query\/?$/.test(path)) {
    return ok({ results: {} });
  }
  if (method === "GET" && /^\/api\/health\/?$/.test(path)) {
    return ok({
      database: "ok",
      version: "13.2.0-vue-offline",
      commit: "offline"
    });
  }
  notFound(`Offline backend: no handler for ${method} ${path}`);
}
function createHttpClient(opts) {
  const instance = axios.create({
    baseURL: opts.baseURL,
    timeout: opts.timeoutMs ?? 3e4,
    withCredentials: opts.withCredentials ?? false,
    // Caller decides ok/error — matches prior fetch + res.ok handling in adapters
    validateStatus: () => true,
    // Avoid axios transforming JSON automatically when we need raw text for size checks
    transitional: { forcedJSONParsing: false, silentJSONParsing: true },
    responseType: "text",
    adapter: opts.adapter
  });
  const ejectors = [];
  return {
    kind: opts.kind,
    axios: instance,
    async request(config) {
      return instance.request(config);
    },
    dispose() {
      for (const eject of ejectors) eject();
      ejectors.length = 0;
    }
  };
}
class NormalizedHeaders {
  map = /* @__PURE__ */ new Map();
  constructor(init) {
    if (!init) return;
    if (typeof init.forEach === "function" && typeof init.get === "function") {
      init.forEach((v, k) => this.map.set(k.toLowerCase(), v));
      return;
    }
    for (const [k, v] of Object.entries(init)) {
      if (v == null) continue;
      this.map.set(
        k.toLowerCase(),
        Array.isArray(v) ? String(v[0]) : String(v)
      );
    }
  }
  get(name) {
    return this.map.get(name.toLowerCase()) ?? null;
  }
  has(name) {
    return this.map.has(name.toLowerCase());
  }
  forEach(cb) {
    this.map.forEach((v, k) => cb(v, k));
  }
  entries() {
    return this.map.entries();
  }
}
function axiosHeadersToRecord(headers) {
  const out = {};
  if (!headers || typeof headers !== "object") return out;
  for (const [k, v] of Object.entries(headers)) {
    if (v == null) continue;
    out[k] = Array.isArray(v) ? String(v[0]) : String(v);
  }
  return out;
}
let backendHttp = null;
let datasourceHttpClient = null;
let resourceHttp = null;
let appHttp = null;
function getBackendHttp() {
  if (!backendHttp) {
    backendHttp = createHttpClient({
      kind: "backend",
      withCredentials: true,
      timeoutMs: 6e4
    });
  }
  return backendHttp;
}
function getDatasourceHttpClient() {
  if (!datasourceHttpClient) {
    datasourceHttpClient = createHttpClient({
      kind: "datasource",
      withCredentials: false,
      timeoutMs: 6e4
    });
  }
  return datasourceHttpClient;
}
function getResourceHttp() {
  if (!resourceHttp) {
    resourceHttp = createHttpClient({
      kind: "resource",
      withCredentials: false,
      timeoutMs: 3e4
    });
  }
  return resourceHttp;
}
function getAppHttp() {
  if (!appHttp) {
    appHttp = createHttpClient({
      kind: "app",
      withCredentials: true,
      timeoutMs: 3e4
    });
  }
  return appHttp;
}
function configureDatasourceHttpClient(opts) {
  datasourceHttpClient?.dispose();
  datasourceHttpClient = createHttpClient({
    kind: "datasource",
    withCredentials: false,
    timeoutMs: opts?.timeoutMs ?? 6e4,
    adapter: opts?.adapter
  });
  return datasourceHttpClient;
}
function resetHttpClients() {
  backendHttp?.dispose();
  datasourceHttpClient?.dispose();
  resourceHttp?.dispose();
  appHttp?.dispose();
  backendHttp = null;
  datasourceHttpClient = null;
  resourceHttp = null;
  appHttp = null;
}
const __vite_import_meta_env__$2 = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
const STORAGE_KEY$1 = "grafana-vue-auth-token";
const WINDOW_KEY = "__GRAFANA_VUE_AUTH_TOKEN__";
function nonEmpty$1(v) {
  if (v == null) return void 0;
  const s = String(v).trim();
  return s.length ? s : void 0;
}
function readEnvToken() {
  try {
    const meta2 = __vite_import_meta_env__$2;
    const fromVite = nonEmpty$1(meta2?.VITE_GRAFANA_TOKEN) || nonEmpty$1(meta2?.VITE_GRAFANA_API_TOKEN);
    if (fromVite) return fromVite;
  } catch {
  }
  try {
    const g = globalThis;
    return nonEmpty$1(g.process?.env?.GRAFANA_TOKEN) || nonEmpty$1(g.process?.env?.VITE_GRAFANA_TOKEN) || nonEmpty$1(g.process?.env?.GRAFANA_API_TOKEN);
  } catch {
    return void 0;
  }
}
function readWindowToken() {
  if (typeof globalThis === "undefined") return void 0;
  const w = globalThis;
  return nonEmpty$1(w[WINDOW_KEY]);
}
function readStorageToken() {
  try {
    if (typeof localStorage === "undefined") return void 0;
    return nonEmpty$1(localStorage.getItem(STORAGE_KEY$1));
  } catch {
    return void 0;
  }
}
function getGrafanaAuthToken() {
  return readWindowToken() ?? readStorageToken() ?? readEnvToken() ?? null;
}
function getGrafanaAuthSnapshot() {
  if (readWindowToken()) {
    return {
      present: true,
      source: "window",
      preview: redactToken(readWindowToken())
    };
  }
  if (readStorageToken()) {
    return {
      present: true,
      source: "localStorage",
      preview: redactToken(readStorageToken())
    };
  }
  if (readEnvToken()) {
    return {
      present: true,
      source: "env",
      preview: redactToken(readEnvToken())
    };
  }
  return { present: false, source: "none", preview: "" };
}
function redactToken(token) {
  if (!token) return "";
  if (token.length <= 8) return "***";
  return `${token.slice(0, 4)}***${token.slice(-2)}`;
}
function setGrafanaAuthToken(token) {
  try {
    if (typeof localStorage === "undefined") return;
    if (!token) localStorage.removeItem(STORAGE_KEY$1);
    else localStorage.setItem(STORAGE_KEY$1, token);
  } catch {
  }
}
class GrafanaAuthError extends Error {
  code = "AUTH_TOKEN_MISSING";
  constructor(message = "Grafana API token missing; set VITE_GRAFANA_TOKEN or window.__GRAFANA_VUE_AUTH_TOKEN__") {
    super(message);
    this.name = "GrafanaAuthError";
  }
}
function requireGrafanaAuthToken() {
  const t2 = getGrafanaAuthToken();
  if (!t2) throw new GrafanaAuthError();
  return t2;
}
function applyGrafanaAuthHeaders(headers = {}) {
  const out = { ...headers };
  if (out.Authorization || out.authorization) return out;
  const token = getGrafanaAuthToken();
  if (token) out.Authorization = `Bearer ${token}`;
  return out;
}
function isGrafanaLiveConfigured() {
  if (getGrafanaAuthToken()) return true;
  try {
    const meta2 = __vite_import_meta_env__$2;
    if (nonEmpty$1(meta2?.VITE_GRAFANA_URL) || nonEmpty$1(meta2?.VITE_GRAFANA_API_URL))
      return true;
  } catch {
  }
  try {
    const g = globalThis;
    if (nonEmpty$1(g.__GRAFANA_VUE_GRAFANA_URL__)) return true;
    if (nonEmpty$1(g.process?.env?.GRAFANA_URL) || nonEmpty$1(g.process?.env?.VITE_GRAFANA_URL))
      return true;
  } catch {
  }
  return false;
}
function getGrafanaBaseUrl() {
  try {
    const meta2 = __vite_import_meta_env__$2;
    const fromVite = nonEmpty$1(meta2?.VITE_GRAFANA_URL) || nonEmpty$1(meta2?.VITE_GRAFANA_API_URL);
    if (fromVite) return fromVite.replace(/\/$/, "");
  } catch {
  }
  try {
    const g = globalThis;
    const fromGlobal = nonEmpty$1(g.__GRAFANA_VUE_GRAFANA_URL__);
    if (fromGlobal) return fromGlobal.replace(/\/$/, "");
    const fromEnv = nonEmpty$1(g.process?.env?.GRAFANA_URL) || nonEmpty$1(g.process?.env?.VITE_GRAFANA_URL);
    if (fromEnv) return fromEnv.replace(/\/$/, "");
  } catch {
  }
  return "";
}
let baseUrl = "";
let clientOverride = null;
function configureLiveAdapter(opts) {
  if (opts.baseUrl != null) baseUrl = opts.baseUrl.replace(/\/$/, "");
  if (opts.client) {
    clientOverride = opts.client;
    return;
  }
  if (opts.axiosAdapter) {
    clientOverride = createHttpClient({
      kind: "backend",
      withCredentials: true,
      adapter: opts.axiosAdapter
    });
    return;
  }
  if (opts.fetch) {
    const fetchImpl = opts.fetch;
    clientOverride = createHttpClient({
      kind: "backend",
      withCredentials: true,
      adapter: async (config) => {
        const url = resolveUrl(config);
        const headers = {};
        const raw = config.headers;
        if (raw) {
          for (const [k, v] of Object.entries(raw)) {
            if (v == null || k === "common" || typeof v === "object") continue;
            headers[k] = String(v);
          }
        }
        const res = await fetchImpl(url, {
          method: (config.method || "GET").toUpperCase(),
          headers,
          body: config.data,
          signal: config.signal,
          credentials: "same-origin"
        });
        const text = await res.text();
        const h2 = {};
        res.headers.forEach((val, key) => {
          h2[key] = val;
        });
        return {
          data: text,
          status: res.status,
          statusText: res.statusText,
          headers: h2,
          config
        };
      }
    });
  }
}
function resolveUrl(config) {
  const base = config.baseURL || "";
  const url = config.url || "";
  if (url.startsWith("http")) return url;
  if (base) return `${base.replace(/\/$/, "")}/${url.replace(/^\//, "")}`;
  return url;
}
function buildUrl(url, params) {
  const full = url.startsWith("http") ? url : `${baseUrl}${url}`;
  if (!params) return full;
  const u = new URL(full, "http://local");
  for (const [k, v] of Object.entries(params)) {
    if (v !== void 0) u.searchParams.set(k, String(v));
  }
  if (full.startsWith("http")) return u.toString();
  return u.pathname + u.search;
}
async function liveRequest(opts) {
  const method = (opts.method ?? (opts.data ? "POST" : "GET")).toUpperCase();
  let headers = {
    Accept: "application/json",
    ...opts.headers ?? {}
  };
  headers = applyGrafanaAuthHeaders(headers);
  const pathOnly = (() => {
    try {
      const u = opts.url.startsWith("http") ? new URL(opts.url).pathname : opts.url.split("?")[0];
      return u;
    } catch {
      return opts.url;
    }
  })();
  const isGrafanaApi = pathOnly === "/api" || pathOnly.startsWith("/api/") || pathOnly.startsWith("/apis/");
  if (isGrafanaApi && !headers.Authorization && !headers.authorization) {
    if (getGrafanaAuthToken() === null && opts.requireAuth) {
      throw new GrafanaAuthError();
    }
  }
  let body;
  if (opts.data !== void 0) {
    headers["Content-Type"] = headers["Content-Type"] ?? "application/json";
    body = typeof opts.data === "string" ? opts.data : JSON.stringify(opts.data);
  }
  const client = clientOverride ?? getBackendHttp();
  const res = await client.request({
    url: buildUrl(opts.url, opts.params),
    method,
    headers,
    data: body,
    signal: opts.signal,
    responseType: "text",
    withCredentials: true
  });
  const text = typeof res.data === "string" ? res.data : res.data == null ? "" : String(res.data);
  let data;
  try {
    data = text ? JSON.parse(text) : null;
  } catch {
    data = text;
  }
  const normalized = new NormalizedHeaders(res.headers);
  const hdrs = new Headers();
  normalized.forEach((v, k) => hdrs.set(k, v));
  if (res.status < 200 || res.status >= 300) {
    const err = new Error(
      `Backend request failed: ${res.status} ${res.statusText}`
    );
    err.status = res.status;
    err.data = data;
    throw err;
  }
  return {
    data,
    status: res.status,
    statusText: res.statusText || "",
    ok: res.status >= 200 && res.status < 300,
    headers: hdrs
  };
}
let mode = "offline";
let customAdapter = null;
function detectInitialMode() {
  try {
    if (typeof globalThis !== "undefined") {
      const g = globalThis;
      const fromGlobal = g.__GRAFANA_VUE_BACKEND_MODE__;
      if (fromGlobal === "live" || fromGlobal === "offline") return fromGlobal;
      const env = g.process?.env?.GRAFANA_VUE_BACKEND_MODE ?? g.process?.env?.VITE_BACKEND_MODE;
      if (env === "live") return "live";
    }
  } catch {
  }
  return "offline";
}
mode = detectInitialMode();
function getBackendMode() {
  return mode;
}
function configureBackendSrv(opts) {
  if (opts.mode) mode = opts.mode;
  if (opts.adapter !== void 0) customAdapter = opts.adapter;
  const baseUrl2 = opts.baseUrl != null ? opts.baseUrl : getGrafanaBaseUrl();
  if (opts.fetch || opts.baseUrl != null || baseUrl2) {
    configureLiveAdapter({
      fetch: opts.fetch,
      baseUrl: baseUrl2 || opts.baseUrl
    });
  }
  if (opts.requireAuth != null) {
    globalThis.__GRAFANA_VUE_REQUIRE_AUTH__ = !!opts.requireAuth;
  }
}
function shouldServeFromOfflineSeed(url) {
  try {
    const path = url.startsWith("http") ? new URL(url).pathname : url.split("?")[0];
    if (path.startsWith("/zabbix-api") || path.startsWith("/signoz-api") || path.startsWith("/signoz-api") || path.includes("api_jsonrpc")) {
      return false;
    }
    if (isGrafanaLiveConfigured()) {
      const liveGrafanaPrefixes = [
        "/api/dashboards",
        "/api/search",
        "/api/folders",
        "/api/library-elements",
        "/api/annotations",
        "/api/user",
        "/api/org",
        "/api/orgs",
        "/api/frontend",
        "/api/plugins",
        "/api/datasources",
        "/api/ds/query",
        "/api/health"
      ];
      if (liveGrafanaPrefixes.some((p) => path === p || path.startsWith(p + "/"))) {
        return false;
      }
    }
    const offlinePrefixes = [
      "/api/dashboards",
      "/api/search",
      "/api/folders",
      "/api/library-elements",
      "/api/annotations",
      "/api/user",
      "/api/org",
      "/api/orgs",
      "/api/frontend",
      "/api/plugins",
      "/api/datasources",
      "/api/ds/query",
      // offline seeds for local demos without Grafana
      "/api/prometheus",
      "/api/v1",
      "/apis/"
    ];
    return offlinePrefixes.some(
      (p) => path === p || path.startsWith(p + "/") || path.startsWith(p)
    );
  } catch {
    return true;
  }
}
async function backendRequest(opts) {
  if (customAdapter) {
    return customAdapter.request(opts);
  }
  if (mode === "live") {
    if (shouldServeFromOfflineSeed(opts.url)) {
      return offlineRequest(opts);
    }
    if (globalThis.__GRAFANA_VUE_REQUIRE_AUTH__ && isGrafanaLiveConfigured()) {
      try {
        requireGrafanaAuthToken();
      } catch (e) {
        if (e instanceof GrafanaAuthError) throw e;
        throw e;
      }
    }
    return liveRequest({
      ...opts,
      requireAuth: !!globalThis.__GRAFANA_VUE_REQUIRE_AUTH__
    });
  }
  return offlineRequest(opts);
}
const backendSrv = {
  get: (url, params, options) => backendRequest({ ...options, method: "GET", url, params }),
  post: (url, data, options) => backendRequest({ ...options, method: "POST", url, data }),
  put: (url, data, options) => backendRequest({ ...options, method: "PUT", url, data }),
  patch: (url, data, options) => backendRequest({ ...options, method: "PATCH", url, data }),
  delete: (url, options) => backendRequest({ ...options, method: "DELETE", url }),
  request: backendRequest,
  configure: configureBackendSrv,
  getMode: getBackendMode
};
const state$2 = reactive({
  path: typeof window !== "undefined" ? window.location.pathname : "/",
  query: {},
  hash: ""
});
function useLocationService() {
  return {
    state: readonly(state$2),
    partial: (update) => {
      if (update.path != null) state$2.path = update.path;
      if (update.query != null)
        state$2.query = { ...state$2.query, ...update.query };
      if (update.hash != null) state$2.hash = update.hash;
    },
    push: (path, query) => {
      state$2.path = path;
      if (query) state$2.query = query;
    },
    replace: (path, query) => {
      state$2.path = path;
      if (query) state$2.query = query;
    },
    getSearchObject: () => ({ ...state$2.query })
  };
}
const THEME_STORAGE_KEY = "grafana-vue-theme-preference";
const listeners$1 = /* @__PURE__ */ new Set();
const state$1 = reactive({
  preference: "dark"
});
const theme2Ref = shallowRef(
  createTheme({ colors: { mode: "dark" } })
);
function onThemeChange(fn) {
  listeners$1.add(fn);
  return () => listeners$1.delete(fn);
}
function systemPrefersDark() {
  if (typeof window === "undefined" || !window.matchMedia) return true;
  return window.matchMedia("(prefers-color-scheme: dark)").matches;
}
function resolveMode(pref = state$1.preference) {
  if (pref === "system") return systemPrefersDark() ? "dark" : "light";
  return pref;
}
function readStoredPreference() {
  if (typeof localStorage === "undefined") return null;
  try {
    const v = localStorage.getItem(THEME_STORAGE_KEY);
    if (v === "light" || v === "dark" || v === "system") return v;
  } catch {
  }
  return null;
}
function writeStoredPreference(pref) {
  if (typeof localStorage === "undefined") return;
  try {
    localStorage.setItem(THEME_STORAGE_KEY, pref);
  } catch {
  }
}
function readUrlTheme() {
  if (typeof window === "undefined") return null;
  try {
    const q = new URLSearchParams(window.location.search);
    const t2 = q.get("theme");
    if (t2 === "light" || t2 === "dark") return t2;
  } catch {
  }
  return null;
}
function readBootTheme() {
  try {
    const boot = globalThis.__grafana_boot_data__ ?? globalThis.grafanaBootData;
    const t2 = boot?.user?.theme;
    if (t2 === "light" || t2 === "dark" || t2 === "system") return t2;
  } catch {
  }
  return null;
}
function resolveInitialPreference() {
  const url = readUrlTheme();
  if (url) {
    const stored = readStoredPreference() ?? readBootTheme() ?? "dark";
    return { preference: stored, runtimeOnly: url };
  }
  return { preference: readStoredPreference() ?? readBootTheme() ?? "dark" };
}
function applyDom(mode2, theme) {
  if (typeof document === "undefined") return;
  applyResolvedTheme(theme, document.documentElement);
  document.documentElement.style.colorScheme = mode2;
  document.documentElement.dataset.theme = mode2;
  if (document.body) {
    document.body.style.colorScheme = mode2;
    document.body.dataset.theme = mode2;
  }
}
function notify(mode2) {
  for (const fn of listeners$1) {
    try {
      fn(mode2);
    } catch {
    }
  }
}
function rebuildTheme(mode2, persist) {
  const theme = createTheme({ colors: { mode: mode2 } });
  theme2Ref.value = theme;
  applyDom(mode2, theme);
  if (persist) writeStoredPreference(state$1.preference);
  notify(mode2);
}
function initTheme(options) {
  const fallback = resolveInitialPreference();
  const preference = options?.preference ?? fallback.preference;
  const runtimeOnly = options?.runtimeOnly ?? fallback.runtimeOnly;
  state$1.preference = preference;
  const mode2 = runtimeOnly ?? resolveMode(preference);
  rebuildTheme(mode2, !runtimeOnly);
  return mode2;
}
function useTheme() {
  const resolved = computed(() => {
    const url = readUrlTheme();
    if (url) return url;
    return resolveMode(state$1.preference);
  });
  const setMode = (mode2, opts) => {
    state$1.preference = mode2;
    const effective = opts?.runtimeOnly ? resolveMode(mode2) : readUrlTheme() ?? resolveMode(mode2);
    rebuildTheme(effective, !opts?.runtimeOnly);
  };
  const setRuntimeMode = (mode2) => {
    rebuildTheme(mode2, false);
  };
  return {
    /** User preference including 'system' */
    mode: readonly(computed(() => state$1.preference)),
    preference: readonly(computed(() => state$1.preference)),
    /** Resolved light|dark */
    resolved,
    theme2: readonly(theme2Ref),
    setMode,
    setRuntimeMode,
    tokens: computed(() => {
      const t2 = theme2Ref.value;
      return {
        bg: t2.colors.background.canvas,
        panelBg: t2.colors.background.primary,
        text: t2.colors.text.primary,
        primary: t2.colors.primary.main,
        border: t2.colors.border.medium
      };
    })
  };
}
if (typeof window !== "undefined") {
  try {
    watchSystemTheme(() => {
      if (state$1.preference === "system" && !readUrlTheme()) {
        rebuildTheme(resolveMode("system"), false);
      }
    });
  } catch {
  }
}
function hasPermission(action) {
  try {
    return Boolean(getBootData().user.permissions[action]);
  } catch {
    return false;
  }
}
function usePermissions() {
  return {
    can: hasPermission,
    canReadDashboards: () => hasPermission("dashboards:read"),
    canWriteDashboards: () => hasPermission("dashboards:write"),
    canReadDatasources: () => hasPermission("datasources:read"),
    canWriteDatasources: () => hasPermission("datasources:write")
  };
}
function isFeatureEnabled(name) {
  try {
    return Boolean(getBootData().settings.featureToggles[name]);
  } catch {
    return false;
  }
}
class QueryScheduler {
  concurrency;
  resolveDataSource;
  cacheTtlMs;
  maxCacheEntries;
  active = /* @__PURE__ */ new Map();
  queue = [];
  running = 0;
  cache = /* @__PURE__ */ new Map();
  stats = reactive({
    started: 0,
    completed: 0,
    cancelled: 0,
    errors: 0,
    cacheHits: 0,
    skippedHidden: 0
  });
  constructor(opts) {
    this.concurrency = opts.concurrency ?? 6;
    this.resolveDataSource = opts.resolveDataSource;
    this.cacheTtlMs = opts.cacheTtlMs ?? 0;
    this.maxCacheEntries = opts.maxCacheEntries ?? 200;
  }
  run(request) {
    if (request.visible === false) {
      this.stats.skippedHidden += 1;
      return Promise.resolve({
        state: LoadingStateEnum.Done,
        series: [],
        timeRange: request.range,
        request: { requestId: request.requestId }
      });
    }
    const cacheKey = this.cacheTtlMs > 0 ? this.buildCacheKey(request) : "";
    if (cacheKey) {
      const hit = this.cache.get(cacheKey);
      if (hit && hit.expiresAt > Date.now()) {
        hit.lastAccess = Date.now();
        this.stats.cacheHits += 1;
        return Promise.resolve({
          ...hit.data,
          request: { requestId: request.requestId }
        });
      }
    }
    this.cancel(request.requestId);
    const controller = new AbortController();
    const promise = this.enqueue(
      () => this.execute(request, controller.signal, cacheKey)
    );
    this.active.set(request.requestId, {
      requestId: request.requestId,
      controller,
      promise
    });
    promise.finally(() => {
      const cur = this.active.get(request.requestId);
      if (cur?.promise === promise) this.active.delete(request.requestId);
    });
    return promise;
  }
  cancel(requestId) {
    const cur = this.active.get(requestId);
    if (cur) {
      cur.controller.abort();
      this.active.delete(requestId);
      this.stats.cancelled += 1;
    }
  }
  cancelAll() {
    for (const id of [...this.active.keys()]) this.cancel(id);
  }
  clearCache() {
    this.cache.clear();
  }
  buildCacheKey(request) {
    return JSON.stringify({
      targets: request.targets,
      from: request.range.from.getTime(),
      to: request.range.to.getTime(),
      maxDataPoints: request.maxDataPoints,
      intervalMs: request.intervalMs,
      scopedVars: request.scopedVars
    });
  }
  putCache(key, data) {
    if (!key || this.cacheTtlMs <= 0) return;
    this.cache.set(key, {
      key,
      data,
      expiresAt: Date.now() + this.cacheTtlMs,
      lastAccess: Date.now()
    });
    if (this.cache.size > this.maxCacheEntries) {
      const oldest = [...this.cache.values()].sort(
        (a, b) => a.lastAccess - b.lastAccess
      )[0];
      if (oldest) this.cache.delete(oldest.key);
    }
  }
  enqueue(fn) {
    return new Promise((resolve, reject) => {
      const run = () => {
        this.running += 1;
        this.stats.started += 1;
        fn().then(resolve, reject).finally(() => {
          this.running -= 1;
          const next = this.queue.shift();
          if (next) next();
        });
      };
      if (this.running < this.concurrency) run();
      else this.queue.push(run);
    });
  }
  async execute(request, signal, cacheKey) {
    const visible = request.targets.filter((t2) => !t2.hide);
    if (!visible.length) {
      return {
        state: LoadingStateEnum.Done,
        series: [],
        timeRange: request.range,
        request: { requestId: request.requestId }
      };
    }
    try {
      const groups = /* @__PURE__ */ new Map();
      for (const t2 of visible) {
        const key = t2.datasource?.uid ?? t2.datasource?.type ?? "default";
        const list = groups.get(key) ?? [];
        list.push(t2);
        groups.set(key, list);
      }
      const series = [];
      for (const [key, targets] of groups) {
        if (signal.aborted) throw new DOMException("Aborted", "AbortError");
        const ds2 = this.resolveDataSource(targets[0].datasource ?? key);
        if (!ds2) {
          this.stats.errors += 1;
          return {
            state: LoadingStateEnum.Error,
            series: [],
            timeRange: request.range,
            error: { message: `Data source not found: ${key}` },
            request: { requestId: request.requestId }
          };
        }
        const res = await ds2.query({ ...request, targets }, signal);
        series.push(
          ...res.data.map((f) => ({
            ...f,
            refId: f.refId ?? targets[0].refId
          }))
        );
      }
      this.stats.completed += 1;
      const data = {
        state: LoadingStateEnum.Done,
        series,
        timeRange: request.range,
        request: { requestId: request.requestId }
      };
      this.putCache(cacheKey, data);
      return data;
    } catch (e) {
      if (e.name === "AbortError") {
        return {
          state: LoadingStateEnum.NotStarted,
          series: [],
          timeRange: request.range,
          request: { requestId: request.requestId }
        };
      }
      this.stats.errors += 1;
      return {
        state: LoadingStateEnum.Error,
        series: [],
        timeRange: request.range,
        error: { message: e instanceof Error ? e.message : String(e) },
        request: { requestId: request.requestId }
      };
    }
  }
}
const catalogs = {
  "en-US": {
    "dashboard.save": "Save",
    "dashboard.edit": "Edit",
    "dashboard.view": "View",
    "dashboard.share": "Share",
    "dashboard.refresh": "Refresh",
    "dashboard.addPanel": "Add panel",
    "dashboard.import": "Import JSON",
    "dashboard.undo": "Undo",
    "dashboard.redo": "Redo",
    "dashboard.inspect": "Inspect",
    "dashboard.copy": "Copy",
    "dashboard.duplicate": "Duplicate panel",
    "dashboard.paste": "Paste",
    "dashboard.library": "Panel library",
    "dashboard.saveLibrary": "Save to library",
    "dashboard.screenshot": "Screenshot",
    "dashboard.loading": "Loading…",
    "dashboard.list": "Dashboards",
    "dashboard.new": "New",
    "dashboard.time.custom": "Custom range",
    "dashboard.time.last5m": "Last 5 minutes",
    "dashboard.time.last15m": "Last 15 minutes",
    "dashboard.time.last1h": "Last 1 hour",
    "dashboard.time.last6h": "Last 6 hours",
    "dashboard.time.last24h": "Last 24 hours",
    "dashboard.time.last7d": "Last 7 days",
    "datasources.title": "Data sources",
    "datasources.add": "Add data source",
    "datasources.search": "Search data sources…",
    "datasources.allTypes": "All types",
    "datasources.default": "default",
    "datasources.empty": "No data sources match",
    "common.cancel": "Cancel",
    "common.apply": "Apply",
    "common.close": "Close",
    "common.search": "Search",
    "common.delete": "Delete",
    "common.settings": "Settings",
    "panel.options": "Panel options",
    "panel.field": "Field",
    "panel.query": "Query",
    "panel.transform": "Transform",
    "panel.alert": "Alert",
    "editor.thresholds": "Thresholds",
    "editor.unit": "Unit",
    "editor.mappings": "Value mappings",
    "editor.color": "Color",
    "time.timezone": "Time zone",
    "time.browser": "Browser time",
    "panel.noData": "No data",
    "dashboard.empty": "Empty dashboard",
    "dashboard.variables": "Variables"
  },
  "zh-Hans": {
    "dashboard.save": "保存",
    "dashboard.edit": "编辑",
    "dashboard.view": "查看",
    "dashboard.share": "分享",
    "dashboard.refresh": "刷新",
    "dashboard.addPanel": "添加面板",
    "dashboard.import": "导入 JSON",
    "dashboard.undo": "撤销",
    "dashboard.redo": "重做",
    "dashboard.inspect": "检查",
    "dashboard.copy": "复制",
    "dashboard.duplicate": "复制面板",
    "dashboard.paste": "粘贴",
    "dashboard.library": "面板库",
    "dashboard.saveLibrary": "存入库",
    "dashboard.screenshot": "截图",
    "dashboard.loading": "加载中…",
    "dashboard.list": "仪表盘",
    "dashboard.new": "新建",
    "dashboard.time.custom": "自定义范围",
    "dashboard.time.last5m": "最近 5 分钟",
    "dashboard.time.last15m": "最近 15 分钟",
    "dashboard.time.last1h": "最近 1 小时",
    "dashboard.time.last6h": "最近 6 小时",
    "dashboard.time.last24h": "最近 24 小时",
    "dashboard.time.last7d": "最近 7 天",
    "datasources.title": "数据源",
    "datasources.add": "添加数据源",
    "datasources.search": "搜索数据源…",
    "datasources.allTypes": "全部类型",
    "datasources.default": "默认",
    "datasources.empty": "无匹配的数据源",
    "common.cancel": "取消",
    "common.apply": "应用",
    "common.close": "关闭",
    "common.search": "搜索",
    "common.delete": "删除",
    "common.settings": "设置",
    "panel.options": "面板选项",
    "panel.field": "字段",
    "panel.query": "查询",
    "panel.transform": "转换",
    "panel.alert": "告警",
    "editor.thresholds": "阈值",
    "editor.unit": "单位",
    "editor.mappings": "值映射",
    "editor.color": "颜色",
    "time.timezone": "时区",
    "time.browser": "浏览器时区",
    "panel.noData": "暂无数据",
    "dashboard.empty": "空仪表盘",
    "dashboard.variables": "变量"
  }
};
const state = reactive({ locale: "zh-Hans", rtl: false });
function setLocale(locale2) {
  state.locale = catalogs[locale2] ? locale2 : "zh-Hans";
  if (typeof document !== "undefined") {
    document.documentElement.lang = state.locale;
  }
}
function setRTL(rtl) {
  state.rtl = rtl;
  if (typeof document !== "undefined") {
    const direction = rtl ? "rtl" : "ltr";
    document.documentElement.setAttribute("dir", direction);
    document.documentElement.dataset.direction = direction;
  }
}
function t(key, fallback) {
  return catalogs[state.locale]?.[key] ?? catalogs["zh-Hans"][key] ?? catalogs["en-US"][key] ?? fallback ?? key;
}
function useI18n() {
  return {
    locale: readonly(computed(() => state.locale)),
    rtl: readonly(computed(() => state.rtl)),
    t,
    setLocale,
    setRTL
  };
}
function registerI18nCatalog(locale2, entries) {
  catalogs[locale2] = { ...catalogs[locale2] ?? {}, ...entries };
}
class RuntimeDataSourceSettingsError extends Error {
  constructor(message, code) {
    super(message);
    this.code = code;
    this.name = "RuntimeDataSourceSettingsError";
  }
  code;
}
const registry$1 = /* @__PURE__ */ new Map();
function assertNoSecrets(settings) {
  const blob = JSON.stringify(settings);
  if (/(?:"password"|"token"|"secureJsonData"|"apiKey")\s*:\s*"[^"]+"/i.test(blob)) {
    throw new RuntimeDataSourceSettingsError(
      "settings must not contain secret values",
      "SETTINGS_CONTAIN_SECRETS"
    );
  }
  const jd = settings.jsonData || {};
  for (const k of Object.keys(jd)) {
    if (/token|password|secret|apiKey|authorization/i.test(k) && jd[k]) {
      throw new RuntimeDataSourceSettingsError(
        `jsonData must not contain secret field ${k}`,
        "SETTINGS_CONTAIN_SECRETS"
      );
    }
  }
}
function assertSingleDefault(list) {
  const defaults2 = list.filter((s) => s.isDefault);
  if (defaults2.length > 1) {
    throw new RuntimeDataSourceSettingsError(
      `multiple default datasources: ${defaults2.map((d) => d.uid).join(",")}`,
      "DATASOURCE_DEFAULT_CONFLICT"
    );
  }
}
function clearRuntimeDataSourceSettings() {
  registry$1.clear();
}
function configureRuntimeDataSourceSettings(settings) {
  clearRuntimeDataSourceSettings();
  const seen = /* @__PURE__ */ new Set();
  const next = [];
  for (const raw of settings) {
    if (!raw?.uid) {
      throw new RuntimeDataSourceSettingsError(
        "datasource uid is required",
        "MISSING_UID"
      );
    }
    if (seen.has(raw.uid)) {
      throw new RuntimeDataSourceSettingsError(
        `duplicate uid: ${raw.uid}`,
        "DUPLICATE_UID"
      );
    }
    seen.add(raw.uid);
    const entry = {
      ...raw,
      source: raw.source ?? "runtime",
      jsonData: { ...raw.jsonData || {} }
    };
    assertNoSecrets(entry);
    next.push(entry);
  }
  assertSingleDefault(next);
  for (const e of next) registry$1.set(e.uid, e);
}
function listRuntimeDataSourceSettings() {
  return [...registry$1.values()].map((s) => ({
    ...s,
    jsonData: { ...s.jsonData || {} }
  }));
}
function getRuntimeDataSourceSettings(uid) {
  const s = registry$1.get(uid);
  return s ? { ...s, jsonData: { ...s.jsonData || {} } } : void 0;
}
function mergeDataSourceSettings(parts) {
  const byUid2 = /* @__PURE__ */ new Map();
  const backendDefaultUids = /* @__PURE__ */ new Set();
  const runtimeDefaultUids = /* @__PURE__ */ new Set();
  for (const s of parts.seeds || []) {
    if (!s?.uid) continue;
    byUid2.set(s.uid, {
      ...s,
      source: "seed",
      isDefault: false,
      jsonData: { ...s.jsonData || {} }
    });
  }
  for (const s of parts.backend || []) {
    if (!s?.uid) continue;
    const prev = byUid2.get(s.uid);
    byUid2.set(s.uid, {
      ...prev || {},
      ...s,
      source: "backend",
      // explicit false/true from backend wins; undefined keeps previous only if prev was backend/runtime
      isDefault: s.isDefault === true ? true : s.isDefault === false ? false : !!prev?.isDefault && prev.source !== "seed",
      jsonData: { ...prev?.jsonData || {}, ...s.jsonData || {} }
    });
    if (s.isDefault === true) backendDefaultUids.add(s.uid);
  }
  for (const s of parts.runtime || []) {
    if (!s?.uid) continue;
    const prev = byUid2.get(s.uid);
    const merged = {
      ...prev || {},
      ...s,
      source: "runtime",
      jsonData: { ...prev?.jsonData || {}, ...s.jsonData || {} }
    };
    if (prev?.source === "backend") {
      if (s.url == null && prev.url != null) merged.url = prev.url;
      if (!s.type && prev.type) merged.type = prev.type;
    }
    byUid2.set(s.uid, merged);
    if (s.isDefault === true) runtimeDefaultUids.add(s.uid);
  }
  for (const [uid, s] of byUid2) {
    if (s.source === "seed") {
      byUid2.set(uid, { ...s, isDefault: false });
      continue;
    }
    if ((s.type === "grafana-testdata-datasource" || s.type === "mixed" || uid === "testdata" || uid === "mixed") && s.source !== "backend" && backendDefaultUids.size > 0 && !backendDefaultUids.has(uid)) {
      byUid2.set(uid, { ...s, isDefault: false });
    }
  }
  if (backendDefaultUids.size > 1) {
    throw new RuntimeDataSourceSettingsError(
      `multiple default datasources from backend: ${[...backendDefaultUids].join(",")}`,
      "DATASOURCE_DEFAULT_CONFLICT"
    );
  }
  let chosenDefault;
  if (backendDefaultUids.size === 1) {
    chosenDefault = [...backendDefaultUids][0];
  } else if (runtimeDefaultUids.size === 1) {
    chosenDefault = [...runtimeDefaultUids][0];
  } else if (runtimeDefaultUids.size > 1) {
    throw new RuntimeDataSourceSettingsError(
      `multiple default datasources: ${[...runtimeDefaultUids].join(",")}`,
      "DATASOURCE_DEFAULT_CONFLICT"
    );
  }
  for (const [uid, s] of byUid2) {
    const want = chosenDefault != null && uid === chosenDefault;
    if (!!s.isDefault !== want) {
      byUid2.set(uid, { ...s, isDefault: want });
    }
  }
  return [...byUid2.values()];
}
function getEffectiveDefaultDataSource(list) {
  const items = list ?? listRuntimeDataSourceSettings();
  return items.find((s) => s.isDefault);
}
const VISIBLE_UIDS = /* @__PURE__ */ new Set(["zabbix-3", "zabbix-14", "signoz"]);
async function listDataSources() {
  const runtime = listRuntimeDataSourceSettings();
  const fromRuntime = runtime.filter((s) => VISIBLE_UIDS.has(s.uid)).map((s) => ({
    uid: s.uid,
    name: s.name,
    type: s.type,
    isDefault: s.isDefault ?? false,
    url: s.url,
    access: s.access,
    jsonData: s.jsonData
  }));
  if (fromRuntime.length > 0) return fromRuntime;
  try {
    const res = await backendSrv.get("/api/datasources");
    const all = res.data ?? [];
    return all.filter((d) => VISIBLE_UIDS.has(d.uid));
  } catch {
    return [];
  }
}
async function getDataSourceByUid(uid) {
  try {
    const res = await backendSrv.get(
      `/api/datasources/uid/${encodeURIComponent(uid)}`
    );
    return res.data ?? null;
  } catch {
    return null;
  }
}
async function saveDataSource(ds2) {
  const uid = String(ds2.uid || "");
  if (uid) {
    try {
      const res2 = await backendSrv.put(
        `/api/datasources/uid/${encodeURIComponent(uid)}`,
        ds2
      );
      return res2.data ?? ds2;
    } catch {
    }
  }
  const res = await backendSrv.post("/api/datasources", ds2);
  return res.data ?? ds2;
}
const SECRET_RE = /(authorization|token|password|secret|apikey|api[_-]?key|bearer|auth)\s*[:=]\s*['"]?[^'"\s,}]+/gi;
const JSON_SECRET_RE = /"(authorization|token|password|secret|apikey|api[_-]?key|auth)"\s*:\s*"[^"]*"/gi;
const SECRET_KEY_RE = /^(authorization|token|password|secret|apikey|api[_-]?key|bearer|auth)$/i;
function sanitizeErrorText(text) {
  return String(text ?? "").replace(JSON_SECRET_RE, '"$1":"[REDACTED]"').replace(SECRET_RE, "$1=[REDACTED]");
}
function redactEndpoint(endpoint) {
  if (!endpoint) return void 0;
  try {
    const u = new URL(endpoint);
    u.username = "";
    u.password = "";
    const parts = [];
    for (const [key, value] of u.searchParams.entries()) {
      if (/(token|auth|password|secret|key|bearer)/i.test(key)) {
        parts.push(`${encodeURIComponent(key)}=[REDACTED]`);
      } else {
        parts.push(`${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
      }
    }
    const base = `${u.origin}${u.pathname}`.replace(/\/\/:+@/, "//").replace(/\/\/@/, "//");
    return parts.length ? `${base}?${parts.join("&")}${u.hash || ""}` : `${base}${u.hash || ""}`;
  } catch {
    return sanitizeErrorText(endpoint);
  }
}
function sanitizeUnknown(value) {
  if (typeof value === "string") return sanitizeErrorText(value);
  if (Array.isArray(value)) return value.map(sanitizeUnknown);
  if (value && typeof value === "object") {
    const out = {};
    for (const [k, v] of Object.entries(value)) {
      out[k] = SECRET_KEY_RE.test(k) ? "[REDACTED]" : sanitizeUnknown(v);
    }
    return out;
  }
  return value;
}
const ALLOWED_DETAIL_KEYS = /* @__PURE__ */ new Set([
  "uid",
  "refId",
  "endpoint",
  "status",
  "upstreamCode",
  "retryAfterMs",
  "url",
  "signal"
]);
function pickDetails(details) {
  if (!details) return void 0;
  const cleaned = sanitizeUnknown(details);
  const out = {};
  for (const key of Object.keys(cleaned)) {
    if (!ALLOWED_DETAIL_KEYS.has(key)) continue;
    out[key] = cleaned[key];
  }
  if (out.endpoint) out.endpoint = redactEndpoint(String(out.endpoint));
  if (out.url) out.url = redactEndpoint(String(out.url));
  return out;
}
class DataSourceError extends Error {
  code;
  details;
  constructor(code, message, details) {
    super(sanitizeErrorText(message));
    this.name = "DataSourceError";
    this.code = code;
    this.details = pickDetails(details);
  }
  static fromHttpStatus(status, _statusText, url) {
    if (status === 401) {
      return new DataSourceError(
        "AUTH_REQUIRED",
        `数据源认证失败（${status}）`,
        { status, url }
      );
    }
    if (status === 403) {
      return new DataSourceError("FORBIDDEN", `数据源拒绝访问（${status}）`, {
        status,
        url
      });
    }
    if (status === 404) {
      return new DataSourceError("NOT_FOUND", `数据源资源不存在（${status}）`, {
        status,
        url
      });
    }
    if (status === 429) {
      return new DataSourceError(
        "RATE_LIMITED",
        `数据源请求过于频繁（${status}）`,
        { status, url }
      );
    }
    if (status >= 500) {
      return new DataSourceError(
        "UPSTREAM_ERROR",
        `数据源服务异常（${status}）`,
        { status, url }
      );
    }
    return new DataSourceError(
      "INVALID_RESPONSE",
      `数据源返回无效 HTTP 状态（${status}）`,
      {
        status,
        url
      }
    );
  }
  static fromNetwork(err, url) {
    if (err instanceof DataSourceError) return err;
    const msg = err instanceof Error ? err.message : String(err);
    const name = err instanceof Error ? err.name : "";
    if (name === "AbortError" || typeof DOMException !== "undefined" && err instanceof DOMException && err.name === "AbortError") {
      return new DataSourceError("CANCELLED", "数据源请求已取消", { url });
    }
    if (/^abort/i.test(msg) && !/timeout/i.test(msg)) {
      return new DataSourceError("CANCELLED", "数据源请求已取消", { url });
    }
    if (/timeout/i.test(msg)) {
      return new DataSourceError("TIMEOUT", "数据源请求超时", { url });
    }
    if (err instanceof TypeError || /failed to fetch|networkerror|cors/i.test(msg)) {
      return new DataSourceError(
        "CORS_BLOCKED",
        "Network/CORS failure — target must allow browser origin",
        {
          url
        }
      );
    }
    return new DataSourceError("NETWORK_ERROR", msg || "Network error", {
      url
    });
  }
}
function isDataSourceError(e) {
  return e instanceof DataSourceError;
}
function withDataSourceContext(error, ctx) {
  const base = error instanceof DataSourceError ? error : new DataSourceError(
    "UNKNOWN",
    error instanceof Error ? error.message : String(error ?? "未知错误")
  );
  return new DataSourceError(base.code, base.message, {
    ...base.details,
    uid: ctx.uid ?? base.details?.uid,
    refId: ctx.refId ?? base.details?.refId,
    endpoint: ctx.endpoint ?? base.details?.endpoint,
    status: ctx.status ?? base.details?.status,
    upstreamCode: ctx.upstreamCode ?? base.details?.upstreamCode,
    retryAfterMs: ctx.retryAfterMs ?? base.details?.retryAfterMs
  });
}
let provider = null;
const memory = /* @__PURE__ */ new Map();
function configureRuntimeCredentials(p) {
  provider = p;
}
function setRuntimeCredential(uid, cred) {
  if (!cred) memory.delete(uid);
  else memory.set(uid, cred);
}
async function getRuntimeCredential(uid) {
  if (memory.has(uid)) return memory.get(uid) ?? null;
  if (!provider) return null;
  const c = await provider(uid);
  return c ?? null;
}
function clearRuntimeCredentials() {
  memory.clear();
  provider = null;
}
function applyCredentialHeaders(headers, cred) {
  if (!cred) return headers;
  const out = { ...headers };
  if ((cred.kind === "bearer" || cred.kind === "session") && cred.value) {
    out.Authorization = `Bearer ${cred.value}`;
  } else if (cred.kind === "basic" && (cred.username != null || cred.password != null)) {
    const raw = `${cred.username ?? ""}:${cred.password ?? ""}`;
    out.Authorization = `Basic ${typeof btoa === "function" ? btoa(raw) : Buffer.from(raw).toString("base64")}`;
  } else if (cred.kind === "apiKey" && cred.value) {
    out[cred.headerName || "X-API-Key"] = cred.value;
  } else if (cred.kind === "headers" && cred.headers) {
    Object.assign(out, cred.headers);
  }
  return out;
}
const HTTP_LOG_MAX = 40;
const httpLog = [];
function redactUrl(url) {
  try {
    const u = new URL(url);
    for (const key of [...u.searchParams.keys()]) {
      if (/(token|auth|password|secret|key|bearer)/i.test(key))
        u.searchParams.set(key, "[REDACTED]");
    }
    return u.toString();
  } catch {
    return url.replace(
      /(authorization|token|password|secret|apikey|bearer)=([^&\s]+)/gi,
      "$1=[REDACTED]"
    );
  }
}
function previewBody(body, max = 4e3) {
  if (!body) return void 0;
  let text = sanitizeErrorText(body);
  text = text.replace(/"auth"\s*:\s*"[^"]*"/gi, '"auth":"[REDACTED]"');
  text = text.replace(/"token"\s*:\s*"[^"]*"/gi, '"token":"[REDACTED]"');
  text = text.replace(/"password"\s*:\s*"[^"]*"/gi, '"password":"[REDACTED]"');
  if (text.length > max) text = text.slice(0, max) + "…";
  return text;
}
function pushHttpLog(entry) {
  httpLog.push(entry);
  while (httpLog.length > HTTP_LOG_MAX) httpLog.shift();
}
function getDatasourceHttpLog(uid) {
  if (!uid) return [...httpLog];
  return httpLog.filter((e) => e.uid === uid);
}
function clearDatasourceHttpLog() {
  httpLog.length = 0;
}
function joinUrl(baseUrl2, path = "") {
  let base = baseUrl2;
  if (base.startsWith("/") && typeof globalThis !== "undefined" && globalThis.location?.origin) {
    base = `${globalThis.location.origin}${base}`;
  } else if (base.startsWith("/") && !base.startsWith("//")) {
    base = `http://local${base}`;
  }
  if (!base.endsWith("/")) base = `${base}/`;
  const p = path.startsWith("/") ? path.slice(1) : path;
  return new URL(p, base);
}
function mergeSignals$1(a, b) {
  if (!a) return b;
  if (!b) return a;
  if (typeof AbortSignal !== "undefined" && "any" in AbortSignal && typeof AbortSignal.any === "function") {
    return AbortSignal.any([a, b]);
  }
  const c = new AbortController();
  const onAbort = () => c.abort();
  if (a.aborted || b.aborted) c.abort();
  else {
    a.addEventListener("abort", onAbort);
    b.addEventListener("abort", onAbort);
  }
  return c.signal;
}
async function sleep(ms, signal) {
  if (ms <= 0) return;
  await new Promise((resolve, reject) => {
    const t2 = setTimeout(() => resolve(), ms);
    if (signal) {
      const onAbort = () => {
        clearTimeout(t2);
        reject(signal.reason || new DOMException("Aborted", "AbortError"));
      };
      if (signal.aborted) return onAbort();
      signal.addEventListener("abort", onAbort, { once: true });
    }
  });
}
function shouldRetry(status, req, attempt, maxRetries) {
  if (req.isWrite) return false;
  if (req.idempotent === false) return false;
  if (attempt >= maxRetries) return false;
  if (status === 401 || status === 403) return false;
  return status === 429 || status === 502 || status === 503 || status === 504;
}
async function datasourceHttp(req) {
  if (getBackendMode() === "offline" && !req.forceNetwork) {
    throw new DataSourceError(
      "OFFLINE",
      "Datasource HTTP disabled in offline mode"
    );
  }
  if (!req.baseUrl) {
    throw new DataSourceError("INVALID_RESPONSE", "Datasource URL is empty");
  }
  const url = joinUrl(req.baseUrl, req.path || "");
  if (req.query) {
    for (const [k, v] of Object.entries(req.query)) {
      if (v == null || v === "") continue;
      if (Array.isArray(v)) {
        for (const item of v) {
          if (item == null || item === "") continue;
          url.searchParams.append(k, String(item));
        }
      } else {
        url.searchParams.set(k, String(v));
      }
    }
  }
  let timeoutCtrl;
  let timer;
  let timedOut = false;
  if (req.timeoutMs && req.timeoutMs > 0) {
    timeoutCtrl = new AbortController();
    timer = setTimeout(() => {
      timedOut = true;
      timeoutCtrl.abort();
    }, req.timeoutMs);
  }
  const signal = mergeSignals$1(req.signal, timeoutCtrl?.signal);
  let cred = req.credential;
  if (cred === void 0 && req.uid) {
    cred = await getRuntimeCredential(req.uid);
  }
  const headers = applyCredentialHeaders(
    { Accept: "application/json", ...req.headers || {} },
    cred
  );
  const method = req.method || (req.body != null ? "POST" : "GET");
  let body;
  if (req.body != null && method !== "GET") {
    headers["Content-Type"] = headers["Content-Type"] || "application/json";
    body = JSON.stringify(req.body);
  }
  let finalMethod = method;
  let finalUrl = url;
  let finalBody = body;
  if (method === "GET" && url.toString().length > 2e3 && req.query) {
    finalMethod = "POST";
    finalUrl = joinUrl(req.baseUrl, req.path || "");
    headers["Content-Type"] = "application/x-www-form-urlencoded";
    const form = new URLSearchParams();
    for (const [k, v] of Object.entries(req.query)) {
      if (v == null || v === "") continue;
      if (Array.isArray(v)) {
        for (const item of v) {
          if (item == null || item === "") continue;
          form.append(k, String(item));
        }
      } else {
        form.append(k, String(v));
      }
    }
    finalBody = form.toString();
  }
  const started = Date.now();
  const logBase = {
    ts: started,
    uid: req.uid,
    method: finalMethod,
    url: redactUrl(finalUrl.toString()),
    bodyPreview: previewBody(finalBody)
  };
  const maxRetries = req.isWrite ? 0 : req.maxRetries ?? 1;
  let attempt = 0;
  try {
    while (true) {
      const client = getDatasourceHttpClient();
      const axiosRes = await client.request({
        url: finalUrl.toString(),
        method: finalMethod,
        headers,
        data: finalBody,
        signal,
        // omit cookies by default unless caller opts in
        withCredentials: req.credentials === "include" || req.credentials === "same-origin",
        responseType: "text",
        // timeout handled by outer timer + AbortSignal
        timeout: 0
      });
      const resHeaders = new NormalizedHeaders(axiosRes.headers);
      const headersOut = new Headers();
      resHeaders.forEach((v, k) => headersOut.set(k, v));
      const res = {
        ok: axiosRes.status >= 200 && axiosRes.status < 300,
        status: axiosRes.status,
        statusText: axiosRes.statusText || "",
        headers: headersOut,
        text: async () => typeof axiosRes.data === "string" ? axiosRes.data : axiosRes.data == null ? "" : String(axiosRes.data)
      };
      if (!res.ok) {
        if (shouldRetry(res.status, req, attempt, maxRetries)) {
          attempt += 1;
          let waitMs = res.status === 429 ? 1e3 : 250 * attempt;
          if (res.status === 429) {
            const ra = res.headers.get("Retry-After");
            if (ra) waitMs = Number(ra) < 100 ? Number(ra) * 1e3 : Number(ra);
          }
          await sleep(waitMs, signal);
          continue;
        }
        if (timer) clearTimeout(timer);
        pushHttpLog({
          ...logBase,
          status: res.status,
          durationMs: Date.now() - started,
          error: `HTTP ${res.status}`
        });
        if (res.status === 429) {
          const ra = res.headers.get("Retry-After");
          const retryAfterMs = ra ? Number(ra) < 100 ? Number(ra) * 1e3 : Number(ra) : void 0;
          throw new DataSourceError(
            "RATE_LIMITED",
            `Rate limited (${res.status})`,
            {
              status: res.status,
              url: finalUrl.toString(),
              retryAfterMs
            }
          );
        }
        throw DataSourceError.fromHttpStatus(
          res.status,
          res.statusText,
          finalUrl.toString()
        );
      }
      if (timer) clearTimeout(timer);
      if (res.status === 204) {
        pushHttpLog({
          ...logBase,
          status: 204,
          durationMs: Date.now() - started
        });
        return {
          data: null,
          status: 204,
          headers: res.headers,
          url: finalUrl.toString()
        };
      }
      const text = await res.text();
      const max = req.maxBodyBytes ?? 10485760;
      if (text.length > max) {
        pushHttpLog({
          ...logBase,
          status: res.status,
          durationMs: Date.now() - started,
          error: "response too large"
        });
        throw new DataSourceError(
          "INVALID_RESPONSE",
          `Response exceeds size limit (${max} bytes)`,
          {
            url: finalUrl.toString()
          }
        );
      }
      if (!text) {
        pushHttpLog({
          ...logBase,
          status: res.status,
          durationMs: Date.now() - started
        });
        return {
          data: null,
          status: res.status,
          headers: res.headers,
          url: finalUrl.toString()
        };
      }
      try {
        const data = JSON.parse(text);
        pushHttpLog({
          ...logBase,
          status: res.status,
          durationMs: Date.now() - started
        });
        return {
          data,
          status: res.status,
          headers: res.headers,
          url: finalUrl.toString()
        };
      } catch {
        pushHttpLog({
          ...logBase,
          status: res.status,
          durationMs: Date.now() - started,
          error: "invalid JSON"
        });
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Response is not valid JSON",
          {
            status: res.status,
            url: finalUrl.toString()
          }
        );
      }
    }
  } catch (e) {
    if (timer) clearTimeout(timer);
    if (timedOut) {
      const timeoutError = new DataSourceError(
        "TIMEOUT",
        `数据源请求在 ${req.timeoutMs}ms 后超时`,
        {
          url: finalUrl.toString()
        }
      );
      pushHttpLog({
        ...logBase,
        durationMs: Date.now() - started,
        error: timeoutError.message
      });
      throw timeoutError;
    }
    if (e instanceof DataSourceError) {
      if (!httpLog.some((x) => x.ts === started && x.uid === req.uid)) {
        pushHttpLog({
          ...logBase,
          durationMs: Date.now() - started,
          error: e.message
        });
      }
      throw e;
    }
    pushHttpLog({
      ...logBase,
      durationMs: Date.now() - started,
      error: e instanceof Error ? e.message : String(e)
    });
    throw DataSourceError.fromNetwork(e, finalUrl.toString());
  }
}
const DEFAULT_TTL_MS = 5 * 6e4;
const DEFAULT_MAX_BYTES = 32 * 1024 * 1024;
const store$2 = /* @__PURE__ */ new Map();
let totalBytes = 0;
let maxBytes = DEFAULT_MAX_BYTES;
let ttlMs = DEFAULT_TTL_MS;
const SENSITIVE_HEADER = /(authorization|cookie|token|password|secret|api[-_]?key|signoz-api-key)/i;
function configureQueryInspectorStore(opts) {
  if (opts?.maxBytes != null) maxBytes = opts.maxBytes;
  if (opts?.ttlMs != null) ttlMs = opts.ttlMs;
}
function clearQueryInspectorStore() {
  store$2.clear();
  totalBytes = 0;
}
function redactHeaders(h2) {
  if (!h2) return {};
  const out = {};
  for (const [k, v] of Object.entries(h2)) {
    out[k] = SENSITIVE_HEADER.test(k) ? "[REDACTED]" : v;
  }
  return out;
}
function redactBody(body) {
  if (body == null) return body;
  const text = typeof body === "string" ? body : JSON.stringify(body);
  const redacted = text.replace(/"auth"\s*:\s*"[^"]*"/gi, '"auth":"[REDACTED]"').replace(/"token"\s*:\s*"[^"]*"/gi, '"token":"[REDACTED]"').replace(/"password"\s*:\s*"[^"]*"/gi, '"password":"[REDACTED]"').replace(/Bearer\s+[A-Za-z0-9\-._~+/]+=*/g, "Bearer [REDACTED]");
  try {
    return JSON.parse(redacted);
  } catch {
    return redacted;
  }
}
function estimateBytes(value) {
  try {
    return new TextEncoder().encode(JSON.stringify(value)).length;
  } catch {
    return 0;
  }
}
function purgeExpired(now = Date.now()) {
  for (const [k, e] of store$2) {
    if (e.expiresAt <= now) {
      totalBytes -= e.bytes;
      store$2.delete(k);
    }
  }
}
function evictLru() {
  while (totalBytes > maxBytes && store$2.size) {
    const oldest = store$2.keys().next().value;
    if (!oldest) break;
    const e = store$2.get(oldest);
    totalBytes -= e.bytes;
    store$2.delete(oldest);
  }
}
function makeInspectorKey(requestId, datasourceUid) {
  return `${requestId}::${datasourceUid}`;
}
function putQueryInspectorEntry(input) {
  purgeExpired();
  const key = makeInspectorKey(input.requestId, input.datasourceUid);
  const request = {
    method: input.request?.method,
    url: input.request?.url,
    headers: redactHeaders(input.request?.headers),
    body: redactBody(input.request?.body)
  };
  const entry = {
    key,
    requestId: input.requestId,
    datasourceUid: input.datasourceUid,
    savedAt: Date.now(),
    expiresAt: Date.now() + (input.ttlMs ?? ttlMs),
    bytes: 0,
    request,
    response: input.response,
    stats: input.stats,
    warnings: input.warnings,
    capability: input.capability
  };
  entry.bytes = estimateBytes(entry);
  const prev = store$2.get(key);
  if (prev) totalBytes -= prev.bytes;
  store$2.delete(key);
  store$2.set(key, entry);
  totalBytes += entry.bytes;
  evictLru();
  return entry;
}
function getQueryInspectorEntry(requestId, datasourceUid) {
  purgeExpired();
  return store$2.get(makeInspectorKey(requestId, datasourceUid));
}
function listQueryInspectorEntries(datasourceUid) {
  purgeExpired();
  const all = [...store$2.values()];
  return datasourceUid ? all.filter((e) => e.datasourceUid === datasourceUid) : all;
}
function getQueryInspectorStats() {
  purgeExpired();
  return { entries: store$2.size, totalBytes, maxBytes, ttlMs };
}
const TYPE_ALIASES = {
  testdata: "grafana-testdata-datasource",
  testdatasource: "grafana-testdata-datasource",
  "test-data": "grafana-testdata-datasource",
  "grafana-testdata-datasource": "grafana-testdata-datasource",
  mixed: "mixed",
  "-- mixed --": "mixed",
  prometheus: "prometheus",
  prom: "prometheus",
  loki: "loki",
  zabbix: "alexanderzobnin-zabbix-datasource",
  "alexanderzobnin-zabbix-datasource": "alexanderzobnin-zabbix-datasource",
  signoz: "signoz"
};
function normalizeDataSourceType(type) {
  const raw = String(type ?? "").trim();
  if (!raw) return "";
  if (TYPE_ALIASES[raw]) return TYPE_ALIASES[raw];
  const lower = raw.toLowerCase();
  if (TYPE_ALIASES[lower]) return TYPE_ALIASES[lower];
  if (lower.includes("testdata") || lower.includes("test-data"))
    return "grafana-testdata-datasource";
  if (lower.includes("zabbix")) return "alexanderzobnin-zabbix-datasource";
  return raw;
}
function normalizeUid(uid) {
  if (uid == null || uid === "") return void 0;
  if (typeof uid === "string") {
    if (uid === "[object Object]") return void 0;
    return uid;
  }
  if (typeof uid === "object") {
    const o = uid;
    if (typeof o.uid === "string" && o.uid && o.uid !== "[object Object]")
      return o.uid;
  }
  return void 0;
}
function loadedIdentity(instances) {
  return [...instances.values()].map((d) => d.uid).sort().join(",") || "(empty)";
}
function createDataSourceCatalog() {
  const instances = /* @__PURE__ */ new Map();
  const appliedFingerprints = /* @__PURE__ */ new Map();
  let hooks = null;
  let ready = false;
  let readyWaiters = [];
  let configureChain = Promise.resolve();
  let configureSeq = 0;
  let lastDefaultConflictLog = "";
  function markReady() {
    ready = true;
    const waiters = readyWaiters;
    readyWaiters = [];
    for (const w of waiters) w();
  }
  function register2(ds2) {
    instances.set(ds2.uid, ds2);
    hooks?.registerRuntimeDataSource?.(ds2.uid, ds2);
  }
  function dispose(uid) {
    if (uid) {
      instances.get(uid)?.dispose?.();
      instances.delete(uid);
      appliedFingerprints.delete(uid);
      hooks?.unregisterRuntimeDataSource?.(uid);
      return;
    }
    for (const id of [...instances.keys()]) {
      dispose(id);
    }
  }
  function resolve(ref2) {
    if (typeof ref2 === "string") {
      const key = ref2.trim();
      if (!key) {
        throw new DataSourceError("DATASOURCE_REQUIRED", "缺少数据源引用", {
          ref: ref2,
          loaded: loadedIdentity(instances)
        });
      }
      const byUid2 = instances.get(key);
      if (byUid2) return byUid2;
      const byName = [...instances.values()].filter((d) => d.name === key);
      if (byName.length === 1) return byName[0];
      if (byName.length > 1) {
        throw new DataSourceError(
          "DATASOURCE_AMBIGUOUS",
          `数据源名称存在多个实例: ${key}`,
          {
            ref: ref2,
            loaded: loadedIdentity(instances)
          }
        );
      }
      const type2 = normalizeDataSourceType(key);
      if (type2) {
        const matches = [...instances.values()].filter(
          (d) => d.type === type2 || normalizeDataSourceType(d.type) === type2 || d.uid === key
        );
        if (type2 === "grafana-testdata-datasource") {
          const preferred = matches.find((d) => d.uid === "testdata") || matches.find((d) => /testdata/i.test(d.uid)) || (matches.length === 1 ? matches[0] : void 0);
          if (preferred) return preferred;
        }
        if (matches.length === 1) return matches[0];
        if (matches.length > 1) {
          throw new DataSourceError(
            "DATASOURCE_AMBIGUOUS",
            `数据源类型存在多个实例: ${key}`,
            { ref: ref2, loaded: loadedIdentity(instances) }
          );
        }
      }
      throw new DataSourceError(
        "DATASOURCE_NOT_FOUND",
        `数据源未找到: ${key}`,
        {
          uid: key,
          ref: ref2,
          loaded: loadedIdentity(instances)
        }
      );
    }
    const rawUid = ref2?.uid;
    const uid = normalizeUid(rawUid);
    const type = normalizeDataSourceType(
      typeof ref2?.type === "string" ? ref2.type : void 0
    );
    const name = typeof ref2?.name === "string" ? ref2.name : void 0;
    if (uid) {
      const hit = instances.get(uid);
      if (hit) {
        if (type && hit.type && normalizeDataSourceType(hit.type) !== type && hit.type !== type) {
          if (normalizeDataSourceType(hit.type) !== type) {
            throw new DataSourceError(
              "DATASOURCE_TYPE_MISMATCH",
              `数据源类型不匹配: expected ${type}, got ${hit.type}`,
              { uid, ref: ref2, loaded: loadedIdentity(instances) }
            );
          }
        }
        return hit;
      }
      if (type === "grafana-testdata-datasource" || /testdata/i.test(uid)) {
        const matches = [...instances.values()].filter(
          (d) => normalizeDataSourceType(d.type) === "grafana-testdata-datasource"
        );
        const preferred = matches.find((d) => d.uid === uid) || matches.find((d) => d.uid === "testdata") || (matches.length === 1 ? matches[0] : void 0);
        if (preferred) return preferred;
      }
      throw new DataSourceError(
        "DATASOURCE_NOT_FOUND",
        `数据源未找到: ${uid}`,
        {
          uid,
          ref: ref2,
          loaded: loadedIdentity(instances)
        }
      );
    }
    if (name) {
      const matches = [...instances.values()].filter(
        (d) => d.name === name || d.name?.toLowerCase() === name.toLowerCase()
      );
      if (matches.length === 1) return matches[0];
      if (matches.length > 1) {
        const preferred = matches.find((d) => d.uid === "testdata") || matches.find(
          (d) => normalizeDataSourceType(d.type) === "grafana-testdata-datasource"
        );
        const types = new Set(
          matches.map((d) => normalizeDataSourceType(d.type) || d.type)
        );
        if (preferred && types.size === 1) return preferred;
        throw new DataSourceError(
          "DATASOURCE_AMBIGUOUS",
          `数据源名称存在多个实例: ${name}`,
          {
            ref: ref2,
            loaded: loadedIdentity(instances)
          }
        );
      }
    }
    if (type) {
      const matches = [...instances.values()].filter(
        (d) => d.type === type || normalizeDataSourceType(d.type) === type
      );
      if (type === "grafana-testdata-datasource") {
        const preferred = matches.find((d) => d.uid === "testdata") || matches.find((d) => /testdata/i.test(d.uid)) || (matches.length === 1 ? matches[0] : void 0);
        if (preferred) return preferred;
      }
      if (matches.length === 0) {
        throw new DataSourceError(
          "DATASOURCE_NOT_FOUND",
          `数据源类型未找到: ${type}`,
          {
            ref: ref2,
            loaded: loadedIdentity(instances)
          }
        );
      }
      if (matches.length > 1) {
        throw new DataSourceError(
          "DATASOURCE_AMBIGUOUS",
          `数据源类型存在多个实例: ${type}`,
          { ref: ref2, loaded: loadedIdentity(instances) }
        );
      }
      return matches[0];
    }
    throw new DataSourceError("DATASOURCE_REQUIRED", "缺少数据源引用", {
      ref: ref2,
      loaded: loadedIdentity(instances)
    });
  }
  function tryResolve(ref2) {
    try {
      return resolve(ref2);
    } catch {
      return void 0;
    }
  }
  async function doConfigure(input) {
    if (!input?.getDataSourcePlugin) {
      throw new Error(
        "DataSourceCatalog.configure requires getDataSourcePlugin"
      );
    }
    hooks = input;
    const seq = ++configureSeq;
    let settings = input.settings;
    if (!settings) {
      const runtimeSettings = listRuntimeDataSourceSettings();
      let backendSettings = [];
      if (isGrafanaLiveConfigured()) {
        try {
          const res = await backendSrv.get("/api/datasources");
          const list = Array.isArray(res.data) ? res.data : res.data?.datasources ?? [];
          backendSettings = list.filter(
            (row) => Boolean(row?.uid && row?.type)
          ).map((row) => ({
            uid: String(row.uid),
            type: String(row.type),
            name: String(row.name || row.uid),
            url: typeof row.url === "string" ? row.url : void 0,
            access: typeof row.access === "string" ? row.access : "proxy",
            isDefault: !!row.isDefault,
            jsonData: row.jsonData && typeof row.jsonData === "object" ? row.jsonData : {},
            source: "backend"
          }));
        } catch {
          backendSettings = [];
        }
      }
      const seedSpecs = [
        ["testdata", "grafana-testdata-datasource", "TestData"],
        ["prometheus", "prometheus", "Prometheus"],
        ["loki", "loki", "Loki"],
        ["jaeger", "jaeger", "Jaeger"],
        ["pyroscope", "grafana-pyroscope-datasource", "Pyroscope"],
        ["mixed", "mixed", "Mixed"],
        ["-- Grafana --", "grafana", "Grafana"],
        ["dashboard", "dashboard", "Dashboard"]
      ];
      const seeds = seedSpecs.map(
        ([uid, type, name]) => ({
          uid,
          type,
          name,
          isDefault: false,
          jsonData: {},
          source: "seed"
        })
      );
      try {
        settings = mergeDataSourceSettings({
          runtime: runtimeSettings,
          backend: backendSettings,
          seeds
        });
      } catch (e) {
        const err = e;
        const msg = `${err?.code || "MERGE_ERROR"}:${err?.message || String(e)}`;
        if (msg !== lastDefaultConflictLog) {
          lastDefaultConflictLog = msg;
          console.error(
            "[DataSourceCatalog] merge failed",
            err?.code || err?.message || e
          );
        }
        settings = mergeDataSourceSettings({
          runtime: runtimeSettings.map((s) => ({ ...s, isDefault: false })),
          backend: backendSettings.map((s) => ({ ...s, isDefault: false })),
          seeds
        });
      }
    }
    if (seq !== configureSeq) return;
    const desired = /* @__PURE__ */ new Map();
    for (const row of settings ?? []) {
      if (!row?.uid || !row?.type) continue;
      desired.set(row.uid, row);
    }
    for (const uid of [...instances.keys()]) {
      if (!desired.has(uid)) ;
    }
    const settingsFingerprint = (row) => {
      const jd = row.jsonData || {};
      return [
        row.uid,
        row.type,
        row.url || "",
        row.access || "proxy",
        String(jd.dataMode ?? ""),
        String(jd.apiProfile ?? ""),
        String(jd.credentialMode ?? "")
      ].join("|");
    };
    for (const row of desired.values()) {
      const fp = settingsFingerprint(row);
      const existing = instances.get(row.uid);
      const prevFp = appliedFingerprints.get(row.uid);
      if (existing) {
        if (prevFp === void 0) {
          const existingUrl = String(existing.url || "").trim();
          const desiredUrl = String(row.url || "").trim();
          if (!desiredUrl || existingUrl) {
            appliedFingerprints.set(row.uid, fp);
            continue;
          }
          dispose(row.uid);
        } else if (prevFp === fp) {
          continue;
        } else {
          dispose(row.uid);
        }
      }
      const typeKey = normalizeDataSourceType(row.type) || row.type;
      const mod = input.getDataSourcePlugin(typeKey) || input.getDataSourcePlugin(row.type);
      if (!mod?.createDataSource) {
        if (typeof console !== "undefined") {
          console.warn(
            `[DataSourceCatalog] skip uid=${row.uid}: no createDataSource for type=${row.type}` + (typeKey !== row.type ? ` (normalized=${typeKey})` : "") + " — is the plugin registered?"
          );
        }
        continue;
      }
      const api = mod.createDataSource({
        uid: row.uid,
        type: row.type,
        name: row.name,
        url: row.url,
        access: row.access || "proxy",
        jsonData: row.jsonData || {},
        meta: mod.meta ?? {}
      });
      register2({
        uid: row.uid,
        type: row.type,
        name: row.name,
        ...api
      });
      appliedFingerprints.set(row.uid, fp);
    }
    markReady();
  }
  function configure(input = hooks) {
    const run = configureChain.then(() => doConfigure(input));
    configureChain = run.then(
      () => void 0,
      () => void 0
    );
    return run;
  }
  return {
    configure,
    list() {
      return [...instances.values()].map((d) => ({
        uid: d.uid,
        type: d.type,
        name: d.name
      }));
    },
    resolve,
    tryResolve,
    getInstances() {
      return instances;
    },
    register: register2,
    dispose,
    isReady() {
      return ready;
    },
    whenReady() {
      if (ready) return Promise.resolve();
      return new Promise((resolveReady) => {
        readyWaiters.push(resolveReady);
      });
    }
  };
}
let defaultCatalog = null;
function getDataSourceCatalog() {
  if (!defaultCatalog) defaultCatalog = createDataSourceCatalog();
  return defaultCatalog;
}
function resetDataSourceCatalog() {
  defaultCatalog?.dispose();
  defaultCatalog = null;
}
const index$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  DataSourceError,
  GrafanaAuthError,
  NormalizedHeaders,
  OFFLINE_STORAGE_KEYS,
  QueryScheduler,
  RuntimeDataSourceSettingsError,
  THEME_STORAGE_KEY,
  applyCredentialHeaders,
  applyGrafanaAuthHeaders,
  axiosHeadersToRecord,
  backendRequest,
  backendSrv,
  clearDatasourceHttpLog,
  clearQueryInspectorStore,
  clearRuntimeCredentials,
  clearRuntimeDataSourceSettings,
  configureBackendSrv,
  configureDatasourceHttpClient,
  configureQueryInspectorStore,
  configureRuntimeCredentials,
  configureRuntimeDataSourceSettings,
  createDataSourceCatalog,
  createDefaultBootData,
  createHttpClient,
  datasourceHttp,
  getAppHttp,
  getBackendHttp,
  getBackendMode,
  getBootData,
  getDataSourceByUid,
  getDataSourceCatalog,
  getDatasourceHttpClient,
  getDatasourceHttpLog,
  getEffectiveDefaultDataSource,
  getGrafanaAuthSnapshot,
  getGrafanaAuthToken,
  getGrafanaBaseUrl,
  getLiveDashboardBuilders,
  getQueryInspectorEntry,
  getQueryInspectorStats,
  getResourceHttp,
  getRuntimeCredential,
  getRuntimeDataSourceSettings,
  hasPermission,
  initTheme,
  isDataSourceError,
  isFeatureEnabled,
  isGrafanaLiveConfigured,
  listDataSources,
  listQueryInspectorEntries,
  listRuntimeDataSourceSettings,
  makeInspectorKey,
  mergeDataSourceSettings,
  normalizeDataSourceType,
  onThemeChange,
  putQueryInspectorEntry,
  readUrlTheme,
  redactToken,
  registerI18nCatalog,
  registerLiveDashboardBuilders,
  requireGrafanaAuthToken,
  resetDataSourceCatalog,
  resetHttpClients,
  resetOfflineStorage,
  resolveInitialPreference,
  sanitizeErrorText,
  saveDataSource,
  setBootData,
  setGrafanaAuthToken,
  setLocale,
  setRTL,
  setRuntimeCredential,
  t,
  useBootData,
  useI18n,
  useLocationService,
  usePermissions,
  useTheme,
  withDataSourceContext
}, Symbol.toStringTag, { value: "Module" }));
function buildCssVars(mode2) {
  const theme = createTheme({ colors: { mode: mode2 } });
  const colors = theme.colors;
  return {
    "--grafana-bg": colors.background.canvas,
    "--grafana-panel-bg": colors.background.primary,
    "--grafana-canvas-bg": colors.background.canvas,
    "--grafana-text": colors.text.primary,
    "--grafana-text-primary": colors.text.primary,
    "--grafana-text-secondary": colors.text.secondary,
    "--grafana-primary": colors.primary.main,
    "--grafana-primary-main": colors.primary.main,
    "--grafana-border": colors.border.medium,
    "--grafana-border-color-weak": colors.border.weak,
    "--grafana-border-color-medium": colors.border.medium,
    "--grafana-border-color-strong": colors.border.strong,
    "--grafana-error": colors.error.main,
    "--grafana-success": colors.success.main,
    "--grafana-warning": colors.warning.main,
    "--grafana-hover": colors.action.hover,
    "--grafana-action-hover": colors.action.hover,
    "--grafana-action-selected": colors.action.selected,
    "--grafana-action-focus": colors.action.focus,
    "--grafana-input-bg": theme.components.input.background,
    "--grafana-bg-canvas": colors.background.canvas,
    "--grafana-bg-page": colors.background.page,
    "--grafana-bg-primary": colors.background.primary,
    "--grafana-bg-secondary": colors.background.secondary,
    "--grafana-bg-elevated": colors.background.elevated,
    "--grafana-border-weak": colors.border.weak,
    "--grafana-border-medium": colors.border.medium,
    "--grafana-border-strong": colors.border.strong,
    "--grafana-primary-text": colors.primary.text,
    "--grafana-error-text": colors.error.text,
    "--grafana-success-text": colors.success.text,
    "--grafana-warning-text": colors.warning.text,
    "--grafana-input-border-hover": theme.components.input.borderHover,
    "--grafana-panel-content-bg": theme.components.panel.contentBg,
    "--grafana-overlay-bg": theme.components.overlay.background,
    "--grafana-table-header-bg": theme.components.table.headerBackground,
    "--grafana-table-row-hover-bg": theme.components.table.rowHoverBackground,
    "--grafana-table-row-selected-bg": theme.components.table.rowSelectedBackground,
    "--grafana-dropdown-bg": theme.components.dropdown.background,
    "--grafana-menu-bg": theme.components.menu.background,
    "--grafana-menu-active-bg": theme.components.menu.activeBackground,
    "--grafana-drawer-bg": theme.components.drawer.background
  };
}
const grafanaCssVars = {
  light: buildCssVars("light"),
  dark: buildCssVars("dark")
};
function applyThemeVars(mode2, el = document.documentElement, opts = {}) {
  const theme = createTheme({ colors: { mode: mode2 } });
  applyTheme2CssVars(theme, el);
  if (opts.direction) {
    applyTextDirection(opts.direction, el);
  }
}
function antDesignThemeTokens(mode2) {
  const v = grafanaCssVars[mode2];
  return {
    colorPrimary: v["--grafana-primary"],
    colorSuccess: v["--grafana-success"],
    colorWarning: v["--grafana-warning"],
    colorError: v["--grafana-error"],
    colorInfo: v["--grafana-primary"],
    colorText: v["--grafana-text"],
    colorTextSecondary: v["--grafana-text-secondary"],
    colorTextTertiary: v["--grafana-text-secondary"],
    colorTextDisabled: v["--grafana-text-secondary"],
    colorBgBase: v["--grafana-bg"],
    colorBgContainer: v["--grafana-panel-bg"],
    colorBgElevated: v["--grafana-bg-elevated"] || v["--grafana-dropdown-bg"] || v["--grafana-panel-bg"],
    colorBgLayout: v["--grafana-bg"],
    colorBgSpotlight: v["--grafana-hover"],
    colorBorder: v["--grafana-border-medium"] || v["--grafana-border"],
    colorBorderSecondary: v["--grafana-border-weak"] || v["--grafana-border"],
    colorFillSecondary: v["--grafana-table-header-bg"] || v["--grafana-hover"],
    colorFillTertiary: v["--grafana-hover"],
    colorFillQuaternary: v["--grafana-input-bg"],
    colorBgTextHover: v["--grafana-hover"],
    controlItemBgHover: v["--grafana-table-row-hover-bg"] || v["--grafana-hover"],
    controlItemBgActive: v["--grafana-table-row-selected-bg"] || v["--grafana-action-selected"] || v["--grafana-hover"],
    borderRadius: 6,
    borderRadiusLG: 10,
    borderRadiusSM: 4,
    fontFamily: "'Inter', 'Helvetica', 'Arial', sans-serif",
    fontSize: 14,
    colorLink: v["--grafana-primary-text"] || v["--grafana-primary"],
    controlHeight: 32,
    controlOutline: v["--grafana-action-focus"] || v["--grafana-hover"],
    colorPrimaryBorderHover: v["--grafana-input-border-hover"] || v["--grafana-border-strong"],
    colorBgContainerDisabled: v["--grafana-hover"],
    boxShadow: mode2 === "dark" ? "0px 1px 2px rgba(1, 4, 9, 0.75)" : "0px 1px 2px rgba(24, 26, 27, 0.2)",
    boxShadowSecondary: mode2 === "dark" ? "0px 4px 8px rgba(1, 4, 9, 0.75)" : "0px 4px 8px rgba(24, 26, 27, 0.2)"
  };
}
function applyTextDirection(direction, el = document.documentElement) {
  el.setAttribute("dir", direction);
  el.style.setProperty("--grafana-direction", direction);
  el.dataset.direction = direction;
}
function detectTextDirection(locale2) {
  const loc = locale2 || (typeof navigator !== "undefined" ? navigator.language : "en");
  return /^(ar|he|fa|ur)/i.test(loc) ? "rtl" : "ltr";
}
const __vite_glob_0_0$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.29,12l3.54-3.54a1,1,0,0,0,0-1.41,1,1,0,0,0-1.42,0L9.17,11.29a1,1,0,0,0,0,1.42L13.41,17a1,1,0,0,0,.71.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41Z"/></svg>';
const __vite_glob_0_1$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.83,11.29,10.59,7.05a1,1,0,0,0-1.42,0,1,1,0,0,0,0,1.41L12.71,12,9.17,15.54a1,1,0,0,0,0,1.41,1,1,0,0,0,.71.29,1,1,0,0,0,.71-.29l4.24-4.24A1,1,0,0,0,14.83,11.29Z"/></svg>';
const __vite_glob_0_2$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10,13H3a1,1,0,0,0-1,1v7a1,1,0,0,0,1,1h7a1,1,0,0,0,1-1V14A1,1,0,0,0,10,13ZM9,20H4V15H9ZM21,2H14a1,1,0,0,0-1,1v7a1,1,0,0,0,1,1h7a1,1,0,0,0,1-1V3A1,1,0,0,0,21,2ZM20,9H15V4h5Zm1,4H14a1,1,0,0,0-1,1v7a1,1,0,0,0,1,1h7a1,1,0,0,0,1-1V14A1,1,0,0,0,21,13Zm-1,7H15V15h5ZM10,2H3A1,1,0,0,0,2,3v7a1,1,0,0,0,1,1h7a1,1,0,0,0,1-1V3A1,1,0,0,0,10,2ZM9,9H4V4H9Z"/></svg>';
const __vite_glob_0_3$1 = '<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17,11H9.41l3.3-3.29a1,1,0,1,0-1.42-1.42l-5,5a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l5,5a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H17a1,1,0,0,0,0-2Z"/></svg>';
const __vite_glob_0_4$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.71,7.21a1,1,0,0,0-1.42,0L9.84,14.67,6.71,11.53A1,1,0,1,0,5.29,13l3.84,3.84a1,1,0,0,0,1.42,0l8.16-8.16A1,1,0,0,0,18.71,7.21Z"/></svg>';
const __vite_glob_0_5$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.32,9.55l-1.89-.63.89-1.78A1,1,0,0,0,20.13,6L18,3.87a1,1,0,0,0-1.15-.19l-1.78.89-.63-1.89A1,1,0,0,0,13.5,2h-3a1,1,0,0,0-.95.68L8.92,4.57,7.14,3.68A1,1,0,0,0,6,3.87L3.87,6a1,1,0,0,0-.19,1.15l.89,1.78-1.89.63A1,1,0,0,0,2,10.5v3a1,1,0,0,0,.68.95l1.89.63-.89,1.78A1,1,0,0,0,3.87,18L6,20.13a1,1,0,0,0,1.15.19l1.78-.89.63,1.89a1,1,0,0,0,.95.68h3a1,1,0,0,0,.95-.68l.63-1.89,1.78.89A1,1,0,0,0,18,20.13L20.13,18a1,1,0,0,0,.19-1.15l-.89-1.78,1.89-.63A1,1,0,0,0,22,13.5v-3A1,1,0,0,0,21.32,9.55ZM20,12.78l-1.2.4A2,2,0,0,0,17.64,16l.57,1.14-1.1,1.1L16,17.64a2,2,0,0,0-2.79,1.16l-.4,1.2H11.22l-.4-1.2A2,2,0,0,0,8,17.64l-1.14.57-1.1-1.1L6.36,16A2,2,0,0,0,5.2,13.18L4,12.78V11.22l1.2-.4A2,2,0,0,0,6.36,8L5.79,6.89l1.1-1.1L8,6.36A2,2,0,0,0,10.82,5.2l.4-1.2h1.56l.4,1.2A2,2,0,0,0,16,6.36l1.14-.57,1.1,1.1L17.64,8a2,2,0,0,0,1.16,2.79l1.2.4ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/></svg>';
const __vite_glob_0_6$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,8.94a1.31,1.31,0,0,0-.06-.27l0-.09a1.07,1.07,0,0,0-.19-.28h0l-6-6h0a1.07,1.07,0,0,0-.28-.19.32.32,0,0,0-.09,0A.88.88,0,0,0,14.05,2H10A3,3,0,0,0,7,5V6H6A3,3,0,0,0,3,9V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V18h1a3,3,0,0,0,3-3V9S21,9,21,8.94ZM15,5.41,17.59,8H16a1,1,0,0,1-1-1ZM15,19a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V9A1,1,0,0,1,6,8H7v7a3,3,0,0,0,3,3h5Zm4-4a1,1,0,0,1-1,1H10a1,1,0,0,1-1-1V5a1,1,0,0,1,1-1h3V7a3,3,0,0,0,3,3h3Z"/></svg>';
const __vite_glob_0_7$1 = '<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M12,14a1,1,0,0,0,1-1V7a1,1,0,0,0-2,0v6A1,1,0,0,0,12,14Zm0,4a1.25,1.25,0,1,0-1.25-1.25A1.25,1.25,0,0,0,12,18Z"/></svg>';
const __vite_glob_0_8$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18,10.82a1,1,0,0,0-1,1V19a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V8A1,1,0,0,1,5,7h7.18a1,1,0,0,0,0-2H5A3,3,0,0,0,2,8V19a3,3,0,0,0,3,3H16a3,3,0,0,0,3-3V11.82A1,1,0,0,0,18,10.82Zm3.92-8.2a1,1,0,0,0-.54-.54A1,1,0,0,0,21,2H15a1,1,0,0,0,0,2h3.59L8.29,14.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L20,5.41V9a1,1,0,0,0,2,0V3A1,1,0,0,0,21.92,2.62Z"/></svg>';
const __vite_glob_0_9$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.92,11.6C19.9,6.91,16.1,4,12,4S4.1,6.91,2.08,11.6a1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20s7.9-2.91,9.92-7.6A1,1,0,0,0,21.92,11.6ZM12,18c-3.17,0-6.17-2.29-7.9-6C5.83,8.29,8.83,6,12,6s6.17,2.29,7.9,6C18.17,15.71,15.17,18,12,18ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/></svg>';
const __vite_glob_0_10$1 = '<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M12,10a1,1,0,0,0-1,1v6a1,1,0,0,0,2,0V11A1,1,0,0,0,12,10Zm0-4a1.25,1.25,0,1,0,1.25,1.25A1.25,1.25,0,0,0,12,6Z"/></svg>';
const __vite_glob_0_11$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,7a2,2,0,1,0-2-2A2,2,0,0,0,12,7Zm0,10a2,2,0,1,0,2,2A2,2,0,0,0,12,17Zm0-7a2,2,0,1,0,2,2A2,2,0,0,0,12,10Z"/></svg>';
const __vite_glob_0_12$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,11H13V5a1,1,0,0,0-2,0v6H5a1,1,0,0,0,0,2h6v6a1,1,0,0,0,2,0V13h6a1,1,0,0,0,0-2Z"/></svg>';
const __vite_glob_0_13$1 = '<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M20.71,9.29l-6-6a1,1,0,0,0-.32-.21A1.09,1.09,0,0,0,14,3H6A3,3,0,0,0,3,6V18a3,3,0,0,0,3,3H18a3,3,0,0,0,3-3V10A1,1,0,0,0,20.71,9.29ZM9,5h4V7H9Zm6,14H9V16a1,1,0,0,1,1-1h4a1,1,0,0,1,1,1Zm4-1a1,1,0,0,1-1,1H17V16a3,3,0,0,0-3-3H10a3,3,0,0,0-3,3v3H6a1,1,0,0,1-1-1V6A1,1,0,0,1,6,5H7V8A1,1,0,0,0,8,9h6a1,1,0,0,0,1-1V6.41l4,4Z"/></svg>';
const __vite_glob_0_14$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"/></svg>';
const __vite_glob_0_15$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.28,3.43a3.23,3.23,0,0,0-3.29,0L8,8.84V6A3,3,0,0,0,2,6V18a3,3,0,0,0,6,0V15.16l9,5.37a3.28,3.28,0,0,0,1.68.47,3.24,3.24,0,0,0,1.61-.43,3.38,3.38,0,0,0,1.72-3V6.42A3.38,3.38,0,0,0,20.28,3.43ZM6,18a1,1,0,0,1-2,0V6A1,1,0,0,1,6,6Zm14-.42a1.4,1.4,0,0,1-.71,1.25,1.23,1.23,0,0,1-1.28,0L8.68,13.23a1.45,1.45,0,0,1,0-2.46L18,5.19A1.23,1.23,0,0,1,18.67,5a1.29,1.29,0,0,1,.62.17A1.4,1.4,0,0,1,20,6.42Z"/></svg>';
const __vite_glob_0_16$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.91,15.51H15.38a1,1,0,0,0,0,2h2.4A8,8,0,0,1,4,12a1,1,0,0,0-2,0,10,10,0,0,0,16.88,7.23V21a1,1,0,0,0,2,0V16.5A1,1,0,0,0,19.91,15.51ZM12,2A10,10,0,0,0,5.12,4.77V3a1,1,0,0,0-2,0V7.5a1,1,0,0,0,1,1h4.5a1,1,0,0,0,0-2H6.22A8,8,0,0,1,20,12a1,1,0,0,0,2,0A10,10,0,0,0,12,2Z"/></svg>';
const __vite_glob_0_17$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"/></svg>';
const __vite_glob_0_18$1 = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20,6H16V5a3,3,0,0,0-3-3H11A3,3,0,0,0,8,5V6H4A1,1,0,0,0,4,8H5V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V8h1a1,1,0,0,0,0-2ZM10,5a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1V6H10Zm7,14a1,1,0,0,1-1,1H8a1,1,0,0,1-1-1V8H17Z"/></svg>';
const registry = /* @__PURE__ */ new Map();
const modules = /* @__PURE__ */ Object.assign({
  "./assets/angle-left.svg": __vite_glob_0_0$1,
  "./assets/angle-right.svg": __vite_glob_0_1$1,
  "./assets/apps.svg": __vite_glob_0_2$1,
  "./assets/arrow-left.svg": __vite_glob_0_3$1,
  "./assets/check.svg": __vite_glob_0_4$1,
  "./assets/cog.svg": __vite_glob_0_5$1,
  "./assets/copy.svg": __vite_glob_0_6$1,
  "./assets/exclamation-triangle.svg": __vite_glob_0_7$1,
  "./assets/external-link-alt.svg": __vite_glob_0_8$1,
  "./assets/eye.svg": __vite_glob_0_9$1,
  "./assets/info.svg": __vite_glob_0_10$1,
  "./assets/more.svg": __vite_glob_0_11$1,
  "./assets/plus.svg": __vite_glob_0_12$1,
  "./assets/save.svg": __vite_glob_0_13$1,
  "./assets/search.svg": __vite_glob_0_14$1,
  "./assets/step-backward.svg": __vite_glob_0_15$1,
  "./assets/sync.svg": __vite_glob_0_16$1,
  "./assets/times.svg": __vite_glob_0_17$1,
  "./assets/trash.svg": __vite_glob_0_18$1
});
function parseSvg(svg) {
  const viewBoxMatch = svg.match(/viewBox="([^"]+)"/i);
  const viewBox = viewBoxMatch?.[1] ?? "0 0 24 24";
  const inner = svg.replace(/^[\s\S]*?<svg[^>]*>/i, "").replace(/<\/svg>\s*$/i, "");
  return { viewBox, body: inner.trim() };
}
for (const [path, svg] of Object.entries(modules)) {
  const file = path.split("/").pop().replace(/\.svg$/, "");
  const parsed = parseSvg(svg);
  registry.set(file, {
    name: file,
    svg,
    viewBox: parsed.viewBox,
    body: parsed.body
  });
}
const ALIASES$1 = {
  setting: "cog",
  settings: "cog",
  trash: "trash",
  "trash-alt": "trash",
  inspect: "search",
  share: "share-alt",
  "share-alt": "copy",
  // fallback if share missing
  more: "more",
  ellipsis: "more",
  "info-circle": "info",
  "exclamation-triangle": "exclamation-triangle",
  warning: "exclamation-triangle",
  fullscreen: "apps",
  expand: "apps",
  "expand-arrows": "apps",
  pen: "cog",
  edit: "cog",
  times: "times",
  close: "times",
  question: "info",
  dashboard: "apps",
  database: "apps",
  clock: "info",
  "clock-circle": "info",
  bell: "info",
  link: "copy",
  camera: "eye",
  "check-circle": "check",
  "step-backward": "times",
  // temporary until asset; LiveRenderer uses path via GIcon name
  "fullscreen-exit": "apps"
};
function registerIcon(def) {
  registry.set(def.name, def);
}
function resolveIconName(name) {
  if (registry.has(name)) return name;
  if (ALIASES$1[name] && registry.has(ALIASES$1[name])) return ALIASES$1[name];
  if (ALIASES$1[name]) return ALIASES$1[name];
  return name;
}
function getIcon(name, { strict = false } = {}) {
  const resolved = resolveIconName(name);
  const hit = registry.get(resolved) ?? registry.get(name);
  if (!hit && strict) {
    throw new Error(`unknown icon: ${name}`);
  }
  return hit;
}
registerIcon({
  name: "step-backward",
  viewBox: "0 0 24 24",
  body: '<path d="M20.28,3.43a3.23,3.23,0,0,0-3.29,0L8,8.84V6A3,3,0,0,0,2,6V18a3,3,0,0,0,6,0V15.16l9,5.37a3.28,3.28,0,0,0,1.68.47,3.24,3.24,0,0,0,1.61-.43,3.38,3.38,0,0,0,1.72-3V6.42A3.38,3.38,0,0,0,20.28,3.43ZM6,18a1,1,0,0,1-2,0V6A1,1,0,0,1,6,6Zm14-.42a1.4,1.4,0,0,1-.71,1.25,1.23,1.23,0,0,1-1.28,0L8.68,13.23a1.45,1.45,0,0,1,0-2.46L18,5.19A1.23,1.23,0,0,1,18.67,5a1.29,1.29,0,0,1,.62.17A1.4,1.4,0,0,1,20,6.42Z"/>'
});
for (const name of [
  "cog",
  "trash",
  "copy",
  "search",
  "plus",
  "save",
  "sync",
  "eye",
  "info",
  "check",
  "times",
  "more"
]) {
  if (!registry.has(name)) {
    registerIcon({ name, viewBox: "0 0 24 24", body: "" });
  }
}
function resolveIcon(_name) {
  return void 0;
}
const iconMap = {};
const _sfc_main$4B = /* @__PURE__ */ defineComponent({
  __name: "GButton",
  props: {
    variant: { default: "secondary" },
    size: { default: "md" },
    disabled: { type: Boolean },
    loading: { type: Boolean },
    htmlType: { default: "button" },
    testId: {}
  },
  setup(__props) {
    const props = __props;
    const type = computed(() => {
      if (props.variant === "primary") return "primary";
      if (props.variant === "destructive") return "primary";
      if (props.variant === "text") return "text";
      return "default";
    });
    const danger = computed(() => props.variant === "destructive");
    const size = computed(
      () => props.size === "sm" ? "small" : props.size === "lg" ? "large" : "middle"
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Button), {
        type: type.value,
        danger: danger.value,
        size: size.value,
        disabled: __props.disabled,
        loading: __props.loading,
        "html-type": __props.htmlType,
        "data-testid": __props.testId,
        class: "g-button"
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default", {}, void 0, true)
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["type", "danger", "size", "disabled", "loading", "html-type", "data-testid"]);
    };
  }
});
const _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const GButton = /* @__PURE__ */ _export_sfc(_sfc_main$4B, [["__scopeId", "data-v-087259e6"]]);
const _hoisted_1$3n = ["data-testid"];
const _sfc_main$4A = /* @__PURE__ */ defineComponent({
  __name: "GModal",
  props: {
    open: { type: Boolean },
    title: {},
    width: { default: 520 },
    confirmLoading: { type: Boolean },
    okText: { default: "确定" },
    cancelText: { default: "取消" },
    testId: {}
  },
  emits: ["update:open", "ok", "cancel"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Modal), {
        open: __props.open,
        title: __props.title,
        width: __props.width,
        "confirm-loading": __props.confirmLoading,
        "ok-text": __props.okText,
        "cancel-text": __props.cancelText,
        "onUpdate:open": _cache[0] || (_cache[0] = ($event) => emit("update:open", $event)),
        onOk: _cache[1] || (_cache[1] = ($event) => emit("ok")),
        onCancel: _cache[2] || (_cache[2] = ($event) => emit("cancel"))
      }, {
        default: withCtx(() => [
          createElementVNode("div", { "data-testid": __props.testId }, [
            renderSlot(_ctx.$slots, "default")
          ], 8, _hoisted_1$3n)
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["open", "title", "width", "confirm-loading", "ok-text", "cancel-text"]);
    };
  }
});
const _sfc_main$4z = /* @__PURE__ */ defineComponent({
  __name: "GSelect",
  props: {
    value: {},
    options: {},
    placeholder: {},
    disabled: { type: Boolean },
    allowClear: { type: Boolean },
    mode: {},
    testId: {},
    ariaLabel: {},
    showSearch: { type: Boolean, default: true },
    size: { default: "middle" },
    filterOption: { type: [Boolean, Function] },
    virtual: { type: Boolean, default: true }
  },
  emits: ["update:value", "change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const mode2 = computed(() => props.mode);
    function defaultFilterOption(input, option) {
      const q = String(input ?? "").trim().toLowerCase();
      if (!q) return true;
      const label = String(option?.label ?? option?.children ?? "").toLowerCase();
      const value = String(option?.value ?? "").toLowerCase();
      return label.includes(q) || value.includes(q);
    }
    const resolvedFilterOption = computed(() => {
      if (props.filterOption === void 0) return defaultFilterOption;
      return props.filterOption;
    });
    function onUpdate(v) {
      emit("update:value", v);
      emit("change", v);
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Select), {
        class: "g-select",
        value: __props.value,
        options: __props.options ?? [],
        placeholder: __props.placeholder || "请选择",
        disabled: __props.disabled,
        "allow-clear": __props.allowClear,
        mode: mode2.value,
        "show-search": __props.showSearch,
        size: __props.size,
        "option-filter-prop": "label",
        "filter-option": resolvedFilterOption.value,
        "data-testid": __props.testId,
        "aria-label": __props.ariaLabel || __props.placeholder || "Select",
        style: { "width": "100%" },
        "popup-class-name": "g-select-dropdown",
        virtual: __props.virtual,
        "onUpdate:value": onUpdate
      }, null, 8, ["value", "options", "placeholder", "disabled", "allow-clear", "mode", "show-search", "size", "filter-option", "data-testid", "aria-label", "virtual"]);
    };
  }
});
const GSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4z, [["__scopeId", "data-v-75041926"]]);
const _sfc_main$4y = /* @__PURE__ */ defineComponent({
  __name: "GForm",
  props: {
    layout: {},
    model: {},
    testId: {}
  },
  emits: ["finish", "finishFailed"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Form), {
        layout: __props.layout ?? "vertical",
        model: __props.model,
        "data-testid": __props.testId,
        onFinish: _cache[0] || (_cache[0] = ($event) => emit("finish", $event)),
        onFinishFailed: _cache[1] || (_cache[1] = ($event) => emit("finishFailed", $event))
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["layout", "model", "data-testid"]);
    };
  }
});
const _hoisted_1$3m = ["viewBox", "width", "height", "aria-hidden", "role", "aria-label", "data-icon-name", "innerHTML"];
const _hoisted_2$2G = ["title"];
const _sfc_main$4x = /* @__PURE__ */ defineComponent({
  __name: "GIcon",
  props: {
    name: {},
    size: { default: 16 },
    color: {},
    title: {},
    spin: { type: Boolean, default: false },
    strict: { type: Boolean, default: false }
  },
  setup(__props) {
    const props = __props;
    const icon = computed(() => getIcon(props.name, { strict: props.strict }));
    const px = computed(
      () => typeof props.size === "number" ? `${props.size}px` : props.size
    );
    return (_ctx, _cache) => {
      return icon.value ? (openBlock(), createElementBlock("svg", {
        key: 0,
        class: normalizeClass(["g-icon", { "is-spin": __props.spin }]),
        viewBox: icon.value.viewBox || "0 0 24 24",
        width: px.value,
        height: px.value,
        "aria-hidden": __props.title ? void 0 : "true",
        role: __props.title ? "img" : void 0,
        "aria-label": __props.title,
        style: normalizeStyle({ color: __props.color }),
        "data-testid": "g-icon",
        "data-icon-name": __props.name,
        innerHTML: icon.value.body || ""
      }, null, 14, _hoisted_1$3m)) : !__props.strict ? (openBlock(), createElementBlock("span", {
        key: 1,
        class: "g-icon-missing",
        title: __props.name,
        "data-testid": "g-icon-missing"
      }, "?", 8, _hoisted_2$2G)) : createCommentVNode("v-if", true);
    };
  }
});
const GIcon = /* @__PURE__ */ _export_sfc(_sfc_main$4x, [["__scopeId", "data-v-eaa1ba73"]]);
const _sfc_main$4w = /* @__PURE__ */ defineComponent({
  ...{ inheritAttrs: false },
  __name: "GInput",
  props: {
    value: {},
    modelValue: {},
    placeholder: {},
    type: { default: "text" },
    disabled: { type: Boolean },
    testId: {}
  },
  emits: ["update:value", "update:modelValue", "focus", "blur"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const attrs = useAttrs();
    const current = computed(
      () => props.modelValue !== void 0 ? props.modelValue : props.value
    );
    const resolvedTestId = computed(
      () => props.testId ?? attrs["data-testid"]
    );
    function onUpdate(v) {
      emit("update:value", v);
      emit("update:modelValue", v);
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Input), mergeProps(unref(attrs), {
        value: current.value,
        placeholder: __props.placeholder,
        type: __props.type,
        disabled: __props.disabled,
        "data-testid": resolvedTestId.value,
        "onUpdate:value": onUpdate,
        onFocus: _cache[0] || (_cache[0] = ($event) => emit("focus", $event)),
        onBlur: _cache[1] || (_cache[1] = ($event) => emit("blur", $event))
      }), null, 16, ["value", "placeholder", "type", "disabled", "data-testid"]);
    };
  }
});
const GInput = /* @__PURE__ */ _export_sfc(_sfc_main$4w, [["__scopeId", "data-v-b06821cd"]]);
const _sfc_main$4v = /* @__PURE__ */ defineComponent({
  __name: "GSwitch",
  props: {
    checked: { type: Boolean },
    disabled: { type: Boolean },
    testId: {}
  },
  emits: ["update:checked"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    function onChange(v) {
      emit("update:checked", !!v);
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Switch), {
        style: { width: "46px" },
        checked: __props.checked,
        disabled: __props.disabled,
        "data-testid": __props.testId,
        "onUpdate:checked": onChange
      }, null, 8, ["checked", "disabled", "data-testid"]);
    };
  }
});
const _sfc_main$4u = /* @__PURE__ */ defineComponent({
  __name: "GCheckbox",
  props: {
    checked: { type: Boolean },
    disabled: { type: Boolean },
    testId: {}
  },
  emits: ["update:checked"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Checkbox), {
        checked: __props.checked,
        disabled: __props.disabled,
        "data-testid": __props.testId,
        "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => emit("update:checked", $event))
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["checked", "disabled", "data-testid"]);
    };
  }
});
const _sfc_main$4t = /* @__PURE__ */ defineComponent({
  __name: "GTabs",
  props: {
    activeKey: {},
    items: {},
    testId: {}
  },
  emits: ["update:activeKey"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Tabs), {
        "active-key": __props.activeKey,
        "data-testid": __props.testId,
        "onUpdate:activeKey": _cache[0] || (_cache[0] = ($event) => emit("update:activeKey", String($event)))
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(__props.items, (it) => {
              return openBlock(), createBlock(unref(TabPane), {
                key: it.key,
                tab: it.label
              }, {
                default: withCtx(() => [
                  renderSlot(_ctx.$slots, it.key)
                ]),
                _: 2
                /* DYNAMIC */
              }, 1032, ["tab"]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["active-key", "data-testid"]);
    };
  }
});
const _sfc_main$4s = /* @__PURE__ */ defineComponent({
  __name: "GDrawer",
  props: {
    open: { type: Boolean },
    title: {},
    width: {},
    testId: {}
  },
  emits: ["update:open"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Drawer), {
        open: __props.open,
        title: __props.title,
        width: __props.width ?? 420,
        "data-testid": __props.testId,
        "onUpdate:open": _cache[0] || (_cache[0] = ($event) => emit("update:open", $event))
      }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["open", "title", "width", "data-testid"]);
    };
  }
});
const _sfc_main$4r = /* @__PURE__ */ defineComponent({
  __name: "GTooltip",
  props: {
    title: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Tooltip), { title: __props.title }, {
        default: withCtx(() => [
          renderSlot(_ctx.$slots, "default")
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["title"]);
    };
  }
});
const _sfc_main$4q = /* @__PURE__ */ defineComponent({
  __name: "GTable",
  props: {
    columns: {},
    dataSource: {},
    loading: { type: Boolean },
    testId: {},
    pagination: { type: [Boolean, Object] }
  },
  setup(__props) {
    const props = __props;
    const paginationOpt = computed(() => {
      if (props.pagination === true) return {};
      if (props.pagination === false || props.pagination == null)
        return false;
      return props.pagination;
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Table), {
        columns: __props.columns,
        "data-source": __props.dataSource,
        loading: __props.loading,
        pagination: paginationOpt.value,
        size: "small",
        "data-testid": __props.testId
      }, null, 8, ["columns", "data-source", "loading", "pagination", "data-testid"]);
    };
  }
});
const _hoisted_1$3l = ["data-testid"];
const _hoisted_2$2F = ["value", "readonly"];
const _sfc_main$4p = /* @__PURE__ */ defineComponent({
  __name: "GCodeEditor",
  props: {
    value: { default: "" },
    language: { default: "plaintext" },
    height: { default: 160 },
    readOnly: { type: Boolean, default: false },
    testId: {}
  },
  emits: ["update:value", "change"],
  setup(__props, { emit: __emit }) {
    function getDocumentThemeMode() {
      if (typeof document === "undefined") return "dark";
      const mode2 = document.documentElement.dataset.theme || document.body?.dataset.theme || "";
      return mode2 === "light" ? "light" : "dark";
    }
    function monacoThemeForMode(mode2) {
      return mode2 === "light" ? "vs" : "vs-dark";
    }
    const props = __props;
    const emit = __emit;
    const host = ref(null);
    const failed = ref(false);
    let editor = null;
    let monaco = null;
    let themeObserver = null;
    async function ensureMonaco() {
      if (monaco) return monaco;
      const mod = await import("monaco-editor");
      monaco = mod.default ?? mod;
      if (typeof Worker !== "undefined") {
        try {
          globalThis.MonacoEnvironment = {
            getWorker(_, _label) {
              return new Worker(
                new URL(
                  /* @vite-ignore */
                  "/assets/editor.worker-BhziHrDZ.js",
                  import.meta.url
                ),
                {
                  type: "module"
                }
              );
            }
          };
        } catch {
        }
      }
      try {
        registerLanguages(monaco);
      } catch {
      }
      return monaco;
    }
    function registerLanguages(m) {
      if (!(m.languages.getLanguages() || []).some((l) => l.id === "promql")) {
        m.languages.register({ id: "promql" });
        m.languages.setMonarchTokensProvider("promql", {
          tokenizer: {
            root: [
              [/#.*$/, "comment"],
              [
                /\b(sum|rate|irate|avg|min|max|count|topk|bottomk|histogram_quantile|increase|delta)\b/,
                "keyword"
              ],
              [/[{}=!,]/, "delimiter"],
              [/"([^"\\]|\\.)*"/, "string"],
              [/'([^'\\]|\\.)*'/, "string"],
              [/[0-9]+(\.[0-9]+)?/, "number"],
              [/[a-zA-Z_:][a-zA-Z0-9_:]*/, "identifier"]
            ]
          }
        });
      }
      if (!(m.languages.getLanguages() || []).some((l) => l.id === "logql")) {
        m.languages.register({ id: "logql" });
        m.languages.setMonarchTokensProvider("logql", {
          tokenizer: {
            root: [
              [/#.*$/, "comment"],
              [
                /\b(rate|count_over_time|sum|avg|max|min|unwrap|json|logfmt|line_format|label_format)\b/,
                "keyword"
              ],
              [/[{}=!~|]/, "delimiter"],
              [/"([^"\\]|\\.)*"/, "string"],
              [/`([^`\\]|\\.)*`/, "string"],
              [/[0-9]+(\.[0-9]+)?/, "number"],
              [/[a-zA-Z_][a-zA-Z0-9_]*/, "identifier"]
            ]
          }
        });
      }
      if (!(m.languages.getLanguages() || []).some((l) => l.id === "sql")) {
        m.languages.register({ id: "sql" });
        m.languages.setMonarchTokensProvider("sql", {
          tokenizer: {
            root: [
              [/--.*$/, "comment"],
              [
                /\b(SELECT|FROM|WHERE|GROUP|BY|ORDER|LIMIT|AS|AND|OR|JOIN|ON|INNER|LEFT|RIGHT|INSERT|UPDATE|DELETE|WITH)\b/i,
                "keyword"
              ],
              [/'([^'\\]|\\.)*'/, "string"],
              [/[0-9]+(\.[0-9]+)?/, "number"],
              [/[a-zA-Z_][a-zA-Z0-9_]*/, "identifier"]
            ]
          }
        });
      }
    }
    onMounted(async () => {
      if (!host.value) return;
      try {
        const m = await ensureMonaco();
        const mode2 = getDocumentThemeMode();
        editor = m.editor.create(host.value, {
          value: props.value,
          language: props.language,
          theme: monacoThemeForMode(mode2),
          minimap: { enabled: false },
          automaticLayout: true,
          fontSize: 12,
          lineNumbers: "on",
          scrollBeyondLastLine: false,
          wordWrap: "on",
          readOnly: props.readOnly,
          tabSize: 2
        });
        editor.onDidChangeModelContent(() => {
          const v = editor?.getValue() ?? "";
          emit("update:value", v);
          emit("change", v);
        });
        themeObserver = new MutationObserver(() => {
          if (!editor || !monaco) return;
          monaco.editor.setTheme(monacoThemeForMode(getDocumentThemeMode()));
        });
        themeObserver.observe(document.documentElement, {
          attributes: true,
          attributeFilter: ["data-theme", "class"]
        });
      } catch {
        failed.value = true;
      }
    });
    watch(
      () => props.value,
      (v) => {
        if (editor && editor.getValue() !== v) editor.setValue(v ?? "");
      }
    );
    watch(
      () => props.language,
      (lang) => {
        if (editor && monaco) {
          const model = editor.getModel();
          if (model) monaco.editor.setModelLanguage(model, lang || "plaintext");
        }
      }
    );
    onBeforeUnmount(() => {
      themeObserver?.disconnect();
      themeObserver = null;
      editor?.dispose();
      editor = null;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "g-code-editor",
        "data-testid": __props.testId || "code-editor",
        style: normalizeStyle({ height: typeof __props.height === "number" ? __props.height + "px" : __props.height })
      }, [
        withDirectives(createElementVNode(
          "div",
          {
            ref_key: "host",
            ref: host,
            class: "g-code-editor__monaco"
          },
          null,
          512
          /* NEED_PATCH */
        ), [
          [vShow, !failed.value]
        ]),
        failed.value ? (openBlock(), createElementBlock("textarea", {
          key: 0,
          class: "g-code-editor__fallback",
          value: __props.value,
          readonly: __props.readOnly,
          "data-testid": "code-editor-fallback",
          onInput: _cache[0] || (_cache[0] = ($event) => {
            emit("update:value", $event.target.value);
            emit("change", $event.target.value);
          })
        }, null, 40, _hoisted_2$2F)) : createCommentVNode("v-if", true)
      ], 12, _hoisted_1$3l);
    };
  }
});
const GCodeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4p, [["__scopeId", "data-v-9304afbe"]]);
const UNIT_CATEGORIES = [
  {
    name: "Misc",
    formats: [
      {
        label: "Number",
        value: "none"
      },
      {
        label: "String",
        value: "string"
      },
      {
        label: "short",
        value: "short"
      },
      {
        label: "SI short",
        value: "sishort"
      },
      {
        label: "Percent (0-100)",
        value: "percent"
      },
      {
        label: "Percent (0.0-1.0)",
        value: "percentunit"
      },
      {
        label: "Humidity (%H)",
        value: "humidity"
      },
      {
        label: "Decibel",
        value: "dB"
      },
      {
        label: "Candela (cd)",
        value: "candela"
      },
      {
        label: "Hexadecimal (0x)",
        value: "hex0x"
      },
      {
        label: "Hexadecimal",
        value: "hex"
      },
      {
        label: "Scientific notation",
        value: "sci"
      },
      {
        label: "Locale format",
        value: "locale"
      },
      {
        label: "Pixels",
        value: "pixel"
      }
    ]
  },
  {
    name: "Acceleration",
    formats: [
      {
        label: "Meters/sec²",
        value: "accMS2"
      },
      {
        label: "Feet/sec²",
        value: "accFS2"
      },
      {
        label: "G unit",
        value: "accG"
      }
    ]
  },
  {
    name: "Angle",
    formats: [
      {
        label: "Degrees (°)",
        value: "degree"
      },
      {
        label: "Radians",
        value: "radian"
      },
      {
        label: "Gradian",
        value: "grad"
      },
      {
        label: "Arc Minutes",
        value: "arcmin"
      },
      {
        label: "Arc Seconds",
        value: "arcsec"
      }
    ]
  },
  {
    name: "Area",
    formats: [
      {
        label: "Square Meters (m²)",
        value: "areaM2"
      },
      {
        label: "Square Feet (ft²)",
        value: "areaF2"
      },
      {
        label: "Square Miles (mi²)",
        value: "areaMI2"
      },
      {
        label: "Acres (ac)",
        value: "acres"
      },
      {
        label: "Hectares (ha)",
        value: "hectares"
      }
    ]
  },
  {
    name: "Computation",
    formats: [
      {
        label: "FLOP/s",
        value: "flops"
      },
      {
        label: "MFLOP/s",
        value: "mflops"
      },
      {
        label: "GFLOP/s",
        value: "gflops"
      },
      {
        label: "TFLOP/s",
        value: "tflops"
      },
      {
        label: "PFLOP/s",
        value: "pflops"
      },
      {
        label: "EFLOP/s",
        value: "eflops"
      },
      {
        label: "ZFLOP/s",
        value: "zflops"
      },
      {
        label: "YFLOP/s",
        value: "yflops"
      }
    ]
  },
  {
    name: "Concentration",
    formats: [
      {
        label: "parts-per-million (ppm)",
        value: "ppm"
      },
      {
        label: "parts-per-billion (ppb)",
        value: "conppb"
      },
      {
        label: "gram per cubic meter (g/m³)",
        value: "congm3"
      }
    ]
  },
  {
    name: "Currency",
    formats: [
      {
        label: "Dollars ($)",
        value: "currencyUSD"
      },
      {
        label: "Pounds (£)",
        value: "currencyGBP"
      },
      {
        label: "Euro (€)",
        value: "currencyEUR"
      },
      {
        label: "Yen (¥)",
        value: "currencyJPY"
      },
      {
        label: "Rubles (₽)",
        value: "currencyRUB"
      },
      {
        label: "Hryvnias (₴)",
        value: "currencyUAH"
      },
      {
        label: "Real (R$)",
        value: "currencyBRL"
      },
      {
        label: "Danish Krone (kr)",
        value: "currencyDKK"
      },
      {
        label: "Icelandic Króna (kr)",
        value: "currencyISK"
      },
      {
        label: "Norwegian Krone (kr)",
        value: "currencyNOK"
      },
      {
        label: "Swedish Krona (kr)",
        value: "currencySEK"
      },
      {
        label: "Czech koruna (czk)",
        value: "currencyCZK"
      },
      {
        label: "Swiss franc (CHF)",
        value: "currencyCHF"
      },
      {
        label: "Polish Złoty (PLN)",
        value: "currencyPLN"
      },
      {
        label: "Bitcoin (฿)",
        value: "currencyBTC"
      },
      {
        label: "Milli Bitcoin (฿)",
        value: "currencymBTC"
      },
      {
        label: "Micro Bitcoin (฿)",
        value: "currencyμBTC"
      },
      {
        label: "South African Rand (R)",
        value: "currencyZAR"
      },
      {
        label: "Indian Rupee (₹)",
        value: "currencyINR"
      },
      {
        label: "South Korean Won (₩)",
        value: "currencyKRW"
      },
      {
        label: "Indonesian Rupiah (Rp)",
        value: "currencyIDR"
      },
      {
        label: "Philippine Peso (PHP)",
        value: "currencyPHP"
      },
      {
        label: "Vietnamese Dong (VND)",
        value: "currencyVND"
      },
      {
        label: "Turkish Lira (₺)",
        value: "currencyTRY"
      },
      {
        label: "Malaysian Ringgit (RM)",
        value: "currencyMYR"
      },
      {
        label: "CFP franc (XPF)",
        value: "currencyXPF"
      },
      {
        label: "Bulgarian Lev (BGN)",
        value: "currencyBGN"
      },
      {
        label: "Guaraní (₲)",
        value: "currencyPYG"
      },
      {
        label: "Uruguay Peso (UYU)",
        value: "currencyUYU"
      },
      {
        label: "Israeli New Shekels (₪)",
        value: "currencyILS"
      }
    ]
  },
  {
    name: "Data",
    formats: [
      {
        label: "bytes(IEC)",
        value: "bytes"
      },
      {
        label: "bytes(SI)",
        value: "decbytes"
      },
      {
        label: "bits(IEC)",
        value: "bits"
      },
      {
        label: "bits(SI)",
        value: "decbits"
      },
      {
        label: "kibibytes",
        value: "kbytes"
      },
      {
        label: "kilobytes",
        value: "deckbytes"
      },
      {
        label: "mebibytes",
        value: "mbytes"
      },
      {
        label: "megabytes",
        value: "decmbytes"
      },
      {
        label: "gibibytes",
        value: "gbytes"
      },
      {
        label: "gigabytes",
        value: "decgbytes"
      },
      {
        label: "tebibytes",
        value: "tbytes"
      },
      {
        label: "terabytes",
        value: "dectbytes"
      },
      {
        label: "pebibytes",
        value: "pbytes"
      },
      {
        label: "petabytes",
        value: "decpbytes"
      }
    ]
  },
  {
    name: "Data rate",
    formats: [
      {
        label: "packets/sec",
        value: "pps"
      },
      {
        label: "bytes/sec(IEC)",
        value: "binBps"
      },
      {
        label: "bytes/sec(SI)",
        value: "Bps"
      },
      {
        label: "bits/sec(IEC)",
        value: "binbps"
      },
      {
        label: "bits/sec(SI)",
        value: "bps"
      },
      {
        label: "kibibytes/sec",
        value: "KiBs"
      },
      {
        label: "kibibits/sec",
        value: "Kibits"
      },
      {
        label: "kilobytes/sec",
        value: "KBs"
      },
      {
        label: "kilobits/sec",
        value: "Kbits"
      },
      {
        label: "mebibytes/sec",
        value: "MiBs"
      },
      {
        label: "mebibits/sec",
        value: "Mibits"
      },
      {
        label: "megabytes/sec",
        value: "MBs"
      },
      {
        label: "megabits/sec",
        value: "Mbits"
      },
      {
        label: "gibibytes/sec",
        value: "GiBs"
      },
      {
        label: "gibibits/sec",
        value: "Gibits"
      },
      {
        label: "gigabytes/sec",
        value: "GBs"
      },
      {
        label: "gigabits/sec",
        value: "Gbits"
      },
      {
        label: "tebibytes/sec",
        value: "TiBs"
      },
      {
        label: "tebibits/sec",
        value: "Tibits"
      },
      {
        label: "terabytes/sec",
        value: "TBs"
      },
      {
        label: "terabits/sec",
        value: "Tbits"
      },
      {
        label: "pebibytes/sec",
        value: "PiBs"
      },
      {
        label: "pebibits/sec",
        value: "Pibits"
      },
      {
        label: "petabytes/sec",
        value: "PBs"
      },
      {
        label: "petabits/sec",
        value: "Pbits"
      }
    ]
  },
  {
    name: "Date & time",
    formats: [
      {
        label: "Datetime ISO",
        value: "dateTimeAsIso"
      },
      {
        label: "Datetime US",
        value: "dateTimeAsUS"
      },
      {
        label: "Datetime local",
        value: "dateTimeAsLocal"
      },
      {
        label: "Datetime default",
        value: "dateTimeAsSystem"
      },
      {
        label: "From Now",
        value: "dateTimeFromNow"
      }
    ]
  },
  {
    name: "Energy",
    formats: [
      {
        label: "Watt (W)",
        value: "watt"
      },
      {
        label: "Kilowatt (kW)",
        value: "kwatt"
      },
      {
        label: "Megawatt (MW)",
        value: "megwatt"
      },
      {
        label: "Gigawatt (GW)",
        value: "gwatt"
      },
      {
        label: "Milliwatt (mW)",
        value: "mwatt"
      },
      {
        label: "Volt-Ampere (VA)",
        value: "voltamp"
      },
      {
        label: "Kilovolt-Ampere (kVA)",
        value: "kvoltamp"
      },
      {
        label: "Watt-hour (Wh)",
        value: "watth"
      },
      {
        label: "Kilowatt-hour (kWh)",
        value: "kwatth"
      },
      {
        label: "Kilowatt-min (kWm)",
        value: "kwattm"
      },
      {
        label: "Megawatt-hour (MWh)",
        value: "mwatth"
      },
      {
        label: "Ampere-hour (Ah)",
        value: "amph"
      },
      {
        label: "Kiloampere-hour (kAh)",
        value: "kamph"
      },
      {
        label: "Milliampere-hour (mAh)",
        value: "mamph"
      },
      {
        label: "Joule (J)",
        value: "joule"
      },
      {
        label: "Electron volt (eV)",
        value: "ev"
      },
      {
        label: "Ampere (A)",
        value: "amp"
      },
      {
        label: "Kiloampere (kA)",
        value: "kamp"
      },
      {
        label: "Milliampere (mA)",
        value: "mamp"
      },
      {
        label: "Volt (V)",
        value: "volt"
      },
      {
        label: "Kilovolt (kV)",
        value: "kvolt"
      },
      {
        label: "Millivolt (mV)",
        value: "mvolt"
      },
      {
        label: "Milliohm (mΩ)",
        value: "mohm"
      },
      {
        label: "Ohm (Ω)",
        value: "ohm"
      },
      {
        label: "Kiloohm (kΩ)",
        value: "kohm"
      },
      {
        label: "Megaohm (MΩ)",
        value: "Mohm"
      },
      {
        label: "Farad (F)",
        value: "farad"
      },
      {
        label: "Microfarad (µF)",
        value: "µfarad"
      },
      {
        label: "Nanofarad (nF)",
        value: "nfarad"
      },
      {
        label: "Picofarad (pF)",
        value: "pfarad"
      },
      {
        label: "Femtofarad (fF)",
        value: "ffarad"
      },
      {
        label: "Henry (H)",
        value: "henry"
      },
      {
        label: "Millihenry (mH)",
        value: "mhenry"
      },
      {
        label: "Microhenry (µH)",
        value: "µhenry"
      },
      {
        label: "Lumens (Lm)",
        value: "lumens"
      }
    ]
  },
  {
    name: "Flow",
    formats: [
      {
        label: "Gallons/min (gpm)",
        value: "flowgpm"
      },
      {
        label: "Cubic meters/sec (cms)",
        value: "flowcms"
      },
      {
        label: "Cubic feet/sec (cfs)",
        value: "flowcfs"
      },
      {
        label: "Cubic feet/min (cfm)",
        value: "flowcfm"
      },
      {
        label: "Litre/hour",
        value: "litreh"
      },
      {
        label: "Litre/min (L/min)",
        value: "flowlpm"
      },
      {
        label: "milliLitre/min (mL/min)",
        value: "flowmlpm"
      },
      {
        label: "Lux (lx)",
        value: "lux"
      }
    ]
  },
  {
    name: "Force",
    formats: [
      {
        label: "Newton-meters (Nm)",
        value: "forceNm"
      },
      {
        label: "Kilonewton-meters (kNm)",
        value: "forcekNm"
      },
      {
        label: "Newtons (N)",
        value: "forceN"
      },
      {
        label: "Kilonewtons (kN)",
        value: "forcekN"
      }
    ]
  },
  {
    name: "Hash rate",
    formats: [
      {
        label: "hashes/sec",
        value: "Hs"
      },
      {
        label: "kilohashes/sec",
        value: "KHs"
      },
      {
        label: "megahashes/sec",
        value: "MHs"
      },
      {
        label: "gigahashes/sec",
        value: "GHs"
      },
      {
        label: "terahashes/sec",
        value: "THs"
      },
      {
        label: "petahashes/sec",
        value: "PHs"
      },
      {
        label: "exahashes/sec",
        value: "EHs"
      }
    ]
  },
  {
    name: "Mass",
    formats: [
      {
        label: "milligram (mg)",
        value: "massmg"
      },
      {
        label: "gram (g)",
        value: "massg"
      },
      {
        label: "pound (lb)",
        value: "masslb"
      },
      {
        label: "kilogram (kg)",
        value: "masskg"
      },
      {
        label: "metric ton (t)",
        value: "masst"
      }
    ]
  },
  {
    name: "Length",
    formats: [
      {
        label: "millimeter (mm)",
        value: "lengthmm"
      },
      {
        label: "centimeter (cm)",
        value: "lengthcm"
      },
      {
        label: "inch (in)",
        value: "lengthin"
      },
      {
        label: "feet (ft)",
        value: "lengthft"
      },
      {
        label: "meter (m)",
        value: "lengthm"
      },
      {
        label: "kilometer (km)",
        value: "lengthkm"
      },
      {
        label: "mile (mi)",
        value: "lengthmi"
      }
    ]
  },
  {
    name: "Pressure",
    formats: [
      {
        label: "Millibars",
        value: "pressurembar"
      },
      {
        label: "Bars",
        value: "pressurebar"
      },
      {
        label: "Kilobars",
        value: "pressurekbar"
      },
      {
        label: "Pascals",
        value: "pressurepa"
      },
      {
        label: "Hectopascals",
        value: "pressurehpa"
      },
      {
        label: "Kilopascals",
        value: "pressurekpa"
      },
      {
        label: "Inches of mercury",
        value: "pressurehg"
      },
      {
        label: "PSI",
        value: "pressurepsi"
      }
    ]
  },
  {
    name: "Radiation",
    formats: [
      {
        label: "Becquerel (Bq)",
        value: "radbq"
      },
      {
        label: "curie (Ci)",
        value: "radci"
      },
      {
        label: "Gray (Gy)",
        value: "radgy"
      },
      {
        label: "rad",
        value: "radrad"
      },
      {
        label: "Sievert (Sv)",
        value: "radsv"
      },
      {
        label: "milliSievert (mSv)",
        value: "radmsv"
      },
      {
        label: "microSievert (µSv)",
        value: "radusv"
      },
      {
        label: "rem",
        value: "radrem"
      },
      {
        label: "Exposure (C/kg)",
        value: "radexpckg"
      },
      {
        label: "roentgen (R)",
        value: "radr"
      },
      {
        label: "Sievert/hour (Sv/h)",
        value: "radsvh"
      }
    ]
  },
  {
    name: "Rotational Speed",
    formats: [
      {
        label: "Hertz (Hz)",
        value: "rothz"
      },
      {
        label: "Kilohertz (kHz)",
        value: "rotkhz"
      },
      {
        label: "Megahertz (MHz)",
        value: "rotmhz"
      },
      {
        label: "Gigahertz (GHz)",
        value: "rotghz"
      }
    ]
  },
  {
    name: "Temperature",
    formats: [
      {
        label: "Celsius (°C)",
        value: "celsius"
      },
      {
        label: "Fahrenheit (°F)",
        value: "fahrenheit"
      },
      {
        label: "Kelvin (K)",
        value: "kelvin"
      }
    ]
  },
  {
    name: "Time",
    formats: [
      {
        label: "Hertz (1/s)",
        value: "hertz"
      },
      {
        label: "nanoseconds (ns)",
        value: "ns"
      },
      {
        label: "microseconds (µs)",
        value: "µs"
      },
      {
        label: "milliseconds (ms)",
        value: "ms"
      },
      {
        label: "seconds (s)",
        value: "s"
      },
      {
        label: "minutes (m)",
        value: "m"
      },
      {
        label: "hours (h)",
        value: "h"
      },
      {
        label: "days (d)",
        value: "d"
      },
      {
        label: "duration (ms)",
        value: "dtdurationms"
      },
      {
        label: "duration (s)",
        value: "dtdurations"
      },
      {
        label: "duration (hh:mm:ss)",
        value: "dthms"
      },
      {
        label: "duration (d hh:mm:ss)",
        value: "dtdhms"
      },
      {
        label: "Timeticks (s/100)",
        value: "timeticks"
      },
      {
        label: "clock (ms)",
        value: "clockms"
      },
      {
        label: "clock (s)",
        value: "clocks"
      }
    ]
  },
  {
    name: "Throughput",
    formats: [
      {
        label: "counts/sec (cps)",
        value: "cps"
      },
      {
        label: "ops/sec (ops)",
        value: "ops"
      },
      {
        label: "requests/sec (rps)",
        value: "reqps"
      },
      {
        label: "reads/sec (rps)",
        value: "rps"
      },
      {
        label: "writes/sec (wps)",
        value: "wps"
      },
      {
        label: "I/O ops/sec (iops)",
        value: "iops"
      },
      {
        label: "events/sec (eps)",
        value: "eps"
      },
      {
        label: "messages/sec (mps)",
        value: "mps"
      },
      {
        label: "records/sec (rps)",
        value: "recps"
      },
      {
        label: "rows/sec (rps)",
        value: "rowsps"
      },
      {
        label: "counts/min (cpm)",
        value: "cpm"
      },
      {
        label: "ops/min (opm)",
        value: "opm"
      },
      {
        label: "requests/min (rpm)",
        value: "reqpm"
      },
      {
        label: "reads/min (rpm)",
        value: "rpm"
      },
      {
        label: "writes/min (wpm)",
        value: "wpm"
      },
      {
        label: "events/min (epm)",
        value: "epm"
      },
      {
        label: "messages/min (mpm)",
        value: "mpm"
      },
      {
        label: "records/min (rpm)",
        value: "recpm"
      },
      {
        label: "rows/min (rpm)",
        value: "rowspm"
      }
    ]
  },
  {
    name: "Velocity",
    formats: [
      {
        label: "meters/second (m/s)",
        value: "velocityms"
      },
      {
        label: "kilometers/hour (km/h)",
        value: "velocitykmh"
      },
      {
        label: "miles/hour (mph)",
        value: "velocitymph"
      },
      {
        label: "knot (kn)",
        value: "velocityknot"
      }
    ]
  },
  {
    name: "Volume",
    formats: [
      {
        label: "millilitre (mL)",
        value: "mlitre"
      },
      {
        label: "litre (L)",
        value: "litre"
      },
      {
        label: "cubic meter",
        value: "m3"
      },
      {
        label: "Normal cubic meter",
        value: "Nm3"
      },
      {
        label: "cubic decimeter",
        value: "dm3"
      },
      {
        label: "gallons",
        value: "gallons"
      }
    ]
  },
  {
    name: "Boolean",
    formats: [
      {
        label: "True / False",
        value: "bool"
      },
      {
        label: "Yes / No",
        value: "bool_yes_no"
      },
      {
        label: "On / Off",
        value: "bool_on_off"
      }
    ]
  }
];
function flattenUnits() {
  const out = [{ label: "默认", value: "" }];
  for (const c of UNIT_CATEGORIES) {
    for (const f of c.formats)
      out.push({ label: `${c.name} / ${f.label}`, value: f.value });
  }
  return out;
}
const _sfc_main$4o = /* @__PURE__ */ defineComponent({
  __name: "UnitPicker",
  props: {
    modelValue: {},
    clearable: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => {
      const groups = [
        {
          label: "常用",
          options: [
            { label: "默认", value: "" },
            { label: "无", value: "none" },
            { label: "短格式", value: "short" },
            { label: "百分比 (0-100)", value: "percent" },
            { label: "百分比 (0-1)", value: "percentunit" }
          ]
        }
      ];
      for (const c of UNIT_CATEGORIES) {
        groups.push({
          label: c.name,
          options: c.formats.map((f) => ({ label: f.label, value: f.value }))
        });
      }
      return groups;
    });
    const value = computed(() => props.modelValue ?? "");
    function onChange(v) {
      if (v == null || v === "")
        emit("update:modelValue", props.clearable ? void 0 : "");
      else emit("update:modelValue", String(v));
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GSelect, {
        class: "unit-picker",
        "test-id": "unit-picker",
        value: value.value,
        options: options.value,
        "show-search": true,
        "allow-clear": "",
        placeholder: "选择单位",
        onChange
      }, null, 8, ["value", "options"]);
    };
  }
});
const UnitPicker = /* @__PURE__ */ _export_sfc(_sfc_main$4o, [["__scopeId", "data-v-c93d0ab4"]]);
const _hoisted_1$3k = {
  class: "color-picker",
  "data-testid": "color-picker"
};
const _hoisted_2$2E = ["value"];
const _sfc_main$4n = /* @__PURE__ */ defineComponent({
  __name: "ColorPicker",
  props: {
    modelValue: {},
    fieldMode: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const NAMED = [
      { label: "绿", value: "green" },
      { label: "红", value: "red" },
      { label: "蓝", value: "blue" },
      { label: "橙", value: "orange" },
      { label: "黄", value: "yellow" },
      { label: "紫", value: "purple" },
      { label: "半深蓝", value: "semi-dark-blue" },
      { label: "亮蓝", value: "light-blue" },
      { label: "超亮蓝", value: "super-light-blue" },
      { label: "深橙", value: "dark-orange" },
      { label: "文本", value: "text" }
    ];
    const hex = computed(() => {
      const v = props.modelValue;
      if (!v) return "#73BF69";
      if (typeof v === "string") {
        if (v.startsWith("#")) return v;
        return "#73BF69";
      }
      return v.fixedColor?.startsWith("#") ? v.fixedColor : "#73BF69";
    });
    const named = computed(() => {
      const v = props.modelValue;
      if (typeof v === "string" && !v.startsWith("#")) return v;
      return "";
    });
    function setHex(c) {
      emit("update:modelValue", c);
    }
    function setNamed(n) {
      if (n == null || n === "") return;
      emit("update:modelValue", String(n));
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3k, [
        createElementVNode("input", {
          type: "color",
          class: "swatch",
          value: hex.value,
          onInput: _cache[0] || (_cache[0] = ($event) => setHex($event.target.value))
        }, null, 40, _hoisted_2$2E),
        createVNode(GSelect, {
          class: "named",
          value: named.value,
          options: NAMED,
          "allow-clear": "",
          placeholder: "命名色 / 自定义",
          "show-search": true,
          onChange: setNamed
        }, null, 8, ["value"])
      ]);
    };
  }
});
const ColorPicker = /* @__PURE__ */ _export_sfc(_sfc_main$4n, [["__scopeId", "data-v-e1135e18"]]);
const _hoisted_1$3j = {
  class: "field-color",
  "data-testid": "field-color-editor"
};
const _hoisted_2$2D = {
  key: 0,
  class: "fixed-row"
};
const _hoisted_3$2h = ["value"];
const _hoisted_4$1V = { class: "hint" };
const _hoisted_5$1I = {
  key: 1,
  class: "series-by"
};
const _sfc_main$4m = /* @__PURE__ */ defineComponent({
  __name: "FieldColorEditor",
  props: {
    modelValue: {},
    byValueSupport: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const MODE_GROUPS = [
      {
        label: "单色",
        options: [
          { label: "单色", value: "fixed" },
          { label: "色阶", value: "shades" }
        ]
      },
      {
        label: "按序列",
        options: [
          { label: "经典色板", value: "palette-classic" },
          { label: "经典色板（按名）", value: "palette-classic-by-name" },
          { label: "色盲安全", value: "palette-colorblind" }
        ]
      },
      {
        label: "按值",
        options: [
          { label: "来自阈值", value: "thresholds" },
          { label: "绿-黄-红", value: "continuous-GrYlRd" },
          { label: "红-黄-绿", value: "continuous-RdYlGr" },
          { label: "蓝-黄-红", value: "continuous-BlYlRd" },
          { label: "黄-红", value: "continuous-YlRd" },
          { label: "蓝-紫", value: "continuous-BlPu" },
          { label: "黄-蓝", value: "continuous-YlBl" },
          { label: "蓝色系", value: "continuous-blues" },
          { label: "红色系", value: "continuous-reds" },
          { label: "绿色系", value: "continuous-greens" },
          { label: "紫色系", value: "continuous-purples" },
          { label: "Viridis", value: "continuous-viridis" },
          { label: "Magma", value: "continuous-magma" },
          { label: "Plasma", value: "continuous-plasma" },
          { label: "Inferno", value: "continuous-inferno" },
          { label: "Cividis", value: "continuous-cividis" }
        ]
      }
    ];
    const value = computed(() => {
      const v = props.modelValue;
      if (!v) return { mode: "palette-classic" };
      if (typeof v === "string") return { mode: "fixed", fixedColor: v };
      return { mode: "palette-classic", ...v };
    });
    const mode2 = computed(() => value.value.mode ?? "palette-classic");
    const needsFixed = computed(
      () => mode2.value === "fixed" || mode2.value === "shades" || mode2.value === "gradient"
    );
    const isByValue = computed(
      () => mode2.value === "thresholds" || String(mode2.value).startsWith("continuous-")
    );
    function setMode(m) {
      emit("update:modelValue", { ...value.value, mode: String(m) });
    }
    function setFixed(c) {
      emit("update:modelValue", {
        ...value.value,
        mode: mode2.value || "fixed",
        fixedColor: c
      });
    }
    function setSeriesBy(s) {
      emit("update:modelValue", { ...value.value, seriesBy: s });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3j, [
        createVNode(GSelect, {
          class: "mode",
          value: mode2.value,
          options: MODE_GROUPS,
          "show-search": true,
          placeholder: "配色方案",
          onChange: setMode
        }, null, 8, ["value", "options"]),
        needsFixed.value ? (openBlock(), createElementBlock("div", _hoisted_2$2D, [
          createElementVNode("input", {
            type: "color",
            class: "swatch",
            "data-testid": "field-color-fixed",
            value: value.value.fixedColor || "#73BF69",
            onInput: _cache[0] || (_cache[0] = ($event) => setFixed($event.target.value))
          }, null, 40, _hoisted_3$2h),
          createElementVNode(
            "span",
            _hoisted_4$1V,
            toDisplayString(mode2.value === "shades" ? "基准色" : "固定色"),
            1
            /* TEXT */
          )
        ])) : createCommentVNode("v-if", true),
        isByValue.value ? (openBlock(), createElementBlock("div", _hoisted_5$1I, [
          _cache[4] || (_cache[4] = createElementVNode(
            "span",
            { class: "hint" },
            "按值取色依据",
            -1
            /* CACHED */
          )),
          createVNode(unref(Radio).Group, {
            size: "small",
            "button-style": "solid",
            value: value.value.seriesBy || "last",
            "onUpdate:value": setSeriesBy
          }, {
            default: withCtx(() => [
              createVNode(unref(Radio).Button, { value: "last" }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "Last",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(unref(Radio).Button, { value: "min" }, {
                default: withCtx(() => [..._cache[2] || (_cache[2] = [
                  createTextVNode(
                    "Min",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(unref(Radio).Button, { value: "max" }, {
                default: withCtx(() => [..._cache[3] || (_cache[3] = [
                  createTextVNode(
                    "Max",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              })
            ]),
            _: 1
            /* STABLE */
          }, 8, ["value"])
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const FieldColorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4m, [["__scopeId", "data-v-5f163aff"]]);
const _hoisted_1$3i = {
  class: "thresholds",
  "data-testid": "thresholds-editor"
};
const _hoisted_2$2C = { class: "row" };
const _hoisted_3$2g = ["value", "onInput"];
const _sfc_main$4l = /* @__PURE__ */ defineComponent({
  __name: "ThresholdsEditor",
  props: {
    modelValue: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const modeOptions = [
      { label: "绝对值", value: "absolute" },
      { label: "百分比", value: "percentage" }
    ];
    const value = computed(() => {
      const v = props.modelValue;
      if (v?.steps?.length) return v;
      return {
        mode: "absolute",
        steps: [
          { value: -Infinity, color: "green" },
          { value: 80, color: "red" }
        ]
      };
    });
    function emitNext(next) {
      emit("update:modelValue", next);
    }
    function setMode(mode2) {
      emitNext({ ...value.value, mode: String(mode2) });
    }
    function setStep(i, patch) {
      const steps = value.value.steps.map(
        (s, idx) => idx === i ? { ...s, ...patch } : s
      );
      emitNext({ ...value.value, steps });
    }
    function addStep() {
      const last = value.value.steps[value.value.steps.length - 1];
      const nextVal = Number.isFinite(last?.value) ? last.value + 10 : 50;
      emitNext({
        ...value.value,
        steps: [...value.value.steps, { value: nextVal, color: "#EAB839" }]
      });
    }
    function removeStep(i) {
      if (i === 0) return;
      emitNext({
        ...value.value,
        steps: value.value.steps.filter((_, idx) => idx !== i)
      });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3i, [
        createElementVNode("div", _hoisted_2$2C, [
          _cache[0] || (_cache[0] = createElementVNode(
            "label",
            null,
            "模式",
            -1
            /* CACHED */
          )),
          createVNode(GSelect, {
            value: value.value.mode,
            options: modeOptions,
            "show-search": false,
            onChange: setMode
          }, null, 8, ["value"])
        ]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(value.value.steps, (s, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "step"
            }, [
              createElementVNode("input", {
                type: "color",
                value: typeof s.color === "string" && s.color.startsWith("#") ? s.color : "#73BF69",
                onInput: ($event) => setStep(i, { color: $event.target.value })
              }, null, 40, _hoisted_3$2g),
              createVNode(GInput, {
                type: "number",
                disabled: i === 0,
                value: i === 0 ? "" : s.value,
                placeholder: i === 0 ? "基准" : "数值",
                "onUpdate:value": ($event) => setStep(i, { value: Number($event) })
              }, null, 8, ["disabled", "value", "placeholder", "onUpdate:value"]),
              i > 0 ? (openBlock(), createBlock(GButton, {
                key: 0,
                size: "sm",
                variant: "text",
                onClick: ($event) => removeStep(i)
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])) : createCommentVNode("v-if", true)
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(GButton, {
          size: "sm",
          "test-id": "thresholds-add",
          onClick: addStep
        }, {
          default: withCtx(() => [..._cache[2] || (_cache[2] = [
            createTextVNode(
              "+ 添加阈值",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ThresholdsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4l, [["__scopeId", "data-v-ba651224"]]);
const _hoisted_1$3h = {
  class: "mappings",
  "data-testid": "value-mappings-editor"
};
const _hoisted_2$2B = ["data-testid"];
const _hoisted_3$2f = ["value", "onInput"];
const _hoisted_4$1U = { class: "add-row" };
const _sfc_main$4k = /* @__PURE__ */ defineComponent({
  __name: "ValueMappingsEditor",
  props: {
    modelValue: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const kindOptions = [
      { label: "值", value: "value" },
      { label: "范围", value: "range" },
      { label: "正则", value: "regex" },
      { label: "特殊", value: "special" }
    ];
    const specialOptions = [
      { label: "空值 (null)", value: "null" },
      { label: "非数字 (NaN)", value: "nan" },
      { label: "空值 + NaN", value: "null+nan" },
      { label: "真", value: "true" },
      { label: "假", value: "false" },
      { label: "空字符串", value: "empty" }
    ];
    const rows = ref([]);
    function flatten(list) {
      const out = [];
      for (const m of list) {
        if (m.type === "value") {
          for (const [k, v] of Object.entries(m.options ?? {})) {
            out.push({ kind: "value", match: k, text: v.text, color: v.color });
          }
        } else if (m.type === "range") {
          for (const r of m.options ?? []) {
            out.push({
              kind: "range",
              match: "",
              from: r.from,
              to: r.to,
              text: r.result?.text ?? "",
              color: r.result?.color
            });
          }
        } else if (m.type === "regex") {
          for (const r of m.options ?? []) {
            out.push({
              kind: "regex",
              match: r.pattern,
              text: r.result?.text ?? "",
              color: r.result?.color
            });
          }
        } else if (m.type === "special") {
          for (const r of m.options ?? []) {
            out.push({
              kind: "special",
              match: r.match,
              text: r.result?.text ?? "",
              color: r.result?.color
            });
          }
        }
      }
      return out.length ? out : [{ kind: "value", match: "", text: "", color: "#ffffff" }];
    }
    watch(
      () => props.modelValue,
      (v) => {
        rows.value = flatten(v ?? []);
      },
      { immediate: true, deep: true }
    );
    function commit(next) {
      rows.value = next;
      const valueOpts = {};
      const rangeOpts = [];
      const regexOpts = [];
      const specialOpts = [];
      for (const r of next) {
        const result = { text: r.text, color: r.color || void 0 };
        if (r.kind === "value" && r.match !== "") valueOpts[r.match] = result;
        else if (r.kind === "range")
          rangeOpts.push({
            from: Number(r.from ?? 0),
            to: Number(r.to ?? 0),
            result
          });
        else if (r.kind === "regex" && r.match)
          regexOpts.push({ pattern: r.match, result });
        else if (r.kind === "special" && r.match)
          specialOpts.push({ match: r.match, result });
      }
      const out = [];
      if (Object.keys(valueOpts).length)
        out.push({ type: "value", options: valueOpts });
      if (rangeOpts.length) out.push({ type: "range", options: rangeOpts });
      if (regexOpts.length) out.push({ type: "regex", options: regexOpts });
      if (specialOpts.length) out.push({ type: "special", options: specialOpts });
      emit(
        "update:modelValue",
        out.length ? out : [{ type: "value", options: {} }]
      );
    }
    function patchRow(i, patch) {
      const next = rows.value.map((r, idx) => idx === i ? { ...r, ...patch } : r);
      commit(next);
    }
    function add(kind2 = "value") {
      const base = kind2 === "range" ? { kind: kind2, match: "", from: 0, to: 100, text: "", color: "#73BF69" } : kind2 === "special" ? { kind: kind2, match: "null", text: "N/A", color: "#FADE2A" } : {
        kind: kind2,
        match: kind2 === "regex" ? ".*" : String(rows.value.length),
        text: "",
        color: "#73BF69"
      };
      commit([...rows.value, base]);
    }
    function remove(i) {
      const next = rows.value.filter((_, idx) => idx !== i);
      commit(
        next.length ? next : [{ kind: "value", match: "", text: "", color: "#ffffff" }]
      );
    }
    const addKind = ref("value");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3h, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (r, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row",
              "data-testid": `mapping-row-${i}`
            }, [
              createVNode(GSelect, {
                class: "kind",
                value: r.kind,
                options: kindOptions,
                "show-search": false,
                onChange: ($event) => patchRow(i, { kind: String($event) })
              }, null, 8, ["value", "onChange"]),
              r.kind === "range" ? (openBlock(), createElementBlock(
                Fragment,
                { key: 0 },
                [
                  createVNode(GInput, {
                    class: "narrow",
                    type: "number",
                    placeholder: "从",
                    value: r.from,
                    "onUpdate:value": ($event) => patchRow(i, { from: Number($event) })
                  }, null, 8, ["value", "onUpdate:value"]),
                  createVNode(GInput, {
                    class: "narrow",
                    type: "number",
                    placeholder: "到",
                    value: r.to,
                    "onUpdate:value": ($event) => patchRow(i, { to: Number($event) })
                  }, null, 8, ["value", "onUpdate:value"])
                ],
                64
                /* STABLE_FRAGMENT */
              )) : r.kind === "special" ? (openBlock(), createBlock(GSelect, {
                key: 1,
                value: r.match,
                options: specialOptions,
                "show-search": false,
                onChange: ($event) => patchRow(i, { match: String($event ?? "") })
              }, null, 8, ["value", "onChange"])) : (openBlock(), createBlock(GInput, {
                key: 2,
                placeholder: r.kind === "regex" ? "正则表达式" : "值",
                value: r.match,
                "onUpdate:value": ($event) => patchRow(i, { match: String($event ?? "") })
              }, null, 8, ["placeholder", "value", "onUpdate:value"])),
              createVNode(GInput, {
                placeholder: "显示文本",
                value: r.text,
                "onUpdate:value": ($event) => patchRow(i, { text: String($event ?? "") })
              }, null, 8, ["value", "onUpdate:value"]),
              createElementVNode("input", {
                type: "color",
                value: r.color?.startsWith("#") ? r.color : "#ffffff",
                onInput: ($event) => patchRow(i, { color: $event.target.value })
              }, null, 40, _hoisted_3$2f),
              createVNode(GButton, {
                size: "sm",
                variant: "text",
                title: "删除",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[2] || (_cache[2] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ], 8, _hoisted_2$2B);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createElementVNode("div", _hoisted_4$1U, [
          createVNode(GSelect, {
            class: "kind",
            value: addKind.value,
            options: kindOptions,
            "show-search": false,
            "test-id": "mapping-add-kind",
            onChange: _cache[0] || (_cache[0] = ($event) => addKind.value = String($event))
          }, null, 8, ["value"]),
          createVNode(GButton, {
            size: "sm",
            "test-id": "mapping-add",
            onClick: _cache[1] || (_cache[1] = ($event) => add(addKind.value))
          }, {
            default: withCtx(() => [..._cache[3] || (_cache[3] = [
              createTextVNode(
                "+ 添加值映射",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ])
      ]);
    };
  }
});
const ValueMappingsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4k, [["__scopeId", "data-v-9c82a4ee"]]);
const _hoisted_1$3g = {
  class: "data-links",
  "data-testid": "data-links-editor"
};
const _hoisted_2$2A = ["data-testid"];
const _hoisted_3$2e = { class: "field-wrap" };
const _hoisted_4$1T = {
  key: 0,
  class: "suggest",
  "data-testid": "data-link-title-suggestions"
};
const _hoisted_5$1H = {
  key: 0,
  class: "suggest-empty"
};
const _hoisted_6$1s = { class: "suggest-origin" };
const _hoisted_7$1j = ["title", "data-testid", "onMousedown"];
const _hoisted_8$19 = { class: "s-label" };
const _hoisted_9$13 = { class: "s-value" };
const _hoisted_10$W = { class: "field-wrap" };
const _hoisted_11$O = {
  key: 0,
  class: "suggest",
  "data-testid": "data-link-suggestions"
};
const _hoisted_12$F = {
  key: 0,
  class: "suggest-empty"
};
const _hoisted_13$E = { class: "suggest-origin" };
const _hoisted_14$D = ["title", "data-testid", "onMousedown"];
const _hoisted_15$w = { class: "s-label" };
const _hoisted_16$u = { class: "s-value" };
const _hoisted_17$r = { class: "blank" };
const _sfc_main$4j = /* @__PURE__ */ defineComponent({
  __name: "DataLinksEditor",
  props: {
    modelValue: {},
    dataFrames: {},
    templateVars: {},
    templateVarProperties: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const links = computed(
      () => Array.isArray(props.modelValue) ? props.modelValue : []
    );
    const suggestions = computed(
      () => getDataLinksVariableSuggestions(props.dataFrames ?? [], {
        templateVars: props.templateVars ?? [],
        templateVarProperties: props.templateVarProperties ?? {},
        // Field data links editor operates on clicked values (Grafana Values scope)
        scope: VariableSuggestionsScope.Values
      })
    );
    const activeIndex = ref(null);
    const activeField = ref("url");
    const filterText = ref("");
    const filteredSuggestions = computed(() => {
      const q = filterText.value.replace(/^\$\{?/, "").toLowerCase();
      const all = suggestions.value;
      if (!q) return all;
      return all.filter(
        (s) => s.value.toLowerCase().includes(q) || s.label.toLowerCase().includes(q)
      );
    });
    const grouped = computed(() => {
      const map = /* @__PURE__ */ new Map();
      for (const s of filteredSuggestions.value) {
        const k = s.origin;
        if (!map.has(k)) map.set(k, []);
        map.get(k).push(s);
      }
      return [...map.entries()];
    });
    const originLabel = {
      series: "Series",
      field: "Field",
      fields: "Fields",
      value: "Value",
      "built-in": "Built-in",
      template: "Template"
    };
    function emitNext(next) {
      emit("update:modelValue", next);
    }
    function update(i, patch) {
      emitNext(links.value.map((l, idx) => idx === i ? { ...l, ...patch } : l));
    }
    function add() {
      emitNext([...links.value, { title: "", url: "", targetBlank: true }]);
    }
    function remove(i) {
      emitNext(links.value.filter((_, idx) => idx !== i));
      if (activeIndex.value === i) activeIndex.value = null;
    }
    function onFieldInput(i, field, raw) {
      const v = String(raw ?? "");
      update(i, { [field]: v });
      activeIndex.value = i;
      activeField.value = field;
      const dollar = v.lastIndexOf("$");
      filterText.value = dollar >= 0 ? v.slice(dollar) : "";
    }
    function applySuggestion(i, s) {
      const field = activeField.value;
      const cur = String(links.value[i]?.[field] ?? "");
      const dollar = cur.lastIndexOf("$");
      const token = formatSuggestionToken(s);
      const next = dollar >= 0 ? cur.slice(0, dollar) + token : cur + token;
      update(i, { [field]: next });
      filterText.value = "";
      activeIndex.value = null;
    }
    function onFocus(i, field) {
      activeIndex.value = i;
      activeField.value = field;
      filterText.value = "";
    }
    function onBlur() {
      setTimeout(() => {
        activeIndex.value = null;
      }, 180);
    }
    function showSuggest(i, field) {
      return activeIndex.value === i && activeField.value === field && suggestions.value.length > 0;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3g, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(links.value, (l, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "link-row",
              "data-testid": `data-link-${i}`
            }, [
              createElementVNode("div", _hoisted_3$2e, [
                createVNode(GInput, {
                  value: l.title ?? "",
                  placeholder: "标题（输入 $ 显示变量）",
                  "data-testid": "data-link-title",
                  "onUpdate:value": ($event) => onFieldInput(i, "title", $event),
                  onFocus: ($event) => onFocus(i, "title"),
                  onBlur
                }, null, 8, ["value", "onUpdate:value", "onFocus"]),
                showSuggest(i, "title") ? (openBlock(), createElementBlock("div", _hoisted_4$1T, [
                  !filteredSuggestions.value.length ? (openBlock(), createElementBlock("div", _hoisted_5$1H, " 无匹配变量 ")) : createCommentVNode("v-if", true),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(grouped.value, ([origin, items]) => {
                      return openBlock(), createElementBlock("div", {
                        key: "t-" + origin,
                        class: "suggest-group"
                      }, [
                        createElementVNode(
                          "div",
                          _hoisted_6$1s,
                          toDisplayString(originLabel[origin] || origin),
                          1
                          /* TEXT */
                        ),
                        (openBlock(true), createElementBlock(
                          Fragment,
                          null,
                          renderList(items, (s) => {
                            return openBlock(), createElementBlock("button", {
                              key: "t-" + s.value,
                              type: "button",
                              class: "suggest-item",
                              title: s.documentation,
                              "data-testid": `data-link-title-suggest-${s.value}`,
                              onMousedown: withModifiers(($event) => applySuggestion(i, s), ["prevent"])
                            }, [
                              createElementVNode(
                                "span",
                                _hoisted_8$19,
                                toDisplayString(s.label),
                                1
                                /* TEXT */
                              ),
                              createElementVNode(
                                "span",
                                _hoisted_9$13,
                                "$" + toDisplayString("{" + s.value + "}"),
                                1
                                /* TEXT */
                              )
                            ], 40, _hoisted_7$1j);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        ))
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true)
              ]),
              createElementVNode("div", _hoisted_10$W, [
                createVNode(GInput, {
                  value: l.url ?? "",
                  placeholder: "URL（输入 $ 显示变量）",
                  "data-testid": "data-link-url",
                  "onUpdate:value": ($event) => onFieldInput(i, "url", $event),
                  onFocus: ($event) => onFocus(i, "url"),
                  onBlur
                }, null, 8, ["value", "onUpdate:value", "onFocus"]),
                showSuggest(i, "url") ? (openBlock(), createElementBlock("div", _hoisted_11$O, [
                  !filteredSuggestions.value.length ? (openBlock(), createElementBlock("div", _hoisted_12$F, " 无匹配变量 ")) : createCommentVNode("v-if", true),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(grouped.value, ([origin, items]) => {
                      return openBlock(), createElementBlock("div", {
                        key: "u-" + origin,
                        class: "suggest-group"
                      }, [
                        createElementVNode(
                          "div",
                          _hoisted_13$E,
                          toDisplayString(originLabel[origin] || origin),
                          1
                          /* TEXT */
                        ),
                        (openBlock(true), createElementBlock(
                          Fragment,
                          null,
                          renderList(items, (s) => {
                            return openBlock(), createElementBlock("button", {
                              key: "u-" + s.value,
                              type: "button",
                              class: "suggest-item",
                              title: s.documentation,
                              "data-testid": `data-link-suggest-${s.value}`,
                              onMousedown: withModifiers(($event) => applySuggestion(i, s), ["prevent"])
                            }, [
                              createElementVNode(
                                "span",
                                _hoisted_15$w,
                                toDisplayString(s.label),
                                1
                                /* TEXT */
                              ),
                              createElementVNode(
                                "span",
                                _hoisted_16$u,
                                "$" + toDisplayString("{" + s.value + "}"),
                                1
                                /* TEXT */
                              )
                            ], 40, _hoisted_14$D);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        ))
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true)
              ]),
              createElementVNode("label", _hoisted_17$r, [
                createVNode(_sfc_main$4v, {
                  checked: l.targetBlank !== false,
                  "onUpdate:checked": ($event) => update(i, { targetBlank: $event })
                }, null, 8, ["checked", "onUpdate:checked"]),
                _cache[0] || (_cache[0] = createTextVNode(
                  " 新窗口 ",
                  -1
                  /* CACHED */
                ))
              ]),
              createVNode(GButton, {
                size: "sm",
                variant: "text",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ], 8, _hoisted_2$2A);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(GButton, {
          size: "sm",
          "test-id": "data-links-add",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[2] || (_cache[2] = [
            createTextVNode(
              "+ 添加链接",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        }),
        _cache[3] || (_cache[3] = createElementVNode(
          "p",
          { class: "hint" },
          [
            createTextVNode(" 标题与 URL 均支持 "),
            createElementVNode("code", null, "$"),
            createTextVNode(" 变量建议（${__value.raw}、${__field.name} 等） ")
          ],
          -1
          /* CACHED */
        ))
      ]);
    };
  }
});
const DataLinksEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4j, [["__scopeId", "data-v-751e9343"]]);
const _hoisted_1$3f = ["data-frame-filter", "data-option-count", "data-group-count", "data-base-name-mode", "data-matcher-scope", "data-empty"];
const _sfc_main$4i = /* @__PURE__ */ defineComponent({
  __name: "FieldNamePicker",
  props: {
    modelValue: {},
    fieldNames: {},
    options: {},
    filterTypes: {},
    filterFn: {},
    frameNames: {},
    placeholder: { default: "选择字段" },
    noFieldsMessage: { default: "无可用字段" },
    baseNameMode: { default: "default" },
    scope: {},
    width: {},
    allowClear: { type: Boolean, default: true },
    includeAuto: { type: Boolean, default: true }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function isLabeledDisplay(label, rawName) {
      if (/\{[^}]+\}/.test(label)) return true;
      if (rawName && label !== rawName && label.includes(rawName)) return true;
      return false;
    }
    const selectOptions = computed(() => {
      let list = [];
      if (props.options?.length) {
        list = props.options.slice();
      } else {
        list = (props.fieldNames ?? []).map((n) => ({ label: n, value: n }));
      }
      if (props.filterTypes?.length) {
        const allow = new Set(props.filterTypes);
        list = list.filter((o) => !o.type || allow.has(o.type));
      }
      if (props.frameNames?.length) {
        const allowFrames = new Set(props.frameNames);
        list = list.filter((o) => {
          const fr = o.frameName ?? o.frame ?? o.refId;
          if (fr == null || fr === "") return true;
          return allowFrames.has(String(fr));
        });
      }
      if (typeof props.filterFn === "function") {
        list = list.filter((o) => {
          try {
            return props.filterFn(o);
          } catch {
            return true;
          }
        });
      }
      const mode2 = normalizeBaseNameMode(props.baseNameMode);
      if (props.scope) {
        const want = String(props.scope);
        list = list.filter((o) => {
          const sc = String(o.scope ?? "series");
          return sc === want;
        });
      }
      if (mode2 === "only") {
        list = list.filter((o) => !isLabeledDisplay(o.label, o.rawName));
      } else if (mode2 === "exclude") {
        const labeled = list.filter((o) => isLabeledDisplay(o.label, o.rawName));
        if (labeled.length) list = labeled;
      }
      const seen = /* @__PURE__ */ new Set();
      const unique = [];
      for (const o of list) {
        if (!o.value || seen.has(o.value)) continue;
        seen.add(o.value);
        unique.push(o);
      }
      const mapped = unique.map((o) => ({
        label: o.type ? `${o.label} (${o.type})` : o.label,
        value: o.value,
        scope: String(o.scope ?? "series")
      }));
      if (!mapped.length) {
        const empty2 = [
          {
            label: props.noFieldsMessage || "无可用字段",
            value: "",
            disabled: true
          }
        ];
        return empty2;
      }
      const auto = props.includeAuto ? [{ label: "自动", value: "" }] : [];
      if (!props.scope) {
        const scopes = new Set(mapped.map((m) => m.scope || "series"));
        if (scopes.size > 1) {
          const groups = [];
          const order = ["series", "nested", "annotation", "exemplar"];
          for (const sc of order) {
            if (!scopes.has(sc)) continue;
            const kids = mapped.filter((m) => (m.scope || "series") === sc);
            groups.push({
              label: groupLabelForScope(sc),
              options: kids.map(({ label, value, disabled }) => ({
                label,
                value,
                disabled
              }))
            });
          }
          for (const sc of scopes) {
            if (order.includes(sc)) continue;
            const kids = mapped.filter((m) => (m.scope || "series") === sc);
            groups.push({
              label: String(sc),
              options: kids.map(({ label, value, disabled }) => ({
                label,
                value,
                disabled
              }))
            });
          }
          return [...auto, ...groups];
        }
      }
      const flat = mapped.map(({ label, value, disabled }) => ({
        label,
        value,
        disabled
      }));
      return [...auto, ...flat];
    });
    function flattenOptionValues(opts) {
      const out = [];
      for (const o of opts) {
        if (o && Array.isArray(o.options)) {
          for (const c of o.options) {
            if (c?.value != null && c.value !== "") out.push(String(c.value));
          }
        } else if (o?.value != null && o.value !== "") {
          out.push(String(o.value));
        }
      }
      return out;
    }
    const flatValues = computed(
      () => flattenOptionValues(selectOptions.value)
    );
    const optionCount = computed(() => {
      const n = flatValues.value.length;
      const hasAuto = selectOptions.value.some(
        (o) => o && o.value === "" && o.label === "自动"
      );
      return n + (hasAuto ? 1 : 0);
    });
    const empty = computed(() => flatValues.value.length === 0);
    const groupCount = computed(
      () => selectOptions.value.filter((o) => o && Array.isArray(o.options)).length
    );
    function filterOption(input, option) {
      const q = String(input ?? "").trim().toLowerCase();
      if (!q) return true;
      const label = String(option?.label ?? option?.children ?? "").toLowerCase();
      const value = String(option?.value ?? "").toLowerCase();
      return label.includes(q) || value.includes(q);
    }
    function onChange(v) {
      if (v === "" || v == null || v === "__none__") {
        emit("update:modelValue", void 0);
        return;
      }
      const s = String(v);
      const allowed = new Set(flatValues.value);
      if (allowed.size && !allowed.has(s)) {
        return;
      }
      emit("update:modelValue", s);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "field-name-picker",
        "data-testid": "field-name-picker",
        "data-frame-filter": __props.frameNames?.length ? __props.frameNames.join(",") : "",
        "data-option-count": String(optionCount.value),
        "data-group-count": String(groupCount.value),
        "data-base-name-mode": String(__props.baseNameMode ?? "default"),
        "data-matcher-scope": String(__props.scope ?? ""),
        "data-empty": String(!!empty.value),
        "data-searchable": "true",
        style: normalizeStyle(
          __props.width != null ? { width: typeof __props.width === "number" ? __props.width + "px" : __props.width } : void 0
        )
      }, [
        createVNode(GSelect, {
          value: __props.modelValue ?? "",
          options: selectOptions.value,
          "allow-clear": __props.allowClear,
          "show-search": "",
          "filter-option": filterOption,
          placeholder: empty.value ? __props.noFieldsMessage || __props.placeholder : __props.placeholder,
          onChange
        }, null, 8, ["value", "options", "allow-clear", "placeholder"])
      ], 12, _hoisted_1$3f);
    };
  }
});
const _sfc_main$4h = /* @__PURE__ */ defineComponent({
  __name: "StatsPicker",
  props: {
    modelValue: {},
    allowMultiple: { type: Boolean, default: true }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const STATS = [
      { label: "Last *", value: "lastNotNull" },
      { label: "Last", value: "last" },
      { label: "First *", value: "firstNotNull" },
      { label: "First", value: "first" },
      { label: "Min", value: "min" },
      { label: "Max", value: "max" },
      { label: "Mean", value: "mean" },
      { label: "Median", value: "median" },
      { label: "Sum", value: "sum" },
      { label: "Count", value: "count" },
      { label: "Range", value: "range" },
      { label: "Delta", value: "delta" },
      { label: "Step", value: "step" },
      { label: "Diff", value: "diff" },
      { label: "StdDev", value: "stdDev" },
      { label: "Variance", value: "variance" },
      { label: "All zeros", value: "allIsZero" },
      { label: "All nulls", value: "allIsNull" },
      { label: "Change count", value: "changeCount" },
      { label: "Distinct count", value: "distinctCount" }
    ];
    const props = __props;
    const emit = __emit;
    const value = computed(() => {
      const v = props.modelValue;
      if (Array.isArray(v)) return v;
      if (typeof v === "string" && v) return [v];
      return [];
    });
    function onChange(v) {
      if (Array.isArray(v)) emit("update:modelValue", v.map(String));
      else if (v == null || v === "") emit("update:modelValue", []);
      else emit("update:modelValue", [String(v)]);
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GSelect, {
        class: "stats-picker",
        "test-id": "stats-picker",
        mode: __props.allowMultiple ? "multiple" : void 0,
        value: __props.allowMultiple ? value.value : value.value[0] ?? "",
        options: STATS,
        "show-search": true,
        "allow-clear": "",
        placeholder: "选择计算",
        onChange
      }, null, 8, ["mode", "value"]);
    };
  }
});
const StatsPicker = /* @__PURE__ */ _export_sfc(_sfc_main$4h, [["__scopeId", "data-v-a3d270c2"]]);
const _hoisted_1$3e = {
  class: "strings",
  "data-testid": "strings-editor"
};
const _sfc_main$4g = /* @__PURE__ */ defineComponent({
  __name: "StringArrayEditor",
  props: {
    modelValue: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const items = computed(
      () => Array.isArray(props.modelValue) ? props.modelValue : []
    );
    function set(i, v) {
      emit(
        "update:modelValue",
        items.value.map((x, idx) => idx === i ? v : x)
      );
    }
    function add() {
      emit("update:modelValue", [...items.value, ""]);
    }
    function remove(i) {
      emit(
        "update:modelValue",
        items.value.filter((_, idx) => idx !== i)
      );
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3e, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(items.value, (s, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row"
            }, [
              createVNode(GInput, {
                value: s,
                "onUpdate:value": ($event) => set(i, String($event ?? ""))
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(GButton, {
                size: "sm",
                variant: "text",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[0] || (_cache[0] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(GButton, {
          size: "sm",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              "+ 添加",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const StringArrayEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4g, [["__scopeId", "data-v-d626ce0d"]]);
const _sfc_main$4f = /* @__PURE__ */ defineComponent({
  __name: "TimezonePicker",
  props: {
    modelValue: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const ZONES = [
      { label: "默认", value: "" },
      { label: "浏览器本地", value: "browser" },
      { label: "UTC", value: "utc" },
      { label: "Asia/Shanghai", value: "Asia/Shanghai" },
      { label: "Asia/Tokyo", value: "Asia/Tokyo" },
      { label: "America/New_York", value: "America/New_York" },
      { label: "America/Los_Angeles", value: "America/Los_Angeles" },
      { label: "Europe/London", value: "Europe/London" },
      { label: "Europe/Berlin", value: "Europe/Berlin" },
      { label: "Europe/Paris", value: "Europe/Paris" },
      { label: "Australia/Sydney", value: "Australia/Sydney" }
    ];
    const props = __props;
    const emit = __emit;
    const value = computed(() => props.modelValue ?? "");
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GSelect, {
        "test-id": "timezone-picker",
        value: value.value,
        options: ZONES,
        "show-search": true,
        "allow-clear": "",
        placeholder: "时区",
        onChange: _cache[0] || (_cache[0] = ($event) => emit(
          "update:modelValue",
          $event == null || $event === "" ? void 0 : String($event)
        ))
      }, null, 8, ["value"]);
    };
  }
});
const _hoisted_1$3d = {
  class: "actions",
  "data-testid": "actions-editor"
};
const _sfc_main$4e = /* @__PURE__ */ defineComponent({
  __name: "ActionsEditor",
  props: {
    modelValue: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const items = computed(
      () => Array.isArray(props.modelValue) ? props.modelValue : []
    );
    const types = [
      { label: "链接", value: "link" },
      { label: "Infinity", value: "infinity" }
    ];
    function update(i, patch) {
      emit(
        "update:modelValue",
        items.value.map((a, idx) => idx === i ? { ...a, ...patch } : a)
      );
    }
    function add() {
      emit("update:modelValue", [
        ...items.value,
        { type: "link", title: "", options: { url: "" } }
      ]);
    }
    function remove(i) {
      emit(
        "update:modelValue",
        items.value.filter((_, idx) => idx !== i)
      );
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3d, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(items.value, (a, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row"
            }, [
              createVNode(GSelect, {
                value: a.type ?? "link",
                options: types,
                "show-search": false,
                onChange: ($event) => update(i, { type: String($event) })
              }, null, 8, ["value", "onChange"]),
              createVNode(GInput, {
                value: a.title ?? "",
                placeholder: "标题",
                "onUpdate:value": ($event) => update(i, { title: String($event ?? "") })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(GInput, {
                value: a.options?.url ?? "",
                placeholder: "URL",
                "onUpdate:value": ($event) => update(i, {
                  options: { ...a.options ?? {}, url: String($event ?? "") }
                })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(GButton, {
                size: "sm",
                variant: "text",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[0] || (_cache[0] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(GButton, {
          size: "sm",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              "+ 添加动作",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ActionsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$4e, [["__scopeId", "data-v-241e55dd"]]);
const _hoisted_1$3c = {
  class: "viz-layout__viz",
  "data-testid": "viz-layout-viz"
};
const _hoisted_2$2z = ["data-placement"];
const _sfc_main$4d = /* @__PURE__ */ defineComponent({
  __name: "VizLayout",
  props: {
    width: {},
    height: {},
    legendPlacement: { default: "bottom" },
    legendMaxHeight: { default: "35%" },
    legendMaxWidth: { default: "60%" },
    legendWidth: {}
  },
  setup(__props) {
    const props = __props;
    const slots = useSlots();
    const legendEl = ref(null);
    const legendSize = ref({ width: 0, height: 0 });
    let ro = null;
    function measure() {
      if (!legendEl.value) {
        legendSize.value = { width: 0, height: 0 };
        return;
      }
      const r = legendEl.value.getBoundingClientRect();
      legendSize.value = { width: r.width, height: r.height };
    }
    onMounted(() => {
      if (typeof ResizeObserver !== "undefined") {
        ro = new ResizeObserver(() => measure());
        if (legendEl.value) ro.observe(legendEl.value);
      }
      measure();
    });
    onBeforeUnmount(() => ro?.disconnect());
    watch(legendEl, (el) => {
      ro?.disconnect();
      if (el && typeof ResizeObserver !== "undefined") {
        ro = new ResizeObserver(() => measure());
        ro.observe(el);
      }
      measure();
    });
    const placement = computed(() => {
      if (typeof document !== "undefined" && document.body.clientWidth < 992)
        return "bottom";
      return props.legendPlacement;
    });
    const vizSize = computed(() => {
      if (!slots.legend) return { width: props.width, height: props.height };
      if (placement.value === "bottom") {
        return {
          width: props.width,
          height: Math.max(0, props.height - legendSize.value.height)
        };
      }
      const lw = typeof props.legendWidth === "number" ? props.legendWidth : legendSize.value.width;
      return { width: Math.max(0, props.width - (lw || 0)), height: props.height };
    });
    const containerStyle = computed(() => ({
      display: "flex",
      width: `${props.width}px`,
      height: `${props.height}px`,
      flexDirection: placement.value === "right" ? "row" : "column"
    }));
    const legendStyle = computed(() => {
      if (placement.value === "bottom")
        return { maxHeight: props.legendMaxHeight, width: "100%" };
      if (typeof props.legendWidth === "number")
        return { width: `${props.legendWidth}px` };
      if (typeof props.legendWidth === "string")
        return { width: props.legendWidth };
      return { maxWidth: props.legendMaxWidth };
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: "viz-layout",
          "data-testid": "viz-layout",
          style: normalizeStyle(containerStyle.value)
        },
        [
          createElementVNode("div", _hoisted_1$3c, [
            renderSlot(_ctx.$slots, "default", {
              width: vizSize.value.width,
              height: vizSize.value.height
            }, void 0, true)
          ]),
          _ctx.$slots.legend ? (openBlock(), createElementBlock("div", {
            key: 0,
            ref_key: "legendEl",
            ref: legendEl,
            class: "viz-layout__legend",
            "data-testid": "viz-layout-legend",
            "data-placement": placement.value,
            style: normalizeStyle(legendStyle.value)
          }, [
            renderSlot(_ctx.$slots, "legend", {}, void 0, true)
          ], 12, _hoisted_2$2z)) : createCommentVNode("v-if", true)
        ],
        4
        /* STYLE */
      );
    };
  }
});
const VizLayout = /* @__PURE__ */ _export_sfc(_sfc_main$4d, [["__scopeId", "data-v-24c80a06"]]);
function createEventBus() {
  const handlers = /* @__PURE__ */ new Map();
  return {
    publish(event, payload) {
      for (const h2 of handlers.get(event) ?? []) h2(payload);
    },
    subscribe(event, handler) {
      if (!handlers.has(event)) handlers.set(event, /* @__PURE__ */ new Set());
      handlers.get(event).add(handler);
      return () => handlers.get(event)?.delete(handler);
    }
  };
}
const panelContextKey = /* @__PURE__ */ Symbol(
  "grafana-panel-context"
);
function createDefaultPanelContext(partial = {}) {
  return {
    eventsScope: partial.eventsScope ?? "global",
    eventBus: partial.eventBus ?? createEventBus(),
    app: partial.app,
    sync: partial.sync,
    onSeriesColorChange: partial.onSeriesColorChange,
    onToggleSeriesVisibility: partial.onToggleSeriesVisibility,
    onToggleLegendSort: partial.onToggleLegendSort,
    onOpenInspector: partial.onOpenInspector,
    instanceState: partial.instanceState,
    onInstanceStateChange: partial.onInstanceStateChange,
    canExecuteActions: partial.canExecuteActions
  };
}
function providePanelContext(ctx) {
  provide(panelContextKey, ctx);
}
function usePanelContext() {
  return inject(panelContextKey, () => createDefaultPanelContext(), true);
}
const _hoisted_1$3b = {
  class: "panel-context-provider",
  "data-testid": "panel-context-provider"
};
const _sfc_main$4c = /* @__PURE__ */ defineComponent({
  __name: "PanelContextProvider",
  props: {
    value: {}
  },
  setup(__props) {
    const props = __props;
    const ctx = computed(() => createDefaultPanelContext(props.value ?? {}));
    provide(panelContextKey, ctx.value);
    watch(
      ctx,
      (v) => {
        Object.assign(ctx.value, v);
      },
      { deep: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3b, [
        renderSlot(_ctx.$slots, "default")
      ]);
    };
  }
});
var BigValueColorMode = /* @__PURE__ */ ((BigValueColorMode2) => {
  BigValueColorMode2["Background"] = "background";
  BigValueColorMode2["BackgroundSolid"] = "background_solid";
  BigValueColorMode2["None"] = "none";
  BigValueColorMode2["Value"] = "value";
  return BigValueColorMode2;
})(BigValueColorMode || {});
var BigValueGraphMode = /* @__PURE__ */ ((BigValueGraphMode2) => {
  BigValueGraphMode2["None"] = "none";
  BigValueGraphMode2["Line"] = "line";
  BigValueGraphMode2["Area"] = "area";
  return BigValueGraphMode2;
})(BigValueGraphMode || {});
var BigValueJustifyMode = /* @__PURE__ */ ((BigValueJustifyMode2) => {
  BigValueJustifyMode2["Auto"] = "auto";
  BigValueJustifyMode2["Center"] = "center";
  return BigValueJustifyMode2;
})(BigValueJustifyMode || {});
var BigValueTextMode = /* @__PURE__ */ ((BigValueTextMode2) => {
  BigValueTextMode2["Auto"] = "auto";
  BigValueTextMode2["Value"] = "value";
  BigValueTextMode2["ValueAndName"] = "value_and_name";
  BigValueTextMode2["Name"] = "name";
  BigValueTextMode2["None"] = "none";
  return BigValueTextMode2;
})(BigValueTextMode || {});
const LINE_HEIGHT = 1.2;
const MAX_TITLE_SIZE = 30;
const VALUE_FONT_WEIGHT = 500;
let measureCanvas;
function estimateTextWidth(text, fontSize, weight = 400) {
  if (typeof document !== "undefined") {
    try {
      if (!measureCanvas) measureCanvas = document.createElement("canvas");
      const ctx = measureCanvas.getContext("2d");
      if (ctx) {
        ctx.font = `${weight} ${fontSize}px Inter, Helvetica, Arial, sans-serif`;
        const measured = ctx.measureText(String(text ?? "")).width;
        if (measured > 0) return measured;
      }
    } catch {
    }
  }
  const factor = weight >= 500 ? 0.62 : 0.55;
  return Math.max(1, String(text ?? "").length) * fontSize * factor;
}
function calculateFontSize(text, width2, height2, lineHeight = LINE_HEIGHT, maxSize, weight = 400) {
  if (!text) {
    const h2 = height2 / lineHeight;
    return maxSize != null ? Math.min(maxSize, h2) : h2;
  }
  const textSize14 = estimateTextWidth(text, 14, weight);
  const fontSizeBasedOnWidth = width2 / (textSize14 + 2) * 14;
  const fontSizeBasedOnHeight = height2 / lineHeight;
  const optimalSize = Math.min(fontSizeBasedOnHeight, fontSizeBasedOnWidth);
  return Math.min(optimalSize, maxSize ?? optimalSize);
}
function shouldJustifyCenter(mode2, title) {
  if (mode2 === BigValueJustifyMode.Center) return true;
  if (mode2 === BigValueJustifyMode.Auto) return !title;
  return !title;
}
function getTextValues(props) {
  const textMode = String(props.textMode ?? BigValueTextMode.Auto);
  const v = props.value;
  const pct = v.percentChange != null && Number.isFinite(v.percentChange) ? `${v.percentChange > 0 ? "+" : ""}${v.percentChange.toFixed(1)}%` : void 0;
  if (textMode === BigValueTextMode.None) {
    return { valueText: "" };
  }
  if (textMode === BigValueTextMode.Name) {
    return { valueText: v.title ?? "", title: void 0, percentText: pct };
  }
  if (textMode === BigValueTextMode.Value) {
    return { valueText: v.text, title: void 0, percentText: pct };
  }
  if (textMode === BigValueTextMode.ValueAndName) {
    return { valueText: v.text, title: v.title, percentText: pct };
  }
  if ((props.count ?? 1) === 1) {
    return { valueText: v.text, title: void 0, percentText: pct };
  }
  return { valueText: v.text, title: v.title, percentText: pct };
}
function mixToward(hex, toward, amount) {
  const parse = (h2) => {
    const m = String(h2).replace("#", "").match(/^([0-9a-f]{6})$/i);
    if (!m) return null;
    const n = parseInt(m[1], 16);
    return { r: n >> 16 & 255, g: n >> 8 & 255, b: n & 255 };
  };
  const a = parse(hex);
  const b = parse(toward) || { r: 0, g: 0, b: 0 };
  if (!a) return hex;
  const t2 = Math.max(0, Math.min(1, amount));
  const r = Math.round(a.r + (b.r - a.r) * t2);
  const g = Math.round(a.g + (b.g - a.g) * t2);
  const bl = Math.round(a.b + (b.b - a.b) * t2);
  return `#${[r, g, bl].map((x) => x.toString(16).padStart(2, "0")).join("")}`;
}
function computeBigValueLayout(props) {
  const width2 = Math.max(1, props.width || 100);
  const height2 = Math.max(1, props.height || 100);
  const valueColor = props.value.color ?? "var(--grafana-text)";
  const panelPadding = height2 > 100 ? 12 : 8;
  const textValues = getTextValues(props);
  const justifyCenter = shouldJustifyCenter(
    props.justifyMode,
    textValues.title
  );
  const maxTextWidth = width2 - panelPadding * 2;
  let maxTextHeight = height2 - panelPadding * 2;
  const wideLayout = props.wideLayout !== false && !props.disableWideLayout;
  const isWide = wideLayout && width2 / height2 > 2.5 && !!textValues.title;
  const hasSpark = (props.graphMode === "area" || props.graphMode === "line") && Array.isArray(props.sparkline) && props.sparkline.length > 1;
  let chartHeight = 0;
  let chartWidth = width2;
  let titleFontSize = props.text?.titleSize ?? 0;
  let valueFontSize = props.text?.valueSize ?? 0;
  let percentFontSize = props.text?.percentSize ?? 0;
  if (isWide && hasSpark && height2 > 50) {
    const chartHeightPercent = 0.5;
    const titleWidthPercent = 0.6;
    const valueWidthPercent = 1 - titleWidthPercent;
    const textHeightPercent = 0.4;
    chartHeight = Math.floor(height2 * chartHeightPercent);
    chartWidth = width2;
    if (textValues.title && !titleFontSize) {
      titleFontSize = calculateFontSize(
        textValues.title,
        maxTextWidth * titleWidthPercent,
        maxTextHeight * textHeightPercent,
        LINE_HEIGHT,
        MAX_TITLE_SIZE
      );
    }
    if (!valueFontSize && textValues.valueText) {
      valueFontSize = calculateFontSize(
        textValues.valueText,
        maxTextWidth * valueWidthPercent,
        maxTextHeight * chartHeightPercent,
        LINE_HEIGHT,
        void 0,
        VALUE_FONT_WEIGHT
      );
    }
  } else if (hasSpark && height2 > 50) {
    const titleHeightPercent = 0.15;
    const chartHeightPercent = 0.25;
    let titleHeight = 0;
    chartHeight = height2 * chartHeightPercent;
    chartWidth = width2;
    if (textValues.title && !titleFontSize) {
      titleFontSize = calculateFontSize(
        textValues.title,
        maxTextWidth,
        height2 * titleHeightPercent,
        LINE_HEIGHT,
        MAX_TITLE_SIZE
      );
      titleHeight = titleFontSize * LINE_HEIGHT;
    }
    if (!valueFontSize && textValues.valueText) {
      valueFontSize = calculateFontSize(
        textValues.valueText,
        maxTextWidth,
        maxTextHeight - chartHeight - titleHeight,
        LINE_HEIGHT,
        void 0,
        VALUE_FONT_WEIGHT
      );
    }
    if (textValues.title && titleFontSize) {
      titleFontSize = Math.min(valueFontSize * 0.7, titleFontSize);
    }
    chartHeight = Math.max(
      0,
      Math.floor(
        height2 - titleFontSize * LINE_HEIGHT - valueFontSize * LINE_HEIGHT
      )
    );
  } else {
    let titleHeight = 0;
    if (textValues.title && !titleFontSize) {
      titleFontSize = calculateFontSize(
        textValues.title,
        maxTextWidth * (isWide ? 0.6 : 1),
        height2 * 0.15,
        LINE_HEIGHT,
        MAX_TITLE_SIZE
      );
      titleHeight = titleFontSize * LINE_HEIGHT;
    }
    if (!valueFontSize && textValues.valueText) {
      let valueHeight = maxTextHeight - titleHeight;
      if (props.value.percentChange != null) valueHeight = valueHeight * 0.75;
      const valueWidthPercent = isWide && textValues.title ? 0.3 : 1;
      valueFontSize = calculateFontSize(
        textValues.valueText,
        maxTextWidth * valueWidthPercent,
        valueHeight,
        LINE_HEIGHT,
        void 0,
        VALUE_FONT_WEIGHT
      );
    }
    if (textValues.title && titleFontSize) {
      titleFontSize = Math.min(valueFontSize * 0.7, titleFontSize);
    }
  }
  if (textValues.percentText && !percentFontSize) {
    percentFontSize = Math.max(valueFontSize / 2.5, 12);
  }
  const colorMode = String(props.colorMode ?? BigValueColorMode.Value);
  let containerBackground;
  let containerColor;
  let valueColorCss = valueColor;
  let titleColorCss = "var(--grafana-text-secondary)";
  if (colorMode === BigValueColorMode.None) {
    valueColorCss = "var(--grafana-text)";
  } else if (colorMode === BigValueColorMode.Background || colorMode === BigValueColorMode.BackgroundSolid) {
    containerBackground = colorMode === BigValueColorMode.BackgroundSolid ? valueColor : `linear-gradient(120deg, ${valueColor}, ${mixToward(valueColor, "#000000", 0.25)})`;
    containerColor = "#fff";
    valueColorCss = "#fff";
    titleColorCss = "rgba(255,255,255,0.85)";
  } else {
    valueColorCss = valueColor;
  }
  return {
    titleFontSize,
    valueFontSize,
    percentFontSize,
    chartHeight,
    chartWidth,
    valueColor,
    panelPadding,
    justifyCenter,
    maxTextWidth,
    maxTextHeight,
    title: textValues.title,
    valueText: textValues.valueText,
    percentText: textValues.percentText,
    isWide,
    valueColorCss,
    titleColorCss,
    containerBackground,
    containerColor
  };
}
const _hoisted_1$3a = {
  class: "big-value__text",
  "data-testid": "big-value-text"
};
const _sfc_main$4b = /* @__PURE__ */ defineComponent({
  __name: "BigValue",
  props: {
    width: { default: 100 },
    height: { default: 100 },
    value: {},
    sparkline: {},
    colorMode: { default: BigValueColorMode.Value },
    graphMode: { default: BigValueGraphMode.None },
    justifyMode: {},
    textMode: {},
    text: {},
    count: {},
    disableWideLayout: { type: Boolean },
    percentChangeColorMode: {},
    wideLayout: { type: Boolean, default: true }
  },
  setup(__props) {
    const props = __props;
    const layout = computed(() => computeBigValueLayout(props));
    const sparkHost = ref(null);
    let sparkCanvas = null;
    function colorWithAlpha2(color, alpha2) {
      const s = String(color).trim();
      let m = s.match(/^#([0-9a-f]{6})$/i);
      if (m) {
        const n = parseInt(m[1], 16);
        return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alpha2})`;
      }
      m = s.match(/^#([0-9a-f]{3})$/i);
      if (m) {
        const r = parseInt(m[1][0] + m[1][0], 16);
        const g = parseInt(m[1][1] + m[1][1], 16);
        const b = parseInt(m[1][2] + m[1][2], 16);
        return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
      }
      m = s.match(
        /^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)(?:\s*,\s*[\d.]+)?\s*\)$/i
      );
      if (m) {
        return `rgba(${m[1]}, ${m[2]}, ${m[3]}, ${alpha2})`;
      }
      return `rgba(115, 191, 105, ${alpha2})`;
    }
    function sparkColors() {
      if (String(props.colorMode).startsWith("background")) {
        return { stroke: "rgba(255,255,255,0.92)", fill: "rgba(255,255,255,0.4)" };
      }
      const base = props.value.color || "#73BF69";
      return { stroke: base, fill: colorWithAlpha2(base, 0.2) };
    }
    function destroyPlot() {
      if (sparkCanvas?.parentNode) {
        sparkCanvas.parentNode.removeChild(sparkCanvas);
      }
      sparkCanvas = null;
      if (sparkHost.value) sparkHost.value.innerHTML = "";
    }
    function paintSpark() {
      const host = sparkHost.value;
      if (!host) return;
      const w = Math.max(1, Math.floor(layout.value.chartWidth));
      const h2 = Math.max(1, Math.floor(layout.value.chartHeight));
      const vals = (props.sparkline ?? []).filter(
        (n2) => Number.isFinite(n2)
      );
      destroyPlot();
      if (vals.length < 2 || w < 2 || h2 < 2) return;
      const mode2 = String(props.graphMode ?? "");
      const isArea = mode2 === BigValueGraphMode.Area || mode2 === "area";
      const isLine = mode2 === BigValueGraphMode.Line || mode2 === "line";
      if (!isArea && !isLine) return;
      let min = Math.min(...vals);
      let max = Math.max(...vals);
      if (min === max) {
        if (min === 0) max = 1;
        else if (min < 0) min *= 2;
        else max *= 2;
      }
      const pad = (max - min) * 0.05 || 1;
      min -= pad;
      max += pad;
      const { stroke, fill } = sparkColors();
      const dpr = typeof window !== "undefined" && window.devicePixelRatio ? window.devicePixelRatio : 1;
      const canvas = document.createElement("canvas");
      canvas.width = Math.max(1, Math.floor(w * dpr));
      canvas.height = Math.max(1, Math.floor(h2 * dpr));
      canvas.style.width = w + "px";
      canvas.style.height = h2 + "px";
      canvas.style.display = "block";
      const ctx = canvas.getContext("2d");
      if (!ctx) return;
      ctx.scale(dpr, dpr);
      const n = vals.length;
      const xAt = (i) => n <= 1 ? 0 : i / (n - 1) * (w - 1);
      const yAt = (v) => {
        const t2 = (v - min) / (max - min || 1);
        return (1 - t2) * (h2 - 1);
      };
      ctx.beginPath();
      ctx.moveTo(xAt(0), yAt(vals[0]));
      for (let i = 1; i < n; i++) {
        ctx.lineTo(xAt(i), yAt(vals[i]));
      }
      if (isArea) {
        ctx.lineTo(xAt(n - 1), h2);
        ctx.lineTo(xAt(0), h2);
        ctx.closePath();
        ctx.fillStyle = fill;
        ctx.fill();
        ctx.beginPath();
        ctx.moveTo(xAt(0), yAt(vals[0]));
        for (let i = 1; i < n; i++) {
          ctx.lineTo(xAt(i), yAt(vals[i]));
        }
      }
      ctx.strokeStyle = stroke;
      ctx.lineWidth = 1.5;
      ctx.lineJoin = "round";
      ctx.lineCap = "round";
      ctx.stroke();
      host.appendChild(canvas);
      sparkCanvas = canvas;
    }
    watch(
      () => [
        layout.value.chartWidth,
        layout.value.chartHeight,
        props.sparkline,
        props.graphMode,
        props.colorMode,
        props.value.color
      ],
      () => {
        nextTick(() => paintSpark());
      },
      { deep: true }
    );
    onMounted(() => {
      nextTick(() => paintSpark());
    });
    onBeforeUnmount(() => destroyPlot());
    function pctClass() {
      const p = props.value.percentChange;
      if (p == null) return "";
      const mode2 = String(props.percentChangeColorMode ?? "standard");
      if (mode2 === "inverted") return p >= 0 ? "is-down" : "is-up";
      if (mode2 === "same_as_value") return "is-same";
      return p >= 0 ? "is-up" : "is-down";
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["big-value", {
            "is-center": layout.value.justifyCenter,
            "is-wide": layout.value.isWide,
            "has-spark": layout.value.chartHeight > 0
          }]),
          "data-testid": "big-value",
          style: normalizeStyle({
            width: __props.width + "px",
            height: __props.height + "px",
            padding: layout.value.panelPadding + "px",
            background: layout.value.containerBackground,
            color: layout.value.containerColor
          })
        },
        [
          createElementVNode("div", _hoisted_1$3a, [
            layout.value.title ? (openBlock(), createElementBlock(
              "div",
              {
                key: 0,
                class: "big-value__title",
                "data-testid": "big-value-title",
                style: normalizeStyle({
                  fontSize: layout.value.titleFontSize + "px",
                  color: layout.value.titleColorCss
                })
              },
              toDisplayString(layout.value.title),
              5
              /* TEXT, STYLE */
            )) : createCommentVNode("v-if", true),
            createElementVNode(
              "div",
              {
                class: "big-value__value",
                "data-testid": "big-value-value",
                style: normalizeStyle({
                  fontSize: layout.value.valueFontSize + "px",
                  color: layout.value.valueColorCss
                })
              },
              toDisplayString(layout.value.valueText),
              5
              /* TEXT, STYLE */
            ),
            layout.value.percentText ? (openBlock(), createElementBlock(
              "div",
              {
                key: 1,
                class: normalizeClass(["big-value__percent", pctClass()]),
                "data-testid": "big-value-percent",
                style: normalizeStyle({
                  fontSize: layout.value.percentFontSize + "px",
                  color: String(__props.percentChangeColorMode) === "same_as_value" && __props.value.color ? __props.value.color : void 0
                })
              },
              toDisplayString(layout.value.percentText),
              7
              /* TEXT, CLASS, STYLE */
            )) : createCommentVNode("v-if", true)
          ]),
          layout.value.chartHeight > 0 && (__props.sparkline?.length ?? 0) > 1 ? (openBlock(), createElementBlock(
            "div",
            {
              key: 0,
              ref_key: "sparkHost",
              ref: sparkHost,
              class: "big-value__spark",
              "data-testid": "big-value-spark",
              style: normalizeStyle({
                width: Math.floor(layout.value.chartWidth) + "px",
                height: Math.floor(layout.value.chartHeight) + "px"
              })
            },
            null,
            4
            /* STYLE */
          )) : createCommentVNode("v-if", true)
        ],
        6
        /* CLASS, STYLE */
      );
    };
  }
});
const BigValue = /* @__PURE__ */ _export_sfc(_sfc_main$4b, [["__scopeId", "data-v-0a8c590b"]]);
const _hoisted_1$39 = ["data-placement", "data-mode"];
const _hoisted_2$2y = ["data-testid", "onClick", "onMouseenter", "onMouseleave"];
const _hoisted_3$2d = { class: "label" };
const _hoisted_4$1S = {
  key: 1,
  class: "viz-legend-table",
  "data-testid": "viz-legend-table"
};
const _hoisted_5$1G = ["data-testid", "onClick"];
const _sfc_main$4a = /* @__PURE__ */ defineComponent({
  __name: "VizLegend",
  props: {
    items: {},
    placement: { default: "bottom" },
    displayMode: { default: "list" },
    readonly: { type: Boolean, default: false }
  },
  emits: ["label-click", "label-mouseover", "label-mouseout"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return __props.displayMode !== "hidden" && __props.items.length ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: "viz-legend",
        "data-testid": "viz-legend",
        "data-placement": __props.placement,
        "data-mode": __props.displayMode
      }, [
        __props.displayMode === "list" ? (openBlock(), createElementBlock(
          "ul",
          {
            key: 0,
            class: normalizeClass(["viz-legend-list", __props.placement])
          },
          [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.items, (item, i) => {
                return openBlock(), createElementBlock("li", {
                  key: item.getItemKey?.() ?? `${item.label}-${i}`,
                  class: normalizeClass(["viz-legend-item", { disabled: item.disabled }]),
                  "data-testid": `viz-legend-item-${i}`,
                  onClick: ($event) => !__props.readonly && emit("label-click", item, $event),
                  onMouseenter: ($event) => emit("label-mouseover", item, $event),
                  onMouseleave: ($event) => emit("label-mouseout", item, $event)
                }, [
                  createElementVNode(
                    "span",
                    {
                      class: "series-icon",
                      style: normalizeStyle({ background: item.color || "var(--grafana-text)" })
                    },
                    null,
                    4
                    /* STYLE */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_3$2d,
                    toDisplayString(item.label),
                    1
                    /* TEXT */
                  )
                ], 42, _hoisted_2$2y);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ],
          2
          /* CLASS */
        )) : (openBlock(), createElementBlock("table", _hoisted_4$1S, [
          _cache[0] || (_cache[0] = createElementVNode(
            "thead",
            null,
            [
              createElementVNode("tr", null, [
                createElementVNode("th"),
                createElementVNode("th", null, "名称")
              ])
            ],
            -1
            /* CACHED */
          )),
          createElementVNode("tbody", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.items, (item, i) => {
                return openBlock(), createElementBlock("tr", {
                  key: item.getItemKey?.() ?? `${item.label}-${i}`,
                  class: normalizeClass({ disabled: item.disabled }),
                  "data-testid": `viz-legend-row-${i}`,
                  onClick: ($event) => !__props.readonly && emit("label-click", item, $event)
                }, [
                  createElementVNode("td", null, [
                    createElementVNode(
                      "span",
                      {
                        class: "series-icon",
                        style: normalizeStyle({ background: item.color || "#ccc" })
                      },
                      null,
                      4
                      /* STYLE */
                    )
                  ]),
                  createElementVNode(
                    "td",
                    null,
                    toDisplayString(item.label),
                    1
                    /* TEXT */
                  )
                ], 10, _hoisted_5$1G);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ]))
      ], 8, _hoisted_1$39)) : createCommentVNode("v-if", true);
    };
  }
});
const VizLegend = /* @__PURE__ */ _export_sfc(_sfc_main$4a, [["__scopeId", "data-v-cbbb4351"]]);
const _hoisted_1$38 = ["data-mode"];
const _hoisted_2$2x = { class: "viz-tooltip__wrapper" };
const _hoisted_3$2c = {
  key: 0,
  class: "viz-tooltip__header",
  "data-testid": "viz-tooltip-title"
};
const _hoisted_4$1R = { class: "viz-tooltip__row viz-tooltip__row--header" };
const _hoisted_5$1F = { class: "viz-tooltip__value-wrap" };
const _hoisted_6$1r = { class: "viz-tooltip__value viz-tooltip__value--header" };
const _hoisted_7$1i = ["data-testid"];
const _hoisted_8$18 = {
  key: 0,
  class: "viz-tooltip__color",
  "aria-hidden": "true"
};
const _hoisted_9$12 = { class: "viz-tooltip__label" };
const _hoisted_10$V = { class: "viz-tooltip__value-wrap" };
const _hoisted_11$N = { class: "viz-tooltip__value" };
const _sfc_main$49 = /* @__PURE__ */ defineComponent({
  __name: "VizTooltip",
  props: {
    title: {},
    items: { default: () => [] },
    mode: { default: "single" },
    x: { default: 0 },
    y: { default: 0 },
    visible: { type: Boolean, default: true },
    floating: { type: Boolean, default: true },
    maxWidth: {},
    maxHeight: {}
  },
  setup(__props) {
    const props = __props;
    const rootStyle = () => {
      const style = {};
      if (props.floating) {
        style.left = `${props.x}px`;
        style.top = `${props.y}px`;
        style.position = "absolute";
      } else {
        style.position = "relative";
        style.left = "auto";
        style.top = "auto";
      }
      if (props.maxWidth != null) {
        style.maxWidth = typeof props.maxWidth === "number" ? `${props.maxWidth}px` : String(props.maxWidth);
      }
      if (props.maxHeight != null) {
        style.maxHeight = typeof props.maxHeight === "number" ? `${props.maxHeight}px` : String(props.maxHeight);
      }
      return style;
    };
    return (_ctx, _cache) => {
      return __props.visible && __props.mode !== "none" && (__props.title || __props.items.length) ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: "viz-tooltip",
        "data-testid": "viz-tooltip",
        "data-mode": __props.mode,
        style: normalizeStyle(rootStyle()),
        "aria-live": "polite",
        "aria-atomic": "true"
      }, [
        createCommentVNode(" VizTooltipWrapper "),
        createElementVNode("div", _hoisted_2$2x, [
          createCommentVNode(" VizTooltipHeader: time as value, empty label (Grafana TimeSeriesTooltip) "),
          __props.title ? (openBlock(), createElementBlock("div", _hoisted_3$2c, [
            createElementVNode("div", _hoisted_4$1R, [
              createElementVNode("div", _hoisted_5$1F, [
                createElementVNode(
                  "div",
                  _hoisted_6$1r,
                  toDisplayString(__props.title),
                  1
                  /* TEXT */
                )
              ])
            ])
          ])) : createCommentVNode("v-if", true),
          createCommentVNode(" VizTooltipContent "),
          __props.items.length ? (openBlock(), createElementBlock(
            "div",
            {
              key: 1,
              class: normalizeClass(["viz-tooltip__content", { "viz-tooltip__content--solo": !__props.title }])
            },
            [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(__props.items, (item, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: `${item.label}-${i}`,
                    class: normalizeClass(["viz-tooltip__row", { active: item.isActive }]),
                    "data-testid": `viz-tooltip-row-${i}`
                  }, [
                    item.color ? (openBlock(), createElementBlock("div", _hoisted_8$18, [
                      createCommentVNode(" SeriesIcon: 14×4 pill "),
                      createElementVNode(
                        "span",
                        {
                          class: "viz-tooltip__series-icon",
                          "data-testid": "series-icon",
                          style: normalizeStyle({ background: item.color })
                        },
                        null,
                        4
                        /* STYLE */
                      )
                    ])) : createCommentVNode("v-if", true),
                    item.label ? (openBlock(), createElementBlock(
                      "div",
                      {
                        key: 1,
                        class: normalizeClass(["viz-tooltip__label-wrap", { active: item.isActive }])
                      },
                      [
                        createElementVNode(
                          "span",
                          _hoisted_9$12,
                          toDisplayString(item.label),
                          1
                          /* TEXT */
                        )
                      ],
                      2
                      /* CLASS */
                    )) : createCommentVNode("v-if", true),
                    createElementVNode("div", _hoisted_10$V, [
                      createElementVNode(
                        "div",
                        _hoisted_11$N,
                        toDisplayString(item.value),
                        1
                        /* TEXT */
                      )
                    ])
                  ], 10, _hoisted_7$1i);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ],
            2
            /* CLASS */
          )) : createCommentVNode("v-if", true)
        ])
      ], 12, _hoisted_1$38)) : createCommentVNode("v-if", true);
    };
  }
});
const VizTooltip = /* @__PURE__ */ _export_sfc(_sfc_main$49, [["__scopeId", "data-v-cdc68b50"]]);
const _sfc_main$48 = /* @__PURE__ */ defineComponent({
  __name: "GRadioButtonGroup",
  props: {
    options: { default: () => [] },
    value: { type: [String, Number, Boolean] },
    disabled: { type: Boolean },
    size: { default: "small" }
  },
  emits: ["update:value"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const antSize = () => props.size === "middle" ? "default" : props.size;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(RadioGroup), {
        class: "g-radio-button-group",
        "data-testid": "g-radio-button-group",
        "button-style": "solid",
        value: __props.value,
        disabled: __props.disabled,
        size: antSize(),
        "onUpdate:value": _cache[0] || (_cache[0] = ($event) => emit("update:value", $event))
      }, {
        default: withCtx(() => [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(__props.options, (opt) => {
              return openBlock(), createBlock(unref(RadioButton), {
                key: String(opt.value),
                value: opt.value,
                disabled: opt.disabled
              }, {
                default: withCtx(() => [
                  createTextVNode(
                    toDisplayString(opt.label),
                    1
                    /* TEXT */
                  )
                ]),
                _: 2
                /* DYNAMIC */
              }, 1032, ["value", "disabled"]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ]),
        _: 1
        /* STABLE */
      }, 8, ["value", "disabled", "size"]);
    };
  }
});
const GRadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$48, [["__scopeId", "data-v-f306f842"]]);
const _hoisted_1$37 = {
  key: 0,
  class: "req"
};
const _hoisted_2$2w = ["title"];
const _hoisted_3$2b = { class: "g-inline-field__control" };
const _sfc_main$47 = /* @__PURE__ */ defineComponent({
  __name: "GInlineField",
  props: {
    label: {},
    labelWidth: { default: 12 },
    tooltip: {},
    grow: { type: Boolean, default: false },
    disabled: { type: Boolean },
    required: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["g-inline-field", { grow: __props.grow, disabled: __props.disabled }]),
          "data-testid": "g-inline-field"
        },
        [
          __props.label ? (openBlock(), createElementBlock(
            "label",
            {
              key: 0,
              class: "g-inline-field__label",
              style: normalizeStyle({ width: __props.labelWidth * 8 + "px" })
            },
            [
              createTextVNode(
                toDisplayString(__props.label),
                1
                /* TEXT */
              ),
              __props.required ? (openBlock(), createElementBlock("span", _hoisted_1$37, "*")) : createCommentVNode("v-if", true),
              __props.tooltip ? (openBlock(), createElementBlock("span", {
                key: 1,
                class: "tip",
                title: __props.tooltip
              }, "?", 8, _hoisted_2$2w)) : createCommentVNode("v-if", true)
            ],
            4
            /* STYLE */
          )) : createCommentVNode("v-if", true),
          createElementVNode("div", _hoisted_3$2b, [
            renderSlot(_ctx.$slots, "default", {}, void 0, true)
          ])
        ],
        2
        /* CLASS */
      );
    };
  }
});
const GInlineField = /* @__PURE__ */ _export_sfc(_sfc_main$47, [["__scopeId", "data-v-e9723eaf"]]);
const _sfc_main$46 = {};
const _hoisted_1$36 = {
  class: "g-inline-field-row",
  "data-testid": "g-inline-field-row"
};
function _sfc_render(_ctx, _cache) {
  return openBlock(), createElementBlock("div", _hoisted_1$36, [
    renderSlot(_ctx.$slots, "default", {}, void 0, true)
  ]);
}
const GInlineFieldRow = /* @__PURE__ */ _export_sfc(_sfc_main$46, [["render", _sfc_render], ["__scopeId", "data-v-5aa6a096"]]);
const _sfc_main$45 = /* @__PURE__ */ defineComponent({
  __name: "GBadge",
  props: {
    text: {},
    color: { default: "default" },
    icon: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "span",
        {
          class: normalizeClass(["g-badge", "is-" + __props.color]),
          "data-testid": "g-badge"
        },
        [
          renderSlot(_ctx.$slots, "default", {}, () => [
            createTextVNode(
              toDisplayString(__props.text),
              1
              /* TEXT */
            )
          ], true)
        ],
        2
        /* CLASS */
      );
    };
  }
});
const GBadge = /* @__PURE__ */ _export_sfc(_sfc_main$45, [["__scopeId", "data-v-db66b1b6"]]);
const _sfc_main$44 = /* @__PURE__ */ defineComponent({
  __name: "GTag",
  props: {
    name: {},
    color: {},
    closable: { type: Boolean }
  },
  emits: ["remove", "click"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "span",
        {
          class: "g-tag",
          "data-testid": "g-tag",
          style: normalizeStyle(__props.color ? { background: __props.color, borderColor: __props.color } : void 0),
          onClick: _cache[1] || (_cache[1] = ($event) => emit("click"))
        },
        [
          createTextVNode(
            toDisplayString(__props.name) + " ",
            1
            /* TEXT */
          ),
          __props.closable ? (openBlock(), createElementBlock("button", {
            key: 0,
            type: "button",
            class: "g-tag__x",
            "aria-label": "remove",
            onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("remove"), ["stop"]))
          }, " × ")) : createCommentVNode("v-if", true)
        ],
        4
        /* STYLE */
      );
    };
  }
});
const GTag = /* @__PURE__ */ _export_sfc(_sfc_main$44, [["__scopeId", "data-v-ed695086"]]);
const _hoisted_1$35 = { class: "g-alert__body" };
const _hoisted_2$2v = {
  key: 0,
  class: "g-alert__title"
};
const _hoisted_3$2a = { class: "g-alert__content" };
const _sfc_main$43 = /* @__PURE__ */ defineComponent({
  __name: "GAlert",
  props: {
    title: {},
    severity: { default: "info" },
    closable: { type: Boolean, default: false }
  },
  emits: ["close"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["g-alert", "is-" + __props.severity]),
          "data-testid": "g-alert",
          role: "alert"
        },
        [
          createElementVNode("div", _hoisted_1$35, [
            __props.title ? (openBlock(), createElementBlock(
              "div",
              _hoisted_2$2v,
              toDisplayString(__props.title),
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true),
            createElementVNode("div", _hoisted_3$2a, [
              renderSlot(_ctx.$slots, "default", {}, void 0, true)
            ])
          ]),
          __props.closable ? (openBlock(), createElementBlock("button", {
            key: 0,
            type: "button",
            class: "g-alert__close",
            "aria-label": "close",
            onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
          }, " × ")) : createCommentVNode("v-if", true)
        ],
        2
        /* CLASS */
      );
    };
  }
});
const GAlert = /* @__PURE__ */ _export_sfc(_sfc_main$43, [["__scopeId", "data-v-3dfe15aa"]]);
const _hoisted_1$34 = {
  key: 0,
  class: "g-card__heading"
};
const _hoisted_2$2u = { class: "g-card__body" };
const _hoisted_3$29 = {
  key: 1,
  class: "g-card__actions"
};
const _sfc_main$42 = /* @__PURE__ */ defineComponent({
  __name: "GCard",
  props: {
    title: {},
    href: {},
    disabled: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["g-card", { disabled: __props.disabled }]),
          "data-testid": "g-card"
        },
        [
          __props.title || _ctx.$slots.heading ? (openBlock(), createElementBlock("div", _hoisted_1$34, [
            renderSlot(_ctx.$slots, "heading", {}, () => [
              createElementVNode(
                "h3",
                null,
                toDisplayString(__props.title),
                1
                /* TEXT */
              )
            ], true)
          ])) : createCommentVNode("v-if", true),
          createElementVNode("div", _hoisted_2$2u, [
            renderSlot(_ctx.$slots, "default", {}, void 0, true)
          ]),
          _ctx.$slots.actions ? (openBlock(), createElementBlock("div", _hoisted_3$29, [
            renderSlot(_ctx.$slots, "actions", {}, void 0, true)
          ])) : createCommentVNode("v-if", true)
        ],
        2
        /* CLASS */
      );
    };
  }
});
const GCard = /* @__PURE__ */ _export_sfc(_sfc_main$42, [["__scopeId", "data-v-80e26f56"]]);
const _hoisted_1$33 = { class: "g-confirm-body" };
const _sfc_main$41 = /* @__PURE__ */ defineComponent({
  __name: "GConfirmModal",
  props: {
    open: { type: Boolean },
    title: { default: "确认" },
    body: {},
    confirmText: { default: "确认" },
    cancelText: { default: "取消" },
    danger: { type: Boolean, default: false }
  },
  emits: ["update:open", "confirm", "cancel"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    function onOk() {
      emit("confirm");
      emit("update:open", false);
    }
    function onCancel() {
      emit("cancel");
      emit("update:open", false);
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$4A, {
        open: __props.open,
        title: __props.title,
        "ok-text": __props.confirmText,
        "cancel-text": __props.cancelText,
        "onUpdate:open": _cache[0] || (_cache[0] = ($event) => emit("update:open", $event)),
        onOk,
        onCancel
      }, {
        default: withCtx(() => [
          createElementVNode("p", _hoisted_1$33, [
            createTextVNode(
              toDisplayString(__props.body),
              1
              /* TEXT */
            ),
            renderSlot(_ctx.$slots, "default", {}, void 0, true)
          ])
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["open", "title", "ok-text", "cancel-text"]);
    };
  }
});
const GConfirmModal = /* @__PURE__ */ _export_sfc(_sfc_main$41, [["__scopeId", "data-v-650c8843"]]);
const _hoisted_1$32 = ["aria-label"];
const _hoisted_2$2t = {
  key: 0,
  class: "g-spinner__tip"
};
const _sfc_main$40 = /* @__PURE__ */ defineComponent({
  __name: "GSpinner",
  props: {
    size: { default: 24 },
    tip: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "g-spinner",
        "data-testid": "g-spinner",
        role: "status",
        "aria-label": __props.tip || "loading"
      }, [
        createElementVNode(
          "span",
          {
            class: "g-spinner__dot",
            style: normalizeStyle({ width: __props.size + "px", height: __props.size + "px" })
          },
          null,
          4
          /* STYLE */
        ),
        __props.tip ? (openBlock(), createElementBlock(
          "span",
          _hoisted_2$2t,
          toDisplayString(__props.tip),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$32);
    };
  }
});
const GSpinner = /* @__PURE__ */ _export_sfc(_sfc_main$40, [["__scopeId", "data-v-2a61b1d5"]]);
const _hoisted_1$31 = {
  class: "g-loading-placeholder",
  "data-testid": "g-loading-placeholder"
};
const _sfc_main$3$ = /* @__PURE__ */ defineComponent({
  __name: "GLoadingPlaceholder",
  props: {
    text: { default: "加载中…" }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$31, [
        createVNode(GSpinner, { tip: __props.text }, null, 8, ["tip"])
      ]);
    };
  }
});
const GLoadingPlaceholder = /* @__PURE__ */ _export_sfc(_sfc_main$3$, [["__scopeId", "data-v-8ce30ec6"]]);
const _sfc_main$3_ = /* @__PURE__ */ defineComponent({
  __name: "GPagination",
  props: {
    current: { default: 1 },
    pageSize: { default: 10 },
    total: { default: 0 },
    showSizeChanger: { type: Boolean, default: false }
  },
  emits: ["update:current", "update:pageSize", "change"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Pagination), {
        class: "g-pagination",
        "data-testid": "g-pagination",
        current: __props.current,
        "page-size": __props.pageSize,
        total: __props.total,
        "show-size-changer": __props.showSizeChanger,
        size: "small",
        onChange: _cache[0] || (_cache[0] = (p, ps) => {
          emit("update:current", p);
          emit("update:pageSize", ps);
          emit("change", p, ps);
        })
      }, null, 8, ["current", "page-size", "total", "show-size-changer"]);
    };
  }
});
const _hoisted_1$30 = {
  class: "g-segment-input",
  "data-testid": "g-segment-input"
};
const _hoisted_2$2s = {
  key: 0,
  class: "g-segment-input__label"
};
const _sfc_main$3Z = /* @__PURE__ */ defineComponent({
  __name: "GSegmentInput",
  props: {
    label: { default: "" },
    value: {},
    placeholder: { default: "" },
    disabled: { type: Boolean }
  },
  emits: ["update:value", "change"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    function onUpdate(v) {
      emit("update:value", v);
      emit("change", v);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$30, [
        __props.label ? (openBlock(), createElementBlock(
          "span",
          _hoisted_2$2s,
          toDisplayString(__props.label),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createVNode(GInput, {
          value: __props.value,
          placeholder: __props.placeholder,
          disabled: __props.disabled,
          "onUpdate:value": onUpdate
        }, null, 8, ["value", "placeholder", "disabled"])
      ]);
    };
  }
});
const GSegmentInput = /* @__PURE__ */ _export_sfc(_sfc_main$3Z, [["__scopeId", "data-v-c517b3f3"]]);
const _hoisted_1$2$ = {
  class: "g-toggletip__body",
  "data-testid": "g-toggletip-content"
};
const _sfc_main$3Y = /* @__PURE__ */ defineComponent({
  __name: "GToggletip",
  props: {
    title: {},
    content: {},
    placement: { default: "bottom" }
  },
  setup(__props) {
    const open = ref(false);
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Popover), {
        open: open.value,
        "onUpdate:open": _cache[1] || (_cache[1] = ($event) => open.value = $event),
        title: __props.title,
        placement: __props.placement,
        trigger: "click"
      }, {
        content: withCtx(() => [
          createElementVNode("div", _hoisted_1$2$, [
            renderSlot(_ctx.$slots, "content", {}, () => [
              createTextVNode(
                toDisplayString(__props.content),
                1
                /* TEXT */
              )
            ], true)
          ])
        ]),
        default: withCtx(() => [
          createElementVNode("button", {
            type: "button",
            class: "g-toggletip__trigger",
            "data-testid": "g-toggletip",
            onClick: _cache[0] || (_cache[0] = withModifiers(() => {
            }, ["stop"]))
          }, [
            renderSlot(_ctx.$slots, "default", {}, () => [
              _cache[2] || (_cache[2] = createTextVNode(
                "ⓘ",
                -1
                /* CACHED */
              ))
            ], true)
          ])
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["open", "title", "placement"]);
    };
  }
});
const GToggletip = /* @__PURE__ */ _export_sfc(_sfc_main$3Y, [["__scopeId", "data-v-df8a5c57"]]);
const _hoisted_1$2_ = {
  class: "g-popover__body",
  "data-testid": "g-popover-content"
};
const _hoisted_2$2r = { "data-testid": "g-popover" };
const _sfc_main$3X = /* @__PURE__ */ defineComponent({
  __name: "GPopover",
  props: {
    title: {},
    content: {},
    open: { type: Boolean },
    placement: { default: "top" },
    trigger: { default: "hover" }
  },
  emits: ["update:open"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(Popover), {
        open: __props.open,
        title: __props.title,
        placement: __props.placement,
        trigger: __props.trigger,
        "onUpdate:open": _cache[0] || (_cache[0] = ($event) => emit("update:open", $event))
      }, {
        content: withCtx(() => [
          createElementVNode("div", _hoisted_1$2_, [
            renderSlot(_ctx.$slots, "content", {}, () => [
              createTextVNode(
                toDisplayString(__props.content),
                1
                /* TEXT */
              )
            ], true)
          ])
        ]),
        default: withCtx(() => [
          createElementVNode("span", _hoisted_2$2r, [
            renderSlot(_ctx.$slots, "default", {}, void 0, true)
          ])
        ]),
        _: 3
        /* FORWARDED */
      }, 8, ["open", "title", "placement", "trigger"]);
    };
  }
});
const GPopover = /* @__PURE__ */ _export_sfc(_sfc_main$3X, [["__scopeId", "data-v-0a6daf18"]]);
const _hoisted_1$2Z = ["data-mode"];
const _hoisted_2$2q = ["value", "disabled"];
const _sfc_main$3W = /* @__PURE__ */ defineComponent({
  __name: "GDatePicker",
  props: {
    value: {},
    placeholder: { default: "时间" },
    allowRelative: { type: Boolean, default: true },
    disabled: { type: Boolean }
  },
  emits: ["update:value", "change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const isRelative = computed(() => {
      const v = props.value || "";
      return !v || /^now/i.test(v) || v.includes("$") || Number.isNaN(Date.parse(v));
    });
    function onUpdate(v) {
      emit("update:value", v);
      emit("change", v);
    }
    function toLocalInput(iso) {
      if (!iso) return "";
      const d = new Date(iso);
      if (Number.isNaN(d.getTime())) return "";
      const pad = (n) => String(n).padStart(2, "0");
      return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`;
    }
    function fromLocalInput(local) {
      if (!local) return "";
      const d = new Date(local);
      return Number.isNaN(d.getTime()) ? local : d.toISOString();
    }
    const mode2 = computed(() => isRelative.value ? "relative" : "absolute");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "g-date-picker",
        "data-testid": "g-date-picker",
        "data-mode": mode2.value
      }, [
        mode2.value === "relative" ? (openBlock(), createBlock(unref(Input), {
          key: 0,
          value: __props.value,
          placeholder: __props.placeholder + " (now-6h)",
          disabled: __props.disabled,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => onUpdate(String($event ?? "")))
        }, null, 8, ["value", "placeholder", "disabled"])) : (openBlock(), createElementBlock("input", {
          key: 1,
          type: "datetime-local",
          class: "g-date-picker__abs",
          value: toLocalInput(__props.value),
          disabled: __props.disabled,
          onInput: _cache[1] || (_cache[1] = ($event) => onUpdate(fromLocalInput($event.target.value)))
        }, null, 40, _hoisted_2$2q)),
        __props.allowRelative ? (openBlock(), createElementBlock(
          "button",
          {
            key: 2,
            type: "button",
            class: "g-date-picker__toggle",
            "data-testid": "g-date-picker-toggle",
            onClick: _cache[2] || (_cache[2] = ($event) => onUpdate(mode2.value === "relative" ? (/* @__PURE__ */ new Date()).toISOString() : "now-6h"))
          },
          toDisplayString(mode2.value === "relative" ? "绝对" : "相对"),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2Z);
    };
  }
});
const GDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main$3W, [["__scopeId", "data-v-ec86856e"]]);
const PANEL_IDS = [
  "alexanderzobnin-zabbix-triggers-panel",
  "signoz-issues",
  "text",
  "news",
  "dashlist",
  "annolist",
  "gettingstarted",
  "welcome",
  "stat",
  "gauge",
  "bargauge",
  "table",
  "logs",
  "logstable",
  "histogram",
  "timeseries",
  "barchart",
  "piechart",
  "candlestick",
  "trend",
  "state-timeline",
  "status-history",
  "heatmap",
  "geomap",
  "nodeGraph",
  "xychart",
  "canvas",
  "traces",
  "flamegraph",
  "live",
  "debug",
  "alertlist",
  "clock",
  "statusmap",
  "polystat",
  "button",
  "dynamictext",
  "gantt",
  "sankey",
  "radar",
  "funnel",
  "wordcloud",
  "treemap",
  "hourly-heatmap"
];
function applyGenericTypeMigration(panel2) {
  const type = panel2.type === "graph" ? "timeseries" : panel2.type === "singlestat" ? "stat" : panel2.type;
  let options = { ...panel2.options ?? {} };
  const fieldConfig = panel2.fieldConfig ?? { defaults: {}, overrides: [] };
  if (type === "text" && options.content == null && panel2.content != null) {
    options = {
      ...options,
      content: panel2.content,
      mode: panel2.mode ?? "markdown"
    };
  }
  if (type === "stat" || type === "gauge" || type === "bargauge") {
    options = {
      reduceOptions: { calcs: ["lastNotNull"], fields: "", values: false },
      orientation: "auto",
      ...options
    };
  }
  if (type === "timeseries") {
    options = {
      legend: { displayMode: "list", placement: "bottom", showLegend: true },
      tooltip: { mode: "single", sort: "none" },
      ...options
    };
  }
  if (type === "table") {
    options = { showHeader: true, cellHeight: "sm", ...options };
  }
  return {
    ...panel2,
    type,
    options,
    fieldConfig
  };
}
function ensurePanelShape(panel2, fallback) {
  const id = typeof panel2.id === "number" ? panel2.id : fallback.id;
  const type = typeof panel2.type === "string" && panel2.type ? panel2.type : fallback.type;
  const options = panel2.options && typeof panel2.options === "object" ? panel2.options : fallback.options ?? {};
  const fieldConfig = panel2.fieldConfig && typeof panel2.fieldConfig === "object" ? panel2.fieldConfig : fallback.fieldConfig ?? { defaults: {}, overrides: [] };
  return {
    ...panel2,
    id: id ?? fallback.id,
    type,
    options,
    fieldConfig: fieldConfig ?? fallback.fieldConfig
  };
}
function migratePanelModel(panel2) {
  let next = applyGenericTypeMigration(panel2);
  const plugin2 = getPanelPlugin(next.type);
  if (plugin2?.migratePanel) {
    try {
      const migrated = plugin2.migratePanel(
        structuredClone(next)
      );
      next = ensurePanelShape(migrated, next);
    } catch (e) {
      const message = e instanceof Error ? e.message : String(e);
      next = {
        ...next,
        // public zh-Hans notice; do not drop targets/datasource
        migrationNotice: `面板迁移失败：${message}`
      };
    }
  }
  if (plugin2?.migrateOptions) {
    try {
      const result = plugin2.migrateOptions(
        { ...next.options ?? {} },
        next.fieldConfig
      );
      next = {
        ...next,
        options: result.options,
        fieldConfig: result.fieldConfig ?? next.fieldConfig
      };
    } catch (e) {
      const message = e instanceof Error ? e.message : String(e);
      next = {
        ...next,
        migrationNotice: `面板选项迁移失败：${message}`
      };
    }
  }
  return next;
}
function migrateDashboardPanels(panels2 = []) {
  return panels2.map(migratePanelModel);
}
const panelHostKey = /* @__PURE__ */ Symbol("grafana-panel-host");
function createEmptyDashboardJson(title = "新仪表盘") {
  return {
    uid: "",
    title,
    description: "",
    schemaVersion: 39,
    version: 0,
    editable: true,
    panels: [],
    templating: { list: [] },
    annotations: { list: [] },
    time: { from: "now-6h", to: "now" },
    timepicker: {},
    timezone: "browser",
    refresh: "",
    tags: [],
    links: [],
    graphTooltip: 0
  };
}
function normalizeThresholds(t2) {
  if (!t2) return { mode: "absolute", steps: [{ color: "green", value: null }] };
  if (Array.isArray(t2)) {
    return { mode: "absolute", steps: t2 };
  }
  return {
    mode: t2.mode ?? "absolute",
    steps: Array.isArray(t2.steps) ? t2.steps : [{ color: "green", value: null }]
  };
}
function normalizeOverride(o) {
  if (!o || typeof o !== "object")
    return { matcher: { id: "byName", options: "" }, properties: [] };
  return {
    matcher: o.matcher ?? { id: "byName", options: "" },
    properties: Array.isArray(o.properties) ? o.properties : []
  };
}
function normalizePanelFieldConfig(fc) {
  if (!fc) return { defaults: {}, overrides: [] };
  return {
    defaults: {
      ...fc.defaults ?? {},
      custom: fc.defaults?.custom ?? {},
      thresholds: normalizeThresholds(fc.defaults?.thresholds),
      mappings: fc.defaults?.mappings ?? [],
      links: fc.defaults?.links ?? []
    },
    overrides: (fc.overrides ?? []).map(normalizeOverride)
  };
}
function normalizePanels(panels2) {
  if (!Array.isArray(panels2)) return [];
  return panels2.map((p, i) => {
    if (!p || typeof p !== "object") {
      return {
        id: i + 1,
        type: "stat",
        title: `Panel ${i + 1}`,
        gridPos: { x: 0, y: i * 8, w: 12, h: 8 },
        targets: [],
        options: {},
        fieldConfig: { defaults: {}, overrides: [] }
      };
    }
    return {
      ...p,
      id: p.id ?? i + 1,
      type: p.type ?? "stat",
      title: p.title ?? `Panel ${p.id ?? i + 1}`,
      gridPos: p.gridPos ?? { x: 0, y: i * 8, w: 12, h: 8 },
      targets: Array.isArray(p.targets) ? p.targets : [],
      options: p.options ?? {},
      fieldConfig: normalizePanelFieldConfig(p.fieldConfig),
      transformations: Array.isArray(p.transformations) ? p.transformations : []
    };
  });
}
function normalizeTemplating(templating) {
  if (!templating) return { list: [] };
  if (Array.isArray(templating)) return { list: templating };
  return {
    list: Array.isArray(templating.list) ? templating.list : []
  };
}
function normalizeAnnotations(annotations) {
  if (!annotations) return { list: [] };
  if (Array.isArray(annotations)) return { list: annotations };
  return {
    list: Array.isArray(annotations.list) ? annotations.list : []
  };
}
function normalizeDashboardJson(raw) {
  return {
    ...raw,
    uid: raw.uid ?? `local-${Date.now()}`,
    title: raw.title ?? "Untitled",
    schemaVersion: raw.schemaVersion ?? 1,
    version: raw.version ?? 0,
    panels: normalizePanels(raw.panels ?? []),
    templating: normalizeTemplating(raw.templating),
    annotations: normalizeAnnotations(raw.annotations),
    time: raw.time ?? { from: "now-6h", to: "now" },
    timepicker: raw.timepicker ?? {},
    refresh: raw.refresh ?? "",
    tags: raw.tags ?? [],
    links: raw.links ?? [],
    editable: raw.editable ?? true,
    graphTooltip: raw.graphTooltip ?? 0,
    timezone: raw.timezone ?? "browser",
    fiscalYearStartMonth: raw.fiscalYearStartMonth ?? 0,
    weekStart: raw.weekStart ?? "",
    liveNow: raw.liveNow ?? false
  };
}
function loadDashboardDocument(raw) {
  const normalized = normalizeDashboardJson(raw ?? {});
  try {
    const envelope = parseDashboardDocument(normalized);
    const doc = envelope.dashboard;
    return { ...doc, panels: migrateDashboardPanels(doc.panels ?? []) };
  } catch {
    const doc = preserveUnknownFields(normalized, migrateDashboard(normalized));
    return { ...doc, panels: migrateDashboardPanels(doc.panels ?? []) };
  }
}
function serializeDashboardDocument(doc) {
  return JSON.stringify(doc, null, 2);
}
function roundTripDashboard(raw) {
  return dashboardRoundTrip(raw);
}
function upsertPanel(doc, panel2) {
  const panels2 = [...doc.panels ?? []];
  const idx = panels2.findIndex((p) => p.id === panel2.id);
  if (idx >= 0) panels2[idx] = panel2;
  else panels2.push(panel2);
  return { ...doc, panels: panels2 };
}
function removePanel(doc, panelId) {
  return { ...doc, panels: (doc.panels ?? []).filter((p) => p.id !== panelId) };
}
function nextPanelId(doc) {
  return (doc.panels ?? []).reduce((max, p) => Math.max(max, p.id ?? 0), 0) + 1;
}
const VAR_REF = /\$([a-zA-Z_][a-zA-Z0-9_]*)|\$\{([^}:]+)(?::[^}]+)?\}/g;
function extractVariableRefs(text) {
  const out = /* @__PURE__ */ new Set();
  let m;
  const re = new RegExp(VAR_REF.source, "g");
  while (m = re.exec(text)) {
    out.add(m[1] || m[2]);
  }
  return [...out];
}
function buildVariableDependencyGraph(variables) {
  const graph = /* @__PURE__ */ new Map();
  const names = new Set(variables.map((v) => v.name));
  for (const v of variables) {
    const raw = typeof v.query === "string" ? v.query : JSON.stringify(v.query ?? "");
    const def = String(v.definition ?? "");
    const regex = String(v.regex ?? "");
    const refs = [
      ...extractVariableRefs(raw),
      ...extractVariableRefs(def),
      ...extractVariableRefs(regex)
    ].filter((r) => names.has(r) && r !== v.name);
    graph.set(v.name, [...new Set(refs)]);
  }
  return graph;
}
function detectVariableCycles(variables) {
  const graph = buildVariableDependencyGraph(variables);
  const cycles = [];
  const visiting = /* @__PURE__ */ new Set();
  const visited = /* @__PURE__ */ new Set();
  const stack = [];
  function dfs(node) {
    if (visiting.has(node)) {
      const idx = stack.indexOf(node);
      cycles.push(stack.slice(idx).concat(node));
      return;
    }
    if (visited.has(node)) return;
    visiting.add(node);
    stack.push(node);
    for (const dep of graph.get(node) ?? []) dfs(dep);
    stack.pop();
    visiting.delete(node);
    visited.add(node);
  }
  for (const name of graph.keys()) dfs(name);
  return cycles;
}
function variableRefreshOrder(variables) {
  const cycles = detectVariableCycles(variables);
  if (cycles.length) {
    throw new Error(`Variable dependency cycle: ${cycles[0].join(" -> ")}`);
  }
  const graph = buildVariableDependencyGraph(variables);
  const remaining = new Set(variables.map((v) => v.name));
  const order = [];
  while (remaining.size) {
    const next = [...remaining].filter(
      (n) => (graph.get(n) ?? []).every((d) => order.includes(d))
    );
    if (!next.length) {
      order.push(...remaining);
      break;
    }
    next.sort();
    for (const n of next) {
      order.push(n);
      remaining.delete(n);
    }
  }
  return order;
}
function encodeVariablesToUrl(variables, params = new URLSearchParams()) {
  for (const v of variables) {
    if (v.skipUrlSync) continue;
    const val = v.current?.value;
    if (val == null) continue;
    const key = `var-${v.name}`;
    if (Array.isArray(val)) {
      params.delete(key);
      for (const item of val) params.append(key, item);
    } else {
      params.set(key, String(val));
    }
  }
  return params;
}
function applyVariablesFromUrl(variables, params) {
  return variables.map((v) => {
    const key = `var-${v.name}`;
    if (!params.has(key)) return v;
    const all = params.getAll(key);
    const value = v.multi ? all : all[0] ?? "";
    const text = value;
    return {
      ...v,
      current: { text, value },
      options: (v.options ?? []).map((o) => ({
        ...o,
        selected: Array.isArray(value) ? value.includes(o.value) : o.value === value
      }))
    };
  });
}
function expandAllToken(variable, value, text) {
  const allValue = variable.allValue != null && String(variable.allValue) !== "" ? String(variable.allValue) : "/.*/";
  if (Array.isArray(value)) {
    if (!value.includes("$__all")) return { value, text };
    return { value: allValue, text: "All" };
  }
  if (String(value) === "$__all") {
    return { value: allValue, text: "All" };
  }
  return { value, text };
}
function buildScopedVars(variables) {
  const scoped = {};
  for (const v of variables) {
    const rawText = v.current?.text ?? "";
    const rawValue = v.current?.value ?? "";
    const expanded = expandAllToken(v, rawValue, rawText);
    scoped[v.name] = { text: expanded.text, value: expanded.value };
  }
  scoped.__org = { text: "Main Org.", value: "1" };
  scoped.__user = { text: "admin", value: "admin" };
  return scoped;
}
function replaceVariables(template, scopedVars) {
  return template.replace(
    /\$([a-zA-Z_][a-zA-Z0-9_]*)|\$\{([^}:]+)(?::([^}]+))?\}/g,
    (match, a, b, format) => {
      const name = a || b;
      const v = scopedVars[name];
      if (!v) return match;
      return formatVariableValue(v.value, format || "csv");
    }
  );
}
function formatVariableValue(value, format = "csv") {
  const values = Array.isArray(value) ? value : [value];
  switch (format) {
    case "json":
      return JSON.stringify(values);
    case "pipe":
      return values.join("|");
    case "queryparam":
      return values.map(encodeURIComponent).join("&");
    case "regex":
      return values.map((v) => v.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")).join("|");
    case "lucene":
      return values.map((v) => `"${v}"`).join(" OR ");
    case "csv":
    default:
      return values.join(",");
  }
}
function setVariableValue(variables, name, value, text) {
  return variables.map((v) => {
    if (v.name !== name) return v;
    const values = Array.isArray(value) ? value : [value];
    const texts = values;
    return {
      ...v,
      current: {
        text: texts.length === 1 ? texts[0] : texts,
        value: values.length === 1 ? values[0] : values
      },
      options: (v.options ?? []).map((o) => ({
        ...o,
        selected: values.includes(o.value)
      }))
    };
  });
}
const MAX_VARIABLE_OPTIONS = 80;
async function refreshVariableOptions(variable, resolveDs, scopedVars) {
  if (variable.type === "constant") {
    const value = String(variable.query ?? variable.current?.value ?? "");
    return {
      ...variable,
      current: { text: value, value },
      options: [{ text: value, value, selected: true }]
    };
  }
  if (variable.type === "custom") {
    const raw = String(variable.query ?? "");
    const options = raw.split(",").map((s) => s.trim()).filter(Boolean).map((v) => ({
      text: v,
      value: v,
      selected: String(variable.current?.value) === v
    }));
    return { ...variable, options };
  }
  if (variable.type === "query") {
    const ds2 = resolveDs(variable.datasource);
    if (!ds2?.metricFindQuery) return variable;
    const curVal = variable.current?.value;
    const curStr = Array.isArray(curVal) ? curVal.map(String).join(",") : String(curVal ?? "");
    const allVal = variable.allValue != null && String(variable.allValue) !== "" ? String(variable.allValue) : "/.*/";
    const curText = String(
      Array.isArray(variable.current?.text) ? variable.current?.text.join(",") : variable.current?.text ?? ""
    ).toLowerCase();
    const isAllCurrent = !!variable.includeAll && (curStr === "$__all" || curStr === allVal || curStr === "/.*/" || curStr === "*" || curText === "all" || curText === "全部");
    if (isAllCurrent) {
      return {
        ...variable,
        options: markRaw([
          { text: "全部", value: allVal, selected: true }
        ]),
        current: { text: "All", value: allVal }
      };
    }
    const rows = await ds2.metricFindQuery(
      variable.query ?? variable.definition ?? "",
      void 0,
      { scopedVars: scopedVars || {} }
    );
    let options = rows.map((r) => ({
      text: r.text,
      value: r.value,
      selected: String(variable.current?.value) === String(r.value)
    }));
    if (options.length > MAX_VARIABLE_OPTIONS) {
      options = options.slice(0, MAX_VARIABLE_OPTIONS);
    }
    const matched = options.find((o) => o.selected);
    const hasCurrent = curVal != null && String(curVal) !== "" && !(Array.isArray(curVal) && !curVal.length);
    const current = matched ? { text: matched.text, value: matched.value } : hasCurrent ? {
      text: String(
        Array.isArray(variable.current?.text) ? variable.current?.text.join(", ") : variable.current?.text ?? curVal
      ),
      value: curVal
    } : options[0] ? { text: options[0].text, value: options[0].value } : variable.current;
    return {
      ...variable,
      options: markRaw(options),
      current: current ?? variable.current
    };
  }
  if (variable.type === "interval") {
    const raw = String(variable.query ?? "1m,5m,10m,30m,1h");
    const options = raw.split(",").map((v) => {
      const value = v.trim();
      return {
        text: value,
        value,
        selected: String(variable.current?.value) === value
      };
    });
    return { ...variable, options };
  }
  if (variable.type === "textbox") {
    const value = String(variable.current?.value ?? variable.query ?? "");
    return {
      ...variable,
      current: { text: value, value },
      options: [{ text: value, value, selected: true }]
    };
  }
  if (variable.type === "datasource") {
    return variable;
  }
  if (variable.type === "adhoc") {
    return variable;
  }
  if (variable.type === "groupby") {
    const ds2 = resolveDs(variable.datasource);
    if (!ds2?.getTagKeys) {
      return { ...variable, options: [] };
    }
    const keys = await ds2.getTagKeys({});
    const options = (keys ?? []).map((k) => ({
      text: k.text,
      value: k.value ?? k.text,
      selected: false
    }));
    return { ...variable, options };
  }
  if (typeof console !== "undefined") {
    console.warn(`[variables] unknown type: ${variable.type}`);
  }
  return { ...variable, options: variable.options ?? [] };
}
async function refreshAllVariables(variables, resolveDs) {
  let order;
  try {
    order = variableRefreshOrder(variables);
  } catch (e) {
    console.warn(String(e));
    order = variables.map((v) => v.name);
  }
  const byName = new Map(variables.map((v) => [v.name, { ...v }]));
  const out = [];
  for (const name of order) {
    const v = byName.get(name);
    if (!v) continue;
    const progressive = variables.map(
      (orig) => out.find((o) => o.name === orig.name) ?? byName.get(orig.name) ?? orig
    );
    const refreshed = await refreshVariableOptions(
      v,
      resolveDs,
      buildScopedVars(progressive)
    );
    out.push(refreshed);
    byName.set(name, refreshed);
  }
  for (const v of variables) {
    if (!out.find((x) => x.name === v.name)) {
      const progressive = variables.map(
        (orig) => out.find((o) => o.name === orig.name) ?? byName.get(orig.name) ?? orig
      );
      out.push(
        await refreshVariableOptions(v, resolveDs, buildScopedVars(progressive))
      );
    }
  }
  return out;
}
function collectAdhocFilters(variables) {
  const out = [];
  for (const v of variables) {
    if (v.type !== "adhoc") continue;
    const filters = v.filters;
    if (Array.isArray(filters)) {
      for (const f of filters) {
        if (f && f.key && f.value !== void 0 && f.value !== "") out.push(f);
      }
    }
  }
  return out;
}
function applyAdhocFiltersToExpr(expr, filters) {
  if (!expr || !filters.length) return expr;
  const matchers = filters.map((f) => {
    const op = f.operator || "=";
    const val = String(f.value).replace(/\\/g, "\\\\").replace(/"/g, '\\"');
    if (op === "=~" || op === "!~" || op === "!=" || op === "=")
      return `${f.key}${op}"${val}"`;
    return `${f.key}="${val}"`;
  }).join(",");
  const brace = expr.indexOf("{");
  if (brace >= 0) {
    const endBrace = expr.indexOf("}", brace);
    if (endBrace > brace) {
      const inside = expr.slice(brace + 1, endBrace).trim();
      const merged = inside ? `${inside},${matchers}` : matchers;
      return expr.slice(0, brace + 1) + merged + expr.slice(endBrace);
    }
  }
  const rangeMatch = expr.match(/([a-zA-Z_:][a-zA-Z0-9_:]*)(\s*)\[/);
  if (rangeMatch && rangeMatch.index != null) {
    const insertAt = rangeMatch.index + rangeMatch[1].length;
    return expr.slice(0, insertAt) + `{${matchers}}` + expr.slice(insertAt);
  }
  const re = /([a-zA-Z_:][a-zA-Z0-9_:]*)/g;
  let best = null;
  let m;
  while (m = re.exec(expr)) {
    const after = expr.slice(m.index + m[1].length);
    if (/^\s*\(/.test(after)) continue;
    best = m;
  }
  if (best) {
    const at = best.index + best[1].length;
    return expr.slice(0, at) + `{${matchers}}` + expr.slice(at);
  }
  return expr + `{${matchers}}`;
}
function isRowPanel(panel2) {
  return panel2.type === "row";
}
function expandRepeats(panels2, repeatValues = {}) {
  const out = [];
  for (const panel2 of panels2) {
    const repeat = String(panel2.repeat ?? "");
    if (!repeat || !repeatValues[repeat]?.length) {
      out.push(panel2);
      continue;
    }
    const values = repeatValues[repeat];
    const direction = String(panel2.repeatDirection ?? "h");
    const maxPerRow = Number(panel2.maxPerRow ?? 4);
    values.forEach((value, index2) => {
      const clone2 = {
        ...panel2,
        id: panel2.id * 1e3 + index2,
        title: `${panel2.title ?? "Panel"} (${value})`,
        // stash repeat value for variable override
        ...{ repeatValue: value, repeatVar: repeat }
      };
      const base = panel2.gridPos ?? { x: 0, y: 0, w: 12, h: 8 };
      if (direction === "v") {
        clone2.gridPos = { ...base, y: base.y + index2 * base.h };
      } else {
        const col2 = index2 % maxPerRow;
        const row = Math.floor(index2 / maxPerRow);
        const w = Math.max(
          2,
          Math.floor(24 / Math.min(maxPerRow, values.length))
        );
        clone2.gridPos = { x: col2 * w, y: base.y + row * base.h, w, h: base.h };
      }
      out.push(clone2);
    });
  }
  return out;
}
function panelsToLayout(panels2, collapsedRowIds = /* @__PURE__ */ new Set()) {
  const items = [];
  let skipUntilY = null;
  for (const p of panels2 ?? []) {
    const g = p.gridPos ?? { x: 0, y: 0, w: 24, h: 1 };
    if (isRowPanel(p)) {
      items.push({
        i: `row-${p.id}`,
        x: 0,
        y: g.y,
        w: 24,
        h: 1,
        static: true,
        panelId: p.id,
        isRow: true
      });
      if (p.collapsed || collapsedRowIds.has(p.id)) {
        skipUntilY = nextRowY(panels2, p);
      } else {
        skipUntilY = null;
      }
      continue;
    }
    if (skipUntilY != null && g.y < skipUntilY) continue;
    items.push({
      i: String(p.id),
      x: g.x,
      y: g.y,
      w: g.w,
      h: g.h,
      panelId: p.id
    });
  }
  return items;
}
function nextRowY(panels2, row) {
  const y = row.gridPos?.y ?? 0;
  let next = Number.POSITIVE_INFINITY;
  for (const p of panels2) {
    if (!isRowPanel(p)) continue;
    const py = p.gridPos?.y ?? 0;
    if (py > y) next = Math.min(next, py);
  }
  return Number.isFinite(next) ? next : Number.POSITIVE_INFINITY;
}
function layoutToGridPos(item) {
  return { x: item.x, y: item.y, w: item.w, h: item.h };
}
function applyLayoutToPanels(panels2, layout) {
  const map = new Map(
    layout.filter((l) => !l.isRow).map((l) => [l.panelId, l])
  );
  return panels2.map((p) => {
    const l = map.get(p.id);
    if (!l) return p;
    return { ...p, gridPos: layoutToGridPos(l) };
  });
}
function collides(a, b) {
  return a.x < b.x + b.w && a.x + a.w > b.x && a.y < b.y + b.h && a.y + a.h > b.y;
}
function findOpenPosition(panels2, size) {
  const occupied = panels2.filter((p) => !isRowPanel(p)).map((p) => p.gridPos ?? { x: 0, y: 0, w: 12, h: 8 });
  for (let y = 0; y < 1e3; y++) {
    for (let x = 0; x <= 24 - size.w; x++) {
      const candidate = { x, y, w: size.w, h: size.h };
      if (!occupied.some((o) => collides(candidate, o))) return candidate;
    }
  }
  return { x: 0, y: 0, w: size.w, h: size.h };
}
function buildShareUrl(opts) {
  const base = opts.appSubUrl ?? "";
  const path = opts.solo ? `${base}/d-solo/${opts.uid}${opts.slug ? "/" + opts.slug : ""}` : `${base}/d/${opts.uid}${opts.slug ? "/" + opts.slug : ""}`;
  const params = new URLSearchParams();
  if (opts.orgId) params.set("orgId", String(opts.orgId));
  if (opts.from) params.set("from", opts.from);
  if (opts.to) params.set("to", opts.to);
  if (opts.theme) params.set("theme", opts.theme);
  if (opts.panelId) params.set("viewPanel", String(opts.panelId));
  if (opts.kiosk === true) params.set("kiosk", "true");
  if (opts.kiosk === "tv") params.set("kiosk", "tv");
  if (opts.variables) {
    for (const [k, v] of Object.entries(opts.variables)) {
      if (Array.isArray(v))
        v.forEach((item) => params.append(`var-${k}`, item));
      else params.set(`var-${k}`, v);
    }
  }
  const q = params.toString();
  return q ? `${path}?${q}` : path;
}
function buildEmbedHtml(opts) {
  const url = buildShareUrl({ ...opts, solo: true });
  const w = opts.width ?? 450;
  const h2 = opts.height ?? 200;
  return `<iframe src="${escapeAttr(url)}" width="${w}" height="${h2}" frameborder="0" sandbox="allow-scripts allow-same-origin" referrerpolicy="no-referrer"></iframe>`;
}
function escapeAttr(s) {
  return s.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;");
}
function buildSnapshotExport(dashboard, meta2 = {}) {
  return {
    dashboard,
    name: meta2.name ?? String(dashboard.title ?? "Snapshot"),
    expires: meta2.expires ?? 0,
    external: false,
    key: `snap-${Date.now().toString(36)}`
  };
}
function buildDashboardJsonExport(dashboard) {
  return JSON.stringify(
    {
      dashboard,
      meta: { type: "db", canSave: true, canEdit: true, canStar: false }
    },
    null,
    2
  );
}
function redactSecrets$1(value) {
  if (value == null) return value;
  if (typeof value === "string") {
    if (/bearer\s+[a-z0-9._\-]+/i.test(value) || /api[_-]?key|password|secret|token/i.test(value)) {
      return "[redacted]";
    }
    return value;
  }
  if (Array.isArray(value)) return value.map(redactSecrets$1);
  if (typeof value === "object") {
    const out = {};
    for (const [k, v] of Object.entries(value)) {
      if (/password|secret|token|authorization|credential|api[_-]?key/i.test(k)) {
        out[k] = "[redacted]";
      } else {
        out[k] = redactSecrets$1(v);
      }
    }
    return out;
  }
  return value;
}
function buildInspectorSnapshot(panel2, data) {
  const frames = data?.series ?? [];
  const fieldTypes = {};
  for (const f of frames) {
    for (const field of f.fields) {
      fieldTypes[field.type] = (fieldTypes[field.type] ?? 0) + 1;
    }
  }
  const targets = panel2.targets ?? [];
  return {
    panelId: panel2.id,
    title: panel2.title,
    type: panel2.type,
    queryCount: targets.length,
    frameCount: frames.length,
    state: data?.state ?? "NotStarted",
    error: data?.error?.message,
    requestId: data?.request?.requestId,
    fieldNames: frames.flatMap((f) => f.fields.map((field) => field.name)),
    stats: {
      seriesCount: frames.length,
      rowCounts: frames.map((f) => f.length),
      fieldTypes
    },
    queries: targets.map((t2) => ({
      refId: t2.refId,
      datasource: redactSecrets$1(t2.datasource),
      hide: t2.hide
    })),
    rawOptions: redactSecrets$1(
      panel2.options ?? {}
    ) ?? {},
    rawFieldConfig: redactSecrets$1(panel2.fieldConfig),
    requestSummary: {
      requestId: data?.request?.requestId,
      targetCount: targets.length,
      refIds: targets.map((t2) => String(t2.refId ?? "")),
      hasDatasourceUid: targets.some(
        (t2) => Boolean(t2?.datasource?.uid || t2?.datasource)
      )
    },
    transformSteps: data?.transformSteps,
    seriesBeforeTransformCount: data?.seriesBeforeTransform?.length
  };
}
async function runAnnotationQueries(queries, range, resolve) {
  const enabled = queries.filter((q) => q.enable !== false && !q.hide);
  const events = [];
  for (const q of enabled) {
    const ds2 = resolve(q.datasource);
    if (!ds2) continue;
    try {
      let frames = [];
      if (typeof ds2.annotationQuery === "function") {
        const res = await ds2.annotationQuery({
          range,
          annotation: q
        });
        frames = Array.isArray(res) ? res : res ? [res] : [];
      } else if (ds2.query) {
        const res = await ds2.query({
          requestId: `anno-${q.name}`,
          targets: [
            { refId: "Anno", ...q.target ?? {}, datasource: q.datasource }
          ],
          range
        });
        frames = res.data;
      }
      for (const frame of frames) {
        const time = frame.fields.find(
          (f) => f.type === "time" || f.name.toLowerCase() === "time"
        );
        const text = frame.fields.find(
          (f) => f.name.toLowerCase() === "text" || f.name.toLowerCase() === "title"
        );
        const tags = frame.fields.find((f) => f.name.toLowerCase() === "tags");
        if (!time) continue;
        for (let i = 0; i < time.values.length; i++) {
          const tagVal = tags?.values[i];
          events.push({
            time: Number(time.values[i]),
            title: String(text?.values[i] ?? q.name),
            text: text ? String(text.values[i] ?? "") : void 0,
            color: q.iconColor,
            tags: typeof tagVal === "string" ? tagVal.split(",") : [q.name]
          });
        }
      }
    } catch {
    }
  }
  return events.sort((a, b) => a.time - b.time);
}
function createPanelEditorState(panel2) {
  return {
    panel: JSON.parse(JSON.stringify(panel2)),
    tab: "query"
  };
}
function applyPanelTypeChange(panel2, type) {
  const plugin2 = getPanelPlugin(type);
  return {
    ...panel2,
    type,
    options: plugin2?.defaultOptions ? { ...plugin2.defaultOptions } : { ...panel2.options ?? {} }
  };
}
class DashboardHistory {
  undoStack = [];
  redoStack = [];
  limit;
  constructor(limit = 50) {
    this.limit = limit;
  }
  push(doc) {
    const snap = JSON.stringify(doc);
    const last = this.undoStack[this.undoStack.length - 1];
    if (last === snap) return;
    this.undoStack.push(snap);
    if (this.undoStack.length > this.limit) this.undoStack.shift();
    this.redoStack = [];
  }
  canUndo() {
    return this.undoStack.length > 1;
  }
  canRedo() {
    return this.redoStack.length > 0;
  }
  undo(current) {
    if (!this.canUndo()) return null;
    const cur = JSON.stringify(current);
    this.redoStack.push(cur);
    this.undoStack.pop();
    const prev = this.undoStack[this.undoStack.length - 1];
    if (!prev) return null;
    return JSON.parse(prev);
  }
  redo(current) {
    if (!this.canRedo()) return null;
    this.undoStack.push(JSON.stringify(current));
    const next = this.redoStack.pop();
    if (!next) return null;
    this.undoStack.push(next);
    return JSON.parse(next);
  }
  reset(doc) {
    this.undoStack = [JSON.stringify(doc)];
    this.redoStack = [];
  }
}
function buildSceneGraph(doc, time) {
  const root = {
    uid: `dashboard:${doc.uid ?? doc.title ?? "root"}`,
    kind: "dashboard",
    title: doc.title,
    children: [],
    state: {
      editable: doc.editable !== false,
      tags: doc.tags ?? [],
      timezone: doc.timezone
    }
  };
  root.children.push({
    uid: "timeRange",
    kind: "timeRange",
    title: "Time range",
    children: [],
    state: { from: time?.from ?? doc.time?.from, to: time?.to ?? doc.time?.to }
  });
  for (const v of doc.templating?.list ?? []) {
    root.children.push(variableNode(v));
  }
  let currentRow = null;
  for (const panel2 of doc.panels ?? []) {
    if (panel2.type === "row") {
      currentRow = {
        uid: `row:${panel2.id}`,
        kind: "row",
        title: panel2.title,
        panelId: panel2.id,
        children: [],
        state: { collapsed: !!panel2.collapsed, repeat: panel2.repeat }
      };
      root.children.push(currentRow);
      const nested = Array.isArray(panel2.panels) ? panel2.panels : [];
      for (const child of nested) {
        currentRow.children.push(panelNode(child));
      }
      continue;
    }
    const node = panelNode(panel2);
    if (currentRow && !panel2.gridPos) {
      currentRow.children.push(node);
    } else {
      root.children.push(node);
    }
  }
  return root;
}
function variableNode(v) {
  return {
    uid: `var:${v.name}`,
    kind: "variable",
    title: v.label || v.name,
    children: [],
    state: {
      type: v.type,
      current: v.current,
      multi: v.multi,
      includeAll: v.includeAll
    }
  };
}
function panelNode(panel2) {
  return {
    uid: `panel:${panel2.id}`,
    kind: "panel",
    title: panel2.title,
    panelId: panel2.id,
    children: (panel2.targets ?? []).map((t2, i) => ({
      uid: `query:${panel2.id}:${t2.refId ?? i}`,
      kind: "query",
      title: String(t2.refId ?? i),
      children: [],
      state: { datasource: t2.datasource, hide: t2.hide }
    })),
    state: {
      type: panel2.type,
      gridPos: panel2.gridPos,
      transparent: panel2.transparent,
      repeat: panel2.repeat
    }
  };
}
let clipboard = null;
function copyPanel(panel2) {
  clipboard = JSON.parse(JSON.stringify(panel2));
}
function hasClipboardPanel() {
  return clipboard != null;
}
function pastePanel(nextId, gridPos) {
  if (!clipboard) return null;
  const panel2 = JSON.parse(JSON.stringify(clipboard));
  panel2.id = nextId;
  panel2.title = panel2.title ? `${panel2.title} copy` : `Panel ${nextId}`;
  if (panel2.gridPos)
    panel2.gridPos = {
      ...panel2.gridPos,
      y: (panel2.gridPos.y ?? 0) + (panel2.gridPos.h ?? 8)
    };
  return panel2;
}
function duplicatePanel(panel2, nextId) {
  copyPanel(panel2);
  return pastePanel(nextId) ?? { ...panel2, id: nextId };
}
const store$1 = /* @__PURE__ */ new Map();
function saveLibraryPanel(panel2, name, uid) {
  const id = uid || panel2?.libraryPanel?.uid || `lib-${Date.now().toString(36)}`;
  const entryName = name || panel2?.libraryPanel?.name || panel2.title || id;
  const entry = {
    uid: id,
    name: entryName,
    version: (store$1.get(id)?.version ?? 0) + 1,
    model: JSON.parse(
      JSON.stringify({ ...panel2, libraryPanel: { uid: id, name: entryName } })
    )
  };
  delete entry.model.id;
  delete entry.model.isNew;
  store$1.set(id, entry);
  return entry;
}
function listLibraryPanels() {
  return [...store$1.values()];
}
function instantiateLibraryPanel(uid, id) {
  const lib = store$1.get(uid);
  if (!lib) return void 0;
  return {
    ...JSON.parse(JSON.stringify(lib.model)),
    id,
    libraryPanel: { uid: lib.uid, name: lib.name }
  };
}
function updateLibraryPanelFromInstance(panel2) {
  const ref2 = panel2?.libraryPanel;
  if (!ref2?.uid) return null;
  return saveLibraryPanel(panel2, ref2.name || panel2.title || ref2.uid, ref2.uid);
}
function applyLibraryModelToInstance(instance, lib) {
  const model = JSON.parse(JSON.stringify(lib.model));
  return {
    ...model,
    id: instance.id,
    gridPos: instance.gridPos,
    libraryPanel: { uid: lib.uid, name: lib.name }
  };
}
function syncLibraryPanelInstances(panels2, source) {
  const ref2 = source?.libraryPanel;
  if (!ref2?.uid) return panels2;
  const lib = updateLibraryPanelFromInstance(source);
  if (!lib) return panels2;
  return panels2.map((p) => {
    if (p.id === source.id) {
      return {
        ...source,
        libraryPanel: { uid: lib.uid, name: lib.name }
      };
    }
    const pRef = p?.libraryPanel;
    if (pRef?.uid === lib.uid) {
      return applyLibraryModelToInstance(p, lib);
    }
    return p;
  });
}
function unlinkLibraryPanel(panel2) {
  const next = JSON.parse(JSON.stringify(panel2));
  delete next.libraryPanel;
  return next;
}
const STORAGE_KEY = "grafana-vue-imported-dashboards";
function readAll() {
  if (typeof localStorage === "undefined") return {};
  try {
    return JSON.parse(localStorage.getItem(STORAGE_KEY) || "{}");
  } catch {
    return {};
  }
}
function writeAll(map) {
  if (typeof localStorage === "undefined") return;
  localStorage.setItem(STORAGE_KEY, JSON.stringify(map));
}
function saveImportedDashboard(raw, opts) {
  const uid = String(raw.uid || `import-${Date.now().toString(36)}`);
  const title = String(raw.title || "Imported dashboard");
  const overwrite = opts?.overwrite !== false;
  const all = readAll();
  if (!overwrite && all[uid]) {
    const err = new Error(`DASHBOARD_UID_EXISTS: ${uid}`);
    err.code = "DASHBOARD_UID_EXISTS";
    throw err;
  }
  const normalized = { ...raw, uid, title };
  const rec = {
    uid,
    title,
    raw: normalized,
    original: opts?.original ? JSON.parse(JSON.stringify(opts.original)) : void 0,
    savedAt: (/* @__PURE__ */ new Date()).toISOString()
  };
  all[uid] = rec;
  writeAll(all);
  return rec;
}
function getImportedDashboard(uid) {
  return readAll()[uid]?.raw;
}
function listImportedDashboards() {
  return Object.values(readAll()).sort(
    (a, b) => b.savedAt.localeCompare(a.savedAt)
  );
}
function collectDatasourceRefPaths(dashboard) {
  const paths = /* @__PURE__ */ new Set();
  const seen = /* @__PURE__ */ new WeakSet();
  function walk(cur, path) {
    if (cur == null || typeof cur !== "object") return;
    if (seen.has(cur)) return;
    seen.add(cur);
    if (Array.isArray(cur)) {
      cur.forEach((item, i) => walk(item, [...path, String(i)]));
      return;
    }
    const obj = cur;
    for (const [key, val] of Object.entries(obj)) {
      const nextPath = [...path, key];
      if (key === "datasource") {
        paths.add(nextPath.join("/"));
      }
      walk(val, nextPath);
    }
  }
  walk(dashboard, []);
  return [...paths];
}
function extractInputsFromDashboard(dashboard) {
  if (Array.isArray(dashboard.__inputs))
    return dashboard.__inputs;
  return [];
}
function applyDatasourceMappings(dashboard, mappings, typeByUid = {}) {
  let next = JSON.parse(JSON.stringify(dashboard));
  const paths = collectDatasourceRefPaths(next);
  for (const path of paths) {
    const val = getAtPath(next, path);
    if (val == null) continue;
    if (typeof val === "string") {
      const key = val.replace(/^\$\{|\}$/g, "");
      if (mappings[val] || mappings[key] || mappings[`\${${key}}`]) {
        const uid = mappings[val] || mappings[key] || mappings[`\${${key}}`];
        next = setAtPath(next, path, {
          type: typeByUid[uid] ?? "datasource",
          uid
        });
      }
      continue;
    }
    if (typeof val === "object") {
      const uid = val.uid;
      if (typeof uid === "string" && (uid.startsWith("${") || mappings[uid])) {
        const key = uid.replace(/^\$\{|\}$/g, "");
        const mapped = mappings[uid] || mappings[key] || mappings[`\${${key}}`];
        if (mapped) {
          next = setAtPath(next, path, {
            type: typeByUid[mapped] ?? val.type ?? "datasource",
            uid: mapped
          });
        }
      }
    }
  }
  for (const [name, value] of Object.entries(mappings)) {
    if (!name.startsWith("constant:") && !name.startsWith("VAR_")) continue;
    const varName = name.replace(/^constant:/, "").replace(/^VAR_/, "");
    const list = next.templating?.list ?? [];
    const idx = list.findIndex((v) => v.name === varName);
    if (idx >= 0) {
      next = setAtPath(next, `templating/list/${idx}/current`, {
        value,
        text: String(value)
      });
      next = setAtPath(next, `templating/list/${idx}/query`, value);
    }
  }
  return next;
}
function buildImportPreview(dashboard, mappings, typeByUid = {}) {
  const applied = applyDatasourceMappings(dashboard, mappings, typeByUid);
  const unresolved = [];
  for (const path of collectDatasourceRefPaths(applied)) {
    const val = getAtPath(applied, path);
    const uid = typeof val === "string" ? val : val?.uid;
    if (typeof uid === "string" && (uid.includes("${") || uid.startsWith("$"))) {
      unresolved.push(path);
    }
  }
  return { dashboard: applied, unresolved };
}
function offsetToLineColumn(text, offset) {
  if (offset < 0 || !Number.isFinite(offset)) {
    return { line: 1, column: 1 };
  }
  let line = 1;
  let column = 1;
  const max = Math.min(offset, text.length);
  for (let i = 0; i < max; i++) {
    if (text.charCodeAt(i) === 10) {
      line += 1;
      column = 1;
    } else {
      column += 1;
    }
  }
  return { line, column };
}
function parseJsonWithPosition(text) {
  try {
    return { ok: true, value: JSON.parse(text) };
  } catch (cause) {
    const message = cause instanceof Error ? cause.message : String(cause);
    const match = /position (\d+)/i.exec(message);
    const offset = Number(match?.[1] ?? -1);
    const { line, column } = offsetToLineColumn(text, offset);
    return { ok: false, message, offset, line, column };
  }
}
async function parseImportJsonText(text) {
  return parseJsonWithPosition(text);
}
function createImportWizardState() {
  return {
    step: "upload",
    rawText: "",
    title: "",
    uid: "",
    overwrite: true,
    mappings: {},
    typeByUid: {},
    inputs: [],
    mode: "local-preview"
  };
}
function parseWizardPayload(state2, text) {
  try {
    const parsed = JSON.parse(text);
    const envelope = parseDashboardDocument(parsed);
    const inputs = extractInputsFromDashboard(envelope.dashboard) ?? envelope.inputs ?? [];
    const rawDocument = envelope.original && typeof envelope.original === "object" ? JSON.parse(JSON.stringify(envelope.original)) : JSON.parse(JSON.stringify(parsed));
    return {
      ...state2,
      rawText: text,
      envelope,
      rawDocument,
      title: String(envelope.dashboard.title ?? "Imported"),
      uid: String(
        envelope.dashboard.uid ?? `import-${Date.now().toString(36)}`
      ),
      inputs,
      error: void 0,
      parseLine: void 0,
      parseColumn: void 0,
      step: "options",
      preview: void 0
    };
  } catch (e) {
    return {
      ...state2,
      rawText: text,
      error: e instanceof Error ? e.message : String(e),
      step: "upload"
    };
  }
}
async function parseWizardPayloadAsync(state2, text) {
  const result = await parseImportJsonText(text);
  if (!result.ok) {
    return {
      ...state2,
      rawText: text,
      error: `${result.message} (行 ${result.line}, 列 ${result.column})`,
      parseLine: result.line,
      parseColumn: result.column,
      step: "upload",
      envelope: void 0,
      preview: void 0
    };
  }
  try {
    const envelope = parseDashboardDocument(result.value);
    const inputs = extractInputsFromDashboard(envelope.dashboard) ?? envelope.inputs ?? [];
    const rawDocument = envelope.original && typeof envelope.original === "object" ? JSON.parse(JSON.stringify(envelope.original)) : JSON.parse(JSON.stringify(result.value));
    return {
      ...state2,
      rawText: text,
      envelope,
      rawDocument,
      title: String(envelope.dashboard.title ?? "Imported"),
      uid: String(
        envelope.dashboard.uid ?? `import-${Date.now().toString(36)}`
      ),
      inputs,
      error: void 0,
      parseLine: void 0,
      parseColumn: void 0,
      step: "options",
      preview: void 0
    };
  } catch (e) {
    return {
      ...state2,
      rawText: text,
      error: e instanceof Error ? e.message : String(e),
      step: "upload"
    };
  }
}
function refreshImportPreview(state2) {
  if (!state2.envelope) return state2;
  const preview = buildImportPreview(
    state2.envelope.dashboard,
    state2.mappings,
    state2.typeByUid
  );
  return { ...state2, preview };
}
function commitImport(state2) {
  if (!state2.envelope) throw new Error("No dashboard loaded");
  const preview = state2.preview ?? buildImportPreview(
    state2.envelope.dashboard,
    state2.mappings,
    state2.typeByUid
  );
  if (preview.unresolved.length > 0) {
    const err = new Error(
      `DATASOURCE_REQUIRED: unresolved datasource refs: ${preview.unresolved.join(", ")}`
    );
    err.code = "DATASOURCE_REQUIRED";
    throw err;
  }
  let dash = JSON.parse(JSON.stringify(preview.dashboard));
  dash.title = state2.title;
  dash.uid = state2.uid;
  if (Object.keys(state2.mappings).length) {
    dash = applyDatasourceMappings(dash, state2.mappings, state2.typeByUid);
  }
  const rec = saveImportedDashboard(dash, {
    overwrite: state2.overwrite,
    original: state2.rawDocument ?? state2.envelope.original
  });
  return { uid: rec.uid, title: rec.title, raw: rec.raw };
}
function dsToken(type, used) {
  const base = `DS_${type.replace(/[^a-zA-Z0-9]+/g, "_").toUpperCase()}`;
  const n = used.get(base) ?? 0;
  used.set(base, n + 1);
  return n === 0 ? base : `${base}_${n + 1}`;
}
function walkDatasourceRefs(obj, visit) {
  if (!obj || typeof obj !== "object") return;
  if (Array.isArray(obj)) {
    obj.forEach((v) => walkDatasourceRefs(v, visit));
    return;
  }
  for (const [k, v] of Object.entries(obj)) {
    if (k === "datasource" && v && typeof v === "object") visit(obj, k, v);
    else walkDatasourceRefs(v, visit);
  }
}
function exportDashboard(envelope, options) {
  const dash = JSON.parse(
    JSON.stringify(envelope.dashboard ?? envelope)
  );
  if (options.mode === "backup") {
    delete dash.__inputs;
    delete dash.__requires;
    return dash;
  }
  const dsList = options.datasources ?? [];
  const byUid2 = new Map(dsList.map((d) => [d.uid, d]));
  const used = /* @__PURE__ */ new Map();
  const inputs = [];
  const requires = /* @__PURE__ */ new Map();
  const uidToToken = /* @__PURE__ */ new Map();
  walkDatasourceRefs(dash, (_parent, _key, ref2) => {
    const uid = ref2.uid;
    if (!uid || uid.startsWith("${")) return;
    if (!uidToToken.has(uid)) {
      const ds2 = byUid2.get(uid);
      const type = ds2?.type ?? ref2.type ?? "datasource";
      const token2 = dsToken(String(type), used);
      uidToToken.set(uid, token2);
      inputs.push({
        name: token2,
        type: "datasource",
        pluginId: type,
        pluginName: ds2?.name ?? type
      });
      requires.set(`datasource:${type}`, {
        type: "datasource",
        id: type,
        name: ds2?.name ?? type,
        version: ds2?.pluginVersion ?? "1.0.0"
      });
    }
    const token = uidToToken.get(uid);
    ref2.uid = `\${${token}}`;
  });
  for (const v of dash.templating?.list ?? []) {
    if (v.type === "constant") {
      inputs.push({
        name: `VAR_${String(v.name).toUpperCase()}`,
        type: "constant",
        label: v.label ?? v.name,
        value: v.current?.value ?? v.query ?? ""
      });
    }
  }
  for (const p of dash.panels ?? []) {
    requires.set(`panel:${p.type}`, {
      type: "panel",
      id: p.type,
      name: p.type,
      version: "1.0.0"
    });
  }
  return {
    ...dash,
    __inputs: inputs,
    __requires: [...requires.values()]
  };
}
function clonePanel$1(panel2) {
  return JSON.parse(JSON.stringify(panel2));
}
function panelJson(panel2) {
  return JSON.stringify(panel2);
}
function createPanelEditSession(opts) {
  const options = opts && typeof opts === "object" && "panel" in opts ? opts : { panel: opts };
  const workingPanel = options.panel;
  const originalPanelSnapshot = clonePanel$1(workingPanel);
  const savedBaselineJson = panelJson(originalPanelSnapshot);
  const session = {
    panelId: workingPanel.id,
    pathId: options.pathId,
    isNewPanel: Boolean(options.isNewPanel),
    isLibraryPanel: Boolean(options.isLibraryPanel),
    originalPanelSnapshot,
    originalLayoutSnapshot: workingPanel.gridPos ? { ...workingPanel.gridPos } : void 0,
    workingPanel,
    originalData: options.originalData,
    phase: "editing",
    tableView: false,
    lastResult: void 0,
    pluginError: null,
    savedBaselineJson,
    get isDirty() {
      return panelJson(this.workingPanel) !== this.savedBaselineJson;
    }
  };
  return session;
}
function backToDashboard(session) {
  if (session.phase !== "editing") {
    throw new Error("session not editing");
  }
  session.phase = "closed";
  return { session, retainWorkingChanges: true, commitHistoryBatch: true };
}
function discard(session) {
  if (session.phase !== "editing") {
    throw new Error("session not editing");
  }
  if (session.isNewPanel) {
    session.phase = "closed";
    return { kind: "delete-new", session, panelId: session.panelId };
  }
  const restored = clonePanel$1(session.originalPanelSnapshot);
  Object.keys(session.workingPanel).forEach((k) => {
    delete session.workingPanel[k];
  });
  Object.assign(session.workingPanel, restored);
  session.phase = "closed";
  return { kind: "restore-existing", session, panel: session.workingPanel };
}
function dashboardSaved(session) {
  if (session.phase !== "editing") {
    throw new Error("session not editing");
  }
  session.savedBaselineJson = panelJson(session.workingPanel);
  session.originalPanelSnapshot = clonePanel$1(session.workingPanel);
  return session;
}
function openPanelEditSession(panel2, opts = {}) {
  return createPanelEditSession({
    panel: panel2,
    isNewPanel: opts.isNewPanel ?? Boolean(panel2.isNew),
    isLibraryPanel: opts.isLibraryPanel ?? Boolean(panel2.libraryPanel),
    pathId: opts.pathId
  });
}
function exitBack(session, workingPanel) {
  Object.assign(session.workingPanel, workingPanel);
  const result = backToDashboard(session);
  delete session.workingPanel.isNew;
  return {
    kind: "back",
    session: result.session,
    panel: session.workingPanel,
    commitHistory: result.commitHistoryBatch
  };
}
function exitDiscard(session) {
  const result = discard(session);
  if (result.kind === "delete-new") {
    return {
      kind: "discard-delete",
      session: result.session,
      panelId: result.panelId
    };
  }
  return {
    kind: "discard-restore",
    session: result.session,
    panel: result.panel
  };
}
function saveDashboardWhileEditing(session, workingPanel) {
  Object.assign(session.workingPanel, workingPanel);
  return dashboardSaved(session);
}
function exclusiveEditViewQuery(base, opts) {
  const next = { ...base };
  delete next.editPanel;
  delete next.viewPanel;
  delete next.edit;
  delete next.view;
  if (opts.mode === "edit") next.editPanel = String(opts.panelId);
  if (opts.mode === "view") next.viewPanel = String(opts.panelId);
  return next;
}
function runPanelDataPipeline(input) {
  const withTrace = input.withTrace === true;
  let frames;
  let transformTrace = [];
  let diagnostics = [];
  if (withTrace) {
    const pipeline = applyTransformationsWithTrace(
      input.series ?? [],
      input.transformations ?? []
    );
    frames = pipeline.frames;
    transformTrace = pipeline.steps;
    diagnostics = pipeline.diagnostics;
  } else {
    frames = applyTransformations(
      input.series ?? [],
      input.transformations ?? []
    );
  }
  const series = applyFieldOverrides(
    frames,
    input.fieldConfigDefaults ?? {},
    input.fieldConfigOverrides ?? []
  );
  const panelData = {
    state: input.state ?? LoadingStateEnum.Done,
    series,
    timeRange: input.timeRange,
    requestId: input.requestId,
    annotations: input.annotations,
    errors: input.errors,
    error: input.error
  };
  return {
    series,
    transformTrace,
    diagnostics,
    panelData
  };
}
const DATASOURCE_IDS = [
  "dashboard",
  "mixed",
  "grafana",
  "grafana-testdata-datasource",
  "grafana-postgresql-datasource",
  "mysql",
  "mssql",
  "influxdb",
  "graphite",
  "prometheus",
  "loki",
  "jaeger",
  "tempo",
  "grafana-pyroscope-datasource",
  "cloudwatch",
  "grafana-azure-monitor-datasource",
  "alertmanager",
  "opentelemetry",
  "alexanderzobnin-zabbix-datasource",
  "signoz"
];
const caps = (partial) => ({
  query: true,
  health: true,
  metadata: false,
  variables: false,
  annotations: false,
  exemplars: false,
  streaming: false,
  queryLanguages: [],
  ...partial
});
const HEAVY_ZABBIX = "alexanderzobnin-zabbix-datasource";
const HEAVY_SIGNOZ = "signoz";
const CATALOG = [
  {
    id: "dashboard",
    name: "仪表盘",
    category: "core",
    icon: "gf-grid",
    capabilities: caps({
      signals: ["metrics"],
      health: false,
      queryLanguages: ["dashboard"]
    })
  },
  {
    id: "mixed",
    name: "混合",
    category: "core",
    icon: "gf-glue",
    capabilities: caps({
      signals: ["metrics", "logs", "traces"],
      health: false,
      queryLanguages: ["mixed"]
    })
  },
  {
    id: "grafana",
    name: "Grafana",
    category: "core",
    icon: "grafana",
    capabilities: caps({
      signals: ["metrics"],
      queryLanguages: ["grafana"]
    })
  },
  {
    id: "grafana-testdata-datasource",
    name: "测试数据",
    category: "core",
    icon: "database",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      queryLanguages: ["testdata"]
    })
  },
  {
    id: "grafana-postgresql-datasource",
    name: "PostgreSQL",
    category: "sql",
    icon: "postgres",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["sql"]
    })
  },
  {
    id: "mysql",
    name: "MySQL",
    category: "sql",
    icon: "mysql",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["sql"]
    })
  },
  {
    id: "mssql",
    name: "Microsoft SQL Server",
    category: "sql",
    icon: "mssql",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["sql"]
    })
  },
  {
    id: "influxdb",
    name: "InfluxDB",
    category: "metrics",
    icon: "influxdb",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["influxql", "flux"]
    })
  },
  {
    id: "graphite",
    name: "Graphite",
    category: "metrics",
    icon: "graphite",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["graphite"]
    })
  },
  {
    id: "prometheus",
    name: "Prometheus",
    category: "metrics",
    icon: "prometheus",
    capabilities: caps({
      signals: ["metrics"],
      variables: true,
      annotations: true,
      metadata: true,
      exemplars: true,
      queryLanguages: ["promql"]
    })
  },
  {
    id: "loki",
    name: "Loki",
    category: "logs",
    icon: "loki",
    capabilities: caps({
      signals: ["logs"],
      variables: true,
      annotations: true,
      metadata: true,
      streaming: true,
      queryLanguages: ["logql"]
    })
  },
  {
    id: "jaeger",
    name: "Jaeger",
    category: "traces",
    icon: "jaeger",
    capabilities: caps({
      signals: ["traces"],
      metadata: true,
      queryLanguages: ["jaeger"]
    })
  },
  {
    id: "tempo",
    name: "Tempo",
    category: "traces",
    icon: "tempo",
    capabilities: caps({
      signals: ["traces"],
      metadata: true,
      queryLanguages: ["traceql"]
    })
  },
  {
    id: "grafana-pyroscope-datasource",
    name: "Pyroscope",
    category: "metrics",
    icon: "pyroscope",
    capabilities: caps({
      signals: ["metrics"],
      metadata: true,
      queryLanguages: ["pyroscope"]
    })
  },
  {
    id: "cloudwatch",
    name: "CloudWatch",
    category: "cloud",
    icon: "cloudwatch",
    capabilities: caps({
      signals: ["metrics", "logs"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["cloudwatch"]
    })
  },
  {
    id: "grafana-azure-monitor-datasource",
    name: "Azure Monitor",
    category: "cloud",
    icon: "azure",
    capabilities: caps({
      signals: ["metrics", "logs", "traces"],
      variables: true,
      annotations: true,
      metadata: true,
      queryLanguages: ["azure-monitor"]
    })
  },
  {
    id: "alertmanager",
    name: "Alertmanager",
    category: "core",
    icon: "bell",
    capabilities: caps({
      signals: ["metrics"],
      query: false,
      health: true,
      queryLanguages: []
    })
  },
  {
    id: "opentelemetry",
    name: "OpenTelemetry",
    category: "observability",
    icon: "opentelemetry",
    capabilities: caps({
      signals: ["metrics", "logs", "traces"],
      metadata: true,
      variables: true,
      queryLanguages: ["promql", "logql", "traceql"]
    })
  },
  {
    id: HEAVY_ZABBIX,
    name: "Zabbix",
    category: "observability",
    icon: "zabbix",
    capabilities: caps({
      signals: ["metrics"],
      metadata: true,
      variables: true,
      annotations: true,
      queryLanguages: ["zabbix-json-rpc"]
    }),
    lazy: async () => {
      const { registerZabbixPlugin: registerZabbixPlugin2 } = await Promise.resolve().then(() => register$1);
      await registerZabbixPlugin2();
    }
  },
  {
    id: HEAVY_SIGNOZ,
    name: "SigNoz",
    category: "observability",
    icon: "signoz",
    capabilities: caps({
      signals: ["metrics", "logs", "traces"],
      metadata: true,
      variables: true,
      annotations: true,
      streaming: true,
      queryLanguages: ["promql", "clickhouse", "trace"]
    }),
    lazy: async () => {
      const { registerSigNozPlugin: registerSigNozPlugin2 } = await Promise.resolve().then(() => register);
      await registerSigNozPlugin2();
    }
  }
];
const byId = new Map(CATALOG.map((e) => [e.id, e]));
const VISIBLE_CATALOG_IDS = /* @__PURE__ */ new Set([HEAVY_ZABBIX, HEAVY_SIGNOZ]);
function listBuiltinDatasourceCatalog() {
  return CATALOG.filter((e) => VISIBLE_CATALOG_IDS.has(e.id));
}
function getBuiltinDatasourceCatalogEntry(id) {
  return byId.get(id);
}
async function ensureDatasourceCatalogEntryRegistered(id) {
  const entry = getBuiltinDatasourceCatalogEntry(id);
  if (!entry) {
    throw new DataSourceError("NOT_FOUND", `未知数据源类型: ${id}`);
  }
  if (getDataSourcePlugin(id)) return;
  await entry.lazy?.();
  if (!getDataSourcePlugin(id)) {
    throw new Error(`数据源注册失败: ${id}`);
  }
}
function catalogCoversDatasourceIds() {
  const ids = CATALOG.map((x) => x.id).sort();
  const expected = [...DATASOURCE_IDS].sort();
  return ids.length === expected.length && ids.every((id, i) => id === expected[i]);
}
function buildDurationLiteralWithSameLength(len) {
  const L = Math.max(0, Math.floor(len));
  if (L <= 1) return "1".repeat(L);
  return `${"1".repeat(L - 1)}s`;
}
function sanitizePromqlForLezer(expr) {
  const s = String(expr ?? "");
  let out = "";
  let i = 0;
  let inString = false;
  while (i < s.length) {
    const ch = s[i];
    if (inString) {
      out += ch;
      if (ch === "\\" && i + 1 < s.length) {
        out += s[i + 1];
        i += 2;
        continue;
      }
      if (ch === '"') inString = false;
      i++;
      continue;
    }
    if (ch === '"') {
      inString = true;
      out += ch;
      i++;
      continue;
    }
    if (ch === "[") {
      const start = i;
      i++;
      let inner = "";
      while (i < s.length && s[i] !== "]") {
        inner += s[i];
        i++;
      }
      if (i < s.length && s[i] === "]") {
        const replacedInner = inner.replace(
          /\$__[\w]+|\$\{__[\w]+\}|\[\[__[\w]+\]\]/g,
          (m) => buildDurationLiteralWithSameLength(m.length)
        );
        out += "[" + replacedInner + "]";
        i++;
        continue;
      }
      out += s.slice(start);
      break;
    }
    out += ch;
    i++;
  }
  return out.replace(
    /\boffset\s+\$__[\w]+/g,
    (m) => m.replace(/\$__[\w]+/, (v) => buildDurationLiteralWithSameLength(v.length))
  );
}
function collectLezerErrors(tree) {
  const out = [];
  const cursor = tree.cursor();
  do {
    if (cursor.type.isError) {
      out.push({
        severity: "error",
        message: "PromQL 语法错误（parser 发现无法解析的片段）",
        range: { from: cursor.from, to: cursor.to }
      });
    }
  } while (cursor.next());
  out.sort((a, b) => (a.range?.from ?? 0) - (b.range?.from ?? 0));
  const merged = [];
  for (const d of out) {
    const last = merged[merged.length - 1];
    if (last?.range && d.range && d.range.from <= last.range.to) {
      last.range = {
        from: last.range.from,
        to: Math.max(last.range.to, d.range.to)
      };
      continue;
    }
    merged.push(d);
  }
  return merged;
}
function parsePromqlToAst(expr) {
  const raw = String(expr ?? "");
  if (!raw.trim()) {
    return { ok: true, ast: parser.parse(""), diagnostics: [] };
  }
  const text = sanitizePromqlForLezer(raw);
  const ast = parser.parse(text);
  const diagnostics = collectLezerErrors(ast);
  const ok2 = diagnostics.every((d) => d.severity !== "error");
  return ok2 ? { ok: true, ast, diagnostics } : { ok: false, ast, diagnostics };
}
function isValidPromql(expr) {
  return parsePromqlToAst(expr).ok;
}
function isDsQueryWireResponse(raw) {
  if (!raw || typeof raw !== "object") return false;
  const r = raw;
  if (r.results == null) return false;
  if (typeof r.results !== "object") return false;
  return true;
}
function assertDsQueryWireShape(raw) {
  if (!isDsQueryWireResponse(raw)) {
    throw new Error("Invalid /api/ds/query response: missing results map");
  }
  for (const [refId, result] of Object.entries(raw.results ?? {})) {
    if (!result || typeof result !== "object") {
      throw new Error(`Invalid result for ${refId}`);
    }
    if (result.error != null && typeof result.error !== "string") {
      throw new Error(`Invalid error for ${refId}`);
    }
    if (result.frames != null && !Array.isArray(result.frames)) {
      throw new Error(`Invalid frames for ${refId}`);
    }
    for (const frame of result.frames ?? []) {
      validateWireFrame(frame, refId);
    }
  }
}
function validateWireFrame(frame, refId) {
  if (!frame || typeof frame !== "object") {
    throw new Error(`Invalid frame in ${refId}`);
  }
  const fields = frame.schema?.fields ?? frame.fields;
  if (fields != null && !Array.isArray(fields)) {
    throw new Error(`Invalid fields in ${refId}`);
  }
  if (frame.data?.values != null && !Array.isArray(frame.data.values)) {
    throw new Error(`Invalid data.values in ${refId}`);
  }
}
function wireResponseToDataFrames(raw, fallbackRefIds = []) {
  assertDsQueryWireShape(raw);
  const out = [];
  const entries = Object.entries(raw.results ?? {});
  if (!entries.length) return out;
  for (const [refId, result] of entries) {
    if (result.error) continue;
    for (const frame of result.frames ?? []) {
      out.push(wireFrameToDataFrame(frame, refId));
    }
  }
  if (fallbackRefIds.length) {
    out.sort((a, b) => {
      const ai = fallbackRefIds.indexOf(a.refId ?? "");
      const bi = fallbackRefIds.indexOf(b.refId ?? "");
      return (ai === -1 ? 999 : ai) - (bi === -1 ? 999 : bi);
    });
  }
  return out;
}
function wireFrameToDataFrame(frame, refId) {
  const schemaFields = frame.schema?.fields ?? frame.fields ?? [];
  const values = frame.data?.values;
  const fields = schemaFields.map((field, fi) => {
    const typeRaw = field.type ?? "string";
    const type = typeRaw === "time" || typeRaw === "number" || typeRaw === "boolean" || typeRaw === "other" ? typeRaw : typeRaw === "string" ? "string" : "string";
    return {
      name: field.name ?? `field_${fi}`,
      type,
      values: values?.[fi] ?? field.values ?? [],
      config: field.config ?? {},
      labels: field.labels
    };
  });
  return createDataFrame({
    refId: frame.schema?.refId ?? frame.refId ?? refId,
    name: frame.schema?.name ?? frame.name,
    fields,
    meta: frame.schema?.meta
  });
}
function timeSeries(query, range, name, valuesFn) {
  const from = range.from.getTime();
  const to = range.to.getTime();
  const steps = Math.min(200, Math.max(20, Math.floor((to - from) / 6e4)));
  const times = [];
  const values = [];
  for (let i = 0; i < steps; i++) {
    times.push(from + (to - from) * i / Math.max(steps - 1, 1));
    values.push(valuesFn(i, steps));
  }
  const legend = String(query.legendFormat || "").trim();
  const labels = { job: "api", instance: "localhost:9090" };
  let display = name;
  if (legend) {
    display = legend.replace(
      /\{\{\s*([a-zA-Z_][\w]*)\s*\}\}/g,
      (_, k) => labels[k] ?? ""
    );
  }
  if (!display || display === "Value" || /^Value\s*\{/.test(display)) {
    display = Object.entries(labels).map(([k, v]) => `${k}=${v}`).join(", ") || name || "series";
  }
  return createDataFrame({
    refId: query.refId,
    name: display,
    fields: [
      { name: "Time", type: "time", values: times },
      {
        name: "Value",
        type: "number",
        values,
        labels,
        config: { displayNameFromDS: display }
      }
    ]
  });
}
function seriesForScenario(query, range, name, metaId) {
  const from = range.from.getTime();
  const to = range.to.getTime();
  const scenario = String(
    query.scenarioId ?? query.query ?? "random_walk"
  );
  const alias = String(query.alias ?? name);
  const expr = String(
    query.expr ?? query.query ?? query.rawSql ?? query.target ?? ""
  );
  if (metaId === "prometheus" || expr.includes("up") || scenario === "prometheus_like") {
    return timeSeries(
      query,
      range,
      alias || "prometheus",
      (i) => Math.sin(i / 3) * 20 + 50 + i * 0.1
    );
  }
  if (metaId === "loki" || expr.includes("{") && expr.includes("}")) {
    const lines = Math.min(50, Number(query.maxLines ?? 30));
    return createDataFrame({
      refId: query.refId,
      name: "logs",
      fields: [
        {
          name: "Time",
          type: "time",
          values: Array.from({ length: lines }, (_, i) => from + i * 1e3)
        },
        {
          name: "Line",
          type: "string",
          values: Array.from({ length: lines }, (_, i) => {
            const level = i % 7 === 0 ? "error" : i % 5 === 0 ? "warn" : "info";
            return `${level} log line ${i} ${expr || scenario}`;
          })
        },
        {
          name: "level",
          type: "string",
          values: Array.from(
            { length: lines },
            (_, i) => i % 7 === 0 ? "error" : i % 5 === 0 ? "warn" : "info"
          )
        },
        {
          name: "labels",
          type: "other",
          values: Array.from({ length: lines }, () => ({ job: "varlogs" }))
        }
      ],
      meta: { preferredVisualisationType: "logs" }
    });
  }
  if (metaId === "mysql" || metaId === "mssql" || metaId === "grafana-postgresql-datasource" || query.rawSql) {
    const n = 12;
    return createDataFrame({
      refId: query.refId,
      name: alias,
      fields: [
        {
          name: "time",
          type: "time",
          values: Array.from(
            { length: n },
            (_, i) => from + (to - from) * i / n
          )
        },
        {
          name: "value",
          type: "number",
          values: Array.from({ length: n }, (_, i) => 10 + i * 3)
        },
        {
          name: "metric",
          type: "string",
          values: Array.from({ length: n }, (_, i) => `row-${i}`)
        }
      ]
    });
  }
  if (metaId === "influxdb") {
    return timeSeries(query, range, alias, (i) => Math.cos(i / 4) * 30 + 40);
  }
  if (metaId === "graphite") {
    return timeSeries(
      query,
      range,
      String(query.target || alias),
      (i) => i % 15
    );
  }
  if (metaId === "cloudwatch") {
    return timeSeries(
      query,
      range,
      String(query.metricName || "CPUUtilization"),
      (i) => 20 + i % 10 * 5
    );
  }
  if (metaId === "tempo" || metaId === "jaeger") {
    const n = 8;
    const spanIDs = Array.from({ length: n }, (_, i) => `span-${i}`);
    return createDataFrame({
      refId: query.refId,
      name: "trace",
      fields: [
        { name: "spanID", type: "string", values: spanIDs },
        {
          name: "parentSpanID",
          type: "string",
          values: Array.from(
            { length: n },
            (_, i) => i === 0 ? null : "span-0"
          )
        },
        {
          name: "operationName",
          type: "string",
          values: Array.from(
            { length: n },
            (_, i) => i === 0 ? "HTTP GET" : `op-${i}`
          )
        },
        {
          name: "serviceName",
          type: "string",
          values: Array.from({ length: n }, (_, i) => `svc-${i % 3}`)
        },
        {
          name: "startTimeUnixNano",
          type: "number",
          values: Array.from({ length: n }, (_, i) => 1e15 + i * 1e7)
        },
        {
          name: "durationNano",
          type: "number",
          values: Array.from(
            { length: n },
            (_, i) => i === 0 ? 1e8 : 2e7 + i * 1e6
          )
        },
        {
          name: "statusCode",
          type: "string",
          values: Array.from(
            { length: n },
            (_, i) => i === 5 ? "ERROR" : "OK"
          )
        }
      ],
      meta: { preferredVisualisationType: "trace" }
    });
  }
  if (metaId === "grafana-pyroscope-datasource") {
    const names = [
      "root",
      "main",
      "parse",
      "query",
      "scan",
      "agg",
      "render",
      "gc"
    ];
    const values = [100, 80, 20, 35, 20, 15, 25, 20];
    return createDataFrame({
      refId: query.refId,
      name: "profile",
      fields: [
        { name: "name", type: "string", values: names },
        { name: "self", type: "number", values },
        { name: "total", type: "number", values: values.map((v) => v * 1.2) },
        { name: "level", type: "number", values: [0, 1, 2, 2, 3, 3, 2, 1] }
      ],
      meta: { preferredVisualisationType: "table" }
    });
  }
  if (metaId === "grafana-azure-monitor-datasource") {
    return timeSeries(query, range, "azure-metric", (i) => 5 + i);
  }
  if (metaId === "alertmanager") {
    return createDataFrame({
      refId: query.refId,
      name: "alerts",
      fields: [
        { name: "alertname", type: "string", values: ["HighCPU", "DiskFull"] },
        { name: "state", type: "string", values: ["firing", "pending"] },
        { name: "severity", type: "string", values: ["critical", "warning"] }
      ]
    });
  }
  if (metaId === "grafana") {
    return createDataFrame({
      refId: query.refId,
      name: "grafana",
      fields: [
        { name: "Time", type: "time", values: [from, to] },
        { name: "Value", type: "number", values: [1, 1] }
      ]
    });
  }
  if (metaId === "grafana-testdata-datasource" || metaId === "testdata") {
    const seriesCount = Math.max(
      1,
      Math.min(20, Number(query.seriesCount ?? 1))
    );
    const noise = Number(query.noise ?? 0);
    const withNoise = (v, i) => v + (noise ? i * 17 % 10 * (noise / 10) : 0);
    if (scenario === "no_data") {
      return createDataFrame({
        refId: query.refId,
        name: alias || "no_data",
        fields: [
          { name: "Time", type: "time", values: [] },
          { name: "Value", type: "number", values: [] }
        ],
        meta: { noValue: true }
      });
    }
    if (scenario === "slow_query") {
      return timeSeries(
        query,
        range,
        alias || "slow",
        (i) => withNoise(Math.sin(i / 5) * 40 + 60, i)
      );
    }
    if (scenario === "csv_metric_values") {
      const raw = String(query.stringInput ?? "1,20,90,30,5,0");
      const nums = raw.split(/[\s,;]+/).map((s) => Number(s)).filter((n) => Number.isFinite(n));
      const vals = nums.length ? nums : [1, 20, 90, 30, 5, 0];
      const times = vals.map(
        (_, i) => from + (to - from) * i / Math.max(vals.length - 1, 1)
      );
      return createDataFrame({
        refId: query.refId,
        name: alias || "csv",
        fields: [
          { name: "Time", type: "time", values: times },
          { name: "Value", type: "number", values: vals }
        ]
      });
    }
    if (scenario === "logs") {
      const lines = Math.min(
        200,
        Math.max(10, Number(query.lines ?? 40))
      );
      return createDataFrame({
        refId: query.refId,
        name: "logs",
        fields: [
          {
            name: "Time",
            type: "time",
            values: Array.from({ length: lines }, (_, i) => from + i * 1500)
          },
          {
            name: "Line",
            type: "string",
            values: Array.from({ length: lines }, (_, i) => {
              const level = i % 7 === 0 ? "error" : i % 5 === 0 ? "warn" : "info";
              return `${level} testdata log line ${i}`;
            })
          },
          {
            name: "level",
            type: "string",
            values: Array.from(
              { length: lines },
              (_, i) => i % 7 === 0 ? "error" : i % 5 === 0 ? "warn" : "info"
            )
          },
          {
            name: "labels",
            type: "other",
            values: Array.from({ length: lines }, () => ({
              job: "testdata",
              filename: "/var/log/app.log"
            }))
          }
        ],
        meta: { preferredVisualisationType: "logs" }
      });
    }
    if (scenario === "trace") {
      const n = 10;
      return createDataFrame({
        refId: query.refId,
        name: "trace",
        fields: [
          {
            name: "traceID",
            type: "string",
            values: Array.from({ length: n }, () => "trace-demo")
          },
          {
            name: "spanID",
            type: "string",
            values: Array.from({ length: n }, (_, i) => `span-${i}`)
          },
          {
            name: "parentSpanID",
            type: "string",
            values: Array.from(
              { length: n },
              (_, i) => i === 0 ? null : "span-0"
            )
          },
          {
            name: "operationName",
            type: "string",
            values: Array.from(
              { length: n },
              (_, i) => i === 0 ? "HTTP GET /api" : `db.query.${i}`
            )
          },
          {
            name: "serviceName",
            type: "string",
            values: Array.from(
              { length: n },
              (_, i) => ["gateway", "api", "db"][i % 3]
            )
          },
          {
            name: "startTimeUnixNano",
            type: "number",
            values: Array.from({ length: n }, (_, i) => from * 1e6 + i * 1e7)
          },
          {
            name: "durationNano",
            type: "number",
            values: Array.from(
              { length: n },
              (_, i) => i === 0 ? 5e8 : 1e7 + i * 2e6
            )
          },
          {
            name: "statusCode",
            type: "string",
            values: Array.from(
              { length: n },
              (_, i) => i === 7 ? "ERROR" : "OK"
            )
          }
        ],
        meta: { preferredVisualisationType: "trace" }
      });
    }
    if (scenario === "node_graph") {
      const nodes = ["A", "B", "C", "D", "E"];
      return createDataFrame({
        refId: query.refId,
        name: "nodes",
        fields: [
          { name: "id", type: "string", values: nodes },
          {
            name: "title",
            type: "string",
            values: nodes.map((n) => `Service ${n}`)
          },
          {
            name: "mainstat",
            type: "number",
            values: nodes.map((_, i) => 10 + i * 7)
          },
          {
            name: "secondarystat",
            type: "number",
            values: nodes.map((_, i) => 0.1 * i)
          },
          {
            name: "arc__success",
            type: "number",
            values: nodes.map((_, i) => 0.7 + i * 0.05)
          },
          {
            name: "arc__failed",
            type: "number",
            values: nodes.map((_, i) => 0.3 - i * 0.05)
          }
        ],
        meta: { preferredVisualisationType: "nodeGraph" }
      });
    }
    if (scenario === "flame_graph") {
      const n = 16;
      return createDataFrame({
        refId: query.refId,
        name: "flame",
        fields: [
          {
            name: "level",
            type: "number",
            values: Array.from({ length: n }, (_, i) => i % 5)
          },
          {
            name: "value",
            type: "number",
            values: Array.from({ length: n }, (_, i) => 1e3 - i * 40)
          },
          {
            name: "self",
            type: "number",
            values: Array.from({ length: n }, (_, i) => 20 + i % 7 * 5)
          },
          {
            name: "label",
            type: "string",
            values: Array.from(
              { length: n },
              (_, i) => `fn_${i % 5}_block_${i}`
            )
          }
        ],
        meta: { preferredVisualisationType: "flamegraph" }
      });
    }
    if (scenario === "usa") {
      const states = ["CA", "TX", "NY", "FL", "WA", "IL", "PA", "OH"];
      return createDataFrame({
        refId: query.refId,
        name: alias || "usa",
        fields: [
          { name: "state", type: "string", values: states },
          {
            name: "value",
            type: "number",
            values: states.map((_, i) => 20 + i * 13 + i % 3 * 5)
          },
          {
            name: "lat",
            type: "number",
            values: [36.7, 31, 43, 27.8, 47.4, 40, 41.2, 40.4]
          },
          {
            name: "lon",
            type: "number",
            values: [-119.4, -99.9, -75.5, -81.7, -120.5, -89, -77.2, -82.8]
          }
        ]
      });
    }
    if (scenario === "linear_trend" || scenario === "steps") {
      const steps = Math.min(
        80,
        Math.max(20, Math.floor((to - from) / 6e4))
      );
      const xs = Array.from({ length: steps }, (_, i) => i);
      const ys = xs.map(
        (i) => withNoise(Math.sin(i / 3) * 40 + 50 + i % 7, i)
      );
      return createDataFrame({
        refId: query.refId,
        name: alias || "trend",
        fields: [
          { name: "x", type: "number", values: xs },
          {
            name: "y",
            type: "number",
            values: ys,
            config: { displayNameFromDS: alias || "y" }
          }
        ]
      });
    }
    if (scenario === "predictable_pulse") {
      return timeSeries(
        query,
        range,
        alias || "pulse",
        (i) => withNoise(i % 10 < 3 ? 100 : 0, i)
      );
    }
    if (scenario === "predictable_csv_wave") {
      return timeSeries(
        query,
        range,
        alias || "wave",
        (i) => withNoise(Math.sin(i / 3) * 50 + 50, i)
      );
    }
    if (scenario === "random_walk" || scenario === "random_walk_table") {
      if (seriesCount > 1) {
        const steps = Math.min(
          120,
          Math.max(20, Math.floor((to - from) / 6e4))
        );
        const times = Array.from(
          { length: steps },
          (_, i) => from + (to - from) * i / Math.max(steps - 1, 1)
        );
        const fields = [{ name: "Time", type: "time", values: times }];
        for (let s = 0; s < seriesCount; s++) {
          let acc2 = 50 + s * 3;
          const vals = [];
          for (let i = 0; i < steps; i++) {
            acc2 += Math.sin((i + s) / 4) * 2 + (i + s) % 5 * 0.1;
            vals.push(withNoise(acc2, i + s));
          }
          fields.push({
            name: "Value",
            type: "number",
            values: vals,
            labels: { series: String(s), name: `${alias || "walk"}-${s}` },
            config: { displayNameFromDS: `${alias || "walk"}-${s}` }
          });
        }
        return createDataFrame({
          refId: query.refId,
          name: alias || "walk",
          fields
        });
      }
      let acc = 50;
      return timeSeries(query, range, alias || "walk", (i) => {
        acc += Math.sin(i / 4) * 2 + i % 5 * 0.1;
        return withNoise(acc, i);
      });
    }
    return timeSeries(
      query,
      range,
      alias,
      (i) => withNoise(Math.sin(i / 3) * 50 + 50 + i, i)
    );
  }
  return timeSeries(query, range, alias, (i) => {
    const x = i / 3;
    switch (scenario) {
      case "predictable_pulse":
        return i % 10 < 3 ? 100 : 0;
      case "predictable_csv_wave":
        return Math.sin(x) * 50 + 50;
      case "csv_metric_values":
        return i * 7 % 100;
      case "random_walk":
      default:
        return Math.sin(x) * 50 + 50 + i + scenario.length % 7;
    }
  });
}
function createBuiltinDataSourceApi(instance, meta2) {
  return {
    uid: instance.uid,
    type: meta2.id,
    name: instance.name,
    capabilities: {
      signals: [
        meta2.metrics !== false ? "metrics" : null,
        meta2.logs ? "logs" : null,
        meta2.tracing ? "traces" : null
      ].filter(Boolean),
      query: true,
      health: true,
      metadata: true,
      variables: true,
      annotations: true,
      exemplars: false,
      streaming: false,
      queryLanguages: []
    },
    async query(request, signal) {
      const isFixtureDs = meta2.id === "grafana-testdata-datasource" || meta2.id === "testdata" || meta2.id === "mixed" || meta2.id === "dashboard" || meta2.id === "grafana";
      if (!isFixtureDs && getBackendMode() === "live" && meta2.backend && instance.uid) {
        try {
          const res = await backendSrv.post(
            "/api/ds/query",
            {
              queries: request.targets.map((t2) => ({
                ...t2,
                datasource: { type: instance.type, uid: instance.uid },
                maxDataPoints: request.maxDataPoints,
                intervalMs: request.intervalMs
              })),
              from: String(request.range.from.getTime()),
              to: String(request.range.to.getTime())
            },
            { signal }
          );
          const frames = wireResponseToDataFrames(
            res.data ?? {},
            request.targets.map((t2) => t2.refId)
          );
          return { data: frames };
        } catch (e) {
          const msg = e instanceof Error ? e.message : String(e);
          return {
            data: request.targets.filter((t2) => !t2.hide).map(
              (t2) => createDataFrame({
                refId: t2.refId,
                name: "error",
                fields: [],
                meta: { error: msg }
              })
            )
          };
        }
      }
      if (meta2.id === "mixed") {
        return { data: [] };
      }
      if (meta2.id === "dashboard") {
        return {
          data: [
            createDataFrame({
              refId: request.targets[0]?.refId ?? "A",
              fields: [
                {
                  name: "Time",
                  type: "time",
                  values: [
                    request.range.from.getTime(),
                    request.range.to.getTime()
                  ]
                },
                { name: "Value", type: "number", values: [0, 0] }
              ]
            })
          ]
        };
      }
      const targets = request.targets.filter((t2) => !t2.hide);
      if (meta2.id === "grafana-testdata-datasource" && targets.some(
        (t2) => String(t2.scenarioId ?? "") === "slow_query"
      )) {
        await new Promise((r) => setTimeout(r, 400));
      }
      return {
        data: targets.map(
          (t2) => seriesForScenario(t2, request.range, instance.name, meta2.id)
        )
      };
    },
    async testDatasource() {
      if (meta2.id === "mixed" || meta2.id === "dashboard") {
        return {
          status: "success",
          message: `${meta2.name} is a built-in meta datasource`
        };
      }
      if (getBackendMode() === "live") {
        try {
          await backendSrv.get(`/api/datasources/uid/${instance.uid}/health`);
          return {
            status: "success",
            message: `Data source is working (${meta2.name})`
          };
        } catch {
          return {
            status: "error",
            message: `Health check failed (${meta2.name})`
          };
        }
      }
      return {
        status: "success",
        message: `Data source offline fixture OK (${meta2.name})`
      };
    },
    async metricFindQuery(query) {
      const q = String(query ?? "");
      if (meta2.id === "prometheus") {
        return [
          "up",
          "process_cpu_seconds_total",
          "go_goroutines",
          "node_cpu_seconds_total"
        ].filter((m) => !q || m.includes(q)).map((m) => ({ text: m, value: m }));
      }
      if (meta2.id === "loki") {
        if (/label_names\s*\(/i.test(q)) {
          return [
            "filename",
            "job",
            "level",
            "namespace",
            "instance",
            "host"
          ].map((m) => ({ text: m, value: m }));
        }
        if (/label_values\s*\(/i.test(q)) {
          if (/\bjob\b/i.test(q)) {
            return ["varlogs", "nginx", "api"].map((m) => ({
              text: m,
              value: m
            }));
          }
          if (/filename|label_name/i.test(q)) {
            return ["/var/log/nginx/json_access.log", "/var/log/app.log"].map(
              (m) => ({ text: m, value: m })
            );
          }
          if (/instance/i.test(q)) {
            return ["localhost:3100", "nginx-1:3100"].map((m) => ({
              text: m,
              value: m
            }));
          }
          return ["a", "b", "all"].map((m) => ({ text: m, value: m }));
        }
        return ["job", "filename", "level", "namespace"].map((m) => ({
          text: m,
          value: m
        }));
      }
      if (meta2.id === "mysql" || meta2.id === "mssql" || meta2.id === "grafana-postgresql-datasource") {
        return ["id", "name", "value"].map((m) => ({ text: m, value: m }));
      }
      if (meta2.id === "cloudwatch") {
        return ["CPUUtilization", "NetworkIn", "NetworkOut"].filter((m) => !q || m.toLowerCase().includes(q.toLowerCase())).map((m) => ({ text: m, value: m }));
      }
      if (meta2.id === "influxdb") {
        return ["cpu", "mem", "disk"].map((m) => ({ text: m, value: m }));
      }
      if (meta2.id === "elasticsearch") {
        const ES_FIELDS = [
          "@timestamp",
          "message",
          "host",
          "service",
          "level",
          "status",
          "duration",
          "bytes",
          "method",
          "path"
        ];
        if (/fields\s*\(/i.test(q) || !q || q === "*") {
          return ES_FIELDS.map((m) => ({ text: m, value: m }));
        }
        return ES_FIELDS.filter((m) => m.includes(q)).map((m) => ({
          text: m,
          value: m
        }));
      }
      if (meta2.id === "graphite") {
        const GRAPHITE_TREE = [
          "servers.web01.cpu.idle",
          "servers.web01.cpu.user",
          "servers.web01.mem.used",
          "servers.web02.cpu.idle",
          "servers.web02.disk.bytes",
          "apps.api.requests",
          "apps.api.errors",
          "apps.worker.queue"
        ];
        const cleaned = q.replace(/\.\*$/, "").replace(/\*$/, "").replace(/\.$/, "");
        if (!cleaned || cleaned === "*") {
          const roots = [...new Set(GRAPHITE_TREE.map((m) => m.split(".")[0]))];
          return roots.map((m) => ({ text: m, value: m, expandable: true }));
        }
        if (cleaned.startsWith("expand(")) {
          const inner = cleaned.slice(7).replace(/\)$/, "");
          return GRAPHITE_TREE.filter(
            (m) => m.includes(inner.replace(/\*/g, ""))
          ).map((m) => ({ text: m, value: m, expandable: false }));
        }
        const partsQ = cleaned.split(".").filter(Boolean);
        const depth = partsQ.length;
        const segs = /* @__PURE__ */ new Map();
        for (const m of GRAPHITE_TREE) {
          const parts = m.split(".");
          let match = true;
          for (let i = 0; i < depth; i++) {
            if (parts[i] !== partsQ[i] && partsQ[i] !== "*") {
              match = false;
              break;
            }
          }
          if (!match) continue;
          if (parts.length === depth) {
            segs.set(parts[depth - 1], false);
          } else if (parts.length > depth) {
            segs.set(parts[depth], parts.length > depth + 1);
          }
        }
        if (!segs.size) {
          return GRAPHITE_TREE.filter((m) => m.includes(cleaned)).map((m) => ({
            text: m,
            value: m,
            expandable: false
          }));
        }
        return [...segs.entries()].map(([text, expandable]) => ({
          text,
          value: text,
          expandable
        }));
      }
      return [
        { text: "A", value: "A" },
        { text: "B", value: "B" },
        { text: q || "all", value: q || "all" }
      ];
    },
    /** Annotation query support — returns event frames. */
    async annotationQuery(options) {
      const from = options.range.from.getTime();
      const to = options.range.to.getTime();
      const n = 5;
      return createDataFrame({
        name: String(options.annotation.name ?? "annotations"),
        fields: [
          {
            name: "time",
            type: "time",
            values: Array.from(
              { length: n },
              (_, i) => from + (to - from) * i / n
            )
          },
          {
            name: "text",
            type: "string",
            values: Array.from(
              { length: n },
              (_, i) => `${meta2.name} event ${i}`
            )
          },
          {
            name: "tags",
            type: "string",
            values: Array.from({ length: n }, () => "outage,deploy")
          }
        ]
      });
    }
  };
}
const ALIASES = {
  prometheus: "prometheus",
  prom: "prometheus",
  loki: "loki",
  mysql: "mysql",
  mssql: "mssql",
  postgres: "grafana-postgresql-datasource",
  postgresql: "grafana-postgresql-datasource",
  "grafana-postgresql-datasource": "grafana-postgresql-datasource",
  influxdb: "influxdb",
  influx: "influxdb",
  graphite: "graphite",
  cloudwatch: "cloudwatch",
  "cloud-watch": "cloudwatch",
  "grafana-testdata-datasource": "grafana-testdata-datasource",
  testdata: "grafana-testdata-datasource",
  testData: "grafana-testdata-datasource",
  elasticsearch: "elasticsearch",
  "grafana-elasticsearch-datasource": "elasticsearch",
  tempo: "tempo",
  opentelemetry: "opentelemetry",
  otel: "opentelemetry",
  signoz: "signoz",
  "alexanderzobnin-zabbix-datasource": "alexanderzobnin-zabbix-datasource",
  zabbix: "alexanderzobnin-zabbix-datasource",
  jaeger: "jaeger",
  "grafana-pyroscope-datasource": "grafana-pyroscope-datasource",
  pyroscope: "grafana-pyroscope-datasource",
  "grafana-azure-monitor-datasource": "grafana-azure-monitor-datasource",
  "azure-monitor": "grafana-azure-monitor-datasource",
  azuremonitor: "grafana-azure-monitor-datasource",
  grafana: "grafana",
  dashboard: "dashboard",
  mixed: "mixed",
  "-- Mixed --": "mixed",
  alertmanager: "alertmanager"
};
function normalizeDsType(type) {
  const raw = String(type ?? "").trim();
  if (!raw) return "";
  if (ALIASES[raw]) return ALIASES[raw];
  const lower = raw.toLowerCase();
  if (ALIASES[lower]) return ALIASES[lower];
  if (lower.includes("postgres")) return "grafana-postgresql-datasource";
  if (lower.includes("prometheus")) return "prometheus";
  if (lower.includes("loki")) return "loki";
  if (lower.includes("elastic")) return "elasticsearch";
  if (lower.includes("opentelemetry") || lower === "otel")
    return "opentelemetry";
  if (lower.includes("signoz")) return "signoz";
  if (lower.includes("zabbix")) return "alexanderzobnin-zabbix-datasource";
  if (lower.includes("pyroscope")) return "grafana-pyroscope-datasource";
  if (lower.includes("azure")) return "grafana-azure-monitor-datasource";
  if (lower.includes("testdata") || lower.includes("test-data"))
    return "grafana-testdata-datasource";
  return raw;
}
function queryFieldFamily(type) {
  const t2 = normalizeDsType(type);
  switch (t2) {
    case "prometheus":
      return "prometheus";
    case "loki":
      return "loki";
    case "mysql":
    case "mssql":
    case "grafana-postgresql-datasource":
      return "sql";
    case "influxdb":
      return "influxdb";
    case "graphite":
      return "graphite";
    case "cloudwatch":
      return "cloudwatch";
    case "grafana-testdata-datasource":
      return "testdata";
    case "elasticsearch":
      return "elasticsearch";
    case "tempo":
      return "tempo";
    case "jaeger":
      return "jaeger";
    case "grafana-pyroscope-datasource":
      return "pyroscope";
    case "grafana-azure-monitor-datasource":
      return "azure";
    case "grafana":
      return "grafana";
    case "dashboard":
      return "dashboard";
    case "mixed":
      return "mixed";
    case "alertmanager":
      return "alertmanager";
    case "alexanderzobnin-zabbix-datasource":
      return "zabbix";
    case "opentelemetry":
      return "opentelemetry";
    case "signoz":
      return "signoz";
    default:
      return "generic";
  }
}
const DS_TYPE_LABELS = {
  prometheus: "Prometheus",
  loki: "Loki",
  mysql: "MySQL",
  mssql: "MSSQL",
  "grafana-postgresql-datasource": "PostgreSQL",
  influxdb: "InfluxDB",
  graphite: "Graphite",
  cloudwatch: "CloudWatch",
  "grafana-testdata-datasource": "TestData",
  elasticsearch: "Elasticsearch",
  tempo: "Tempo",
  opentelemetry: "OpenTelemetry",
  signoz: "SigNoz",
  "alexanderzobnin-zabbix-datasource": "Zabbix",
  jaeger: "Jaeger",
  "grafana-pyroscope-datasource": "Pyroscope",
  "grafana-azure-monitor-datasource": "Azure Monitor",
  grafana: "Grafana",
  dashboard: "Dashboard",
  mixed: "Mixed",
  alertmanager: "Alertmanager"
};
function dsTypeLabel(type) {
  const t2 = normalizeDsType(type);
  return DS_TYPE_LABELS[t2] || t2 || "未知";
}
function dsTypeBadge(type) {
  const t2 = normalizeDsType(type);
  const map = {
    prometheus: "Prom",
    loki: "Loki",
    mysql: "MySQL",
    mssql: "MSSQL",
    "grafana-postgresql-datasource": "PG",
    influxdb: "Influx",
    graphite: "Graphite",
    cloudwatch: "CW",
    "grafana-testdata-datasource": "Test",
    elasticsearch: "ES",
    tempo: "Tempo",
    opentelemetry: "OTel",
    signoz: "SigNoz",
    "alexanderzobnin-zabbix-datasource": "Zabbix",
    jaeger: "Jaeger",
    "grafana-pyroscope-datasource": "Prof",
    "grafana-azure-monitor-datasource": "Azure",
    grafana: "Graf",
    dashboard: "Dash",
    mixed: "Mixed",
    alertmanager: "AM"
  };
  return map[t2] || (t2 ? t2.slice(0, 6) : "?");
}
function defaultQueryForType(type, refId = "A") {
  const t2 = normalizeDsType(type);
  switch (t2) {
    case "prometheus":
      return {
        refId,
        expr: "up",
        range: true,
        instant: false,
        exemplar: false,
        format: "time_series",
        editorMode: "code",
        datasource: { type: t2 }
      };
    case "loki":
      return {
        refId,
        expr: '{job="varlogs"}',
        queryType: "range",
        maxLines: 1e3,
        editorMode: "code",
        datasource: { type: t2 }
      };
    case "grafana-postgresql-datasource":
    case "mysql":
    case "mssql":
      return {
        refId,
        rawSql: "SELECT 1 AS value",
        format: 1,
        rawQuery: true,
        datasource: { type: t2 }
      };
    case "grafana-testdata-datasource":
      return {
        refId,
        scenarioId: "random_walk",
        alias: "test",
        seriesCount: 1,
        datasource: { type: t2 }
      };
    case "graphite":
      return {
        refId,
        target: "stats.counters.*",
        textEditor: true,
        datasource: { type: t2 }
      };
    case "influxdb":
      return {
        refId,
        query: "SELECT mean(value) FROM cpu",
        rawQuery: true,
        resultFormat: "time_series",
        datasource: { type: t2 }
      };
    case "cloudwatch":
      return {
        refId,
        queryMode: "Metrics",
        region: "default",
        namespace: "AWS/EC2",
        metricName: "CPUUtilization",
        statistic: "Average",
        period: "",
        matchExact: true,
        expression: "",
        datasource: { type: t2 }
      };
    case "jaeger":
      return {
        refId,
        query: "",
        service: "",
        operation: "",
        datasource: { type: t2 }
      };
    case "grafana-pyroscope-datasource":
      return {
        refId,
        query: "process_cpu:cpu:nanoseconds:cpu:nanoseconds{}",
        profileTypeId: "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
        labelSelector: "{}",
        groupBy: [],
        datasource: { type: t2 }
      };
    case "grafana-azure-monitor-datasource":
      return {
        refId,
        queryType: "Azure Monitor",
        azureMonitor: {
          timeGrain: "auto",
          metricName: "",
          aggregation: "Average"
        },
        datasource: { type: t2 }
      };
    case "elasticsearch":
      return {
        refId,
        query: "*",
        timeField: "@timestamp",
        metrics: [{ type: "count", id: "1" }],
        bucketAggs: [
          { type: "date_histogram", id: "2", settings: { interval: "auto" } }
        ],
        datasource: { type: t2 }
      };
    case "tempo":
      return {
        refId,
        query: "{}",
        queryType: "traceql",
        limit: 20,
        datasource: { type: t2 }
      };
    case "grafana":
      return { refId, queryType: "randomWalk", datasource: { type: t2 } };
    case "dashboard":
      return { refId, panelId: void 0, datasource: { type: t2 } };
    case "alertmanager":
      return { refId, query: "", expr: "", datasource: { type: t2 } };
    case "mixed":
      return { refId, datasource: { type: "mixed", uid: "mixed" } };
    default:
      return { refId, query: "", datasource: t2 ? { type: t2 } : void 0 };
  }
}
function switchQueryDatasource(current, ds2) {
  const type = normalizeDsType(ds2.type);
  const base = defaultQueryForType(type, current.refId);
  return {
    ...base,
    refId: current.refId,
    hide: current.hide,
    datasource: {
      type,
      uid: ds2.uid || type,
      ...ds2.name ? { name: ds2.name } : {}
    }
  };
}
const INTERPOLATE_KEYS = [
  "expr",
  "query",
  "rawSql",
  "target",
  "alias",
  "legendFormat",
  "expression",
  "namespace",
  "metricName",
  "service",
  "operation",
  "labelSelector",
  "rawQuery",
  "rawLegend"
];
function deepReplaceStrings(value, replace, depth = 0) {
  if (depth > 12) return value;
  if (typeof value === "string") return replace(value);
  if (Array.isArray(value)) {
    return value.map((v) => deepReplaceStrings(v, replace, depth + 1));
  }
  if (value && typeof value === "object") {
    const out = {};
    for (const [k, v] of Object.entries(value)) {
      out[k] = deepReplaceStrings(v, replace, depth + 1);
    }
    return out;
  }
  return value;
}
function interpolateQuery(query, replace) {
  const deep = deepReplaceStrings(query, replace);
  const next = { ...deep };
  for (const key of INTERPOLATE_KEYS) {
    const v = next[key];
    if (typeof v === "string") next[key] = replace(v);
  }
  return next;
}
function computeStepMs(opts) {
  if (opts.step != null && opts.step !== "") {
    const s = typeof opts.step === "number" ? opts.step : parseDurationMs$1(String(opts.step));
    if (s > 0) return s;
  }
  const maxPoints = Math.max(1, opts.maxDataPoints ?? 1100);
  const minInterval = Math.max(
    1,
    opts.minIntervalMs ?? opts.intervalMs ?? 15e3
  );
  const raw = Math.ceil(Math.max(1, opts.rangeMs) / maxPoints);
  const step = Math.max(minInterval, raw);
  const nice = [
    1e3,
    5e3,
    1e4,
    15e3,
    3e4,
    6e4,
    12e4,
    3e5,
    6e5,
    9e5,
    18e5,
    36e5
  ];
  for (const n of nice) {
    if (n >= step) return n;
  }
  return step;
}
function parseDurationMs$1(input) {
  const m = String(input).trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/i);
  if (!m) {
    const n = Number(input);
    return Number.isFinite(n) ? n : 0;
  }
  const v = Number(m[1]);
  const u = (m[2] || "s").toLowerCase();
  if (u === "ms") return v;
  if (u === "s") return v * 1e3;
  if (u === "m") return v * 6e4;
  if (u === "h") return v * 36e5;
  if (u === "d") return v * 864e5;
  return v;
}
function formatDurationProm(ms) {
  if (ms % 864e5 === 0) return `${ms / 864e5}d`;
  if (ms % 36e5 === 0) return `${ms / 36e5}h`;
  if (ms % 6e4 === 0) return `${ms / 6e4}m`;
  if (ms % 1e3 === 0) return `${ms / 1e3}s`;
  return `${ms}ms`;
}
function interpolatePromMacros(expr, ctx) {
  const interval = formatDurationProm(Math.max(1, ctx.intervalMs));
  const rate = formatDurationProm(
    Math.max(ctx.intervalMs * 4, ctx.rateIntervalMs ?? ctx.intervalMs * 4)
  );
  const rangeS = Math.max(1, Math.floor(ctx.rangeMs / 1e3));
  const range = formatDurationProm(ctx.rangeMs);
  let out = expr.replace(/\$__rate_interval/g, rate).replace(/\$__interval_ms/g, String(ctx.intervalMs)).replace(/\$__interval/g, interval).replace(/\$__range_ms/g, String(ctx.rangeMs)).replace(/\$__range_s/g, String(rangeS)).replace(/\$__range/g, range);
  if (ctx.interpolate) out = ctx.interpolate(out);
  return out;
}
function formatPromLegend(legendFormat, labels = {}) {
  if (!legendFormat) {
    const entries = Object.entries(labels).filter(
      ([k, v]) => k !== "__name__" && v != null && v !== ""
    );
    const metric = labels.__name__ || "";
    if (!entries.length) return metric;
    if (entries.length === 1) return String(entries[0][1]);
    const body = entries.map(([k, v]) => `${k}="${v}"`).join(", ");
    return metric ? `${metric}{${body}}` : `{${body}}`;
  }
  return legendFormat.replace(
    /\{\{\s*([a-zA-Z_][\w]*)\s*\}\}/g,
    (_, k) => labels[k] ?? ""
  );
}
function mapPrometheusResponse(body, opts) {
  if (body?.status === "error" || body?.error) {
    throw new Error(body.error || body.errorType || "Prometheus query error");
  }
  const resultType = body?.data?.resultType ?? "matrix";
  const result = body?.data?.result ?? [];
  if (resultType === "scalar" || resultType === "string") {
    const pair = Array.isArray(result) ? result : [0, result];
    const t2 = Number(pair[0]) * (Number(pair[0]) < 1e12 ? 1e3 : 1);
    const v = resultType === "string" ? null : Number(pair[1]);
    return [
      createDataFrame({
        refId: opts.refId,
        name: opts.expr || "scalar",
        meta: { preferredVisualisationType: "table", resultType },
        fields: [
          { name: "Time", type: "time", values: [t2] },
          {
            name: "Value",
            type: "number",
            values: [v],
            config: { displayNameFromDS: "Value" }
          }
        ]
      })
    ];
  }
  return result.map((series, idx) => {
    const metric = series.metric || {};
    const labels = {};
    for (const [k, v] of Object.entries(metric)) {
      if (k === "__name__") continue;
      labels[k] = String(v);
    }
    const name = formatPromLegend(opts.legendFormat || "", {
      ...labels,
      __name__: metric.__name__ || ""
    }) || metric.__name__ || opts.expr || `series ${idx}`;
    let times = [];
    let values = [];
    if (resultType === "vector") {
      const t2 = Number(series.value?.[0] ?? 0);
      times = [t2 < 1e12 ? t2 * 1e3 : t2];
      const raw = series.value?.[1];
      values = [raw == null || raw === "NaN" ? null : Number(raw)];
    } else {
      const pts = series.values || [];
      times = pts.map((p) => {
        const t2 = Number(p[0]);
        return t2 < 1e12 ? t2 * 1e3 : t2;
      });
      values = pts.map((p) => {
        const raw = p[1];
        if (raw == null || raw === "NaN") return null;
        if (raw === "+Inf") return Infinity;
        if (raw === "-Inf") return -Infinity;
        const n = Number(raw);
        return Number.isFinite(n) ? n : null;
      });
    }
    return createDataFrame({
      refId: opts.refId,
      name,
      meta: { resultType, preferredVisualisationType: "graph" },
      fields: [
        { name: "Time", type: "time", values: times },
        {
          name: "Value",
          type: "number",
          values,
          labels,
          config: { displayNameFromDS: name }
        }
      ]
    });
  });
}
let factory$1 = null;
function registerPrometheusDataSourceFactory(fn) {
  factory$1 = fn;
}
function createPrometheusDataSource$1(instance, meta2) {
  if (!factory$1) {
    throw new Error(
      "Prometheus data source factory not registered — call registerBuiltinPlugins() / load prometheus module first"
    );
  }
  return factory$1(instance, meta2);
}
function hasPrometheusDataSourceFactory() {
  return factory$1 != null;
}
function resetPrometheusDataSourceFactory() {
  factory$1 = null;
}
let factory = null;
function registerSignozDataSourceFactory(fn) {
  factory = fn;
}
function createSignozDataSource$1(instance, meta2) {
  if (!factory) {
    throw new Error(
      "SigNoz data source factory not registered — call registerHeavyPlugins() / load signoz module first"
    );
  }
  return factory(instance, meta2);
}
function hasSignozDataSourceFactory() {
  return factory != null;
}
function resetSignozDataSourceFactory() {
  factory = null;
}
function normalizePromQuery(q) {
  const instant = q.instant ?? false;
  const range = q.range ?? !instant;
  return {
    refId: q.refId,
    expr: q.expr ?? "",
    legendFormat: q.legendFormat ?? "",
    interval: q.interval,
    intervalFactor: q.intervalFactor ?? 1,
    instant,
    range: instant ? false : range,
    exemplar: q.exemplar ?? false,
    format: q.format ?? "time_series",
    editorMode: q.editorMode ?? "code",
    utcOffsetSec: q.utcOffsetSec ?? 0,
    datasource: q.datasource,
    hide: q.hide
  };
}
function normalizeLokiQuery(q) {
  const instant = q.instant === true || q.queryType === "instant";
  return {
    refId: q.refId,
    expr: q.expr ?? "",
    legendFormat: q.legendFormat ?? "",
    maxLines: q.maxLines ?? 1e3,
    queryType: q.queryType ?? (instant ? "instant" : "range"),
    instant,
    range: instant ? false : q.range !== false,
    editorMode: q.editorMode ?? "code",
    resolution: q.resolution ?? 1,
    direction: q.direction ?? "backward",
    step: q.step,
    datasource: q.datasource,
    hide: q.hide
  };
}
function isLokiMetricQuery(expr) {
  return /\b(rate|count_over_time|sum_over_time|avg_over_time|max_over_time|min_over_time|bytes_rate|bytes_over_time|quantile_over_time|first_over_time|last_over_time|stdvar_over_time|stddev_over_time|unwrap|topk|bottomk)\b/i.test(
    expr
  );
}
function formatLokiLegend(legendFormat, labels = {}) {
  if (!legendFormat) {
    const entries = Object.entries(labels).filter(
      ([k, v]) => k !== "__name__" && v != null && v !== ""
    );
    if (!entries.length) return "";
    if (entries.length === 1) return String(entries[0][1]);
    return "{" + entries.map(([k, v]) => `${k}="${v}"`).join(", ") + "}";
  }
  return legendFormat.replace(
    /\{\{\s*([a-zA-Z_][\w]*)\s*\}\}/g,
    (_, k) => labels[k] ?? ""
  );
}
function extractByLabels(expr) {
  const m = expr.match(/\bby\s*\(\s*([^)]+)\s*\)/i);
  if (!m) return [];
  return m[1].split(",").map((s) => s.trim()).filter(Boolean);
}
function buildPrometheusQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      ...normalizePromQuery(q),
      datasource: {
        type: "prometheus",
        uid: opts.uid ?? q.datasource?.uid ?? "prometheus"
      },
      maxDataPoints: opts.maxDataPoints ?? 1100,
      intervalMs: opts.intervalMs ?? 15e3
    }))
  };
}
function buildLokiQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      ...normalizeLokiQuery(q),
      datasource: {
        type: "loki",
        uid: opts.uid ?? q.datasource?.uid ?? "loki"
      },
      maxDataPoints: opts.maxDataPoints ?? 1100,
      intervalMs: opts.intervalMs ?? 1e3
    }))
  };
}
function buildSqlQueryBody(type, queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      rawSql: String(q.rawSql ?? "SELECT 1"),
      format: Number(q.format ?? 1),
      rawQuery: true,
      datasource: { type, uid: opts.uid ?? type }
    }))
  };
}
function buildCloudWatchQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      queryMode: q.queryMode ?? "Metrics",
      region: q.region ?? "default",
      namespace: q.namespace ?? "AWS/EC2",
      metricName: q.metricName ?? "CPUUtilization",
      statistic: q.statistic ?? "Average",
      dimensions: q.dimensions ?? {},
      expression: q.expression ?? "",
      datasource: { type: "cloudwatch", uid: opts.uid ?? "cloudwatch" }
    }))
  };
}
function buildInfluxQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      query: String(q.query ?? ""),
      rawQuery: true,
      resultFormat: q.resultFormat ?? "time_series",
      policy: q.policy ?? "default",
      datasource: { type: "influxdb", uid: opts.uid ?? "influxdb" }
    }))
  };
}
function buildGraphiteQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      target: String(q.target ?? ""),
      textEditor: q.textEditor !== false,
      datasource: { type: "graphite", uid: opts.uid ?? "graphite" }
    }))
  };
}
function buildJaegerQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      query: String(q.query ?? q.service ?? ""),
      service: q.service,
      operation: q.operation,
      datasource: { type: "jaeger", uid: opts.uid ?? "jaeger" }
    }))
  };
}
function buildPyroscopeQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      profileTypeId: q.profileTypeId ?? "process_cpu:cpu:nanoseconds:cpu:nanoseconds",
      labelSelector: q.labelSelector ?? "{}",
      query: String(q.query ?? ""),
      groupBy: q.groupBy ?? [],
      datasource: {
        type: "grafana-pyroscope-datasource",
        uid: opts.uid ?? "pyroscope"
      }
    }))
  };
}
function buildTestDataQueryBody(queries, range, opts = {}) {
  return {
    from: String(range.from),
    to: String(range.to),
    queries: queries.map((q) => ({
      refId: q.refId,
      scenarioId: q.scenarioId ?? "random_walk",
      alias: q.alias ?? "",
      datasource: {
        type: "grafana-testdata-datasource",
        uid: opts.uid ?? "testdata"
      }
    }))
  };
}
function buildQueryBodyForType(type, queries, range, opts = {}) {
  switch (type) {
    case "prometheus":
      return buildPrometheusQueryBody(queries, range, opts);
    case "loki":
      return buildLokiQueryBody(queries, range, opts);
    case "mysql":
    case "mssql":
    case "grafana-postgresql-datasource":
      return buildSqlQueryBody(type, queries, range, opts);
    case "cloudwatch":
      return buildCloudWatchQueryBody(queries, range, opts);
    case "influxdb":
      return buildInfluxQueryBody(queries, range, opts);
    case "graphite":
      return buildGraphiteQueryBody(queries, range, opts);
    case "jaeger":
      return buildJaegerQueryBody(queries, range, opts);
    case "grafana-pyroscope-datasource":
      return buildPyroscopeQueryBody(queries, range, opts);
    case "grafana-testdata-datasource":
      return buildTestDataQueryBody(queries, range, opts);
    default:
      return {
        from: String(range.from),
        to: String(range.to),
        queries: queries.map((q) => ({
          ...q,
          datasource: { type, uid: opts.uid ?? type }
        }))
      };
  }
}
const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  DATASOURCE_IDS,
  DS_TYPE_LABELS,
  buildQueryBodyForType,
  catalogCoversDatasourceIds,
  computeStepMs,
  createBuiltinDataSourceApi,
  createPrometheusDataSource: createPrometheusDataSource$1,
  createSignozDataSource: createSignozDataSource$1,
  defaultQueryForType,
  dsTypeBadge,
  dsTypeLabel,
  ensureDatasourceCatalogEntryRegistered,
  formatDurationProm,
  formatPromLegend,
  frameFingerprint,
  getBuiltinDatasourceCatalogEntry,
  hasPrometheusDataSourceFactory,
  hasSignozDataSourceFactory,
  interpolatePromMacros,
  interpolateQuery,
  isValidPromql,
  listBuiltinDatasourceCatalog,
  mapPrometheusResponse,
  normalizeDataFrames,
  normalizeDsType,
  parseDurationMs: parseDurationMs$1,
  parsePromqlToAst,
  queryFieldFamily,
  registerPrometheusDataSourceFactory,
  registerSignozDataSourceFactory,
  resetPrometheusDataSourceFactory,
  resetSignozDataSourceFactory,
  sanitizePromqlForLezer,
  switchQueryDatasource,
  wireResponseToDataFrames
}, Symbol.toStringTag, { value: "Module" }));
function isVisibleTarget(t2) {
  return Boolean(t2 && typeof t2 === "object" && t2.hide !== true);
}
function isAbortLike(e) {
  if (!e || typeof e !== "object") return false;
  const err = e;
  return err.name === "AbortError" || err.code === "ERR_CANCELED";
}
function emptyDone(range) {
  return {
    state: LoadingStateEnum.Done,
    series: [],
    timeRange: range
  };
}
function createPanelQueryEngine(opts) {
  return {
    async execute(panel2, context, signal) {
      if (signal.aborted) {
        return emptyDone(context.timeRange);
      }
      const targets = (panel2.targets ?? []).filter(isVisibleTarget);
      if (!targets.length) {
        return emptyDone(context.timeRange);
      }
      const onAbort = () => {
        opts.scheduler.cancel(context.requestId);
      };
      signal.addEventListener("abort", onAbort, { once: true });
      try {
        const dsRef = targets[0]?.datasource ?? panel2.datasource;
        opts.resolveDataSource(dsRef);
        const raw = await opts.scheduler.run({
          requestId: context.requestId,
          targets,
          range: context.timeRange,
          scopedVars: context.scopedVars,
          maxDataPoints: context.maxDataPoints,
          intervalMs: context.intervalMs,
          panelId: panel2.id,
          visible: context.visible,
          onPartialData: context.onPartialData
        });
        if (signal.aborted) {
          return emptyDone(context.timeRange);
        }
        return opts.postProcess ? await opts.postProcess(raw, panel2, context) : raw;
      } catch (e) {
        if (signal.aborted || isAbortLike(e)) {
          return emptyDone(context.timeRange);
        }
        const message = e instanceof DataSourceError ? e.message : e instanceof Error ? e.message : String(e);
        return {
          state: LoadingStateEnum.Error,
          series: [],
          timeRange: context.timeRange,
          error: { message }
        };
      } finally {
        signal.removeEventListener("abort", onAbort);
      }
    }
  };
}
function buildInterpolatedTargets(panel2, scoped, adhoc) {
  const panelDsRaw = panel2.datasource;
  let panelDs = panelDsRaw;
  if (typeof panelDsRaw === "string") {
    panelDs = replaceVariables(panelDsRaw, scoped);
  } else if (panelDsRaw && typeof panelDsRaw === "object") {
    const uid = panelDsRaw.uid;
    panelDs = {
      ...panelDsRaw,
      uid: typeof uid === "string" ? replaceVariables(uid, scoped) : uid
    };
  }
  const targets = (panel2.targets ?? []).map((t2) => {
    const q = interpolateQuery(t2, (s) => replaceVariables(s, scoped));
    if (q.datasource && typeof q.datasource === "object" && typeof q.datasource.uid === "string") {
      q.datasource = {
        ...q.datasource,
        uid: replaceVariables(q.datasource.uid, scoped)
      };
    } else if (typeof q.datasource === "string") {
      q.datasource = { uid: replaceVariables(q.datasource, scoped) };
    }
    if (q.datasource == null && panelDs != null) {
      q.datasource = typeof panelDs === "string" ? { uid: panelDs } : { ...panelDs };
    }
    if (adhoc.length && typeof q.expr === "string") {
      q.expr = applyAdhocFiltersToExpr(q.expr, adhoc);
    }
    return q;
  });
  return { panelDs, targets };
}
function cloneDoc(doc) {
  return JSON.parse(JSON.stringify(doc));
}
function applyCommand(doc, command) {
  switch (command.type) {
    case "replace":
      return cloneDoc(command.document);
    case "upsert-panel":
      return upsertPanel(doc, command.panel);
    case "remove-panel":
      return removePanel(doc, command.panelId);
    case "set-time":
      return { ...doc, time: { from: command.from, to: command.to } };
    case "set-timezone":
      return { ...doc, timezone: command.timezone };
    case "set-refresh":
      return { ...doc, refresh: command.refresh };
    case "set-variables":
      return {
        ...doc,
        templating: { ...doc.templating, list: command.list }
      };
    case "set-annotations":
      return {
        ...doc,
        annotations: { ...doc.annotations, list: command.list }
      };
    case "patch":
      return command.mutator(cloneDoc(doc));
    default: {
      const _exhaustive = command;
      return _exhaustive;
    }
  }
}
function createDashboardDocument(initial) {
  const history = new DashboardHistory();
  const state2 = {
    document: initial ? cloneDoc(initial) : null,
    baselineJson: initial ? JSON.stringify(initial) : "",
    dirty: false,
    canUndo: false,
    canRedo: false
  };
  if (state2.document) {
    history.reset(state2.document);
  }
  function syncFlags() {
    state2.canUndo = history.canUndo();
    state2.canRedo = history.canRedo();
    state2.dirty = state2.document ? JSON.stringify(state2.document) !== state2.baselineJson : false;
  }
  function pushHistory() {
    if (state2.document) {
      history.push(state2.document);
      syncFlags();
    }
  }
  return {
    get state() {
      return state2;
    },
    load(document2) {
      state2.document = cloneDoc(document2);
      state2.baselineJson = JSON.stringify(state2.document);
      history.reset(state2.document);
      syncFlags();
    },
    dispatch(command, opts = {}) {
      if (!state2.document && command.type !== "replace") {
        return state2;
      }
      const recordHistory = opts.history !== false;
      const base = command.type === "replace" ? {
        uid: "",
        title: "",
        panels: [],
        schemaVersion: 39
      } : state2.document;
      const next = applyCommand(base, command);
      state2.document = next;
      if (command.type === "replace") {
        state2.baselineJson = JSON.stringify(next);
        history.reset(next);
      } else if (recordHistory) {
        pushHistory();
      }
      if (opts.dirty === false) {
        state2.canUndo = history.canUndo();
        state2.canRedo = history.canRedo();
        state2.dirty = false;
      } else {
        syncFlags();
      }
      return state2;
    },
    undo() {
      if (!state2.document) return state2;
      const prev = history.undo(state2.document);
      if (prev) {
        state2.document = prev;
        syncFlags();
      }
      return state2;
    },
    redo() {
      if (!state2.document) return state2;
      const next = history.redo(state2.document);
      if (next) {
        state2.document = next;
        syncFlags();
      }
      return state2;
    },
    markSaved(document2) {
      if (document2) state2.document = cloneDoc(document2);
      if (state2.document) {
        state2.baselineJson = JSON.stringify(state2.document);
      }
      syncFlags();
      return state2;
    },
    syncWorking(document2) {
      state2.document = cloneDoc(document2);
      syncFlags();
      return state2;
    },
    recordHistoryTip(baselineJson) {
      if (!state2.document) return state2;
      if (baselineJson != null) state2.baselineJson = baselineJson;
      history.push(state2.document);
      syncFlags();
      return state2;
    },
    snapshot() {
      return state2.document ? JSON.stringify(state2.document) : "";
    },
    resetHistory() {
      if (state2.document) history.reset(state2.document);
      syncFlags();
    }
  };
}
function populateDatasourceVariableOptions(list, sources) {
  return list.map((v) => {
    if (v?.type !== "datasource") return v;
    const queryType = String(v.query ?? "").trim();
    const matches = sources.filter((d) => {
      if (!queryType) return true;
      return d.type === queryType || d.type.includes(queryType);
    });
    if (!matches.length) return v;
    const curVal = v.current?.value != null ? String(v.current.value) : "";
    const options = matches.map((d) => ({
      text: d.name || d.uid,
      value: d.uid,
      selected: curVal ? curVal === d.uid : false
    }));
    let current = options.find((o) => o.selected) ?? options[0];
    if (!options.some((o) => o.selected) && current) {
      options.forEach((o) => {
        o.selected = o.value === current.value;
      });
    }
    return {
      ...v,
      options,
      current: current ? { text: current.text, value: current.value } : v.current
    };
  });
}
const _hoisted_1$2Y = ["data-mode", "data-code-lang", "data-line-numbers", "data-mini-map"];
const _hoisted_2$2p = ["data-mode", "data-code-lang", "data-line-numbers", "data-mini-map", "innerHTML"];
const _hoisted_3$28 = {
  key: 0,
  class: "code-minimap",
  "data-testid": "text-code-minimap",
  "aria-hidden": "true"
};
const _sfc_main$3V = /* @__PURE__ */ defineComponent({
  __name: "TextRenderer",
  props: {
    options: {},
    title: {},
    replaceVariables: { type: Function },
    width: {},
    height: {},
    data: {},
    fieldConfig: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    function sanitize(html2) {
      return html2.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi, "").replace(/\son\w+\s*=\s*(['"]).*?\1/gi, "").replace(/javascript:/gi, "").replace(/<iframe[\s\S]*?>[\s\S]*?<\/iframe>/gi, "");
    }
    function mdToHtml(src) {
      if (!src) return " ";
      let s = src.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
      s = s.replace(
        /```([\s\S]*?)```/g,
        (_m, code) => `<pre><code>${code.replace(/^\n/, "")}</code></pre>`
      );
      s = s.replace(/^### (.+)$/gm, "<h3>$1</h3>");
      s = s.replace(/^## (.+)$/gm, "<h2>$1</h2>");
      s = s.replace(/^# (.+)$/gm, "<h1>$1</h1>");
      s = s.replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>");
      s = s.replace(/\*(.+?)\*/g, "<em>$1</em>");
      s = s.replace(/`([^`]+)`/g, "<code>$1</code>");
      s = s.replace(
        /\[(.+?)\]\((https?:\/\/[^)]+)\)/g,
        '<a href="$2" rel="noreferrer" target="_blank">$1</a>'
      );
      const parts = s.split(/\n{2,}/);
      const html2 = parts.map((part) => {
        const trimmed = part.trim();
        if (!trimmed) return "";
        if (/^<(h[1-6]|pre|ul|ol|blockquote)/i.test(trimmed))
          return trimmed.replace(/\n/g, " ");
        return `<p>${trimmed.replace(/\n/g, " ")}</p>`;
      }).join("");
      return html2 || " ";
    }
    const showMiniMap = computed(() => {
      const mode2 = String(opts.value.mode ?? "markdown");
      if (mode2 !== "code") return false;
      return Boolean(
        opts.value.code?.showMiniMap ?? opts.value["code.showMiniMap"]
      );
    });
    const codeLines = computed(() => {
      if (String(opts.value.mode ?? "markdown") !== "code") return [];
      let content = String(opts.value.content ?? "");
      if (props.replaceVariables) content = props.replaceVariables(content);
      return content.split("\n");
    });
    const html = computed(() => {
      const mode2 = String(opts.value.mode ?? "markdown");
      let content = String(opts.value.content ?? "");
      if (props.replaceVariables) content = props.replaceVariables(content);
      if (!content) return " ";
      if (mode2 === "html") return sanitize(content);
      if (mode2 === "code") {
        const lang = String(
          opts.value.code?.language ?? opts.value["code.language"] ?? "plaintext"
        );
        const showLines = opts.value.code?.showLineNumbers ?? opts.value["code.showLineNumbers"];
        const escaped = content.replace(/&/g, "&amp;").replace(/</g, "&lt;");
        if (showLines) {
          const lines = escaped.split("\n");
          const body = lines.map(
            (line, i) => `<div class="code-line"><span class="ln">${i + 1}</span><span class="lc">${line || " "}</span></div>`
          ).join("");
          return `<pre data-lang="${lang}" class="code-block with-lines"><code>${body}</code></pre>`;
        }
        return `<pre data-lang="${lang}" class="code-block"><code>${escaped}</code></pre>`;
      }
      return sanitize(mdToHtml(content));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "text-panel-host",
        "data-testid": "panel-text",
        "data-mode": String(opts.value.mode ?? "markdown"),
        "data-code-lang": String(opts.value.code?.language ?? opts.value["code.language"] ?? ""),
        "data-line-numbers": String(!!(opts.value.code?.showLineNumbers ?? opts.value["code.showLineNumbers"])),
        "data-mini-map": String(showMiniMap.value)
      }, [
        createElementVNode("div", {
          class: "text-panel markdown-html",
          "data-testid": "panel-text-content",
          "data-testid-grafana": "TextPanel-converted-content",
          "data-mode": String(opts.value.mode ?? "markdown"),
          "data-code-lang": String(opts.value.code?.language ?? opts.value["code.language"] ?? ""),
          "data-line-numbers": String(!!(opts.value.code?.showLineNumbers ?? opts.value["code.showLineNumbers"])),
          "data-mini-map": String(showMiniMap.value),
          role: "region",
          "aria-label": "Text panel",
          tabindex: "0",
          innerHTML: html.value
        }, null, 8, _hoisted_2$2p),
        createCommentVNode(" Grafana code editor mini-map: density overview of lines "),
        showMiniMap.value ? (openBlock(), createElementBlock("aside", _hoisted_3$28, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(codeLines.value, (line, i) => {
              return openBlock(), createElementBlock(
                "div",
                {
                  key: i,
                  class: "mm-line",
                  style: normalizeStyle({ opacity: line.trim() ? 0.55 : 0.15 })
                },
                null,
                4
                /* STYLE */
              );
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2Y);
    };
  }
});
const TextRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3V, [["__scopeId", "data-v-a8b6c17a"]]);
const _sfc_main$3U = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(TextRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  { id: "text", name: "文本", state: "stable", skipDataQuery: true },
  _sfc_main$3U
).setPanelOptions((builder) => {
  builder.addRadio(
    {
      id: "mode",
      path: "mode",
      name: "模式",
      category: ["文本"],
      editor: "radio",
      settings: {
        options: [
          { label: "Markdown", value: "markdown" },
          { label: "HTML", value: "html" },
          { label: "代码", value: "code" }
        ]
      }
    },
    "markdown"
  ).addTextArea(
    {
      id: "content",
      path: "content",
      name: "内容",
      category: ["文本"],
      editor: "textarea"
    },
    `# Title

For markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)`
  ).addSelect(
    {
      id: "code.language",
      path: "code.language",
      name: "语言",
      category: ["代码"],
      editor: "select",
      settings: {
        options: [
          { label: "plaintext", value: "plaintext" },
          { label: "yaml", value: "yaml" },
          { label: "json", value: "json" },
          { label: "sql", value: "sql" },
          { label: "markdown", value: "markdown" },
          { label: "javascript", value: "javascript" },
          { label: "typescript", value: "typescript" }
        ]
      },
      showIf: (c) => c.mode === "code"
    },
    "plaintext"
  ).addBoolean(
    {
      id: "code.showLineNumbers",
      path: "code.showLineNumbers",
      name: "显示行号",
      category: ["代码"],
      editor: "boolean",
      showIf: (c) => c.mode === "code"
    },
    false
  ).addBoolean(
    {
      id: "code.showMiniMap",
      path: "code.showMiniMap",
      name: "显示缩略图",
      category: ["代码"],
      editor: "boolean",
      showIf: (c) => c.mode === "code"
    },
    false
  );
}).setRuntimeConsumedPaths([
  "mode",
  "content",
  "code.language",
  "code.showLineNumbers",
  "code.showMiniMap"
]).register();
const _hoisted_1$2X = ["data-feed-url", "data-show-image", "data-loading", "data-item-count"];
const _hoisted_2$2o = {
  key: 0,
  class: "alert",
  "data-testid": "news-error",
  role: "alert"
};
const _hoisted_3$27 = {
  key: 1,
  class: "loading",
  "data-testid": "news-loading"
};
const _hoisted_4$1Q = {
  key: 2,
  class: "scroll",
  "data-testid": "news-list"
};
const _hoisted_5$1E = ["href"];
const _hoisted_6$1q = ["src", "alt"];
const _hoisted_7$1h = { class: "body" };
const _hoisted_8$17 = ["datetime"];
const _hoisted_9$11 = { class: "title" };
const _hoisted_10$U = ["href"];
const _hoisted_11$M = {
  class: "content",
  "data-testid": "news-content"
};
const DEFAULT_FEED_URL = "https://grafana.com/blog/news.xml";
const _sfc_main$3T = /* @__PURE__ */ defineComponent({
  __name: "NewsRenderer",
  props: {
    options: {},
    width: {}
  },
  setup(__props, { expose: __expose }) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const feedUrl = computed(() => {
      const raw = opts.value.feedUrl ?? opts.value.url;
      const s = typeof raw === "string" && raw.trim() ? raw.trim() : DEFAULT_FEED_URL;
      return s;
    });
    const showImage = computed(() => opts.value.showImage !== false);
    const useWideLayout = computed(() => (props.width ?? 0) > 600);
    const loading = ref(true);
    const error = ref(null);
    const items = ref([]);
    function getProperty(node, property) {
      return node.querySelector(property)?.textContent ?? "";
    }
    function parseFeed(txt) {
      const doc = new DOMParser().parseFromString(txt, "text/xml");
      const isAtom = !!doc.querySelector("feed");
      if (isAtom) {
        return Array.from(doc.querySelectorAll("entry")).map((node) => {
          const link = node.querySelector("link[href]")?.getAttribute("href") || node.querySelector("link")?.textContent || "#";
          const pub = getProperty(node, "updated") || getProperty(node, "published");
          return {
            title: getProperty(node, "title"),
            link,
            content: getProperty(node, "summary") || getProperty(node, "content"),
            date: Date.parse(pub) || 0,
            ogImage: node.querySelector("meta[property='og:image']")?.getAttribute("content") || void 0
          };
        });
      }
      return Array.from(doc.querySelectorAll("item")).map((node) => {
        const pub = getProperty(node, "pubDate");
        const content = getProperty(node, "description").replace(
          /<\/?[^>]+(>|$)/g,
          ""
        );
        return {
          title: getProperty(node, "title"),
          link: getProperty(node, "link"),
          content,
          date: Date.parse(pub) || 0,
          ogImage: node.querySelector("meta[property='og:image']")?.getAttribute("content") || void 0
        };
      });
    }
    function formatNewsDate(ms) {
      if (!ms) return "";
      const d = new Date(ms);
      return d.toLocaleDateString("en-US", { month: "short", day: "2-digit" }).replace(",", "");
    }
    async function load() {
      loading.value = true;
      error.value = null;
      items.value = [];
      try {
        const { getResourceHttp: getResourceHttp2 } = await Promise.resolve().then(() => index$1);
        const axiosRes = await getResourceHttp2().request({
          url: feedUrl.value,
          method: "GET",
          responseType: "text"
        });
        if (axiosRes.status < 200 || axiosRes.status >= 300)
          throw new Error(`HTTP ${axiosRes.status}`);
        const txt = typeof axiosRes.data === "string" ? axiosRes.data : String(axiosRes.data ?? "");
        items.value = parseFeed(txt);
      } catch (e) {
        error.value = e?.message || String(e);
      } finally {
        loading.value = false;
      }
    }
    onMounted(load);
    watch(feedUrl, load);
    __expose({ loading, error, items });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "news",
        "data-testid": "panel-news",
        "data-feed-url": feedUrl.value,
        "data-show-image": String(showImage.value),
        "data-loading": loading.value ? "1" : "0",
        "data-item-count": String(items.value.length)
      }, [
        error.value ? (openBlock(), createElementBlock("div", _hoisted_2$2o, [..._cache[0] || (_cache[0] = [
          createElementVNode(
            "div",
            { class: "alert-title" },
            "加载 RSS 源时出错",
            -1
            /* CACHED */
          ),
          createElementVNode(
            "div",
            { class: "alert-body" },
            [
              createTextVNode(" 请确保订阅源网址正确无误，并且在服务器上正确配置了 CORS。请参阅 "),
              createElementVNode("a", {
                class: "doc-link",
                href: "https://grafana.com/docs/grafana/latest/panels-visualizations/visualizations/news/",
                target: "_blank",
                rel: "noreferrer"
              }, "新闻面板文档"),
              createTextVNode("。 ")
            ],
            -1
            /* CACHED */
          )
        ])])) : loading.value ? (openBlock(), createElementBlock("div", _hoisted_3$27, " 加载中... ")) : (openBlock(), createElementBlock("div", _hoisted_4$1Q, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(items.value, (it, index2) => {
              return openBlock(), createElementBlock(
                "article",
                {
                  key: `${index2}-${it.link}`,
                  class: normalizeClass(["item", { wide: useWideLayout.value }]),
                  "data-testid": "news-item"
                },
                [
                  showImage.value && it.ogImage ? (openBlock(), createElementBlock("a", {
                    key: 0,
                    class: normalizeClass(["social-image", { wide: useWideLayout.value }]),
                    href: it.link,
                    target: "_blank",
                    rel: "noopener noreferrer",
                    tabindex: "-1",
                    "aria-hidden": "true"
                  }, [
                    createElementVNode("img", {
                      src: it.ogImage,
                      alt: it.title,
                      "data-testid": "news-image"
                    }, null, 8, _hoisted_6$1q)
                  ], 10, _hoisted_5$1E)) : createCommentVNode("v-if", true),
                  createElementVNode("div", _hoisted_7$1h, [
                    createElementVNode("time", {
                      class: "date",
                      datetime: formatNewsDate(it.date)
                    }, toDisplayString(formatNewsDate(it.date)) + " ", 9, _hoisted_8$17),
                    createElementVNode("h1", _hoisted_9$11, [
                      createElementVNode("a", {
                        class: "title-link",
                        href: it.link,
                        target: "_blank",
                        rel: "noreferrer"
                      }, toDisplayString(it.title), 9, _hoisted_10$U)
                    ]),
                    createElementVNode(
                      "div",
                      _hoisted_11$M,
                      toDisplayString(it.content),
                      1
                      /* TEXT */
                    )
                  ])
                ],
                2
                /* CLASS */
              );
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ]))
      ], 8, _hoisted_1$2X);
    };
  }
});
const NewsRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3T, [["__scopeId", "data-v-a490456f"]]);
const _sfc_main$3S = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(NewsRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  { id: "news", name: "新闻", state: "stable", skipDataQuery: true },
  _sfc_main$3S
).setPanelOptions((builder) => {
  const category = ["新闻"];
  builder.addText(
    {
      id: "feedUrl",
      path: "feedUrl",
      name: "订阅源 URL",
      category
    },
    "https://grafana.com/blog/news.xml"
  ).addBoolean(
    {
      id: "showImage",
      path: "showImage",
      name: "显示图片",
      category
    },
    true
  );
}).setRuntimeConsumedPaths(["feedUrl", "showImage"]).register();
const _hoisted_1$2W = ["data-folder-uid", "data-include-vars", "data-show-folder-names", "data-show-headings", "data-max-items", "data-show-folder", "data-show-starred", "data-show-recent", "data-show-search", "data-item-count"];
const _hoisted_2$2n = {
  key: 0,
  class: "empty-state",
  "data-testid": "dashlist-empty"
};
const _hoisted_3$26 = {
  key: 1,
  class: "group",
  "data-testid": "dashlist-starred"
};
const _hoisted_4$1P = {
  key: 0,
  class: "heading",
  "data-testid": "dashlist-header"
};
const _hoisted_5$1D = ["href"];
const _hoisted_6$1p = {
  key: 0,
  class: "folder"
};
const _hoisted_7$1g = {
  key: 2,
  class: "group",
  "data-testid": "dashlist-recent"
};
const _hoisted_8$16 = {
  key: 0,
  class: "heading",
  "data-testid": "dashlist-header"
};
const _hoisted_9$10 = ["href"];
const _hoisted_10$T = {
  key: 0,
  class: "folder"
};
const _hoisted_11$L = {
  key: 3,
  class: "group",
  "data-testid": "dashlist-search-results"
};
const _hoisted_12$E = {
  key: 0,
  class: "heading",
  "data-testid": "dashlist-header"
};
const _hoisted_13$D = ["href"];
const _hoisted_14$C = {
  key: 0,
  class: "folder"
};
const _sfc_main$3R = /* @__PURE__ */ defineComponent({
  __name: "DashListRenderer",
  props: {
    options: {},
    replaceVariables: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const replace = (s) => props.replaceVariables ? props.replaceVariables(s) : s;
    const maxItems = computed(() => Number(opts.value.maxItems ?? 10));
    const query = computed(() => String(opts.value.query ?? ""));
    const showHeadings = computed(() => opts.value.showHeadings !== false);
    const showFolderNames = computed(() => opts.value.showFolderNames !== false);
    const showStarred = computed(() => opts.value.showStarred !== false);
    const showRecentlyViewed = computed(
      () => opts.value.showRecentlyViewed === true
    );
    const showSearch = computed(() => opts.value.showSearch === true);
    const keepTime = computed(() => opts.value.keepTime === true);
    const includeVars = computed(() => opts.value.includeVars === true);
    const folderUID = computed(() => {
      const v = opts.value.folderUID;
      return v == null || v === "" ? "" : String(v);
    });
    const tags = computed(() => {
      const t2 = opts.value.tags;
      if (Array.isArray(t2)) return t2.map(String);
      return String(t2 || "").split(",").map((s) => s.trim()).filter(Boolean);
    });
    const starred = ref([]);
    const recent = ref([]);
    const searched = ref([]);
    const loading = ref(false);
    function mapDash(d, flags = {}) {
      return {
        uid: String(d.uid ?? ""),
        title: String(d.title ?? d.name ?? d.uid ?? ""),
        url: String(d.url || `/d/${d.uid}`),
        folderTitle: d.folderTitle || d.folder || "",
        tags: d.tags || [],
        starred: !!d.isStarred || !!d.starred || !!flags.starred,
        ...flags
      };
    }
    async function load() {
      loading.value = true;
      try {
        const tasks = [];
        if (showStarred.value) {
          tasks.push(
            (async () => {
              try {
                const res = await backendSrv.get("/api/search", {
                  type: "dash-db",
                  limit: maxItems.value,
                  starred: "true"
                });
                const raw = Array.isArray(res.data) ? res.data : res.data?.dashboards ?? [];
                starred.value = raw.map((d) => mapDash(d)).slice(0, maxItems.value);
              } catch {
                starred.value = [];
              }
            })()
          );
        } else {
          starred.value = [];
        }
        if (showRecentlyViewed.value) {
          tasks.push(
            (async () => {
              try {
                const res = await backendSrv.get("/api/search", {
                  type: "dash-db",
                  limit: maxItems.value
                });
                const raw = Array.isArray(res.data) ? res.data : res.data?.dashboards ?? [];
                recent.value = raw.map((d) => mapDash(d)).slice(0, maxItems.value);
              } catch {
                recent.value = [];
              }
            })()
          );
        } else {
          recent.value = [];
        }
        if (showSearch.value) {
          tasks.push(
            (async () => {
              try {
                const res = await backendSrv.get("/api/search", {
                  type: "dash-db",
                  limit: maxItems.value,
                  query: replace(query.value) || void 0,
                  folderUIDs: folderUID.value || void 0,
                  tag: tags.value.length ? tags.value.map(replace).join(",") : void 0
                });
                const raw = Array.isArray(res.data) ? res.data : res.data?.dashboards ?? [];
                searched.value = raw.map((d) => mapDash(d)).slice(0, maxItems.value);
              } catch {
                searched.value = [];
              }
            })()
          );
        } else {
          searched.value = [];
        }
        await Promise.all(tasks);
      } finally {
        loading.value = false;
      }
    }
    onMounted(load);
    watch(
      [
        maxItems,
        query,
        folderUID,
        tags,
        showStarred,
        showRecentlyViewed,
        showSearch,
        showHeadings,
        showFolderNames
      ],
      load
    );
    function withQuery(url) {
      const parts = [];
      if (keepTime.value) parts.push("from=now-6h", "to=now");
      if (includeVars.value) parts.push("var-all=1");
      if (!parts.length) return url;
      return url.includes("?") ? `${url}&${parts.join("&")}` : `${url}?${parts.join("&")}`;
    }
    const showEmptyState = computed(
      () => !showStarred.value && !showRecentlyViewed.value && !showSearch.value
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "dashlist",
        "data-testid": "panel-dashlist",
        "data-folder-uid": String(folderUID.value ?? ""),
        "data-include-vars": String(!!opts.value.includeVars),
        "data-show-folder-names": String(showFolderNames.value),
        "data-show-headings": String(showHeadings.value),
        "data-max-items": String(maxItems.value),
        "data-show-folder": String(showFolderNames.value),
        "data-show-starred": String(showStarred.value),
        "data-show-recent": String(showRecentlyViewed.value),
        "data-show-search": String(showSearch.value),
        "data-item-count": String(starred.value.length + recent.value.length + searched.value.length)
      }, [
        showEmptyState.value ? (openBlock(), createElementBlock("div", _hoisted_2$2n, " 未配置数据面板组 ")) : createCommentVNode("v-if", true),
        createCommentVNode(" Starred group (always render section when enabled, even if empty — Grafana keeps empty <ul>) "),
        showStarred.value ? (openBlock(), createElementBlock("section", _hoisted_3$26, [
          showHeadings.value ? (openBlock(), createElementBlock("div", _hoisted_4$1P, " 已加星标的数据面板 ")) : createCommentVNode("v-if", true),
          createElementVNode("ul", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(starred.value, (it) => {
                return openBlock(), createElementBlock("li", {
                  key: "s" + it.uid,
                  "data-testid": "dashlist-item"
                }, [
                  createElementVNode("a", {
                    class: "link",
                    href: withQuery(it.url)
                  }, toDisplayString(it.title), 9, _hoisted_5$1D),
                  showFolderNames.value && it.folderTitle ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_6$1p,
                    toDisplayString(it.folderTitle),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true),
        showRecentlyViewed.value ? (openBlock(), createElementBlock("section", _hoisted_7$1g, [
          showHeadings.value ? (openBlock(), createElementBlock("div", _hoisted_8$16, " 最近查看的数据面板 ")) : createCommentVNode("v-if", true),
          createElementVNode("ul", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(recent.value, (it) => {
                return openBlock(), createElementBlock("li", {
                  key: "r" + it.uid,
                  "data-testid": "dashlist-item"
                }, [
                  createElementVNode("a", {
                    class: "link",
                    href: withQuery(it.url)
                  }, toDisplayString(it.title), 9, _hoisted_9$10),
                  showFolderNames.value && it.folderTitle ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_10$T,
                    toDisplayString(it.folderTitle),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true),
        showSearch.value ? (openBlock(), createElementBlock("section", _hoisted_11$L, [
          showHeadings.value ? (openBlock(), createElementBlock("div", _hoisted_12$E, " 搜索 ")) : createCommentVNode("v-if", true),
          createElementVNode("ul", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(searched.value, (it) => {
                return openBlock(), createElementBlock("li", {
                  key: "q" + it.uid,
                  "data-testid": "dashlist-item"
                }, [
                  createElementVNode("a", {
                    class: "link",
                    href: withQuery(it.url)
                  }, toDisplayString(it.title), 9, _hoisted_13$D),
                  showFolderNames.value && it.folderTitle ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_14$C,
                    toDisplayString(it.folderTitle),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2W);
    };
  }
});
const DashListRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3R, [["__scopeId", "data-v-e0a27e48"]]);
const _sfc_main$3Q = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(DashListRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "dashlist",
    name: "仪表盘列表",
    description: "星标 / 最近 / 搜索仪表盘",
    state: "stable",
    skipDataQuery: true
  },
  _sfc_main$3Q
).setPanelOptions((builder) => {
  const cat = ["仪表盘列表"];
  builder.addBoolean(
    {
      id: "keepTime",
      path: "keepTime",
      name: "包含当前时间范围",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "includeVars",
      path: "includeVars",
      name: "包含当前模板变量",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "showStarred",
      path: "showStarred",
      name: "星标",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showRecentlyViewed",
      path: "showRecentlyViewed",
      name: "最近查看",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "showSearch",
      path: "showSearch",
      name: "搜索",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "showHeadings",
      path: "showHeadings",
      name: "显示标题",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showFolderNames",
      path: "showFolderNames",
      name: "显示文件夹名",
      category: cat
    },
    true
  ).addNumber(
    {
      id: "maxItems",
      path: "maxItems",
      name: "最大条目",
      category: cat,
      settings: { min: 1 }
    },
    10
  ).addText(
    {
      id: "query",
      path: "query",
      name: "查询",
      category: cat,
      showIf: (c) => !!c.showSearch
    },
    ""
  ).addText(
    {
      id: "folderUID",
      path: "folderUID",
      name: "文件夹 UID",
      category: cat,
      showIf: (c) => !!c.showSearch
    },
    void 0
  ).addText(
    {
      id: "tags",
      path: "tags",
      name: "标签",
      description: "逗号分隔或 JSON 数组",
      category: cat,
      showIf: (c) => !!c.showSearch
    },
    void 0
  );
}).setRuntimeConsumedPaths([
  "folderUID",
  "includeVars",
  "keepTime",
  "maxItems",
  "query",
  "showFolderNames",
  "showHeadings",
  "showRecentlyViewed",
  "showSearch",
  "showStarred",
  "tags"
]).register();
const _hoisted_1$2V = ["data-limit", "data-only-in-range", "data-only-this-dash", "data-show-time", "data-show-tags", "data-show-user", "data-navigate", "data-nav-before", "data-nav-after", "data-row-count"];
const _hoisted_2$2m = {
  key: 0,
  class: "filter-bar",
  "data-testid": "annolist-filter-bar"
};
const _hoisted_3$25 = { class: "meta-line" };
const _hoisted_4$1O = {
  key: 0,
  class: "time"
};
const _hoisted_5$1C = {
  key: 1,
  class: "user",
  "data-testid": "annolist-user"
};
const _hoisted_6$1o = { class: "text" };
const _hoisted_7$1f = ["href"];
const _hoisted_8$15 = {
  key: 0,
  class: "tags"
};
const _hoisted_9$$ = {
  key: 1,
  class: "empty",
  "data-testid": "annolist-empty"
};
const _sfc_main$3P = /* @__PURE__ */ defineComponent({
  __name: "AnnoListRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {},
    replaceVariables: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const tagFilter = ref("");
    const hasFilter = computed(() => {
      if (tagFilter.value.trim()) return true;
      const tags = opts.value.tags;
      if (Array.isArray(tags) && tags.length) return true;
      if (typeof tags === "string" && tags.trim()) return true;
      return false;
    });
    const allRows = computed(() => {
      const limit = Number(opts.value.limit ?? 10);
      const onlyInTimeRange = opts.value.onlyInTimeRange !== false && opts.value.onlyInTimeRange !== "false";
      const onlyThisDash = opts.value.onlyFromThisDashboard === true || opts.value.onlyFromThisDashboard === "true" || opts.value.onlyFromThisDashboard === "yes";
      const from = props.data?.timeRange?.from?.getTime?.() ?? 0;
      const to = props.data?.timeRange?.to?.getTime?.() ?? Date.now();
      const navPanel = opts.value.navigateToPanel === false || opts.value.navigateToPanel === "dashboard" || opts.value.navigateToPanel === "false" ? false : true;
      const annos = props.data?.annotations ?? [];
      return annos.filter((a) => {
        if (onlyInTimeRange && !(a.time >= from && a.time <= to)) return false;
        if (onlyThisDash && a.dashboardUID && props.data?.request) {
          const dashUid = props.data.request?.dashboardUID;
          if (dashUid && a.dashboardUID !== dashUid) return false;
        }
        return true;
      }).slice(0, limit).map((a) => ({
        time: opts.value.showTime === false ? "" : new Date(a.time).toISOString(),
        timeMs: a.time,
        text: a.title || a.text || "",
        tags: (a.tags ?? []).join(","),
        user: String(
          a.login || a.user || a.email || ""
        ),
        panelId: a.panelId,
        dashboardUID: a.dashboardUID,
        navigateToPanel: navPanel
      }));
    });
    function parseDurationMs2(raw) {
      const s = String(raw || "").trim();
      const m = s.match(/^(\d+)(ms|s|m|h|d)?$/i);
      if (!m) return 0;
      const n = Number(m[1]);
      const u = (m[2] || "s").toLowerCase();
      if (u === "ms") return n;
      if (u === "s") return n * 1e3;
      if (u === "m") return n * 6e4;
      if (u === "h") return n * 36e5;
      if (u === "d") return n * 864e5;
      return n;
    }
    function navHref(r) {
      const before = parseDurationMs2(String(opts.value.navigateBefore ?? "10m"));
      const after = parseDurationMs2(String(opts.value.navigateAfter ?? "10m"));
      const from = new Date(r.timeMs - before).toISOString();
      const to = new Date(r.timeMs + after).toISOString();
      if (r.navigateToPanel && r.panelId != null) {
        return `?viewPanel=${r.panelId}&from=${encodeURIComponent(from)}&to=${encodeURIComponent(to)}`;
      }
      return `?from=${encodeURIComponent(from)}&to=${encodeURIComponent(to)}`;
    }
    const rows = computed(() => {
      const limit = Number(opts.value.limit ?? 10);
      let list = allRows.value;
      const q = tagFilter.value.trim().toLowerCase();
      if (q)
        list = list.filter(
          (r) => r.tags.toLowerCase().includes(q) || r.text.toLowerCase().includes(q) || r.user.toLowerCase().includes(q)
        );
      const filterTags = Array.isArray(opts.value.tags) ? opts.value.tags.map(String) : String(opts.value.tags || "").split(",").map((t2) => t2.trim()).filter(Boolean);
      if (filterTags.length) {
        list = list.filter(
          (r) => filterTags.some(
            (t2) => r.tags.split(",").map((x) => x.trim()).includes(t2)
          )
        );
      }
      return list.slice(0, limit);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "annolist",
        "data-testid": "panel-annolist",
        "data-limit": String(opts.value.limit ?? 10),
        "data-only-in-range": String(opts.value.onlyInTimeRange !== false),
        "data-only-this-dash": String(
          !!opts.value.onlyFromThisDashboard && opts.value.onlyFromThisDashboard !== false
        ),
        "data-show-time": String(opts.value.showTime !== false),
        "data-show-tags": String(opts.value.showTags !== false),
        "data-show-user": String(opts.value.showUser !== false),
        "data-navigate": String(
          opts.value.navigateToPanel !== false && opts.value.navigateToPanel !== "dashboard"
        ),
        "data-nav-before": String(opts.value.navigateBefore ?? "10m"),
        "data-nav-after": String(opts.value.navigateAfter ?? "10m"),
        "data-row-count": String(rows.value.length)
      }, [
        hasFilter.value ? (openBlock(), createElementBlock("div", _hoisted_2$2m, [
          _cache[1] || (_cache[1] = createElementVNode(
            "b",
            { class: "filter-label" },
            "筛选：",
            -1
            /* CACHED */
          )),
          withDirectives(createElementVNode(
            "input",
            {
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => tagFilter.value = $event),
              class: "filter",
              "data-testid": "annolist-filter",
              placeholder: "按标签/文本/用户筛选…"
            },
            null,
            512
            /* NEED_PATCH */
          ), [
            [vModelText, tagFilter.value]
          ])
        ])) : createCommentVNode("v-if", true),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (r, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row",
              "data-testid": "annolist-row"
            }, [
              createElementVNode("div", _hoisted_3$25, [
                opts.value.showTime !== false && r.time ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_4$1O,
                  toDisplayString(r.time),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                opts.value.showUser !== false && r.user ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_5$1C,
                  toDisplayString(r.user),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ]),
              createElementVNode("div", _hoisted_6$1o, [
                createTextVNode(
                  toDisplayString(r.text) + " ",
                  1
                  /* TEXT */
                ),
                r.panelId != null || opts.value.navigateBefore || opts.value.navigateAfter ? (openBlock(), createElementBlock("a", {
                  key: 0,
                  class: "nav",
                  "data-testid": "annolist-nav",
                  href: navHref(r)
                }, toDisplayString(r.navigateToPanel && r.panelId != null ? `面板 #${r.panelId}` : "打开时间范围"), 9, _hoisted_7$1f)) : createCommentVNode("v-if", true)
              ]),
              opts.value.showTags !== false && r.tags ? (openBlock(), createElementBlock(
                "div",
                _hoisted_8$15,
                toDisplayString(r.tags),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true)
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createCommentVNode(" zh-Hans: Grafana i18n annolist.anno-list-panel.no-annotations-found "),
        !rows.value.length ? (openBlock(), createElementBlock("div", _hoisted_9$$, " 未找到注释 ")) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2V);
    };
  }
});
const AnnoListRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3P, [["__scopeId", "data-v-5237f3cc"]]);
const _sfc_main$3O = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(AnnoListRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "annolist",
    name: "注解列表",
    state: "stable",
    skipDataQuery: true
  },
  _sfc_main$3O
).setPanelOptions((builder) => {
  const category = ["注解列表"];
  builder.addRadio(
    {
      id: "onlyFromThisDashboard",
      path: "onlyFromThisDashboard",
      name: "查询范围",
      category,
      settings: {
        options: [
          { label: "本仪表盘", value: true },
          { label: "全部仪表盘", value: false }
        ]
      }
    },
    true
  ).addRadio(
    {
      id: "onlyInTimeRange",
      path: "onlyInTimeRange",
      name: "时间范围",
      category,
      settings: {
        options: [
          { label: "当前时间范围", value: true },
          { label: "不限", value: false }
        ]
      }
    },
    true
  ).addText({
    id: "tags",
    path: "tags",
    name: "标签",
    description: "逗号分隔；仅显示包含任一标签的注解",
    category
  }).addNumber(
    {
      id: "limit",
      path: "limit",
      name: "条数限制",
      category,
      settings: { min: 1, max: 1e3 }
    },
    10
  ).addBoolean(
    {
      id: "showUser",
      path: "showUser",
      name: "显示用户",
      category
    },
    true
  ).addBoolean(
    {
      id: "showTime",
      path: "showTime",
      name: "显示时间",
      category
    },
    true
  ).addBoolean(
    {
      id: "showTags",
      path: "showTags",
      name: "显示标签",
      category
    },
    true
  ).addRadio(
    {
      id: "navigateToPanel",
      path: "navigateToPanel",
      name: "链接目标",
      category,
      settings: {
        options: [
          { label: "面板", value: true },
          { label: "仪表盘", value: false }
        ]
      }
    },
    true
  ).addText(
    {
      id: "navigateBefore",
      path: "navigateBefore",
      name: "前移时间",
      description: "如 10m、1h",
      category
    },
    "10m"
  ).addText(
    {
      id: "navigateAfter",
      path: "navigateAfter",
      name: "后移时间",
      description: "如 10m、1h",
      category
    },
    "10m"
  );
}).setRuntimeConsumedPaths([
  "limit",
  "navigateAfter",
  "navigateBefore",
  "navigateToPanel",
  "onlyFromThisDashboard",
  "onlyInTimeRange",
  "showTags",
  "showTime",
  "showUser",
  "tags"
]).register();
const _hoisted_1$2U = {
  class: "gs",
  "data-testid": "panel-gettingstarted"
};
const _hoisted_2$2l = { class: "content" };
const _hoisted_3$24 = { class: "setup" };
const _hoisted_4$1N = { class: "cards" };
const _hoisted_5$1B = ["href"];
const _hoisted_6$1n = { class: "card-content" };
const _hoisted_7$1e = { class: "type" };
const _hoisted_8$14 = { class: "heading" };
const _hoisted_9$_ = { class: "card-title-wrap" };
const _hoisted_10$S = { class: "card-title" };
const _hoisted_11$K = { class: "card-info" };
const _hoisted_12$D = { class: "card-content docs-content" };
const _hoisted_13$C = ["href"];
const _hoisted_14$B = { class: "card-title-wrap" };
const _hoisted_15$v = { class: "card-title" };
const _hoisted_16$t = { class: "learn" };
const _hoisted_17$q = ["href"];
const _hoisted_18$q = {
  type: "button",
  class: "nav forward",
  "aria-label": "前往高级教程",
  "data-testid": "gettingstarted-forward"
};
const _sfc_main$3N = /* @__PURE__ */ defineComponent({
  __name: "GettingStartedRenderer",
  setup(__props) {
    const tutorial = {
      type: "tutorial",
      heading: "Data source and dashboards",
      title: "Grafana fundamentals",
      info: "Set up and understand Grafana if you have no prior experience. This tutorial guides you through the entire process and covers the “Data source” and “Dashboards” steps to the right.",
      href: "https://grafana.com/tutorials/grafana-fundamentals?utm_source=grafana_gettingstarted"
    };
    const docsCards = [
      {
        title: "Add your first data source",
        href: "datasources/new?utm_source=grafana_gettingstarted",
        learnHref: "https://grafana.com/docs/grafana/latest/features/datasources/add-a-data-source?utm_source=grafana_gettingstarted",
        done: true
      },
      {
        title: "Create your first dashboard",
        href: "dashboard/new?utm_source=grafana_gettingstarted",
        learnHref: "https://grafana.com/docs/grafana/latest/guides/getting_started/#create-a-dashboard?utm_source=grafana_gettingstarted",
        done: true
      }
    ];
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2U, [
        _cache[3] || (_cache[3] = createElementVNode(
          "button",
          {
            type: "button",
            class: "dismiss",
            "data-testid": "gettingstarted-dismiss"
          },
          " 移除此面板 ",
          -1
          /* CACHED */
        )),
        createElementVNode("div", _hoisted_2$2l, [
          createElementVNode("div", _hoisted_3$24, [
            _cache[2] || (_cache[2] = createElementVNode(
              "div",
              { class: "info" },
              [
                createElementVNode("h2", { class: "step-title" }, "Basic"),
                createElementVNode("p", { class: "step-info" }, " The steps below will guide you to quickly finish setting up your Grafana installation. ")
              ],
              -1
              /* CACHED */
            )),
            createElementVNode("div", _hoisted_4$1N, [
              createElementVNode("a", {
                class: "card tutorial",
                href: tutorial.href,
                target: "_blank",
                rel: "noreferrer",
                "data-testid": "gettingstarted-tutorial"
              }, [
                createElementVNode("div", _hoisted_6$1n, [
                  createElementVNode(
                    "div",
                    _hoisted_7$1e,
                    toDisplayString(tutorial.type),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "div",
                    _hoisted_8$14,
                    toDisplayString(tutorial.heading),
                    1
                    /* TEXT */
                  ),
                  createElementVNode("div", _hoisted_9$_, [
                    createElementVNode(
                      "h3",
                      _hoisted_10$S,
                      toDisplayString(tutorial.title),
                      1
                      /* TEXT */
                    )
                  ]),
                  createElementVNode(
                    "div",
                    _hoisted_11$K,
                    toDisplayString(tutorial.info),
                    1
                    /* TEXT */
                  )
                ])
              ], 8, _hoisted_5$1B),
              (openBlock(), createElementBlock(
                Fragment,
                null,
                renderList(docsCards, (card) => {
                  return createElementVNode("div", {
                    key: card.title,
                    class: "card docs",
                    "data-testid": "gettingstarted-docs"
                  }, [
                    createElementVNode("div", _hoisted_12$D, [
                      createElementVNode("a", {
                        href: card.href,
                        class: "docs-url"
                      }, [
                        _cache[0] || (_cache[0] = createElementVNode(
                          "div",
                          { class: "heading complete" },
                          "完成",
                          -1
                          /* CACHED */
                        )),
                        createElementVNode("div", _hoisted_14$B, [
                          createElementVNode(
                            "h3",
                            _hoisted_15$v,
                            toDisplayString(card.title),
                            1
                            /* TEXT */
                          )
                        ])
                      ], 8, _hoisted_13$C)
                    ]),
                    createElementVNode("div", _hoisted_16$t, [
                      createElementVNode("a", {
                        href: card.learnHref,
                        target: "_blank",
                        rel: "noreferrer",
                        class: "learn-link"
                      }, [
                        _cache[1] || (_cache[1] = createTextVNode(
                          " 在文档中了解如何操作 ",
                          -1
                          /* CACHED */
                        )),
                        createVNode(unref(GIcon), {
                          name: "external-link-alt",
                          size: 16,
                          class: "ext"
                        })
                      ], 8, _hoisted_17$q)
                    ])
                  ]);
                }),
                64
                /* STABLE_FRAGMENT */
              ))
            ])
          ])
        ]),
        createElementVNode("button", _hoisted_18$q, [
          createVNode(unref(GIcon), {
            name: "angle-right",
            size: 16,
            class: "nav-icon"
          })
        ])
      ]);
    };
  }
});
const GettingStartedRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3N, [["__scopeId", "data-v-986884a0"]]);
const _sfc_main$3M = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GettingStartedRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "gettingstarted",
    name: "快速开始",
    state: "stable",
    skipDataQuery: true
  },
  _sfc_main$3M
).setNoPadding().setPanelOptions(() => {
}).setRuntimeConsumedPaths([]).register();
const _hoisted_1$2T = {
  class: "welcome",
  "data-testid": "panel-welcome",
  "data-locale": "zh-Hans"
};
const _hoisted_2$2k = { class: "help" };
const _hoisted_3$23 = { class: "help-links" };
const _hoisted_4$1M = ["href"];
const _sfc_main$3L = /* @__PURE__ */ defineComponent({
  __name: "WelcomeRenderer",
  setup(__props) {
    const helpOptions = [
      { label: "Documentation", href: "https://grafana.com/docs/grafana/latest" },
      { label: "Tutorials", href: "https://grafana.com/tutorials" },
      { label: "Community", href: "https://community.grafana.com" },
      { label: "Public Slack", href: "http://slack.grafana.com" }
    ];
    function hrefWithUtm(href) {
      const join = href.includes("?") ? "&" : "?";
      return `${href}${join}utm_source=grafana_gettingstarted`;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2T, [
        _cache[1] || (_cache[1] = createElementVNode(
          "h1",
          { class: "title" },
          "欢迎使用 Grafana",
          -1
          /* CACHED */
        )),
        createElementVNode("div", _hoisted_2$2k, [
          _cache[0] || (_cache[0] = createElementVNode(
            "h2",
            { class: "help-text" },
            "需要帮助吗？",
            -1
            /* CACHED */
          )),
          createElementVNode("div", _hoisted_3$23, [
            (openBlock(), createElementBlock(
              Fragment,
              null,
              renderList(helpOptions, (option, index2) => {
                return createElementVNode("a", {
                  key: `${option.label}-${index2}`,
                  class: "help-link",
                  href: hrefWithUtm(option.href),
                  target: "_blank",
                  rel: "noreferrer",
                  "data-testid": "welcome-help-link"
                }, [
                  createTextVNode(
                    toDisplayString(option.label),
                    1
                    /* TEXT */
                  ),
                  createVNode(unref(GIcon), {
                    name: "external-link-alt",
                    size: 16,
                    class: "ext-icon"
                  })
                ], 8, _hoisted_4$1M);
              }),
              64
              /* STABLE_FRAGMENT */
            ))
          ])
        ])
      ]);
    };
  }
});
const WelcomeRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3L, [["__scopeId", "data-v-f709e310"]]);
const _sfc_main$3K = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(WelcomeRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "welcome",
    name: "欢迎横幅",
    state: "stable",
    skipDataQuery: true
  },
  _sfc_main$3K
).setNoPadding().setPanelOptions(() => {
}).setRuntimeConsumedPaths([]).register();
function percentChange(values) {
  const nums = values.filter((n) => Number.isFinite(n));
  if (nums.length < 2) return null;
  const last = nums[nums.length - 1];
  const prev = nums[nums.length - 2];
  if (!Number.isFinite(prev) || prev === 0) return null;
  return (last - prev) / Math.abs(prev) * 100;
}
function prepareStatItems(input) {
  const o = input.options ?? {};
  const out = [];
  const calcs = o.reduceOptions?.calcs ?? [
    o.calc ?? "lastNotNull"
  ];
  const calc = String(calcs[0] ?? "lastNotNull");
  const fieldFilter = String(o.reduceOptions?.fields ?? "");
  const fieldRe = fieldFilter ? new RegExp(fieldFilter) : null;
  const showAllValues = o.reduceOptions?.values === true;
  const limit = o.reduceOptions?.limit != null ? Number(o.reduceOptions.limit) : showAllValues ? 25 : void 0;
  let textMode = String(o.textMode ?? "auto");
  const defaultsDisplayName = String(
    input.fieldConfig?.defaults?.displayName ?? ""
  );
  if (textMode === "auto" && defaultsDisplayName) textMode = "value_and_name";
  const graphMode = String(o.graphMode ?? "area");
  const showPct = o.showPercentChange === true;
  const allFrames = input.data?.series ?? [];
  for (const frame of allFrames) {
    for (const field of frame.fields.filter((f) => f.type === "number")) {
      if (fieldRe && !fieldRe.test(field.name) && !fieldRe.test(getFieldDisplayName(field, frame, allFrames))) {
        continue;
      }
      const cfg = { ...field.config, ...input.fieldConfig?.defaults ?? {} };
      const name = getFieldDisplayName(field, frame, allFrames);
      const nums = field.values.map(Number).filter((n) => Number.isFinite(n));
      const display = getDisplayProcessor({ field: { ...field, config: cfg } });
      if (showAllValues) {
        const values = field.values.map((v2) => v2).slice(-(limit ?? 25));
        for (const v2 of values) {
          const dv2 = display(v2);
          out.push({
            text: textMode === "name" ? name : textMode === "none" ? "" : formattedValueToString(dv2),
            name: textMode === "value" || textMode === "none" ? "" : name,
            color: dv2.color,
            spark: graphMode === "none" ? [] : nums.slice(-24),
            percentChange: showPct ? percentChange(nums) : null
          });
        }
        continue;
      }
      const r = reduceField(field, [calc]);
      const v = r[calc];
      const dv = display(v);
      const color = dv.color;
      const spark = graphMode === "none" ? [] : nums.slice(-24);
      const pct = showPct ? percentChange(nums) : null;
      const text = formattedValueToString(dv);
      if (textMode === "none") {
        out.push({ text: "", name: "", color, spark: [], percentChange: null });
      } else if (textMode === "name") {
        out.push({ text: name, name: "", color, spark, percentChange: pct });
      } else if (textMode === "value") {
        out.push({ text, name: "", color, spark, percentChange: pct });
      } else if (textMode === "value_and_name") {
        out.push({ text, name, color, spark, percentChange: pct });
      } else {
        out.push({ text, name, color, spark, percentChange: pct });
      }
    }
  }
  let result = limit != null && Number.isFinite(limit) && !showAllValues ? out.slice(0, limit) : out;
  if (textMode === "auto" && result.length === 1) {
    result = [{ ...result[0], name: "" }];
  }
  return result.map((it) => {
    const n = String(it.name || "");
    if (n === "Value" || /^Value\s*\{/.test(n)) return { ...it, name: "" };
    return it;
  });
}
const _hoisted_1$2S = ["data-orientation", "data-text-mode", "data-graph-mode", "data-color-mode", "data-percent-color-mode", "data-justify-mode", "data-reduce-values", "data-reduce-limit"];
const _hoisted_2$2j = {
  key: 0,
  class: "stat-empty",
  "data-testid": "stat-empty"
};
const _hoisted_3$22 = ["data-testid"];
const _hoisted_4$1L = { class: "stat-name sr-mirror" };
const _hoisted_5$1A = {
  class: "stat-value sr-mirror",
  "data-testid": "panel-stat-value"
};
const _hoisted_6$1m = {
  key: 0,
  class: "sr-mirror",
  "data-testid": "panel-stat-pct"
};
const _hoisted_7$1d = {
  key: 1,
  class: "sr-mirror",
  "data-testid": "panel-stat-spark"
};
const _hoisted_8$13 = {
  key: 2,
  class: "sr-mirror",
  "data-testid": "panel-stat-spark-area"
};
const _sfc_main$3J = /* @__PURE__ */ defineComponent({
  __name: "StatRenderer",
  props: {
    data: {},
    fieldConfig: {},
    options: {},
    replaceVariables: { type: Function },
    width: {},
    height: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const items = computed(
      () => prepareStatItems({
        data: props.data,
        options: props.options,
        fieldConfig: props.fieldConfig
      })
    );
    const orientation = computed(() => String(opts.value.orientation ?? "auto"));
    const colorMode = computed(
      () => String(opts.value.colorMode ?? "value")
    );
    const graphMode = computed(() => {
      const g = String(opts.value.graphMode ?? "area");
      return g === "area" ? BigValueGraphMode.Area : g === "line" ? BigValueGraphMode.Line : BigValueGraphMode.None;
    });
    const justifyMode = computed(
      () => String(opts.value.justifyMode ?? "auto")
    );
    const textMode = computed(() => {
      let tm = String(opts.value.textMode ?? "auto");
      const defaultsDisplayName = String(
        props.fieldConfig?.defaults?.displayName ?? ""
      );
      if (tm === "auto" && defaultsDisplayName) tm = "value_and_name";
      return tm;
    });
    const wideLayout = computed(() => opts.value.wideLayout !== false);
    const textSizes = computed(
      () => opts.value.text ?? {}
    );
    function itemShellStyle(it) {
      const mode2 = String(opts.value.colorMode ?? "value");
      if ((mode2 === "background" || mode2 === "background_solid") && it.color) {
        if (mode2 === "background_solid") return { background: it.color };
        return { background: `linear-gradient(120deg, ${it.color}, ${it.color})` };
      }
      return {};
    }
    const cellSize = computed(() => {
      const n = Math.max(1, items.value.length);
      const W2 = props.width ?? 300;
      const H2 = props.height ?? 200;
      const orient = orientation.value;
      if (orient === "horizontal") {
        return { w: Math.floor(W2 / n), h: H2 };
      }
      if (orient === "vertical") {
        return { w: W2, h: Math.floor(H2 / n) };
      }
      const cols = Math.ceil(Math.sqrt(n));
      const rows = Math.ceil(n / cols);
      return { w: Math.floor(W2 / cols), h: Math.floor(H2 / rows) };
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "stat-renderer",
        "data-testid": "panel-stat",
        "data-orientation": orientation.value,
        "data-text-mode": String(textMode.value),
        "data-graph-mode": String(graphMode.value),
        "data-color-mode": String(colorMode.value),
        "data-percent-color-mode": String(opts.value.percentChangeColorMode ?? "standard"),
        "data-justify-mode": String(justifyMode.value),
        "data-reduce-values": String(!!opts.value.reduceOptions?.values),
        "data-reduce-limit": String(opts.value.reduceOptions?.limit ?? ""),
        style: { "width": "100%", "height": "100%" }
      }, [
        !items.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$2j, " 暂无数据 ")) : createCommentVNode("v-if", true),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(items.value, (it, idx) => {
            return openBlock(), createElementBlock("div", {
              key: idx,
              class: "stat-item",
              "data-testid": "stat-item-" + idx,
              style: normalizeStyle(itemShellStyle(it))
            }, [
              createVNode(unref(BigValue), {
                width: cellSize.value.w,
                height: cellSize.value.h,
                value: {
                  text: it.text,
                  title: it.name,
                  color: it.color,
                  percentChange: it.percentChange
                },
                sparkline: it.spark,
                "color-mode": colorMode.value,
                "graph-mode": graphMode.value,
                "justify-mode": justifyMode.value,
                "text-mode": textMode.value,
                text: textSizes.value,
                count: items.value.length,
                "wide-layout": wideLayout.value,
                "percent-change-color-mode": String(opts.value.percentChangeColorMode ?? "standard")
              }, null, 8, ["width", "height", "value", "sparkline", "color-mode", "graph-mode", "justify-mode", "text-mode", "text", "count", "wide-layout", "percent-change-color-mode"]),
              createCommentVNode(" legacy selectors for unit tests "),
              createElementVNode(
                "span",
                _hoisted_4$1L,
                toDisplayString(it.name),
                1
                /* TEXT */
              ),
              createElementVNode(
                "span",
                _hoisted_5$1A,
                toDisplayString(it.text),
                1
                /* TEXT */
              ),
              it.percentChange != null ? (openBlock(), createElementBlock(
                "span",
                _hoisted_6$1m,
                toDisplayString(it.percentChange),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              it.spark.length ? (openBlock(), createElementBlock("span", _hoisted_7$1d)) : createCommentVNode("v-if", true),
              it.spark.length && String(opts.value.graphMode ?? "area") === "area" ? (openBlock(), createElementBlock("span", _hoisted_8$13)) : createCommentVNode("v-if", true)
            ], 12, _hoisted_3$22);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ], 8, _hoisted_1$2S);
    };
  }
});
const StatRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3J, [["__scopeId", "data-v-b9170033"]]);
const _sfc_main$3I = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(StatRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  { id: "stat", name: "统计值", state: "stable", skipDataQuery: false },
  _sfc_main$3I
).useFieldConfig().setPanelOptions((builder) => {
  builder.addCustom(
    {
      id: "reduceOptions.calcs",
      path: "reduceOptions.calcs",
      name: "计算",
      category: ["数值"],
      editor: "stats-picker",
      settings: {
        options: [
          { label: "Last *", value: "lastNotNull" },
          { label: "最后一个", value: "last" },
          { label: "First *", value: "firstNotNull" },
          { label: "第一个", value: "first" },
          { label: "最小值", value: "min" },
          { label: "最大值", value: "max" },
          { label: "平均值", value: "mean" },
          { label: "总和", value: "sum" },
          { label: "计数", value: "count" },
          { label: "范围", value: "range" },
          { label: "增量", value: "delta" },
          { label: "步长", value: "step" },
          { label: "差值", value: "diff" },
          { label: "Min (above zero)", value: "minAboveZero" },
          { label: "全部值", value: "allValues" }
        ]
      }
    },
    ["lastNotNull"]
  ).addText(
    {
      id: "reduceOptions.fields",
      path: "reduceOptions.fields",
      name: "字段",
      description: "字段名正则；留空表示数值字段",
      category: ["数值"],
      editor: "text"
    },
    ""
  ).addBoolean(
    {
      id: "reduceOptions.values",
      path: "reduceOptions.values",
      name: "显示全部值",
      category: ["数值"],
      editor: "boolean"
    },
    false
  ).addNumber(
    {
      id: "reduceOptions.limit",
      path: "reduceOptions.limit",
      name: "限制",
      category: ["数值"],
      editor: "number",
      showIf: (c) => !!c.reduceOptions?.values
    },
    25
  ).addRadio(
    {
      id: "orientation",
      path: "orientation",
      name: "方向",
      category: ["Stat 样式"],
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "水平", value: "horizontal" },
          { label: "垂直", value: "vertical" }
        ]
      }
    },
    "auto"
  ).addRadio(
    {
      id: "textMode",
      path: "textMode",
      name: "文本模式",
      category: ["Stat 样式"],
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "值", value: "value" },
          { label: "值与名称", value: "value_and_name" },
          { label: "名称", value: "name" },
          { label: "无", value: "none" }
        ]
      }
    },
    "auto"
  ).addRadio(
    {
      id: "colorMode",
      path: "colorMode",
      name: "颜色模式",
      category: ["Stat 样式"],
      editor: "radio",
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "值", value: "value" },
          { label: "背景渐变", value: "background" },
          { label: "背景纯色", value: "background_solid" }
        ]
      }
    },
    "value"
  ).addRadio(
    {
      id: "graphMode",
      path: "graphMode",
      name: "图表模式",
      category: ["Stat 样式"],
      editor: "radio",
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "面积", value: "area" }
        ]
      }
    },
    "area"
  ).addRadio(
    {
      id: "justifyMode",
      path: "justifyMode",
      name: "文本对齐",
      category: ["Stat 样式"],
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "居中", value: "center" }
        ]
      }
    },
    "auto"
  ).addBoolean(
    {
      id: "wideLayout",
      path: "wideLayout",
      name: "宽布局",
      category: ["Stat 样式"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "showPercentChange",
      path: "showPercentChange",
      name: "显示百分比变化",
      category: ["Stat 样式"],
      editor: "boolean"
    },
    false
  ).addRadio(
    {
      id: "percentChangeColorMode",
      path: "percentChangeColorMode",
      name: "百分比变化颜色模式",
      category: ["Stat 样式"],
      editor: "radio",
      settings: {
        options: [
          { label: "标准", value: "standard" },
          { label: "反转", value: "inverted" },
          { label: "与值相同", value: "same_as_value" }
        ]
      },
      showIf: (c) => !!c.showPercentChange
    },
    "standard"
  );
  addTextSizeOptions(builder, {
    withTitle: true,
    withValue: true,
    withPercentChange: true
  });
}).setNoPadding().setRuntimeConsumedPaths([
  "reduceOptions.calcs",
  "reduceOptions.fields",
  "reduceOptions.values",
  "reduceOptions.limit",
  "orientation",
  "textMode",
  "colorMode",
  "graphMode",
  "justifyMode",
  "wideLayout",
  "showPercentChange",
  "percentChangeColorMode"
]).register();
const FALLBACK_LCD = "#808080";
const DEFAULT_LCD_ITEM_SPACING = 8;
const DEFAULT_LCD_CELL_WIDTH = 12;
function colorWithAlpha(color, alpha2) {
  const m = String(color).match(/^#?([0-9a-f]{6})$/i);
  if (m) {
    const n = parseInt(m[1], 16);
    const r = n >> 16 & 255;
    const g = n >> 8 & 255;
    const b = n & 255;
    return `rgba(${r}, ${g}, ${b}, ${alpha2})`;
  }
  const rgb = String(color).match(/rgba?\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
  if (rgb) return `rgba(${rgb[1]}, ${rgb[2]}, ${rgb[3]}, ${alpha2})`;
  return color;
}
function getCellColor(positionValue, valueNumeric, cellColor) {
  if (positionValue == null || Number.isNaN(positionValue)) {
    return { background: FALLBACK_LCD, border: FALLBACK_LCD, isLit: false };
  }
  const color = cellColor || FALLBACK_LCD;
  if (valueNumeric == null || Number.isNaN(valueNumeric) || positionValue != null && positionValue > valueNumeric) {
    return {
      background: colorWithAlpha(color, 0.18),
      border: "transparent",
      isLit: false
    };
  }
  return {
    background: colorWithAlpha(color, 0.95),
    backgroundShade: colorWithAlpha(color, 0.55),
    border: colorWithAlpha(color, 0.9),
    isLit: true
  };
}
function buildLcdCells(opts) {
  const lcdW = Math.max(
    2,
    Number(opts.lcdCellWidth ?? DEFAULT_LCD_CELL_WIDTH) || DEFAULT_LCD_CELL_WIDTH
  );
  const maxSize = Math.max(lcdW, Number(opts.maxSize ?? 180) || 180);
  const cellSpacing = Math.max(
    0,
    Number(opts.itemSpacing ?? DEFAULT_LCD_ITEM_SPACING) || DEFAULT_LCD_ITEM_SPACING
  );
  const cellCount = Math.max(1, Math.floor(maxSize / lcdW));
  const cellSize = Math.max(
    1,
    Math.floor((maxSize - cellSpacing * cellCount) / cellCount)
  );
  const min = Number(opts.min);
  const max = Number(opts.max);
  const valueRange = max - min || 1;
  const value = Number(opts.value);
  const fallback = opts.color || "#3d71d9";
  const out = [];
  for (let i = 0; i < cellCount; i++) {
    const positionValue = min + valueRange / cellCount * i;
    const posColor = opts.colorAt?.(positionValue) || fallback;
    const cell = getCellColor(positionValue, value, posColor);
    out.push({
      on: !!cell.isLit,
      color: cell.background,
      shade: cell.backgroundShade || colorWithAlpha(posColor, 0.55),
      size: cellSize,
      spacing: cellSpacing,
      positionValue
    });
  }
  return out;
}
const BAR_GAUGE_LAYOUT = {
  MIN_VALUE_HEIGHT: 18,
  MAX_VALUE_HEIGHT: 50,
  MAX_VALUE_WIDTH: 150,
  TITLE_LINE_HEIGHT: 1.5,
  VALUE_LINE_HEIGHT: 1,
  VALUE_LEFT_PADDING: 10,
  VALUE_RIGHT_OVERFLOW_PADDING: 15,
  DEFAULT_ITEM_SPACING: 8,
  DEFAULT_LCD_CELL_WIDTH: 12,
  MIN_VIZ_WIDTH: 8,
  /** option default minVizHeight in panel cfg is often 16; renderer floor stays 18 */
  OPTION_MIN_VIZ_HEIGHT: 16,
  /** Grafana title-to-left max width ratio */
  MAX_TITLE_WIDTH_RATIO: 0.4,
  /** Auto namePlacement: show above when height exceeds this */
  AUTO_ABOVE_HEIGHT: 40,
  AVG_CHAR_WIDTH: 7
};
function calculateTitleDimensions(args) {
  const title = args.title ?? "";
  const orientation = String(args.orientation ?? "horizontal");
  const namePlacement = String(args.namePlacement ?? "auto");
  const height2 = Math.max(0, Number(args.height) || 0);
  const width2 = Math.max(0, Number(args.width) || 0);
  if (!title) {
    return { fontSize: 0, width: 0, height: 0, placement: "above" };
  }
  if (namePlacement === "hidden") {
    return { fontSize: 0, width: 0, height: 0, placement: "hidden" };
  }
  if (orientation === "vertical") {
    const fontSize = args.titleSize ?? 14;
    return {
      fontSize,
      width: width2,
      height: fontSize * BAR_GAUGE_LAYOUT.TITLE_LINE_HEIGHT,
      placement: "below"
    };
  }
  const shouldDisplayAbove = height2 > BAR_GAUGE_LAYOUT.AUTO_ABOVE_HEIGHT && namePlacement === "auto" || namePlacement === "top";
  if (shouldDisplayAbove) {
    if (args.titleSize != null && Number.isFinite(args.titleSize)) {
      return {
        fontSize: Number(args.titleSize),
        width: 0,
        height: Number(args.titleSize) * BAR_GAUGE_LAYOUT.TITLE_LINE_HEIGHT,
        placement: "above"
      };
    }
    const maxTitleHeightRatio = 0.45;
    const titleHeight = Math.max(
      Math.min(height2 * maxTitleHeightRatio, BAR_GAUGE_LAYOUT.MAX_VALUE_HEIGHT),
      17
    );
    return {
      fontSize: titleHeight / BAR_GAUGE_LAYOUT.TITLE_LINE_HEIGHT,
      width: 0,
      height: titleHeight,
      placement: "above"
    };
  }
  if (namePlacement === "left" || namePlacement === "auto") {
    const maxTitleHeightRatio = 0.6;
    const titleHeight = Math.max(
      height2 * maxTitleHeightRatio,
      BAR_GAUGE_LAYOUT.MIN_VALUE_HEIGHT
    );
    const titleFontSize = titleHeight / BAR_GAUGE_LAYOUT.TITLE_LINE_HEIGHT;
    const textWidth = Math.min(
      title.length * BAR_GAUGE_LAYOUT.AVG_CHAR_WIDTH + 15,
      width2 * BAR_GAUGE_LAYOUT.MAX_TITLE_WIDTH_RATIO
    );
    return {
      fontSize: args.titleSize ?? titleFontSize,
      height: 0,
      width: textWidth,
      placement: "left"
    };
  }
  return {
    fontSize: 12,
    width: 0,
    height: 18,
    placement: "above"
  };
}
function calculateBarAndValueDimensions(args) {
  const height2 = Math.max(1, Number(args.height) || 100);
  const width2 = Math.max(1, Number(args.width) || 200);
  const orientation = String(args.orientation ?? "horizontal");
  const titleDim = calculateTitleDimensions({
    height: height2,
    width: width2,
    orientation,
    namePlacement: args.namePlacement,
    title: args.title,
    titleSize: args.titleSize
  });
  const valueString = args.valueText ?? "";
  const fontSizeToMeasureWith = args.valueSize ?? Math.max(titleDim.fontSize, 12);
  const realValueWidth = valueString.length * (fontSizeToMeasureWith * 0.55) + BAR_GAUGE_LAYOUT.VALUE_LEFT_PADDING * 2;
  let maxBarHeight = 0;
  let maxBarWidth = 0;
  let valueHeight = 0;
  let valueWidth = 0;
  let wrapperWidth = 0;
  let wrapperHeight = 0;
  const valueHidden = args.valueMode === "hidden";
  if (orientation === "vertical") {
    if (args.valueSize != null && Number.isFinite(args.valueSize)) {
      valueHeight = Number(args.valueSize) * BAR_GAUGE_LAYOUT.VALUE_LINE_HEIGHT;
    } else {
      valueHeight = Math.min(
        Math.max(height2 * 0.1, BAR_GAUGE_LAYOUT.MIN_VALUE_HEIGHT),
        BAR_GAUGE_LAYOUT.MAX_VALUE_HEIGHT
      );
    }
    valueWidth = width2;
    if (valueHidden) {
      valueHeight = 0;
      valueWidth = 0;
    }
    maxBarHeight = Math.max(1, height2 - (titleDim.height + valueHeight));
    maxBarWidth = width2;
    wrapperWidth = width2;
    wrapperHeight = Math.max(1, height2 - titleDim.height);
  } else {
    if (valueHidden) {
      valueHeight = 0;
      valueWidth = 0;
    } else {
      valueHeight = Math.max(1, height2 - titleDim.height);
      valueWidth = Math.max(
        Math.min(width2 * 0.2, BAR_GAUGE_LAYOUT.MAX_VALUE_WIDTH),
        realValueWidth
      );
      valueWidth = Math.min(BAR_GAUGE_LAYOUT.MAX_VALUE_WIDTH, valueWidth);
    }
    maxBarHeight = Math.max(1, height2 - titleDim.height);
    maxBarWidth = Math.max(1, width2 - valueWidth - titleDim.width);
    if (titleDim.placement === "above") {
      wrapperWidth = width2;
      wrapperHeight = Math.max(1, height2 - titleDim.height);
    } else {
      wrapperWidth = Math.max(1, width2 - titleDim.width);
      wrapperHeight = height2;
    }
  }
  return {
    valueWidth,
    valueHeight,
    maxBarWidth,
    maxBarHeight,
    wrapperHeight,
    wrapperWidth
  };
}
function resolveTitlePlacement(args) {
  if (!args.hasTitle) return "hidden";
  const dim = calculateTitleDimensions({
    height: args.panelHeight ?? 100,
    width: 200,
    orientation: args.orientation,
    namePlacement: args.namePlacement,
    title: !args.hasTitle ? "" : "x"
  });
  return dim.placement;
}
function toRad(angle) {
  return (angle - 90) * Math.PI / 180;
}
function drawRadialArcPathStable(startAngle, endAngle, radius, cx, cy) {
  let end = endAngle;
  if (end >= 360) end = 359.99;
  if (end <= 0) return "";
  const startRadians = toRad(startAngle);
  const endRadians = toRad(startAngle + end);
  const largeArc = end > 180 ? 1 : 0;
  const MAX_DECIMALS = 2;
  const x1 = parseFloat(
    (cx + radius * Math.cos(startRadians)).toFixed(MAX_DECIMALS)
  );
  const y1 = parseFloat(
    (cy + radius * Math.sin(startRadians)).toFixed(MAX_DECIMALS)
  );
  const x2 = parseFloat(
    (cx + radius * Math.cos(endRadians)).toFixed(MAX_DECIMALS)
  );
  const y2 = parseFloat(
    (cy + radius * Math.sin(endRadians)).toFixed(MAX_DECIMALS)
  );
  return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2}`;
}
const ARC_START = 250;
const ARC_END = 110;
function angleRangeForShape(shape) {
  if (shape === "circle") return 360;
  return 360 % ARC_START + ARC_END;
}
function startAngleForShape(shape) {
  return shape === "circle" ? 0 : ARC_START;
}
function getAngleBetweenSegments(segmentSpacing, segmentCount, range) {
  const maxAngleBetweenSegments = Math.max(
    range / 1.5 / Math.max(1, segmentCount),
    2
  );
  return segmentSpacing * maxAngleBetweenSegments;
}
function getOptimalSegmentCount(radius, barWidth, segmentSpacing, segmentCount, range) {
  const angleBetweenSegments = getAngleBetweenSegments(
    segmentSpacing,
    segmentCount,
    range
  );
  const innerRadius = radius - barWidth / 2;
  const circumference = Math.PI * innerRadius * 2 * (range / 360);
  const maxSegments = Math.floor(circumference / (angleBetweenSegments + 3));
  return Math.min(Math.max(1, maxSegments), Math.max(1, segmentCount));
}
function getValueAngleForValue(value, min, max, startAngle, endAngle, neutral) {
  const angleRange = 360 % (startAngle === 0 ? 1 : startAngle) + endAngle;
  const span = max - min || 1;
  const pct = (value - min) / span;
  const valueAngle = pct * angleRange;
  let startValueAngle = 0;
  let endValueAngle = valueAngle;
  if (typeof neutral === "number" && Number.isFinite(neutral)) {
    const clampedNeutral = Math.min(Math.max(min, neutral), max);
    const neutralAngle = (clampedNeutral - min) / span * angleRange;
    if (neutralAngle <= valueAngle) {
      startValueAngle = neutralAngle;
      endValueAngle = valueAngle - neutralAngle;
    } else {
      startValueAngle = valueAngle;
      endValueAngle = neutralAngle - valueAngle;
    }
  }
  const clampedEnd = Math.min(Math.max(endValueAngle, 0), angleRange);
  return { angleRange, startValueAngle, endValueAngle: clampedEnd };
}
const PANEL_GAUGE_VIEW = {
  width: 100,
  height: 90,
  cx: 50,
  cy: 46,
  radius: 32,
  stroke: 8
};
function calculateDimensions(width2, height2, endAngle = ARC_END, glow = false, roundedBars = false, barWidthFactor = 0.4, barIndex = 0, thresholdBar = false, showScaleLabels = false) {
  const yMaxAngle = endAngle > 180 ? 180 : endAngle;
  let margin = 0;
  if (glow) {
    margin = 0.02 * Math.min(width2, height2);
  }
  let maxRadiusW = width2 / 2 - margin;
  const heightRatioV = Math.sin(toRad(yMaxAngle));
  let maxRadiusH = (height2 - margin * 2) / (1 + heightRatioV);
  let maxRadius = Math.min(maxRadiusW, maxRadiusH);
  let maxRadiusIsLimitedByHeight = maxRadiusH === maxRadius;
  let outerRadius = maxRadius;
  const barWidth = Math.max(barWidthFactor * (maxRadius / 3), 2);
  const totalEndcapAdjustment = yMaxAngle < 180 && roundedBars ? barWidth * 0.5 : 0;
  const radiusEndcapAdjustment = totalEndcapAdjustment * 0.5;
  outerRadius -= radiusEndcapAdjustment;
  maxRadiusH -= radiusEndcapAdjustment;
  maxRadiusW -= radiusEndcapAdjustment;
  let scaleLabelsFontSize = 0;
  let scaleLabelsSpacing = 0;
  let scaleLabelsRadius = 0;
  if (showScaleLabels) {
    scaleLabelsRadius = outerRadius;
    const radiusToFontSizeFactor = 0.12;
    scaleLabelsFontSize = Math.max(
      radiusToFontSizeFactor * Math.pow(outerRadius, 0.92),
      10
    );
    scaleLabelsSpacing = scaleLabelsFontSize / 3;
    const labelsSize = scaleLabelsFontSize * 1.2 + scaleLabelsSpacing;
    outerRadius -= labelsSize;
    maxRadiusW -= labelsSize;
    maxRadiusH -= labelsSize;
    if (maxRadiusIsLimitedByHeight && endAngle < 180) {
      const amount = outerRadius * 0.07;
      scaleLabelsRadius -= amount;
      maxRadiusH -= amount;
      maxRadiusW -= amount;
      outerRadius -= amount;
    }
  }
  const thresholdsToBarWidth = 0.2 * Math.pow(barWidth, 0.92);
  const thresholdsBarWidth = thresholdBar ? Math.min(Math.max(thresholdsToBarWidth, 4), 12) : 0;
  const thresholdsBarSpacing = Math.min(
    Math.max(thresholdsBarWidth / 2, 2),
    12
  );
  let thresholdsBarRadius = 0;
  if (thresholdsBarWidth > 0) {
    thresholdsBarRadius = outerRadius - thresholdsBarWidth / 2;
    maxRadiusW -= thresholdsBarWidth + thresholdsBarSpacing;
    maxRadiusH -= thresholdsBarWidth + thresholdsBarSpacing;
    outerRadius = Math.min(maxRadiusW, maxRadiusH);
  }
  let innerRadius = outerRadius - barWidth / 2;
  const belowCenterY = maxRadius * Math.sin(toRad(yMaxAngle));
  const rest = height2 - belowCenterY - margin * 2 - maxRadius;
  const centerX = width2 / 2;
  const centerYEndcapAdjustment = totalEndcapAdjustment - radiusEndcapAdjustment;
  const centerY = maxRadius + margin + rest / 2 - centerYEndcapAdjustment;
  if (barIndex > 0) {
    innerRadius = innerRadius - (barWidth + 4) * barIndex;
  }
  return {
    vizWidth: width2,
    vizHeight: height2,
    margin,
    gaugeBottomY: centerY + belowCenterY,
    radius: Math.max(innerRadius, 2),
    centerX,
    centerY,
    barWidth,
    barIndex,
    thresholdsBarWidth,
    thresholdsBarSpacing,
    thresholdsBarRadius,
    scaleLabelsFontSize,
    scaleLabelsSpacing,
    scaleLabelsRadius
  };
}
function panelGaugeGeometry(opts) {
  const shape = opts?.shape ?? "gauge";
  const endAngle = shape === "circle" ? 180 : ARC_END;
  const f = Number(opts?.barWidthFactor ?? 0.5);
  const glow = !!opts?.glow;
  const rounded = !!opts?.roundedBars;
  const thresholdBar = !!opts?.thresholdBar;
  const showScaleLabels = !!opts?.showScaleLabels;
  const showName = !!opts?.showName;
  const sparkline = !!opts?.sparkline;
  const pw = Number(opts?.panelWidth);
  const ph = Number(opts?.panelHeight);
  const usePanelPx = Number.isFinite(pw) && pw > 0 && Number.isFinite(ph) && ph > 0;
  const viewW = usePanelPx ? pw : PANEL_GAUGE_VIEW.width;
  const viewH = usePanelPx ? ph : shape === "circle" ? 100 : PANEL_GAUGE_VIEW.height;
  const calcW = viewW;
  const calcH = viewH;
  const baseDims = calculateDimensions(
    calcW,
    calcH,
    endAngle,
    glow,
    rounded,
    f,
    0,
    false,
    false
  );
  const dims = calculateDimensions(
    calcW,
    calcH,
    endAngle,
    glow,
    rounded,
    f,
    0,
    thresholdBar,
    showScaleLabels
  );
  let cx = PANEL_GAUGE_VIEW.cx;
  let cy = PANEL_GAUGE_VIEW.cy;
  let r = PANEL_GAUGE_VIEW.radius;
  let stroke = Math.max(3, Math.min(14, PANEL_GAUGE_VIEW.stroke * (0.6 + f)));
  let gaugeBottomY = cy + r * Math.sin(toRad(Math.min(endAngle, 180)));
  if (usePanelPx && dims.radius > 0) {
    cx = dims.centerX;
    cy = dims.centerY;
    r = dims.radius;
    stroke = dims.barWidth;
    gaugeBottomY = dims.gaugeBottomY;
  } else if ((showScaleLabels || thresholdBar && showScaleLabels) && baseDims.radius > 0) {
    const rScale = dims.radius / baseDims.radius;
    r = Math.max(8, PANEL_GAUGE_VIEW.radius * rScale);
    if (baseDims.centerY > 0) {
      const cyShift = (dims.centerY - baseDims.centerY) * (viewH / calcH);
      cy = PANEL_GAUGE_VIEW.cy + cyShift;
    }
    gaugeBottomY = cy + r * Math.sin(toRad(Math.min(endAngle, 180)));
  }
  const scale = usePanelPx ? 1 : viewW / Math.max(calcW, 1);
  const scaleLabelsFontSize = showScaleLabels ? usePanelPx ? Math.max(10, dims.scaleLabelsFontSize) : Math.max(
    3.5,
    Math.min(8, dims.scaleLabelsFontSize * scale * (viewW / 100))
  ) : 0;
  const scaleLabelsRadius = showScaleLabels ? usePanelPx ? dims.scaleLabelsRadius || r + stroke : Math.max(
    r + stroke * 0.5 + 2,
    (dims.scaleLabelsRadius || 0) * (PANEL_GAUGE_VIEW.radius / Math.max(baseDims.radius, 1))
  ) : r + 10;
  const thresholdsBarRadius = thresholdBar && dims.thresholdsBarRadius > 0 ? usePanelPx ? dims.thresholdsBarRadius : r + stroke * 0.75 + 1.5 : r + stroke * 0.75 + 1.5;
  const thresholdsBarWidth = dims.thresholdsBarWidth > 0 ? usePanelPx ? dims.thresholdsBarWidth : Math.max(2, Math.min(6, dims.thresholdsBarWidth * scale)) : 0;
  const LINE_HEIGHT_FACTOR2 = 1.21;
  const VALUE_SPACE_PERCENTAGE2 = 0.7;
  const SPARKLINE_SPACING2 = 8;
  const VALUE_WIDTH_TO_RADIUS_FACTOR2 = 0.82;
  const LARGE_RADIUS_SCALING_DECAY2 = 0.86;
  const NAME_TO_HEIGHT_FACTOR2 = 0.45;
  const MAX_NAME_HEIGHT_DIVISOR2 = 4;
  let maxValueHeight = VALUE_WIDTH_TO_RADIUS_FACTOR2 * Math.pow(r, LARGE_RADIUS_SCALING_DECAY2);
  let maxNameHeight = r / MAX_NAME_HEIGHT_DIVISOR2;
  if (showName) {
    maxValueHeight = VALUE_WIDTH_TO_RADIUS_FACTOR2 * Math.pow(r, LARGE_RADIUS_SCALING_DECAY2);
    maxNameHeight = NAME_TO_HEIGHT_FACTOR2 * Math.pow(r, LARGE_RADIUS_SCALING_DECAY2);
  }
  const approxValueFont = Math.max(1, maxValueHeight / LINE_HEIGHT_FACTOR2);
  const approxNameFont = Math.max(
    usePanelPx ? 10 : 4.5,
    maxNameHeight / LINE_HEIGHT_FACTOR2
  );
  const valueHeight = approxValueFont * LINE_HEIGHT_FACTOR2;
  const nameHeight = showName ? approxNameFont * LINE_HEIGHT_FACTOR2 : 0;
  let valueY = showName ? cy - nameHeight * (1 - VALUE_SPACE_PERCENTAGE2) : cy;
  let nameY = showName ? valueY + valueHeight * VALUE_SPACE_PERCENTAGE2 : cy;
  let yOffset = 0;
  if (shape === "gauge") {
    yOffset += (valueHeight + nameHeight) / 4;
  }
  if (sparkline) {
    yOffset += SPARKLINE_SPACING2;
  }
  const valueTextY = usePanelPx ? valueY - yOffset : shape === "circle" ? cy : cy + r * 0.18;
  const nameTextY = usePanelPx ? nameY - yOffset : shape === "circle" ? cy + r * 0.38 : cy + r * 0.42;
  const SPARKLINE_HEIGHT_DIVISOR = 4;
  const SPARKLINE_WIDTH_FACTOR_ARC = 1.4;
  const SPARKLINE_WIDTH_FACTOR_CIRCLE = 1.6;
  const sparkHeight = r / SPARKLINE_HEIGHT_DIVISOR;
  const sparkWidth = r * (shape === "gauge" ? SPARKLINE_WIDTH_FACTOR_ARC : SPARKLINE_WIDTH_FACTOR_CIRCLE) - stroke;
  const sparkY1 = usePanelPx ? gaugeBottomY - SPARKLINE_SPACING2 : Math.min(viewH - 2, viewH - 6);
  const sparkY0 = usePanelPx ? sparkY1 - sparkHeight : Math.min(viewH - 4, cy + r * 0.55);
  return {
    viewW,
    viewH,
    cx,
    cy,
    r,
    stroke,
    valueTextY,
    nameTextY,
    sparkY0,
    sparkY1,
    sparkWidth: Math.max(8, sparkWidth),
    sparkHeight: Math.max(4, sparkHeight),
    scaleLabelsFontSize,
    scaleLabelsRadius,
    thresholdsBarRadius,
    thresholdsBarWidth,
    pixelSpace: usePanelPx,
    gaugeBottomY
  };
}
function cleanGaugeName(name) {
  const n = String(name || "").trim();
  if (!n || n === "Value" || /^Value\s*\{/.test(n)) return "";
  return n;
}
function fieldMinMax(field, cfg) {
  let min = cfg.min;
  let max = cfg.max;
  const hasMin = typeof min === "number" && Number.isFinite(min);
  const hasMax = typeof max === "number" && Number.isFinite(max);
  if (!hasMin || !hasMax) {
    const vals = (field.values ?? []).map((n) => Number(n)).filter((n) => Number.isFinite(n));
    if (vals.length) {
      if (!hasMin) min = Math.min(...vals);
      if (!hasMax) max = Math.max(...vals);
    } else {
      if (!hasMin) min = 0;
      if (!hasMax) max = 100;
    }
  }
  if (min === max) {
    min = min - min * 0.1;
    max = max + max * 0.1;
  }
  return { min: Number(min), max: Number(max) };
}
function fieldMatchesFilter(field, filter2) {
  if (!filter2 || !String(filter2).trim()) return true;
  const raw = String(filter2).trim();
  const name = field.name || "";
  if (raw.startsWith("/") && raw.lastIndexOf("/") > 0) {
    const last = raw.lastIndexOf("/");
    const body = raw.slice(1, last);
    const flags = raw.slice(last + 1);
    try {
      return new RegExp(body, flags).test(name);
    } catch {
      return name.includes(body);
    }
  }
  return name === raw || name.includes(raw);
}
function prepareGaugeItems(input) {
  const out = [];
  const calc = String(input.reduceCalc ?? "lastNotNull");
  const textMode = String(input.textMode ?? "auto");
  const allFrames = input.series ?? [];
  for (const frame of allFrames) {
    for (const field of frame.fields.filter(
      (f) => f.type === "number"
    )) {
      if (!fieldMatchesFilter(field, input.fieldsFilter)) continue;
      const cfg = { ...field.config, ...input.fieldDefaults ?? {} };
      const r = reduceField(field, [calc]);
      const v = Number(r[calc] ?? r.lastNotNull ?? 0);
      const { min, max } = fieldMinMax(field, cfg);
      const pct = Math.max(0, Math.min(1, (v - min) / (max - min || 1)));
      const rawSteps = cfg.thresholds?.steps ?? [];
      const steps = rawSteps.length > 0 ? rawSteps : [
        { value: -Infinity, color: "#73BF69" },
        { value: 80, color: "#F2495C" }
      ];
      const display = cfg.displayNameFromDS || cfg.displayName || getFieldDisplayName(field, frame, allFrames);
      const name = cleanGaugeName(display);
      const titleForLayout = display || name || "Value";
      let text = formatValue(v, cfg);
      let showName = name;
      if (textMode === "name") {
        text = name || text;
        showName = "";
      } else if (textMode === "value") {
        showName = "";
      } else if (textMode === "none") {
        text = "";
        showName = "";
      } else if (textMode === "auto" && allFrames.length === 1) {
        const numFields = allFrames[0].fields.filter(
          (f) => f.type === "number"
        ).length;
        if (numFields <= 1) showName = "";
      }
      const spark = field.values.map((n) => Number(n)).filter((n) => Number.isFinite(n)).slice(-40);
      out.push({
        text,
        name: showName,
        titleForLayout,
        color: getFieldColor(v, cfg) ?? "#73BF69",
        pct,
        min,
        max,
        thresholds: steps.filter(
          (s) => Number.isFinite(Number(s.value)) && Number(s.value) !== -Infinity
        ),
        spark
      });
    }
  }
  const lim = input.limit != null ? Number(input.limit) : void 0;
  if (lim != null && Number.isFinite(lim) && lim >= 0) {
    return out.slice(0, Math.floor(lim));
  }
  return out;
}
function arcPathRelative(startDeg, lengthDeg, radius) {
  let end = lengthDeg;
  if (end >= 360) end = 359.99;
  const startRadians = toRad(startDeg);
  const endRadians = toRad(startDeg + end);
  const largeArc = end > 180 ? 1 : 0;
  const x1 = radius * Math.cos(startRadians);
  const y1 = radius * Math.sin(startRadians);
  const x2 = radius * Math.cos(endRadians);
  const y2 = radius * Math.sin(endRadians);
  return `M ${x1} ${y1} A ${radius} ${radius} 0 ${largeArc} 1 ${x2} ${y2}`;
}
function arcPath(startDeg, lengthDeg, geom, radius) {
  return drawRadialArcPathStable(
    startDeg,
    lengthDeg,
    radius ?? geom.r,
    geom.cx,
    geom.cy
  );
}
function trackArcs(it, geom, neutral) {
  const start = startAngleForShape(geom.shape);
  const full = angleRangeForShape(geom.shape);
  const endAngle = geom.shape === "circle" ? 360 : ARC_END;
  const value = it.min + it.pct * (it.max - it.min || 1);
  const { startValueAngle, endValueAngle } = getValueAngleForValue(
    value,
    it.min,
    it.max,
    start,
    endAngle,
    neutral != null && Number.isFinite(Number(neutral)) ? Number(neutral) : void 0
  );
  const out = [];
  if (startValueAngle > 0.05) {
    out.push({ d: arcPath(start, startValueAngle, geom) });
  }
  const afterStart = start + startValueAngle + endValueAngle;
  const afterLen = full - endValueAngle - startValueAngle;
  if (afterLen > 0.05) {
    out.push({ d: arcPath(afterStart, afterLen, geom) });
  }
  return out;
}
function thresholdTicks(it, geom) {
  const start = startAngleForShape(geom.shape);
  const full = angleRangeForShape(geom.shape);
  const labelR = geom.scaleLabelsRadius || geom.r + 10;
  return it.thresholds.map((s) => {
    const t2 = Math.max(
      0,
      Math.min(1, (Number(s.value) - it.min) / (it.max - it.min || 1))
    );
    const ang = start + full * t2;
    const rad = toRad(ang);
    const r1 = geom.r - geom.stroke * 0.75;
    const r2 = geom.r + geom.stroke * 0.75;
    return {
      x1: geom.cx + r1 * Math.cos(rad),
      y1: geom.cy + r1 * Math.sin(rad),
      x2: geom.cx + r2 * Math.cos(rad),
      y2: geom.cy + r2 * Math.sin(rad),
      color: s.color || "#ff780a",
      label: String(s.value),
      lx: geom.cx + labelR * Math.cos(rad),
      ly: geom.cy + labelR * Math.sin(rad)
    };
  });
}
function segmentArcs(it, geom, requested, segmentSpacing, neutral) {
  if (requested <= 1) return [];
  const start = startAngleForShape(geom.shape);
  const full = angleRangeForShape(geom.shape);
  const n = getOptimalSegmentCount(
    geom.r,
    geom.stroke,
    segmentSpacing,
    requested,
    full
  );
  const angleBetween = getAngleBetweenSegments(segmentSpacing, n, full);
  const segmentArcLengthDeg = full / n - angleBetween;
  const angles = getValueAngleForValue(
    it.min + it.pct * (it.max - it.min || 1),
    it.min,
    it.max,
    start,
    geom.shape === "circle" ? 360 : ARC_END,
    neutral != null && Number.isFinite(Number(neutral)) ? Number(neutral) : void 0
  );
  const out = [];
  for (let i = 0; i < n; i++) {
    const segmentStartAngle = start + full / n * i + 0.01;
    const segmentAngle = i / n * full;
    const isTrack = segmentAngle < angles.startValueAngle - 1e-9 || segmentAngle >= angles.startValueAngle + angles.endValueAngle - 1e-9;
    const len = Math.max(0.5, segmentArcLengthDeg);
    out.push({
      d: arcPath(segmentStartAngle, len, geom),
      on: !isTrack,
      startAngle: segmentStartAngle
    });
  }
  return out;
}
function endpointPos(it, geom, endpointMarker, neutral) {
  const marker = String(endpointMarker ?? "point");
  if (marker === "none" || !marker) return null;
  const start = startAngleForShape(geom.shape);
  const full = angleRangeForShape(geom.shape);
  let pct = Math.max(0, Math.min(1, it.pct));
  if (neutral != null && Number.isFinite(Number(neutral))) {
    const n = Number(neutral);
    const nPct = Math.max(
      0,
      Math.min(1, (n - it.min) / (it.max - it.min || 1))
    );
    pct = Math.max(pct, nPct);
  }
  if (pct <= 0) return null;
  const ang = start + full * pct;
  const rad = toRad(ang);
  return {
    x: geom.cx + geom.r * Math.cos(rad),
    y: geom.cy + geom.r * Math.sin(rad)
  };
}
function valueArcAngles(it, shape, neutral) {
  const start = startAngleForShape(shape);
  const endAngle = shape === "circle" ? 360 : ARC_END;
  const value = it.min + it.pct * (it.max - it.min || 1);
  const { startValueAngle, endValueAngle } = getValueAngleForValue(
    value,
    it.min,
    it.max,
    start,
    endAngle,
    neutral != null && Number.isFinite(Number(neutral)) ? Number(neutral) : void 0
  );
  return { start: start + startValueAngle, startValueAngle, endValueAngle };
}
function thresholdBarArcs(it, geom, showThresholdMarkers) {
  if (showThresholdMarkers === false) return [];
  const baseColor = it.color || "#73BF69";
  const raw = [
    { value: it.min, color: baseColor },
    ...it.thresholds.map((s) => ({ value: Number(s.value), color: s.color || baseColor })).filter((s) => Number.isFinite(s.value))
  ].sort((a, b) => a.value - b.value);
  const clamped = [];
  let lastColor = baseColor;
  for (const s of raw) {
    if (s.value <= it.min) {
      lastColor = s.color;
      continue;
    }
    if (s.value >= it.max) {
      break;
    }
    if (!clamped.length) clamped.push({ value: it.min, color: lastColor });
    clamped.push({ value: s.value, color: lastColor });
    lastColor = s.color;
  }
  if (!clamped.length) clamped.push({ value: it.min, color: lastColor });
  if (clamped[clamped.length - 1].value < it.max) {
    clamped.push({ value: it.max, color: lastColor });
  }
  if (clamped.length < 2) return [];
  const start = startAngleForShape(geom.shape);
  const full = angleRangeForShape(geom.shape);
  const range = it.max - it.min || 1;
  const out = [];
  const outerR = geom.thresholdsBarRadius || geom.r + geom.stroke * 0.75 + 1.5;
  for (let i = 1; i < clamped.length; i++) {
    const a0pct = Math.max(
      0,
      Math.min(1, (clamped[i - 1].value - it.min) / range)
    );
    const a1pct = Math.max(0, Math.min(1, (clamped[i].value - it.min) / range));
    const len = (a1pct - a0pct) * full;
    if (len <= 0.05) continue;
    out.push({
      d: arcPath(start + a0pct * full, len, geom, outerR),
      dRel: arcPathRelative(start + a0pct * full, len, outerR),
      color: clamped[i].color || baseColor
    });
  }
  return out;
}
function hexAlpha$1(hex, a) {
  const m = String(hex).match(/^#?([0-9a-f]{6})$/i);
  if (!m) return hex;
  const n = parseInt(m[1], 16);
  const r = n >> 16 & 255;
  const g = n >> 8 & 255;
  const b = n & 255;
  return `rgba(${r},${g},${b},${a})`;
}
function thresholdGradient(it, vertical) {
  const cssDir = vertical ? "0deg" : "90deg";
  const color = it.color || "#73BF69";
  const steps = [...it.thresholds ?? []].map((s) => ({ value: Number(s.value), color: s.color || color })).filter((s) => Number.isFinite(s.value)).sort((a, b) => a.value - b.value);
  if (!steps.length) {
    return `linear-gradient(${cssDir}, ${hexAlpha$1(color, 0.35)} 0%, ${color} 100%)`;
  }
  const range = it.max - it.min || 1;
  const parts = [`${color} 0%`];
  let lastColor = color;
  for (const s of steps) {
    if (s.value <= it.min) {
      lastColor = s.color;
      continue;
    }
    if (s.value >= it.max) break;
    const pct = (s.value - it.min) / range * 100;
    parts.push(`${lastColor} ${pct}%`);
    parts.push(`${s.color} ${pct}%`);
    lastColor = s.color;
  }
  parts.push(`${lastColor} 100%`);
  return `linear-gradient(${cssDir}, ${parts.join(", ")})`;
}
function barFillStyle(it, displayMode = "gradient") {
  const mode2 = String(displayMode ?? "gradient");
  const color = it.color || "#3d71d9";
  const pct = `${Math.max(it.pct * 100, 0.5)}%`;
  if (mode2 === "basic") {
    return {
      background: hexAlpha$1(color, 0.35),
      borderRight: `2px solid ${color}`,
      width: pct,
      height: "100%"
    };
  }
  return {
    background: thresholdGradient(it, false),
    width: pct,
    height: "100%"
  };
}
function barFillStyleV(it, displayMode = "gradient") {
  const mode2 = String(displayMode ?? "gradient");
  const color = it.color || "#3d71d9";
  const pct = `${Math.max(it.pct * 100, 0.5)}%`;
  if (mode2 === "basic") {
    return {
      background: hexAlpha$1(color, 0.35),
      borderTop: `2px solid ${color}`,
      height: pct,
      width: "100%"
    };
  }
  return {
    background: thresholdGradient(it, true),
    height: pct,
    width: "100%"
  };
}
function lcdCellStyle(cell, isVertical, defaultSpacing = 8) {
  const size = Math.max(1, Number(cell.size ?? 8));
  const spacing = Math.max(0, Number(cell.spacing ?? defaultSpacing));
  const base = {
    borderRadius: "2px",
    flex: "0 0 auto"
  };
  if (isVertical) {
    base.height = `${size}px`;
    base.width = "100%";
    base.marginTop = `${spacing}px`;
  } else {
    base.width = `${size}px`;
    base.height = "100%";
    base.marginRight = `${spacing}px`;
  }
  if (cell.on) {
    base.backgroundImage = `radial-gradient(${cell.color} 10%, ${cell.shade})`;
  } else {
    base.backgroundColor = cell.color;
  }
  return base;
}
function barGlowStyle(color, enabled) {
  if (!enabled) return void 0;
  const c = color || "#3d71d9";
  return { filter: `drop-shadow(0 0 2px ${c}) drop-shadow(0 0 4px ${c})` };
}
function conicValueStyle(input) {
  const color = input.color || "#73BF69";
  const css = input.shape === "circle" ? `conic-gradient(from 0deg, ${color} 0deg, ${color} 360deg)` : `conic-gradient(from ${input.startDeg}deg, ${color} ${(-input.fullDeg / 2).toFixed(0)}deg, ${color} ${input.fullDeg}deg, rgba(0, 0, 0, 0) 0deg, rgba(0, 0, 0, 0) ${input.fullDeg}deg)`;
  const box = Math.ceil((input.r + input.stroke) * 2);
  return {
    width: box + "px",
    height: box + "px",
    backgroundImage: css
  };
}
function hexToRgba(hex, alpha2) {
  const m = String(hex).replace("#", "").match(/^([0-9a-f]{6})$/i);
  if (!m) return `rgba(115, 191, 105, ${alpha2})`;
  const n = parseInt(m[1], 16);
  return `rgba(${n >> 16 & 255}, ${n >> 8 & 255}, ${n & 255}, ${alpha2})`;
}
const LINE_HEIGHT_FACTOR = 1.21;
const VALUE_WIDTH_TO_RADIUS_FACTOR = 0.82;
const LARGE_RADIUS_SCALING_DECAY = 0.86;
const MAX_TEXT_WIDTH_DIVISOR = 7;
const MAX_NAME_HEIGHT_DIVISOR = 4;
const NAME_TO_HEIGHT_FACTOR = 0.45;
const VALUE_SPACE_PERCENTAGE = 0.7;
const SPARKLINE_SPACING = 8;
const MIN_NAME_FONT_SIZE = 10;
const VALUE_TEXT_COLOR = "var(--grafana-text)";
const NAME_TEXT_COLOR = "var(--grafana-text-secondary)";
function radialValueFontSize(text, r, barW) {
  const maxTextWidth = r * 2 - barW - r / MAX_TEXT_WIDTH_DIVISOR;
  const maxValueHeight = VALUE_WIDTH_TO_RADIUS_FACTOR * Math.pow(r, LARGE_RADIUS_SCALING_DECAY);
  const size = calculateFontSize(
    String(text ?? ""),
    maxTextWidth,
    maxValueHeight,
    LINE_HEIGHT_FACTOR,
    void 0,
    400
  );
  return Math.max(1, size);
}
function radialNameFontSize(title, r, barW, showValue, showName) {
  const maxTextWidth = r * 2 - barW - r / MAX_TEXT_WIDTH_DIVISOR;
  let maxNameHeight = r / MAX_NAME_HEIGHT_DIVISOR;
  if (showValue && showName) {
    maxNameHeight = NAME_TO_HEIGHT_FACTOR * Math.pow(r, LARGE_RADIUS_SCALING_DECAY);
  }
  const size = calculateFontSize(
    title,
    maxTextWidth,
    maxNameHeight,
    LINE_HEIGHT_FACTOR,
    void 0,
    400
  );
  return Math.max(MIN_NAME_FONT_SIZE, size);
}
function radialValueTextY(input) {
  if (!input.pixelSpace) return input.fallbackY;
  const valueHeight = input.valueFontSize * LINE_HEIGHT_FACTOR;
  const nameHeight = input.nameFontSize * LINE_HEIGHT_FACTOR;
  let valueY = input.showName ? input.cy - nameHeight * (1 - VALUE_SPACE_PERCENTAGE) : input.cy;
  let yOffset = 0;
  if (input.shape === "gauge") {
    yOffset += (valueHeight + nameHeight) / 4;
  }
  if (input.showSparkline && input.sparkLen > 1) {
    yOffset += SPARKLINE_SPACING;
  }
  return valueY - yOffset;
}
function radialNameTextY(input) {
  if (!input.pixelSpace) return input.fallbackY;
  const valueHeight = input.valueFontSize * LINE_HEIGHT_FACTOR;
  const nameHeight = input.nameFontSize * LINE_HEIGHT_FACTOR;
  let valueY = input.cy - nameHeight * (1 - VALUE_SPACE_PERCENTAGE);
  let nameY = input.showValue ? valueY + valueHeight * VALUE_SPACE_PERCENTAGE : input.cy;
  let yOffset = 0;
  if (input.shape === "gauge") {
    yOffset += (valueHeight + nameHeight) / 4;
  }
  if (input.showSparkline && input.sparkLen > 1) {
    yOffset += SPARKLINE_SPACING;
  }
  return nameY - yOffset;
}
const _hoisted_1$2R = ["data-reduce-calcs", "data-legend-show", "data-display-mode", "data-name-placement", "data-title-placement", "data-value-mode", "data-orientation", "data-show-unfilled", "data-sizing", "data-min-viz-height", "data-min-viz-width", "data-item-spacing", "data-max-value-width", "data-min-value-height", "data-max-bar-height", "data-max-bar-width", "data-value-width", "data-max-viz-height"];
const _hoisted_2$2i = ["data-title-placement"];
const _hoisted_3$21 = {
  class: "bargauge-body",
  "data-testid": "bargauge-body"
};
const _hoisted_4$1K = { class: "bargauge-track-wrap" };
const _hoisted_5$1z = {
  key: 0,
  class: "empty"
};
const _hoisted_6$1l = ["data-reduce-fields", "data-reduce-values", "data-reduce-limit", "data-panel-w", "data-panel-h", "data-display-mode", "data-show-threshold-labels", "data-show-threshold-markers", "data-gauge-r", "data-gauge-cy", "data-scale-labels-r", "data-sizing", "data-shape", "data-text-mode", "data-bar-shape", "data-neutral", "data-endpoint", "data-segment-count", "data-segment-spacing", "data-min-viz-width", "data-min-viz-height", "data-bar-width-factor", "data-multi", "data-sparkline", "data-bar-glow", "data-center-glow", "data-gradient-effect"];
const _hoisted_7$1c = {
  key: 0,
  class: "empty"
};
const _hoisted_8$12 = ["data-bar-glow", "data-center-glow", "data-sparkline"];
const _hoisted_9$Z = ["viewBox", "preserveAspectRatio"];
const _hoisted_10$R = ["d", "stroke-width", "stroke-linecap"];
const _hoisted_11$J = {
  key: 0,
  "data-testid": "gauge-thresholds-bar"
};
const _hoisted_12$C = ["id"];
const _hoisted_13$B = ["width", "height"];
const _hoisted_14$A = ["d", "stroke-width"];
const _hoisted_15$u = ["x", "width", "height", "mask"];
const _hoisted_16$s = ["cx", "cy", "r", "fill"];
const _hoisted_17$p = ["d", "stroke", "stroke-width", "stroke-linecap", "data-testid"];
const _hoisted_18$p = ["id"];
const _hoisted_19$m = ["width", "height"];
const _hoisted_20$k = ["d", "stroke-width", "stroke-linecap"];
const _hoisted_21$e = ["x", "y", "width", "height", "mask"];
const _hoisted_22$d = ["cx", "cy", "r", "fill", "opacity"];
const _hoisted_23$9 = ["x1", "y1", "x2", "y2", "stroke"];
const _hoisted_24$9 = ["x", "y", "font-size"];
const _hoisted_25$9 = ["x", "y", "fill", "font-size"];
const _hoisted_26$8 = ["x", "y", "fill", "font-size"];
const TRACK_COLOR = "var(--grafana-hover)";
const _sfc_main$3H = /* @__PURE__ */ defineComponent({
  __name: "GaugeRenderer",
  props: {
    data: {},
    fieldConfig: {},
    options: {},
    mode: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const reduceFieldsAttr = computed(
      () => String(opts.value.reduceOptions?.fields ?? "")
    );
    const reduceLimitAttr = computed(
      () => String(opts.value.reduceOptions?.limit ?? "")
    );
    const gaugeRootEl = ref(null);
    const panelSize = ref({ w: 0, h: 0 });
    let gaugeRo = null;
    function measureGaugePanel() {
      const el = gaugeRootEl.value;
      if (!el) return;
      const w = el.clientWidth || 0;
      const h2 = el.clientHeight || 0;
      if (w !== panelSize.value.w || h2 !== panelSize.value.h) {
        panelSize.value = { w, h: h2 };
      }
    }
    onMounted(() => {
      nextTick(() => {
        measureGaugePanel();
        if (typeof ResizeObserver !== "undefined" && gaugeRootEl.value) {
          gaugeRo = new ResizeObserver(() => {
            measureGaugePanel();
            paintSparklines();
          });
          gaugeRo.observe(gaugeRootEl.value);
        }
        paintSparklines();
      });
    });
    onBeforeUnmount(() => {
      gaugeRo?.disconnect();
      gaugeRo = null;
      for (const p of sparkPlots.values()) p.destroy();
      sparkPlots.clear();
    });
    const itemsCountHint = computed(() => {
      const frames = props.data?.series ?? [];
      let n = 0;
      for (const f of frames) {
        for (const field of f.fields ?? []) {
          if (field.type === "number") n += 1;
        }
      }
      return Math.max(1, n);
    });
    const geom = computed(() => {
      const labels = !!opts.value.showThresholdLabels;
      const pw = panelSize.value.w;
      const ph = panelSize.value.h;
      const textMode = String(opts.value.textMode ?? "auto");
      const showName = textMode === "name" || textMode === "value_and_name" || textMode === "auto" && itemsCountHint.value > 1;
      return panelGaugeGeometry({
        barWidthFactor: Number(opts.value.barWidthFactor ?? 0.5),
        roundedBars: opts.value.barShape == null ? false : String(opts.value.barShape) === "rounded",
        thresholdBar: opts.value.showThresholdMarkers !== false,
        showScaleLabels: labels,
        glow: !!opts.value.effects?.barGlow || !!opts.value.effects?.centerGlow,
        shape: String(opts.value.shape ?? "gauge"),
        panelWidth: pw > 40 ? pw : void 0,
        panelHeight: ph > 40 ? ph : void 0,
        showName,
        sparkline: opts.value.sparkline === true
      });
    });
    const CX = computed(() => geom.value.cx);
    const CY = computed(() => geom.value.cy);
    const R = computed(() => geom.value.r);
    const VIEW_W = computed(() => geom.value.viewW);
    const VIEW_H = computed(() => geom.value.viewH);
    const MIN_VALUE_HEIGHT = BAR_GAUGE_LAYOUT.MIN_VALUE_HEIGHT;
    const MAX_VALUE_HEIGHT = BAR_GAUGE_LAYOUT.MAX_VALUE_HEIGHT;
    const DEFAULT_ITEM_SPACING = BAR_GAUGE_LAYOUT.DEFAULT_ITEM_SPACING;
    const items = computed(
      () => prepareGaugeItems({
        series: props.data?.series ?? [],
        fieldDefaults: props.fieldConfig?.defaults ?? {},
        reduceCalc: opts.value.reduceOptions?.calcs?.[0],
        textMode: opts.value.textMode,
        fieldsFilter: opts.value.reduceOptions?.fields,
        limit: opts.value.reduceOptions?.limit
      })
    );
    const multi = computed(() => items.value.length > 1);
    const shape = computed(() => String(opts.value.shape ?? "gauge"));
    function arcPath$1(startDeg, lengthDeg, radius) {
      return arcPath(startDeg, lengthDeg, arcGeom(), radius);
    }
    function trackArcs$1(it) {
      return trackArcs(
        it,
        arcGeom(),
        opts.value.neutral
      );
    }
    function thresholdTicks$1(it) {
      return thresholdTicks(it, arcGeom());
    }
    const showValueText = (it) => opts.value.textMode !== "name" && !!it.text;
    const showNameText = (it) => opts.value.textMode !== "value" && opts.value.textMode !== "none" && !!it.name;
    function lcdCells(it, cellCount) {
      const lcdW = Number(opts.value.lcdCellWidth ?? DEFAULT_LCD_CELL_WIDTH) || DEFAULT_LCD_CELL_WIDTH;
      const maxSize = Number(
        opts.value.minVizWidth ?? opts.value.maxVizWidth ?? (isVertical.value ? barTrackHeight.value * 4 : 180)
      ) || 180;
      const spacingRaw = Number(opts.value.itemSpacing);
      const spacing = Number.isFinite(spacingRaw) && spacingRaw >= 0 ? spacingRaw : DEFAULT_ITEM_SPACING;
      const value = it.min + it.pct * (it.max - it.min || 1);
      const colorAt = (pos) => {
        if (it.thresholds?.length) {
          const steps = [...it.thresholds].sort(
            (a, b) => Number(a.value) - Number(b.value)
          );
          let c = steps[0]?.color || it.color;
          for (const s of steps) {
            if (pos >= Number(s.value)) c = s.color || c;
          }
          return c || it.color;
        }
        return it.color;
      };
      let cells = buildLcdCells({
        min: it.min,
        max: it.max,
        value,
        color: it.color,
        colorAt,
        lcdCellWidth: lcdW,
        maxSize,
        itemSpacing: spacing
      });
      return cells.map((c) => ({
        on: c.on,
        color: c.color,
        shade: c.shade,
        size: c.size,
        spacing: c.spacing
      }));
    }
    function lcdCellStyle$1(cell) {
      return lcdCellStyle(cell, isVertical.value, DEFAULT_ITEM_SPACING);
    }
    function barFillStyle$1(it) {
      return barFillStyle(it, String(opts.value.displayMode ?? "gradient"));
    }
    function barFillStyleV$1(it) {
      return barFillStyleV(it, String(opts.value.displayMode ?? "gradient"));
    }
    const strokeW = computed(() => geom.value.stroke);
    function arcGeom() {
      return {
        shape: shape.value,
        r: R.value,
        cx: CX.value,
        cy: CY.value,
        stroke: strokeW.value,
        scaleLabelsRadius: geom.value.scaleLabelsRadius,
        thresholdsBarRadius: geom.value.thresholdsBarRadius
      };
    }
    const segmentCount = computed(
      () => Math.max(1, Math.floor(Number(opts.value.segmentCount ?? 1)))
    );
    const segmentSpacing = computed(
      () => Math.max(0, Number(opts.value.segmentSpacing ?? 0.3))
    );
    function segmentArcs$1(it) {
      return segmentArcs(
        it,
        arcGeom(),
        segmentCount.value,
        segmentSpacing.value,
        opts.value.neutral
      );
    }
    function endpointPos$1(it) {
      return endpointPos(
        it,
        arcGeom(),
        opts.value.endpointMarker,
        opts.value.neutral
      );
    }
    function valueArcAngles$1(it) {
      return valueArcAngles(
        it,
        shape.value,
        opts.value.neutral
      );
    }
    const itemSpacing = computed(() => {
      const n = Number(opts.value.itemSpacing);
      return Number.isFinite(n) && n >= 0 ? n : DEFAULT_ITEM_SPACING;
    });
    const isManualSizing = computed(
      () => String(opts.value.sizing ?? "auto") === "manual"
    );
    const barTrackHeight = computed(() => {
      const minH = isManualSizing.value ? Number(opts.value.minVizHeight) : NaN;
      const maxH = isManualSizing.value ? Number(opts.value.maxVizHeight) : NaN;
      let h2 = Number.isFinite(minH) && minH > 0 ? Math.max(MIN_VALUE_HEIGHT, Math.min(MAX_VALUE_HEIGHT, minH)) : MIN_VALUE_HEIGHT + 4;
      if (Number.isFinite(maxH) && maxH > 0) h2 = Math.min(h2, maxH);
      return h2;
    });
    const barTrackWidth = computed(() => {
      if (!isManualSizing.value) return 80;
      const minW = Number(opts.value.minVizWidth);
      if (Number.isFinite(minW) && minW > 0) return minW;
      return 80;
    });
    const isVertical = computed(() => {
      const o = String(opts.value.orientation ?? "auto");
      if (o === "vertical") return true;
      if (o === "horizontal") return false;
      const w = panelSize.value.w || 0;
      const h2 = panelSize.value.h || 0;
      if (w > 0 && h2 > 0) return w > h2;
      return false;
    });
    const isLcd = computed(() => String(opts.value.displayMode ?? "") === "lcd");
    const linecap = computed(
      () => String(opts.value.barShape ?? "") === "rounded" ? "round" : "butt"
    );
    function itemBarLayout(it) {
      const pw = panelSize.value.w > 40 ? panelSize.value.w : 0;
      const ph = panelSize.value.h > 40 ? panelSize.value.h : 0;
      const n = Math.max(1, items.value.length);
      const spacing = itemSpacing.value;
      let height2 = ph || (isVertical.value ? 200 : 36);
      let width2 = pw || (isVertical.value ? 80 : 400);
      if (ph && pw) {
        if (isVertical.value && n > 1) {
          width2 = Math.max(1, (pw - spacing * (n - 1)) / n);
          height2 = ph;
        } else if (!isVertical.value && n > 1) {
          height2 = Math.max(1, (ph - spacing * (n - 1)) / n);
          width2 = pw;
        }
      }
      if (isManualSizing.value) {
        if (!isVertical.value) {
          const minH = Number(opts.value.minVizHeight);
          const maxH = Number(opts.value.maxVizHeight);
          if (Number.isFinite(minH) && minH > 0) height2 = Math.max(height2, minH);
          if (Number.isFinite(maxH) && maxH > 0) height2 = Math.min(height2, maxH);
        } else {
          const minW = Number(opts.value.minVizWidth);
          if (Number.isFinite(minW) && minW > 0) width2 = Math.max(width2, minW);
        }
      }
      const title = it?.name ?? "";
      return calculateBarAndValueDimensions({
        height: height2,
        width: width2,
        orientation: isVertical.value ? "vertical" : "horizontal",
        namePlacement: String(opts.value.namePlacement ?? "auto"),
        title,
        valueText: it?.text ?? items.value[0]?.text ?? "0",
        valueMode: String(opts.value.valueMode ?? "color"),
        titleSize: Number(opts.value.text?.titleSize) || void 0,
        valueSize: Number(opts.value.text?.valueSize) || void 0
      });
    }
    const barItemLayout = computed(() => itemBarLayout(items.value[0]));
    const titlePlacement = computed(() => {
      const minH = Number(opts.value.minVizHeight);
      const panelHeight = panelSize.value.h > 40 ? panelSize.value.h : Number.isFinite(minH) && minH > 0 ? minH : isVertical.value ? 200 : 36;
      const hasTitle = items.value.some((it) => !!it.name);
      return resolveTitlePlacement({
        orientation: isVertical.value ? "vertical" : "horizontal",
        namePlacement: String(opts.value.namePlacement ?? "auto"),
        panelHeight,
        hasTitle
      });
    });
    function itemTitlePlacement(it) {
      if (!it.name || opts.value.namePlacement === "hidden") return "hidden";
      return titlePlacement.value;
    }
    function barValueStyle(it) {
      const layout = itemBarLayout(it);
      const mode2 = String(opts.value.valueMode ?? "color");
      const color = mode2 === "text" ? VALUE_TEXT_COLOR : mode2 === "hidden" ? "transparent" : it.color || "#73BF69";
      const fixedSize = Number(opts.value.text?.valueSize);
      if (isVertical.value) {
        const fontSize2 = Number.isFinite(fixedSize) && fixedSize > 0 ? fixedSize : calculateFontSize(
          String(it.text ?? ""),
          layout.valueWidth,
          layout.valueHeight,
          BAR_GAUGE_LAYOUT.VALUE_LINE_HEIGHT
        );
        return {
          color,
          height: `${layout.valueHeight}px`,
          width: `${layout.valueWidth}px`,
          maxWidth: "100%",
          display: "flex",
          alignItems: "center",
          justifyContent: "center",
          fontSize: `${Math.max(1, fontSize2)}px`,
          lineHeight: String(BAR_GAUGE_LAYOUT.VALUE_LINE_HEIGHT),
          paddingLeft: "0",
          textAlign: "center",
          overflow: "hidden",
          whiteSpace: "nowrap"
        };
      }
      const fontSize = Number.isFinite(fixedSize) && fixedSize > 0 ? fixedSize : calculateFontSize(
        String(it.text ?? ""),
        Math.max(
          1,
          layout.valueWidth - BAR_GAUGE_LAYOUT.VALUE_LEFT_PADDING * 2
        ),
        layout.valueHeight,
        BAR_GAUGE_LAYOUT.VALUE_LINE_HEIGHT
      );
      return {
        color,
        height: `${layout.valueHeight}px`,
        maxWidth: `${BAR_GAUGE_LAYOUT.MAX_VALUE_WIDTH}px`,
        minWidth: `${Math.min(40, layout.valueWidth)}px`,
        display: "flex",
        alignItems: "center",
        justifyContent: "flex-end",
        fontSize: `${Math.max(1, fontSize)}px`,
        lineHeight: String(BAR_GAUGE_LAYOUT.VALUE_LINE_HEIGHT),
        paddingLeft: `${BAR_GAUGE_LAYOUT.VALUE_LEFT_PADDING}px`,
        overflow: "hidden",
        whiteSpace: "nowrap"
      };
    }
    function barTrackBoxStyle(it) {
      const layout = itemBarLayout(it);
      if (isVertical.value) {
        const h2 = Math.max(1, layout.maxBarHeight);
        return {
          "--bar-h": `${h2}px`,
          height: `${h2}px`,
          width: "100%",
          // Grafana emptyBar: theme.colors.background.secondary (dark gray15)
          background: opts.value.showUnfilled === false ? "transparent" : "var(--grafana-hover)"
        };
      }
      return {
        "--bar-h": `${barTrackHeight.value}px`,
        height: `${barTrackHeight.value}px`,
        background: opts.value.showUnfilled === false ? "transparent" : "var(--grafana-hover)"
      };
    }
    function barLcdBoxStyle(it) {
      const layout = itemBarLayout(it);
      if (isVertical.value) {
        return {
          height: `${Math.max(1, layout.maxBarHeight)}px`,
          width: `${Math.max(12, layout.maxBarWidth || 40)}px`
        };
      }
      return {
        height: `${opts.value.minVizHeight || barTrackHeight.value}px`,
        width: "100%"
      };
    }
    const effects = computed(() => {
      const e = opts.value.effects ?? {};
      return {
        gradient: e.gradient === true,
        barGlow: e.barGlow === true,
        centerGlow: e.centerGlow === true
      };
    });
    const showSparkline = computed(() => opts.value.sparkline === true);
    const sparkHosts = ref({});
    const sparkPlots = /* @__PURE__ */ new Map();
    function setSparkHost(i, el) {
      sparkHosts.value[i] = el || null;
    }
    function paintSparklines() {
      if (!showSparkline.value) {
        for (const p of sparkPlots.values()) p.destroy();
        sparkPlots.clear();
        return;
      }
      const list = items.value;
      for (let i = 0; i < list.length; i++) {
        const it = list[i];
        const host = sparkHosts.value[i];
        const prev = sparkPlots.get(i);
        if (prev) {
          prev.destroy();
          sparkPlots.delete(i);
        }
        if (!host || it.spark.length < 2) {
          if (host) host.innerHTML = "";
          continue;
        }
        const w = Math.max(2, Math.floor(geom.value.sparkWidth));
        const h2 = Math.max(2, Math.floor(geom.value.sparkHeight));
        host.innerHTML = "";
        host.style.width = w + "px";
        host.style.height = h2 + "px";
        let min = Math.min(...it.spark);
        let max = Math.max(...it.spark);
        if (min === max) {
          if (min === 0) max = 1;
          else if (min < 0) min *= 2;
          else max *= 2;
        }
        const stroke = it.color || "#73BF69";
        const fillColor = stroke.startsWith("#") ? stroke : "#73BF69";
        const opacity = 0.4;
        const xs = it.spark.map((_, idx) => idx);
        const ys = it.spark.slice();
        const rangePad = 3;
        const plot = new uPlot(
          {
            width: w,
            height: h2,
            pxAlign: false,
            cursor: { show: false, x: false, y: false },
            legend: { show: false },
            padding: [rangePad, rangePad, rangePad, rangePad],
            scales: {
              x: { time: false, range: [0, Math.max(1, it.spark.length - 1)] },
              y: { range: [min, max] }
            },
            axes: [
              { show: false, scale: "x" },
              { show: false, scale: "y" }
            ],
            series: [
              {},
              {
                stroke,
                width: 1.5,
                // Grafana getOpacityGradientFn — vertical fade line→transparent
                fill: (u) => {
                  const { top, height: height2 } = u.bbox;
                  const g = u.ctx.createLinearGradient(
                    0,
                    top,
                    0,
                    top + height2
                  );
                  g.addColorStop(0, hexToRgba(fillColor, opacity));
                  g.addColorStop(1, hexToRgba(fillColor, 0));
                  return g;
                },
                // Grafana showHighlights + lastNotNull → last point size 6
                points: {
                  show: (_u, _s, i2) => i2 === it.spark.length - 1,
                  size: 6,
                  width: 0,
                  fill: stroke,
                  stroke
                },
                pxAlign: false,
                // Grafana LineInterpolation.Smooth
                paths: uPlot.paths?.spline?.() ?? void 0
              }
            ]
          },
          [xs, ys],
          host
        );
        sparkPlots.set(i, plot);
      }
      for (const key of [...sparkPlots.keys()]) {
        if (key >= list.length) {
          sparkPlots.get(key)?.destroy();
          sparkPlots.delete(key);
        }
      }
    }
    watch(
      () => [
        items.value,
        geom.value.sparkWidth,
        geom.value.sparkHeight,
        showSparkline.value,
        panelSize.value.w,
        panelSize.value.h
      ],
      () => nextTick(() => paintSparklines()),
      { deep: true }
    );
    function valueFontSize(it) {
      return radialValueFontSize(String(it.text ?? ""), R.value, strokeW.value);
    }
    function nameFontSize(it) {
      const title = it.name || it.titleForLayout || "";
      return radialNameFontSize(
        title,
        R.value,
        strokeW.value,
        showValueText(it),
        !!it.name
      );
    }
    function valueTextYFor(it) {
      return radialValueTextY({
        cx: CX.value,
        cy: CY.value,
        shape: shape.value,
        showName: !!it.name,
        valueFontSize: valueFontSize(it),
        nameFontSize: nameFontSize(it),
        pixelSpace: !!geom.value.pixelSpace,
        fallbackY: geom.value.valueTextY,
        showSparkline: showSparkline.value,
        sparkLen: it.spark.length
      });
    }
    function nameTextYFor(it) {
      return radialNameTextY({
        cy: CY.value,
        shape: shape.value,
        showValue: showValueText(it),
        valueFontSize: valueFontSize(it),
        nameFontSize: nameFontSize(it),
        pixelSpace: !!geom.value.pixelSpace,
        fallbackY: geom.value.nameTextY,
        showSparkline: showSparkline.value,
        sparkLen: it.spark.length
      });
    }
    function thresholdBarArcs$1(it) {
      return thresholdBarArcs(
        it,
        arcGeom(),
        opts.value.showThresholdMarkers
      );
    }
    function conicValueStyle$1(it) {
      return conicValueStyle({
        shape: shape.value,
        color: it.color,
        startDeg: startAngleForShape(shape.value),
        fullDeg: angleRangeForShape(shape.value),
        r: R.value,
        stroke: strokeW.value
      });
    }
    function barGlowStyle$1(it) {
      return barGlowStyle(it.color, !!effects.value.barGlow);
    }
    return (_ctx, _cache) => {
      return __props.mode === "bargauge" ? (openBlock(), createElementBlock("div", {
        key: 0,
        ref_key: "gaugeRootEl",
        ref: gaugeRootEl,
        class: normalizeClass(["bargauge-list", {
          vertical: isVertical.value,
          ["name-" + titlePlacement.value]: true
        }]),
        "data-testid": "panel-bargauge",
        "data-reduce-calcs": String((opts.value.reduceOptions?.calcs ?? []).join(",")),
        "data-legend-show": String(opts.value.legend?.showLegend !== false),
        style: normalizeStyle({ gap: itemSpacing.value + "px" }),
        "data-display-mode": String(opts.value.displayMode ?? "basic"),
        "data-name-placement": String(opts.value.namePlacement ?? "auto"),
        "data-title-placement": String(titlePlacement.value),
        "data-value-mode": String(opts.value.valueMode ?? "color"),
        "data-orientation": String(opts.value.orientation ?? "horizontal"),
        "data-show-unfilled": String(opts.value.showUnfilled !== false),
        "data-sizing": String(opts.value.sizing ?? "auto"),
        "data-min-viz-height": String(opts.value.minVizHeight ?? barTrackHeight.value),
        "data-min-viz-width": String(opts.value.minVizWidth ?? barTrackWidth.value),
        "data-item-spacing": String(itemSpacing.value),
        "data-max-value-width": String(unref(BAR_GAUGE_LAYOUT).MAX_VALUE_WIDTH),
        "data-min-value-height": String(unref(MIN_VALUE_HEIGHT)),
        "data-max-bar-height": String(Math.round(barItemLayout.value.maxBarHeight)),
        "data-max-bar-width": String(Math.round(barItemLayout.value.maxBarWidth)),
        "data-value-width": String(Math.round(barItemLayout.value.valueWidth)),
        "data-max-viz-height": String(opts.value.maxVizHeight ?? "")
      }, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(items.value, (it, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: normalizeClass(["bargauge", ["name-" + itemTitlePlacement(it), { vertical: isVertical.value }]]),
              "data-title-placement": itemTitlePlacement(it),
              style: normalizeStyle(
                isVertical.value ? {
                  // Grafana VizRepeater vertical: each item gets vizWidth ≈ panelWidth/n
                  height: "100%",
                  width: Math.max(barItemLayout.value.wrapperWidth || panelSize.value.w || 80, 40) + "px",
                  flex: "1 1 auto",
                  maxWidth: "100%"
                } : {
                  minHeight: Math.max(barTrackHeight.value, barItemLayout.value.wrapperHeight * 0.3) + "px",
                  width: "100%"
                }
              )
            }, [
              itemTitlePlacement(it) !== "hidden" && it.name ? (openBlock(), createElementBlock(
                "div",
                {
                  key: 0,
                  class: "bargauge-label",
                  "data-testid": "bargauge-name",
                  style: normalizeStyle(
                    itemTitlePlacement(it) === "left" ? {
                      width: Math.max(
                        48,
                        Math.min(120, barItemLayout.value.wrapperWidth * 0.35)
                      ) + "px",
                      maxWidth: "40%",
                      textAlign: "right",
                      paddingRight: "10px"
                    } : void 0
                  )
                },
                toDisplayString(it.name),
                5
                /* TEXT, STYLE */
              )) : createCommentVNode("v-if", true),
              createElementVNode("div", _hoisted_3$21, [
                opts.value.valueMode !== "hidden" && isVertical.value ? (openBlock(), createElementBlock(
                  "div",
                  {
                    key: 0,
                    class: normalizeClass(["bargauge-value", {
                      "value-text": opts.value.valueMode === "text",
                      "value-color": opts.value.valueMode === "color" || !opts.value.valueMode
                    }]),
                    "data-testid": "bargauge-value",
                    style: normalizeStyle(barValueStyle(it))
                  },
                  toDisplayString(it.text),
                  7
                  /* TEXT, CLASS, STYLE */
                )) : createCommentVNode("v-if", true),
                createElementVNode("div", _hoisted_4$1K, [
                  isLcd.value ? (openBlock(), createElementBlock(
                    "div",
                    {
                      key: 0,
                      class: normalizeClass(["bargauge-lcd", { vertical: isVertical.value }]),
                      style: normalizeStyle(barLcdBoxStyle(it)),
                      "data-testid": "bargauge-lcd"
                    },
                    [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(lcdCells(it), (cell, ci) => {
                          return openBlock(), createElementBlock(
                            "div",
                            {
                              key: ci,
                              class: normalizeClass(["lcd-cell", { on: cell.on }]),
                              style: normalizeStyle(lcdCellStyle$1(cell)),
                              "data-testid": "bargauge-lcd-cell"
                            },
                            null,
                            6
                            /* CLASS, STYLE */
                          );
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ],
                    6
                    /* CLASS, STYLE */
                  )) : (openBlock(), createElementBlock(
                    "div",
                    {
                      key: 1,
                      class: normalizeClass(["bargauge-track", [
                        String(opts.value.displayMode ?? "basic"),
                        {
                          "no-unfilled": opts.value.showUnfilled === false,
                          vertical: isVertical.value
                        }
                      ]]),
                      style: normalizeStyle(barTrackBoxStyle(it)),
                      "data-testid": "bargauge-track"
                    },
                    [
                      createElementVNode(
                        "div",
                        {
                          class: "bargauge-fill",
                          style: normalizeStyle(isVertical.value ? barFillStyleV$1(it) : barFillStyle$1(it))
                        },
                        null,
                        4
                        /* STYLE */
                      )
                    ],
                    6
                    /* CLASS, STYLE */
                  ))
                ]),
                opts.value.valueMode !== "hidden" && !isVertical.value ? (openBlock(), createElementBlock(
                  "div",
                  {
                    key: 1,
                    class: normalizeClass(["bargauge-value", {
                      "value-text": opts.value.valueMode === "text",
                      "value-color": opts.value.valueMode === "color" || !opts.value.valueMode
                    }]),
                    "data-testid": "bargauge-value",
                    style: normalizeStyle(barValueStyle(it))
                  },
                  toDisplayString(it.text),
                  7
                  /* TEXT, CLASS, STYLE */
                )) : createCommentVNode("v-if", true)
              ])
            ], 14, _hoisted_2$2i);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        !items.value.length ? (openBlock(), createElementBlock("div", _hoisted_5$1z, "暂无数据")) : createCommentVNode("v-if", true)
      ], 14, _hoisted_1$2R)) : (openBlock(), createElementBlock("div", {
        key: 1,
        ref_key: "gaugeRootEl",
        ref: gaugeRootEl,
        class: "gauge-root",
        "data-testid": "panel-gauge",
        "data-reduce-fields": reduceFieldsAttr.value,
        "data-reduce-values": String(!!opts.value.reduceOptions?.values),
        "data-reduce-limit": reduceLimitAttr.value,
        "data-panel-w": String(panelSize.value.w),
        "data-panel-h": String(panelSize.value.h),
        "data-display-mode": String(opts.value.displayMode ?? "gradient"),
        "data-show-threshold-labels": String(!!opts.value.showThresholdLabels),
        "data-show-threshold-markers": String(opts.value.showThresholdMarkers !== false),
        "data-gauge-r": String(R.value),
        "data-gauge-cy": String(CY.value),
        "data-scale-labels-r": String(geom.value.scaleLabelsRadius),
        "data-sizing": String(opts.value.sizing ?? "auto"),
        "data-shape": String(opts.value.shape ?? "gauge"),
        "data-text-mode": String(opts.value.textMode ?? "auto"),
        "data-bar-shape": String(opts.value.barShape ?? ""),
        "data-neutral": String(opts.value.neutral ?? ""),
        "data-endpoint": String(opts.value.endpointMarker ?? ""),
        "data-segment-count": String(segmentCount.value),
        "data-segment-spacing": String(segmentSpacing.value),
        "data-min-viz-width": String(opts.value.minVizWidth ?? ""),
        "data-min-viz-height": String(opts.value.minVizHeight ?? ""),
        "data-bar-width-factor": String(opts.value.barWidthFactor ?? 0.5),
        "data-multi": String(multi.value),
        "data-sparkline": String(!!opts.value.sparkline),
        "data-bar-glow": String(!!opts.value.effects?.barGlow),
        "data-center-glow": String(!!opts.value.effects?.centerGlow),
        "data-gradient-effect": String(!!opts.value.effects?.gradient)
      }, [
        !items.value.length ? (openBlock(), createElementBlock("div", _hoisted_7$1c, "暂无数据")) : (openBlock(), createElementBlock(
          "div",
          {
            key: 1,
            class: normalizeClass(["gauge-grid", { multi: multi.value }])
          },
          [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(items.value, (it, i) => {
                return openBlock(), createElementBlock("div", {
                  key: i,
                  class: "gauge",
                  "data-bar-glow": String(effects.value.barGlow),
                  "data-center-glow": String(effects.value.centerGlow),
                  "data-sparkline": String(showSparkline.value)
                }, [
                  (openBlock(), createElementBlock("svg", {
                    viewBox: `0 0 ${VIEW_W.value} ${VIEW_H.value}`,
                    class: "gauge-svg",
                    "aria-hidden": "true",
                    preserveAspectRatio: geom.value.pixelSpace ? "none" : "xMidYMid meet"
                  }, [
                    createCommentVNode(" Track (unfilled only — Grafana RadialBar) "),
                    (openBlock(true), createElementBlock(
                      Fragment,
                      null,
                      renderList(trackArcs$1(it), (tr, tri) => {
                        return openBlock(), createElementBlock("path", {
                          key: "track" + tri,
                          d: tr.d,
                          fill: "none",
                          stroke: TRACK_COLOR,
                          "stroke-width": strokeW.value,
                          "stroke-linecap": linecap.value,
                          "data-testid": "gauge-track"
                        }, null, 8, _hoisted_10$R);
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    )),
                    createCommentVNode(" ThresholdsBar (outer multi-stop ring) "),
                    opts.value.showThresholdMarkers !== false && thresholdBarArcs$1(it).length ? (openBlock(), createElementBlock("g", _hoisted_11$J, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(thresholdBarArcs$1(it), (tb, tbi) => {
                          return openBlock(), createElementBlock(
                            Fragment,
                            {
                              key: "tb" + tbi
                            },
                            [
                              createElementVNode("defs", null, [
                                createElementVNode("mask", {
                                  id: "gauge-th-mask-" + i + "-" + tbi,
                                  maskUnits: "userSpaceOnUse",
                                  maskContentUnits: "userSpaceOnUse"
                                }, [
                                  createElementVNode("rect", {
                                    x: "0",
                                    y: "0",
                                    width: VIEW_W.value,
                                    height: VIEW_H.value,
                                    fill: "black"
                                  }, null, 8, _hoisted_13$B),
                                  createElementVNode("path", {
                                    d: tb.d,
                                    fill: "none",
                                    stroke: "white",
                                    "stroke-width": geom.value.thresholdsBarWidth > 0 ? geom.value.thresholdsBarWidth : Math.max(2, strokeW.value * 0.35),
                                    "stroke-linecap": "butt"
                                  }, null, 8, _hoisted_14$A)
                                ], 8, _hoisted_12$C)
                              ]),
                              (openBlock(), createElementBlock("foreignObject", {
                                x: Math.round(
                                  CX.value - (geom.value.thresholdsBarRadius || R.value) - (geom.value.thresholdsBarWidth || 4)
                                ),
                                y: "0",
                                width: VIEW_W.value,
                                height: Math.max(
                                  VIEW_H.value,
                                  Math.ceil(
                                    ((geom.value.thresholdsBarRadius || R.value) + (geom.value.thresholdsBarWidth || 4)) * 2
                                  )
                                ),
                                mask: "url(#gauge-th-mask-" + i + "-" + tbi + ")"
                              }, [
                                createElementVNode(
                                  "div",
                                  {
                                    xmlns: "http://www.w3.org/1999/xhtml",
                                    style: normalizeStyle({
                                      width: Math.ceil(
                                        ((geom.value.thresholdsBarRadius || R.value) + (geom.value.thresholdsBarWidth || 4)) * 2
                                      ) + "px",
                                      height: Math.ceil(
                                        ((geom.value.thresholdsBarRadius || R.value) + (geom.value.thresholdsBarWidth || 4)) * 2
                                      ) + "px",
                                      backgroundImage: `conic-gradient(from ${unref(startAngleForShape)(shape.value)}deg, ${tb.color} ${-unref(angleRangeForShape)(shape.value) / 2}deg, ${tb.color} ${unref(angleRangeForShape)(shape.value)}deg, rgba(0,0,0,0) 0deg, rgba(0,0,0,0) ${unref(angleRangeForShape)(shape.value)}deg)`
                                    })
                                  },
                                  null,
                                  4
                                  /* STYLE */
                                )
                              ], 8, _hoisted_15$u))
                            ],
                            64
                            /* STABLE_FRAGMENT */
                          );
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ])) : createCommentVNode("v-if", true),
                    createCommentVNode(" Center glow (effects.centerGlow) "),
                    effects.value.centerGlow ? (openBlock(), createElementBlock("circle", {
                      key: 1,
                      cx: CX.value,
                      cy: CY.value,
                      r: R.value * 0.42,
                      fill: it.color || "var(--grafana-primary)",
                      opacity: "0.18",
                      "data-testid": "gauge-center-glow"
                    }, null, 8, _hoisted_16$s)) : createCommentVNode("v-if", true),
                    createCommentVNode(" Segmented bars when segmentCount > 1 "),
                    segmentCount.value > 1 ? (openBlock(true), createElementBlock(
                      Fragment,
                      { key: 2 },
                      renderList(segmentArcs$1(it), (seg, si) => {
                        return openBlock(), createElementBlock("path", {
                          key: "seg" + si,
                          d: seg.d,
                          fill: "none",
                          stroke: seg.on ? it.color || "var(--grafana-primary)" : TRACK_COLOR,
                          "stroke-width": strokeW.value,
                          "stroke-linecap": linecap.value,
                          "data-testid": seg.on ? "gauge-segment-on" : "gauge-segment-off",
                          style: normalizeStyle(seg.on ? barGlowStyle$1(it) : void 0)
                        }, null, 12, _hoisted_17$p);
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    )) : createCommentVNode("v-if", true),
                    createCommentVNode(" Grafana RadialArcPath: mask (relative path + translate) + conic FO "),
                    valueArcAngles$1(it).endValueAngle > 0.05 ? (openBlock(), createElementBlock(
                      Fragment,
                      { key: 3 },
                      [
                        createElementVNode("defs", null, [
                          createElementVNode("mask", {
                            id: "gauge-val-mask-" + i,
                            maskUnits: "userSpaceOnUse",
                            maskContentUnits: "userSpaceOnUse"
                          }, [
                            createElementVNode("rect", {
                              x: "0",
                              y: "0",
                              width: VIEW_W.value,
                              height: VIEW_H.value,
                              fill: "black"
                            }, null, 8, _hoisted_19$m),
                            createElementVNode("path", {
                              d: arcPath$1(
                                valueArcAngles$1(it).start,
                                valueArcAngles$1(it).endValueAngle
                              ),
                              fill: "none",
                              stroke: "white",
                              "stroke-width": strokeW.value,
                              "stroke-linecap": linecap.value
                            }, null, 8, _hoisted_20$k)
                          ], 8, _hoisted_18$p)
                        ]),
                        (openBlock(), createElementBlock("foreignObject", {
                          x: Math.round(CX.value - R.value - strokeW.value),
                          y: Math.max(0, Math.round(CY.value - R.value - strokeW.value)),
                          width: VIEW_W.value,
                          height: Math.max(VIEW_H.value, Math.ceil((R.value + strokeW.value) * 2)),
                          mask: "url(#gauge-val-mask-" + i + ")",
                          "data-testid": "gauge-value-arc",
                          style: normalizeStyle(barGlowStyle$1(it))
                        }, [
                          createElementVNode(
                            "div",
                            {
                              xmlns: "http://www.w3.org/1999/xhtml",
                              style: normalizeStyle(conicValueStyle$1(it))
                            },
                            null,
                            4
                            /* STYLE */
                          )
                        ], 12, _hoisted_21$e))
                      ],
                      64
                      /* STABLE_FRAGMENT */
                    )) : createCommentVNode("v-if", true),
                    createCommentVNode(" Grafana: endpointMarker only when roundedBars (barShape=rounded) "),
                    endpointPos$1(it) && String(opts.value.barShape) === "rounded" && String(opts.value.endpointMarker ?? "point") !== "none" ? (openBlock(), createElementBlock("circle", {
                      key: 4,
                      cx: endpointPos$1(it)?.x,
                      cy: endpointPos$1(it)?.y,
                      r: String(opts.value.endpointMarker) === "glow" ? Math.max(2, strokeW.value * 0.35) : Math.max(2, strokeW.value * 0.25),
                      fill: it.color || "var(--grafana-primary)",
                      opacity: String(opts.value.endpointMarker) === "glow" ? 0.85 : 1,
                      "data-testid": "gauge-endpoint"
                    }, null, 8, _hoisted_22$d)) : createCommentVNode("v-if", true),
                    opts.value.showThresholdMarkers !== false ? (openBlock(), createElementBlock(
                      Fragment,
                      { key: 5 },
                      [
                        (openBlock(true), createElementBlock(
                          Fragment,
                          null,
                          renderList(thresholdTicks$1(it), (tk, ti) => {
                            return openBlock(), createElementBlock("line", {
                              key: "t" + ti,
                              x1: tk.x1,
                              y1: tk.y1,
                              x2: tk.x2,
                              y2: tk.y2,
                              stroke: tk.color,
                              "stroke-width": "1.5"
                            }, null, 8, _hoisted_23$9);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        )),
                        opts.value.showThresholdLabels ? (openBlock(true), createElementBlock(
                          Fragment,
                          { key: 0 },
                          renderList(thresholdTicks$1(it), (tk, ti) => {
                            return openBlock(), createElementBlock("text", {
                              key: "l" + ti,
                              x: tk.lx,
                              y: tk.ly,
                              "font-size": geom.value.scaleLabelsFontSize || 3.5,
                              fill: "var(--grafana-text-secondary)",
                              "text-anchor": "middle",
                              "dominant-baseline": "middle",
                              "data-testid": "gauge-threshold-label"
                            }, toDisplayString(tk.label), 9, _hoisted_24$9);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        )) : createCommentVNode("v-if", true)
                      ],
                      64
                      /* STABLE_FRAGMENT */
                    )) : createCommentVNode("v-if", true),
                    showValueText(it) ? (openBlock(), createElementBlock("text", {
                      key: 6,
                      x: CX.value,
                      y: valueTextYFor(it),
                      "text-anchor": "middle",
                      "dominant-baseline": "middle",
                      class: "gauge-svg-value",
                      fill: unref(VALUE_TEXT_COLOR),
                      "font-size": String(valueFontSize(it)),
                      "font-weight": "400",
                      "font-family": "Inter, Helvetica, Arial, sans-serif"
                    }, toDisplayString(it.text), 9, _hoisted_25$9)) : createCommentVNode("v-if", true),
                    showNameText(it) ? (openBlock(), createElementBlock("text", {
                      key: 7,
                      x: CX.value,
                      y: nameTextYFor(it),
                      "text-anchor": "middle",
                      "dominant-baseline": "middle",
                      class: "gauge-svg-name",
                      fill: unref(NAME_TEXT_COLOR),
                      "font-size": String(nameFontSize(it)),
                      "font-family": "Inter, Helvetica, Arial, sans-serif"
                    }, toDisplayString(it.name), 9, _hoisted_26$8)) : createCommentVNode("v-if", true)
                  ], 8, _hoisted_9$Z)),
                  createCommentVNode(" Grafana RadialSparkline: absolute uPlot under horseshoe "),
                  showSparkline.value && it.spark.length > 1 ? (openBlock(), createElementBlock(
                    "div",
                    {
                      key: 0,
                      class: "gauge-sparkline",
                      "data-testid": "gauge-sparkline",
                      ref_for: true,
                      ref: (el) => setSparkHost(i, el),
                      style: normalizeStyle({
                        top: geom.value.sparkY0 + "px",
                        left: "50%",
                        width: geom.value.sparkWidth + "px",
                        height: geom.value.sparkHeight + "px",
                        marginLeft: -geom.value.sparkWidth / 2 + "px"
                      })
                    },
                    null,
                    4
                    /* STYLE */
                  )) : createCommentVNode("v-if", true)
                ], 8, _hoisted_8$12);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ],
          2
          /* CLASS */
        ))
      ], 8, _hoisted_6$1l));
    };
  }
});
const GaugeRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3H, [["__scopeId", "data-v-4dbe0e96"]]);
const _sfc_main$3G = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GaugeRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "gauge",
    name: "仪表",
    description: "径向仪表盘",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3G
).useFieldConfig().setPanelOptions((builder) => {
  const cat = ["仪表"];
  builder.addRadio(
    {
      id: "reduceOptions.values",
      path: "reduceOptions.values",
      name: "显示",
      category: ["数值选项"],
      editor: "radio",
      settings: {
        options: [
          { label: "计算", value: false },
          { label: "全部值", value: true }
        ]
      }
    },
    false
  ).addNumber(
    {
      id: "reduceOptions.limit",
      path: "reduceOptions.limit",
      name: "限制",
      category: ["数值选项"],
      editor: "number",
      showIf: (c) => !!c.reduceOptions?.values
    },
    25
  ).addCustom(
    {
      id: "reduceOptions.calcs",
      path: "reduceOptions.calcs",
      name: "计算",
      category: ["数值选项"],
      editor: "stats-picker",
      settings: {
        options: [
          { label: "Last *", value: "lastNotNull" },
          { label: "最后一个", value: "last" },
          { label: "最小值", value: "min" },
          { label: "最大值", value: "max" },
          { label: "平均值", value: "mean" },
          { label: "总和", value: "sum" }
        ]
      },
      showIf: (c) => !c.reduceOptions?.values
    },
    ["lastNotNull"]
  ).addText(
    {
      id: "reduceOptions.fields",
      path: "reduceOptions.fields",
      name: "字段",
      category: ["数值选项"],
      editor: "text"
    },
    ""
  ).addRadio(
    {
      id: "shape",
      path: "shape",
      name: "样式",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "圆形", value: "circle" },
          { label: "弧形", value: "gauge" }
        ]
      }
    },
    "gauge"
  ).addRadio(
    {
      id: "orientation",
      path: "orientation",
      name: "方向",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "水平", value: "horizontal" },
          { label: "垂直", value: "vertical" }
        ]
      }
    },
    "auto"
  ).addRadio(
    {
      id: "sizing",
      path: "sizing",
      name: "仪表尺寸",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "手动", value: "manual" }
        ]
      },
      showIf: (c) => c.orientation && c.orientation !== "auto"
    },
    "auto"
  ).addNumber(
    {
      id: "minVizWidth",
      path: "minVizWidth",
      name: "最小宽度",
      category: cat,
      editor: "number",
      settings: { min: 0, max: 600 },
      showIf: (c) => c.sizing === "manual" && c.orientation === "vertical"
    },
    75
  ).addNumber(
    {
      id: "minVizHeight",
      path: "minVizHeight",
      name: "最小高度",
      category: cat,
      editor: "number",
      settings: { min: 0, max: 600 },
      showIf: (c) => c.sizing === "manual" && c.orientation === "horizontal"
    },
    75
  ).addNumber(
    {
      id: "barWidthFactor",
      path: "barWidthFactor",
      name: "条宽因子",
      category: cat,
      editor: "number",
      settings: { min: 0.1, max: 1, step: 0.01 }
    },
    0.5
  ).addNumber(
    {
      id: "segmentCount",
      path: "segmentCount",
      name: "分段数",
      category: cat,
      editor: "number",
      settings: { min: 1, max: 100, step: 1 }
    },
    1
  ).addNumber(
    {
      id: "segmentSpacing",
      path: "segmentSpacing",
      name: "分段间距",
      category: cat,
      editor: "number",
      settings: { min: 0, max: 1, step: 0.01 },
      showIf: (c) => Number(c.segmentCount) > 1
    },
    0.3
  ).addRadio(
    {
      id: "barShape",
      path: "barShape",
      name: "条形样式",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "扁平", value: "flat" },
          { label: "圆角", value: "rounded" }
        ]
      },
      showIf: (c) => Number(c.segmentCount ?? 1) === 1
    },
    "flat"
  ).addRadio(
    {
      id: "endpointMarker",
      path: "endpointMarker",
      name: "端点标记",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "点", value: "point" },
          { label: "光晕", value: "glow" },
          { label: "无", value: "none" }
        ]
      },
      showIf: (c) => c.barShape === "rounded" && Number(c.segmentCount ?? 1) === 1
    },
    "point"
  ).addSelect(
    {
      id: "textMode",
      path: "textMode",
      name: "文本模式",
      category: cat,
      editor: "select",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "值与名称", value: "value_and_name" },
          { label: "值", value: "value" },
          { label: "名称", value: "name" },
          { label: "无", value: "none" }
        ]
      }
    },
    "auto"
  ).addNumber(
    {
      id: "neutral",
      path: "neutral",
      name: "中性值",
      category: cat,
      editor: "number"
    },
    void 0
  ).addBoolean(
    {
      id: "sparkline",
      path: "sparkline",
      name: "迷你图",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showThresholdMarkers",
      path: "showThresholdMarkers",
      name: "显示阈值标记",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "showThresholdLabels",
      path: "showThresholdLabels",
      name: "显示阈值标签",
      category: cat,
      editor: "boolean"
    },
    false
  ).addText(
    {
      id: "effects",
      path: "effects",
      name: "特效",
      description: "Grafana EffectsEditor：gradient / barGlow / centerGlow",
      category: cat,
      editor: "text"
    },
    // Live Grafana 13.2 RadialGauge applies defaultGaugePanelEffects.gradient=true (conic-gradient FO).
    { gradient: true, barGlow: false, centerGlow: false }
  ).addBoolean(
    {
      id: "effects.gradient",
      path: "effects.gradient",
      name: "渐变",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "effects.barGlow",
      path: "effects.barGlow",
      name: "条形光晕",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "effects.centerGlow",
      path: "effects.centerGlow",
      name: "中心光晕",
      category: cat,
      editor: "boolean"
    },
    false
  );
  addTextSizeOptions(builder, { withTitle: true, withValue: true });
}).setRuntimeConsumedPaths([
  "reduceOptions.calcs",
  "reduceOptions.fields",
  "reduceOptions.values",
  "reduceOptions.limit",
  "shape",
  "orientation",
  "sizing",
  "minVizWidth",
  "minVizHeight",
  "barWidthFactor",
  "segmentCount",
  "segmentSpacing",
  "barShape",
  "endpointMarker",
  "textMode",
  "neutral",
  "sparkline",
  "showThresholdMarkers",
  "showThresholdLabels",
  "effects",
  "effects",
  "effects.gradient",
  "effects.barGlow",
  "effects.centerGlow"
]).register();
const _sfc_main$3F = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GaugeRenderer, {
        mode: "bargauge",
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "bargauge",
    name: "条形仪表",
    description: "水平/垂直条形仪表",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3F
).useFieldConfig().setPanelOptions((builder) => {
  const cat = ["条形仪表"];
  builder.addRadio(
    {
      id: "reduceOptions.values",
      path: "reduceOptions.values",
      name: "显示",
      category: ["数值选项"],
      editor: "radio",
      settings: {
        options: [
          { label: "计算", value: false },
          { label: "全部值", value: true }
        ]
      }
    },
    false
  ).addCustom(
    {
      id: "reduceOptions.calcs",
      path: "reduceOptions.calcs",
      name: "计算",
      category: ["数值选项"],
      editor: "stats-picker",
      settings: {
        options: [
          { label: "Last *", value: "lastNotNull" },
          { label: "最后一个", value: "last" },
          { label: "最小值", value: "min" },
          { label: "最大值", value: "max" },
          { label: "平均值", value: "mean" },
          { label: "总和", value: "sum" }
        ]
      },
      showIf: (c) => !c.reduceOptions?.values
    },
    ["lastNotNull"]
  ).addText(
    {
      id: "reduceOptions.fields",
      path: "reduceOptions.fields",
      name: "字段",
      category: ["数值选项"],
      editor: "text"
    },
    ""
  ).addRadio(
    {
      id: "orientation",
      path: "orientation",
      name: "方向",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "水平", value: "horizontal" },
          { label: "垂直", value: "vertical" }
        ]
      }
    },
    "auto"
  );
  addLegendOptions(builder, true, false);
  builder.addRadio(
    {
      id: "displayMode",
      path: "displayMode",
      name: "显示模式",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "渐变", value: "gradient" },
          { label: "复古 LCD", value: "lcd" },
          { label: "基本", value: "basic" }
        ]
      }
    },
    "gradient"
  ).addRadio(
    {
      id: "valueMode",
      path: "valueMode",
      name: "数值显示",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "值颜色", value: "color" },
          { label: "文本颜色", value: "text" },
          { label: "隐藏", value: "hidden" }
        ]
      }
    },
    "color"
  ).addRadio(
    {
      id: "namePlacement",
      path: "namePlacement",
      name: "名称位置",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "顶部", value: "top" },
          { label: "左侧", value: "left" },
          { label: "隐藏", value: "hidden" }
        ]
      },
      showIf: (c) => c.orientation !== "vertical"
    },
    "auto"
  ).addRadio(
    {
      id: "namePlacementV",
      path: "namePlacement",
      name: "名称位置",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "隐藏", value: "hidden" }
        ]
      },
      showIf: (c) => c.orientation === "vertical"
    },
    "auto"
  ).addBoolean(
    {
      id: "showUnfilled",
      path: "showUnfilled",
      name: "显示未填充区域",
      category: cat,
      editor: "boolean",
      showIf: (c) => c.displayMode !== "lcd"
    },
    true
  ).addRadio(
    {
      id: "sizing",
      path: "sizing",
      name: "条尺寸",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "手动", value: "manual" }
        ]
      }
    },
    "auto"
  ).addNumber(
    {
      id: "minVizWidth",
      path: "minVizWidth",
      name: "最小宽度",
      category: cat,
      editor: "number",
      settings: { min: 0, max: 600 },
      showIf: (c) => c.sizing === "manual" && c.orientation === "vertical"
    },
    8
  ).addNumber(
    {
      id: "minVizHeight",
      path: "minVizHeight",
      name: "最小高度",
      category: cat,
      editor: "number",
      settings: { min: 0, max: 600 },
      showIf: (c) => c.sizing === "manual" && c.orientation !== "vertical"
    },
    16
  ).addNumber(
    {
      id: "maxVizHeight",
      path: "maxVizHeight",
      name: "最大高度",
      category: cat,
      editor: "number",
      settings: { min: 0, max: 600 },
      showIf: (c) => c.sizing === "manual" && c.orientation !== "vertical"
    },
    300
  );
  addTextSizeOptions(builder, { withTitle: true, withValue: true });
}).setRuntimeConsumedPaths([
  "reduceOptions.calcs",
  "reduceOptions.fields",
  "reduceOptions.values",
  "orientation",
  "displayMode",
  "valueMode",
  "namePlacement",
  "showUnfilled",
  "sizing",
  "minVizWidth",
  "minVizHeight",
  "maxVizHeight",
  "legend.showLegend"
]).register();
function migrateTableDisplayModeToCellOptions(displayMode) {
  switch (displayMode) {
    case "basic":
    case "gradient-gauge":
    case "lcd-gauge":
    case "gauge": {
      let gaugeMode = "gradient";
      if (displayMode === "basic") gaugeMode = "basic";
      if (displayMode === "lcd-gauge") gaugeMode = "lcd";
      if (displayMode === "gauge" || displayMode === "gradient-gauge")
        gaugeMode = "gradient";
      return { type: "gauge", mode: gaugeMode };
    }
    case "color-background":
      return { type: "color-background", mode: "gradient" };
    case "color-background-solid":
      return { type: "color-background", mode: "basic" };
    case "color-text":
      return { type: "color-text" };
    case "json-view":
    case "json":
      return { type: "json-view" };
    case "image":
      return { type: "image" };
    case "markdown":
      return { type: "markdown" };
    case "pill":
      return { type: "pill" };
    case "sparkline":
      return { type: "sparkline" };
    case "geo":
      return { type: "geo" };
    case "data-links":
      return { type: "data-links" };
    case "actions":
      return { type: "actions" };
    case "auto":
    default:
      return { type: displayMode || "auto" };
  }
}
function getCellOptions(field, panelCellOptions) {
  const custom = field.config?.custom ?? {};
  if (custom.cellOptions && typeof custom.cellOptions === "object") {
    return custom.cellOptions;
  }
  if (custom.displayMode) {
    return migrateTableDisplayModeToCellOptions(String(custom.displayMode));
  }
  if (panelCellOptions && typeof panelCellOptions === "object") {
    return panelCellOptions;
  }
  if (typeof panelCellOptions === "string" && panelCellOptions) {
    return migrateTableDisplayModeToCellOptions(panelCellOptions);
  }
  return { type: "auto" };
}
function cellTypeFromOptions(opts) {
  return String(opts?.type ?? "auto");
}
const REDUCER_DISPLAY_NAME = {
  sum: "Total",
  mean: "Mean",
  min: "Min",
  max: "Max",
  last: "Last",
  lastNotNull: "Last *",
  first: "First",
  firstNotNull: "First *",
  count: "Count",
  range: "Range",
  delta: "Delta",
  diff: "Difference",
  variance: "Variance",
  stdDev: "StdDev",
  allValues: "All values",
  allIsZero: "All Zeros",
  allIsNull: "All Nulls",
  changeCount: "Change Count",
  distinctCount: "Distinct Count"
};
function reducerDisplayName(id) {
  return REDUCER_DISPLAY_NAME[id] || id;
}
function getFooterItems(fields, options, formatCfg) {
  const panelReducers = Array.isArray(options.reducers) && options.reducers.length ? options.reducers : ["sum"];
  const countRows = options.countRows === true;
  const fieldFilter = options.fields?.length ? new Set(options.fields) : null;
  return fields.map((f, i) => {
    const fieldReducers = f.config?.custom?.footer?.reducers;
    const reducers = fieldReducers?.length ? fieldReducers : panelReducers;
    if (f.type !== "number") {
      if (i === 0 && reducers.length) {
        return reducerDisplayName(reducers[0]);
      }
      return void 0;
    }
    if (fieldFilter && !fieldFilter.has(f.name)) {
      return void 0;
    }
    if (countRows) {
      const r2 = reduceField(f, ["count"]);
      const c = r2.count;
      if (c == null) return void 0;
      return [{ [reducerDisplayName("count")]: String(c) }];
    }
    if (!reducers.length) return void 0;
    const r = reduceField(f, reducers);
    const cfg = formatCfg?.(f) ?? f.config ?? {};
    const items = [];
    for (const name of reducers) {
      const v = r[name];
      if (v == null || typeof v === "number" && Number.isNaN(v)) continue;
      const label = reducerDisplayName(name);
      if (name === "count") {
        items.push({ [label]: String(v) });
      } else {
        items.push({ [label]: formatValue(Number(v), cfg) });
      }
    }
    return items.length ? items : void 0;
  });
}
function shouldShowFooter(options, fields) {
  const show = options?.show === true;
  const anyField = fields.some(
    (f) => Array.isArray(f.config?.custom?.footer?.reducers) && f.config.custom.footer.reducers.length
  );
  return show || anyField;
}
function isNestedFramesField(f) {
  if (!f) return false;
  return String(f.type) === "nestedFrames" || f.name === "__nestedFrames" || f.name === "nested";
}
function findNestedFramesField(fields) {
  return fields.find((f) => isNestedFramesField(f));
}
function displayFieldsExcludingNested(fields) {
  return fields.filter((f) => {
    if (isNestedFramesField(f)) return false;
    const hide = f.config?.custom?.hideFrom;
    if (hide === true || hide?.viz === true) return false;
    return true;
  });
}
function computeTableRowIndices(input) {
  const fields = input.fields ?? [];
  const fieldDisplay = input.fieldDisplay ?? ((f) => f.name);
  let idxs = Array.from({ length: input.length }, (_, i) => i);
  const q = String(input.filterText).trim().toLowerCase();
  if (q) {
    idxs = idxs.filter(
      (i) => fields.some(
        (field) => String(field.values[i] ?? "").toLowerCase().includes(q)
      )
    );
  }
  for (const [name, fq] of Object.entries(input.colFilters ?? {})) {
    const t2 = String(fq).trim().toLowerCase();
    if (!t2) continue;
    const field = fields.find(
      (x) => x.name === name || fieldDisplay(x) === name
    );
    if (!field) continue;
    idxs = idxs.filter(
      (i) => String(field.values[i] ?? "").toLowerCase().includes(t2)
    );
  }
  if (input.sortKey) {
    const field = fields.find((x) => x.name === input.sortKey) || fields.find((x) => fieldDisplay(x) === input.sortKey);
    if (field) {
      const dir = input.sortDir === "desc" ? -1 : 1;
      idxs.sort((a, b) => {
        const av = field.values[a];
        const bv = field.values[b];
        const an = Number(av);
        const bn = Number(bv);
        let cmp = 0;
        if (Number.isFinite(an) && Number.isFinite(bn)) cmp = an - bn;
        else cmp = String(av ?? "").localeCompare(String(bv ?? ""));
        return dir * cmp;
      });
    }
  }
  return idxs;
}
function formatGeoCell(value) {
  if (value == null || value === "") return { label: "" };
  if (typeof value === "object" && value) {
    const o = value;
    if (o.type === "Point" && Array.isArray(o.coordinates)) {
      const [lon, lat] = o.coordinates;
      return {
        label: `${Number(lat).toFixed(5)}, ${Number(lon).toFixed(5)}`,
        lat: Number(lat),
        lon: Number(lon)
      };
    }
    if (o.lat != null && (o.lon != null || o.lng != null)) {
      const lat = Number(o.lat);
      const lon = Number(o.lon ?? o.lng);
      return { label: `${lat.toFixed(5)}, ${lon.toFixed(5)}`, lat, lon };
    }
  }
  const s = String(value).trim();
  const m = s.match(/^\s*(-?\d+(?:\.\d+)?)\s*[,\s]\s*(-?\d+(?:\.\d+)?)\s*$/);
  if (m) {
    const a = Number(m[1]);
    const b = Number(m[2]);
    if (Math.abs(a) <= 90)
      return { label: `${a.toFixed(5)}, ${b.toFixed(5)}`, lat: a, lon: b };
    return { label: `${b.toFixed(5)}, ${a.toFixed(5)}`, lat: b, lon: a };
  }
  return { label: s };
}
function formatJsonCell(value) {
  if (value == null) return "";
  if (typeof value === "string") {
    try {
      return JSON.stringify(JSON.parse(value), null, 2);
    } catch {
      return value;
    }
  }
  try {
    return JSON.stringify(value, null, 2);
  } catch {
    return String(value);
  }
}
function typeIcon(field) {
  switch (field.type) {
    case "time":
      return "⏱";
    case "number":
      return "#";
    case "boolean":
      return "☑";
    case "string":
      return "T";
    default:
      return "·";
  }
}
function displayCellValue(field, value, input) {
  const mode2 = input.cellType;
  if (value == null || value === "") return input.noValue;
  if (mode2 === "json-view") return formatJsonCell(value);
  if (mode2 === "pill") return String(value);
  if (mode2 === "geo") return formatGeoCell(value).label || input.noValue;
  if (mode2 === "markdown") return String(value);
  if (mode2 === "data-links" || mode2 === "actions") return "";
  if (input.hideValue) return "•";
  if (mode2 === "image" && typeof value === "string") return "";
  if (mode2 === "sparkline") return "";
  const processor = getDisplayProcessor({
    field: {
      ...field,
      config: { ...field.config, ...input.fieldDefaults ?? {} }
    },
    timeZone: input.timeZone || "browser"
  });
  return formattedValueToString(processor(value));
}
const _hoisted_1$2Q = ["data-show-header", "data-footer", "data-pagination", "data-freeze", "data-inspect", "data-style-field", "data-filterable", "data-custom-filterable", "data-column-min-width", "data-sort-by", "data-custom-align", "data-custom-min-width", "data-has-nested", "data-hide-value", "data-show-type-icons", "data-max-row-height", "data-tooltip-field", "data-wrap-text", "data-wrap-header-text", "data-custom-width", "data-cell-options", "data-tooltip-placement", "data-cell-height"];
const _hoisted_2$2h = {
  key: 0,
  class: "table-toolbar",
  "data-testid": "table-frame-select"
};
const _hoisted_3$20 = ["value"];
const _hoisted_4$1J = {
  key: 1,
  class: "table-col-filters",
  "data-testid": "table-col-filters"
};
const _hoisted_5$1y = ["placeholder", "value", "onInput"];
const _hoisted_6$1k = {
  class: "table-footer-row",
  "data-testid": "table-footer"
};
const _hoisted_7$1b = {
  key: 3,
  class: "table-empty",
  "data-testid": "table-empty"
};
const _hoisted_8$11 = {
  key: 4,
  class: "table-inspect",
  "data-testid": "table-inspect"
};
const _sfc_main$3E = /* @__PURE__ */ defineComponent({
  __name: "TableRenderer.antd",
  props: {
    data: {},
    fieldConfig: {},
    options: {},
    replaceVariables: {},
    width: {},
    height: {},
    nestDepth: { default: 0 }
  },
  setup(__props) {
    const props = __props;
    const sortKey = ref(null);
    const sortDir = ref("asc");
    const frameIndex = ref(0);
    const colFilters = ref({});
    const inspectCell = ref(null);
    const opts = computed(() => props.options ?? {});
    const hideValue = computed(() => !!opts.value.hideValue);
    const maxRowHeight = computed(() => {
      const n = Number(opts.value.maxRowHeight);
      return Number.isFinite(n) && n > 0 ? n : null;
    });
    const tooltipField = computed(
      () => String(opts.value.tooltip?.field ?? opts.value["tooltip.field"] ?? "").trim()
    );
    const tooltipPlacement = computed(() => {
      const p = String(
        opts.value.tooltip?.placement ?? opts.value["tooltip.placement"] ?? "top"
      ).trim();
      return p || "top";
    });
    const showTypeIcons = computed(() => !!opts.value.showTypeIcons);
    function applySortByOption() {
      const sb = opts.value.sortBy;
      if (!Array.isArray(sb) || !sb.length) return;
      const first = sb[0];
      const key = first?.displayName ?? first?.name ?? first?.field ?? null;
      if (key) {
        sortKey.value = String(key);
        sortDir.value = first?.desc || first?.direction === "desc" ? "desc" : "asc";
      }
    }
    watch(
      () => opts.value.sortBy,
      () => applySortByOption(),
      { immediate: true, deep: true }
    );
    const frames = computed(() => props.data?.series ?? []);
    const frame = computed(() => {
      const list = frames.value;
      if (!list.length) return void 0;
      const i = Math.min(Math.max(0, frameIndex.value), list.length - 1);
      return list[i];
    });
    const fields = computed(() => frame.value?.fields ?? []);
    const nestedField = computed(() => findNestedFramesField(fields.value));
    const displayFields = computed(() => displayFieldsExcludingNested(fields.value));
    const noValue = computed(() => {
      const nv = props.fieldConfig?.defaults?.noValue;
      return nv != null && String(nv) !== "" ? String(nv) : "-";
    });
    watch(frames, (f) => {
      if (frameIndex.value >= f.length) frameIndex.value = 0;
    });
    function fieldDisplay(f) {
      return getFieldDisplayName(f, frame.value, frames.value);
    }
    function cellType(f) {
      const panel2 = opts.value.cellOptions;
      const co = getCellOptions(f, panel2);
      if ((!co.type || co.type === "auto") && opts.value.displayMode) {
        return cellTypeFromOptions(
          migrateTableDisplayModeToCellOptions(String(opts.value.displayMode))
        );
      }
      return cellTypeFromOptions(co);
    }
    function isFilterable(f) {
      if (opts.value.filterable === true) return true;
      return f.config?.custom?.filterable === true;
    }
    function cfgFor(f) {
      return { ...props.fieldConfig?.defaults ?? {}, ...f.config ?? {} };
    }
    function formatCell(f, row) {
      const v = f.values?.[row];
      if (v == null || v === "") return noValue.value;
      try {
        return displayCellValue(f, v, {
          noValue: noValue.value,
          cellType: cellType(f),
          fieldDefaults: cfgFor(f),
          hideValue: hideValue.value
        });
      } catch {
        if (hideValue.value) return "•";
        if (f.type === "number") return formatValue(Number(v), cfgFor(f));
        return String(v);
      }
    }
    const rowIndices = computed(() => {
      const f = frame.value;
      if (!f) return [];
      return computeTableRowIndices({
        length: f.length,
        fields: fields.value,
        filterText: "",
        colFilters: colFilters.value,
        sortKey: sortKey.value,
        sortDir: sortDir.value,
        fieldDisplay
      });
    });
    const styleFieldName = computed(() => String(opts.value.styleField ?? "").trim());
    const dataSource = computed(
      () => rowIndices.value.map((ri) => {
        const record = { key: ri, __rowIndex: ri };
        for (const f of displayFields.value) {
          record[f.name] = formatCell(f, ri);
          record["__raw_" + f.name] = f.values?.[ri];
        }
        if (styleFieldName.value) {
          const sf = displayFields.value.find(
            (f) => f.name === styleFieldName.value || fieldDisplay(f) === styleFieldName.value
          ) || fields.value.find(
            (f) => f.name === styleFieldName.value || fieldDisplay(f) === styleFieldName.value
          );
          if (sf) {
            const raw = sf.values?.[ri];
            const color = getFieldColor(Number(raw), cfgFor(sf));
            if (color) record.__rowBg = color + "33";
          }
        }
        return record;
      })
    );
    const freezeCols = computed(() => {
      const raw = opts.value.frozenColumns?.left ?? opts.value.freezeColumns ?? opts.value.frozenColumns ?? 0;
      return Math.max(0, Number(raw) || 0);
    });
    function isTooltipField(f) {
      const tf = tooltipField.value;
      if (!tf) return false;
      return f.name === tf || fieldDisplay(f) === tf;
    }
    function renderColumnTitle(f) {
      const label = fieldDisplay(f);
      if (!showTypeIcons.value) return label;
      return h("span", { class: "gv-table-col-title" }, [
        h("span", { class: "type-icon", title: f.type, "data-testid": "table-type-icon" }, typeIcon(f)),
        label
      ]);
    }
    function renderCell(f, text, record) {
      const style = {};
      if (maxRowHeight.value) {
        style.maxHeight = maxRowHeight.value + "px";
        style.overflow = "hidden";
      }
      if (hideValue.value) {
        style.color = "transparent";
      }
      const wrapCell = !!f.config?.custom?.wrapText;
      if (wrapCell) {
        style.whiteSpace = "normal";
        style.wordBreak = "break-word";
      }
      const content = h(
        "span",
        {
          class: "gv-table-cell",
          style,
          "data-hide-value": hideValue.value ? "true" : "false"
        },
        text == null ? "" : String(text)
      );
      if (!isTooltipField(f)) return content;
      const tip = String(record["__raw_" + f.name] ?? text ?? "");
      return h(
        Tooltip,
        {
          title: tip,
          placement: tooltipPlacement.value
        },
        { default: () => content }
      );
    }
    const columns = computed(
      () => displayFields.value.map((f, fi) => {
        const custom = f.config?.custom ?? {};
        const width2 = Number(custom.width) > 0 ? Number(custom.width) : Math.max(Number(custom.minWidth) || Number(opts.value.columnMinWidth) || 80, 80);
        const filterable = isFilterable(f);
        const uniqueVals = filterable ? Array.from(
          new Set(
            (f.values ?? []).slice(0, 200).map((v) => v == null ? "" : String(v)).filter(Boolean)
          )
        ).slice(0, 50) : [];
        const wrapHeader = !!custom.wrapHeaderText;
        const wrapCell = !!custom.wrapText;
        return {
          title: () => renderColumnTitle(f),
          dataIndex: f.name,
          key: f.name,
          width: width2,
          ellipsis: !(wrapHeader || wrapCell || maxRowHeight.value),
          className: [
            wrapHeader ? "gv-table-wrap-header" : "",
            maxRowHeight.value ? "gv-table-max-row" : ""
          ].filter(Boolean).join(" ") || void 0,
          fixed: fi < freezeCols.value ? "left" : void 0,
          sorter: true,
          filters: filterable ? uniqueVals.map((v) => ({ text: v, value: v })) : void 0,
          onFilter: filterable ? (value, record) => String(record[f.name] ?? "") === String(value) : void 0,
          customRender: ({ text, record }) => renderCell(f, text, record)
        };
      })
    );
    const pagination = computed(() => {
      if (!opts.value.enablePagination) return false;
      const ps = Number(opts.value.pageSize) > 0 ? Number(opts.value.pageSize) : 50;
      return { pageSize: ps, size: "small", showSizeChanger: false };
    });
    const showFooter = computed(
      () => shouldShowFooter(opts.value.footer, displayFields.value)
    );
    const footerMap = computed(() => {
      if (!showFooter.value || !frame.value) return null;
      const footerOpts = {
        reducers: opts.value.footer?.reducers ?? ["sum"],
        countRows: opts.value.footer?.countRows,
        fields: opts.value.footer?.fields
      };
      const items = getFooterItems(displayFields.value, footerOpts, (f) => cfgFor(f));
      const map = {};
      displayFields.value.forEach((f, i) => {
        const it = items[i];
        if (it == null) return;
        if (typeof it === "string") {
          map[fieldDisplay(f)] = it;
          return;
        }
        if (Array.isArray(it)) {
          map[fieldDisplay(f)] = it.map((kv) => {
            const k = Object.keys(kv)[0];
            return k ? `${k}: ${kv[k]}` : "";
          }).filter(Boolean).join(", ");
        }
      });
      return Object.keys(map).length ? map : null;
    });
    const cellHeight = computed(
      () => String(opts.value.cellHeight ?? "sm")
    );
    function rowClassName(record) {
      const base = `table-row-${cellHeight.value}`;
      return record?.__rowBg ? `${base} table-row-styled` : base;
    }
    function customRow(record) {
      return {
        onClick: () => onRowClick(record),
        style: record?.__rowBg ? { background: String(record.__rowBg) } : void 0
      };
    }
    function onChange(_pag, _filters, sorter) {
      if (!sorter || Array.isArray(sorter)) return;
      if (sorter.field || sorter.columnKey) {
        sortKey.value = String(sorter.field || sorter.columnKey);
        sortDir.value = sorter.order === "descend" ? "desc" : "asc";
      }
    }
    function onRowClick(record) {
      if (!opts.value.inspect) return;
      const entries = Object.entries(record).filter(
        ([k]) => !k.startsWith("__") && k !== "key"
      );
      const [field, value] = entries[0] ?? ["", ""];
      inspectCell.value = { field: String(field), value: String(value ?? "") };
    }
    const scrollY = computed(() => {
      if (!props.height || props.height < 80) return void 0;
      return Math.max(80, props.height - 48);
    });
    function scrubSorterAria(root) {
      if (!root) return;
      root.querySelectorAll(
        '.ant-table-column-sorter [role="presentation"][aria-label], .anticon[role="presentation"][aria-label], span[role="presentation"][aria-label]'
      ).forEach((el) => el.removeAttribute("aria-label"));
    }
    const tableRoot = ref(null);
    let _mo = null;
    onMounted(() => {
      scrubSorterAria(tableRoot.value);
      void nextTick(() => scrubSorterAria(tableRoot.value));
      if (tableRoot.value && typeof MutationObserver !== "undefined") {
        _mo = new MutationObserver(() => scrubSorterAria(tableRoot.value));
        _mo.observe(tableRoot.value, {
          subtree: true,
          childList: true,
          attributes: true,
          attributeFilter: ["aria-label", "role"]
        });
      }
    });
    onUpdated(() => scrubSorterAria(tableRoot.value));
    onBeforeUnmount(() => {
      _mo?.disconnect();
      _mo = null;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "tableRoot",
        ref: tableRoot,
        class: "table-renderer",
        "data-testid": "panel-table",
        "data-show-header": String(opts.value.showHeader !== false),
        "data-footer": String(!!showFooter.value),
        "data-pagination": String(!!opts.value.enablePagination),
        "data-freeze": String(freezeCols.value),
        "data-inspect": String(!!opts.value.inspect),
        "data-style-field": String(opts.value.styleField ?? ""),
        "data-filterable": String(!!opts.value.filterable),
        "data-custom-filterable": String(!!__props.fieldConfig?.defaults?.custom?.filterable),
        "data-column-min-width": String(opts.value.columnMinWidth ?? ""),
        "data-sort-by": String(
          Array.isArray(opts.value.sortBy) ? opts.value.sortBy.map((s) => s?.displayName ?? s?.name ?? s).join(",") : opts.value.sortBy ?? ""
        ),
        "data-custom-align": String(__props.fieldConfig?.defaults?.custom?.align ?? ""),
        "data-custom-min-width": String(__props.fieldConfig?.defaults?.custom?.minWidth ?? ""),
        "data-has-nested": String(!!nestedField.value),
        "data-hide-value": String(!!opts.value.hideValue),
        "data-show-type-icons": String(!!opts.value.showTypeIcons),
        "data-max-row-height": String(opts.value.maxRowHeight ?? ""),
        "data-tooltip-field": String(tooltipField.value),
        "data-wrap-text": String(!!__props.fieldConfig?.defaults?.custom?.wrapText || !!opts.value.wrapText),
        "data-wrap-header-text": String(!!__props.fieldConfig?.defaults?.custom?.wrapHeaderText || !!opts.value.wrapHeaderText),
        "data-custom-width": String(__props.fieldConfig?.defaults?.custom?.width ?? ""),
        "data-cell-options": String(__props.fieldConfig?.defaults?.custom?.cellOptions ? JSON.stringify(__props.fieldConfig.defaults.custom.cellOptions) : opts.value.cellOptions ? JSON.stringify(opts.value.cellOptions) : ""),
        "data-tooltip-placement": String(tooltipPlacement.value),
        "data-cell-height": String(opts.value.cellHeight ?? "sm"),
        style: normalizeStyle({
          width: __props.width ? __props.width + "px" : "100%",
          height: __props.height ? __props.height + "px" : "100%"
        })
      }, [
        frames.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2$2h, [
          createElementVNode("label", null, [
            _cache[1] || (_cache[1] = createTextVNode(
              " 数据帧 ",
              -1
              /* CACHED */
            )),
            withDirectives(createElementVNode(
              "select",
              {
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => frameIndex.value = $event)
              },
              [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(frames.value, (fr, i) => {
                    return openBlock(), createElementBlock("option", {
                      key: i,
                      value: i
                    }, toDisplayString(fr.name || fr.refId || `Frame ${i + 1}`), 9, _hoisted_3$20);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ],
              512
              /* NEED_PATCH */
            ), [
              [
                vModelSelect,
                frameIndex.value,
                void 0,
                { number: true }
              ]
            ])
          ])
        ])) : createCommentVNode("v-if", true),
        displayFields.value.some((f) => isFilterable(f)) ? (openBlock(), createElementBlock("div", _hoisted_4$1J, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(displayFields.value.filter((x) => isFilterable(x)), (f) => {
              return openBlock(), createElementBlock("input", {
                key: f.name,
                class: "table-filter",
                placeholder: fieldDisplay(f),
                "data-testid": "table-col-filter",
                value: colFilters.value[f.name] || "",
                onInput: ($event) => colFilters.value = {
                  ...colFilters.value,
                  [f.name]: $event.target.value
                }
              }, null, 40, _hoisted_5$1y);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : createCommentVNode("v-if", true),
        displayFields.value.length ? (openBlock(), createBlock(unref(Table), {
          key: 2,
          size: "small",
          bordered: "",
          columns: columns.value,
          "data-source": dataSource.value,
          pagination: pagination.value,
          "row-class-name": rowClassName,
          scroll: { x: "max-content", y: scrollY.value },
          "show-header": opts.value.showHeader !== false,
          "data-testid": "table-antd",
          "custom-row": customRow,
          onChange
        }, createSlots({
          _: 2
          /* DYNAMIC */
        }, [
          footerMap.value ? {
            name: "footer",
            fn: withCtx(() => [
              createElementVNode("div", _hoisted_6$1k, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(footerMap.value, (val, key) => {
                    return openBlock(), createElementBlock(
                      "span",
                      {
                        key,
                        class: "table-footer-cell"
                      },
                      toDisplayString(key) + ": " + toDisplayString(val),
                      1
                      /* TEXT */
                    );
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])
            ]),
            key: "0"
          } : void 0
        ]), 1032, ["columns", "data-source", "pagination", "scroll", "show-header"])) : (openBlock(), createElementBlock("div", _hoisted_7$1b, "暂无数据")),
        inspectCell.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_8$11,
          toDisplayString(inspectCell.value.field) + ": " + toDisplayString(inspectCell.value.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ], 12, _hoisted_1$2Q);
    };
  }
});
const TableRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3E, [["__scopeId", "data-v-8e8fb06d"]]);
const _sfc_main$3D = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(TableRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  { id: "table", name: "表格", state: "stable", skipDataQuery: false },
  _sfc_main$3D
).useFieldConfig({
  useCustomConfig: (builder) => {
    const cat = ["单元格选项"];
    builder.addCustom({
      id: "custom.align",
      path: "custom.align",
      name: "对齐",
      category: cat,
      editor: "radio",
      isCustom: true,
      override: true,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "左", value: "left" },
          { label: "中", value: "center" },
          { label: "右", value: "right" }
        ]
      },
      defaultValue: "auto"
    }).addCustom({
      id: "custom.wrapText",
      path: "custom.wrapText",
      name: "自动换行",
      category: cat,
      editor: "boolean",
      isCustom: true,
      override: true,
      defaultValue: false
    }).addCustom({
      id: "custom.wrapHeaderText",
      path: "custom.wrapHeaderText",
      name: "表头换行",
      category: cat,
      editor: "boolean",
      isCustom: true,
      override: true,
      defaultValue: false
    }).addCustom({
      id: "custom.filterable",
      path: "custom.filterable",
      name: "可过滤",
      category: cat,
      editor: "boolean",
      isCustom: true,
      override: true,
      defaultValue: false
    }).addCustom({
      id: "custom.minWidth",
      path: "custom.minWidth",
      name: "最小宽度",
      category: cat,
      editor: "number",
      isCustom: true,
      override: true,
      defaultValue: 150
    }).addCustom({
      id: "custom.width",
      path: "custom.width",
      name: "列宽",
      category: cat,
      editor: "number",
      isCustom: true,
      override: true
    }).addCustom({
      id: "custom.hideFrom.viz",
      path: "custom.hideFrom.viz",
      name: "从可视化隐藏",
      category: cat,
      editor: "boolean",
      isCustom: true,
      override: true,
      defaultValue: false
    }).addCustom({
      id: "custom.cellOptions",
      path: "custom.cellOptions",
      name: "单元格类型",
      category: cat,
      editor: "select",
      isCustom: true,
      override: true,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "彩色文本", value: "color-text" },
          { label: "彩色背景", value: "color-background" },
          { label: "仪表", value: "gauge" },
          { label: "JSON", value: "json-view" }
        ]
      },
      defaultValue: "auto"
    });
  }
}).setPanelOptions((builder) => {
  builder.addBoolean(
    {
      id: "showHeader",
      path: "showHeader",
      name: "显示表头",
      category: ["表格"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "filterable",
      path: "filterable",
      name: "列过滤",
      category: ["表格"],
      editor: "boolean"
    },
    false
  ).addNumber(
    {
      id: "columnMinWidth",
      path: "columnMinWidth",
      name: "列最小宽度",
      category: ["表格"],
      editor: "number"
    },
    150
  ).addRadio(
    {
      id: "cellHeight",
      path: "cellHeight",
      name: "行高",
      category: ["表格"],
      editor: "radio",
      settings: {
        options: [
          { label: "小", value: "sm" },
          { label: "中", value: "md" },
          { label: "大", value: "lg" }
        ]
      }
    },
    "sm"
  ).addBoolean(
    {
      id: "footer.show",
      path: "footer.show",
      name: "显示页脚",
      category: ["表格"],
      editor: "boolean"
    },
    false
  ).addSelect(
    {
      id: "footer.reducers",
      path: "footer.reducers",
      name: "页脚计算",
      category: ["表格"],
      editor: "multi-select",
      settings: {
        options: [
          { label: "求和", value: "sum" },
          { label: "平均", value: "mean" },
          { label: "计数", value: "count" },
          { label: "最小", value: "min" },
          { label: "最大", value: "max" }
        ]
      },
      showIf: (c) => !!c.footer?.show
    },
    ["sum"]
  ).addBoolean(
    {
      id: "enablePagination",
      path: "enablePagination",
      name: "启用分页",
      category: ["表格"],
      editor: "boolean"
    },
    false
  ).addNumber(
    {
      id: "pageSize",
      path: "pageSize",
      name: "每页行数",
      category: ["表格"],
      editor: "number",
      settings: { min: 5, max: 500 },
      showIf: (c) => !!c.enablePagination
    },
    50
  ).addNumber(
    {
      id: "frozenColumns.left",
      path: "frozenColumns.left",
      name: "冻结左侧列",
      category: ["表格"],
      editor: "number",
      settings: { min: 0, max: 20 }
    },
    0
  ).addSelect(
    {
      id: "cellOptions",
      path: "cellOptions",
      name: "单元格类型",
      description: "默认单元格显示类型",
      category: ["表格"],
      editor: "select",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "彩色文本", value: "color-text" },
          { label: "彩色背景", value: "color-background" },
          { label: "彩色背景（纯色）", value: "color-background-solid" },
          { label: "仪表", value: "gauge" },
          { label: "渐变仪表", value: "gradient-gauge" },
          { label: "LCD 仪表", value: "lcd-gauge" },
          { label: "基础条", value: "basic" },
          { label: "迷你图", value: "sparkline" },
          { label: "图片", value: "image" },
          { label: "JSON 视图", value: "json-view" },
          { label: "胶囊", value: "pill" }
        ]
      }
    },
    "auto"
  ).addBoolean(
    {
      id: "hideValue",
      path: "hideValue",
      name: "隐藏值",
      category: ["表格"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "inspect",
      path: "inspect",
      name: "检查单元格值",
      category: ["表格"],
      editor: "boolean"
    },
    false
  ).addText(
    {
      id: "styleField",
      path: "styleField",
      name: "样式字段",
      category: ["表格"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "tooltip.field",
      path: "tooltip.field",
      name: "提示字段",
      category: ["提示"],
      editor: "text"
    },
    ""
  ).addRadio(
    {
      id: "tooltip.placement",
      path: "tooltip.placement",
      name: "提示位置",
      category: ["提示"],
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "上方", value: "top" },
          { label: "下方", value: "bottom" }
        ]
      }
    },
    "auto"
  ).addBoolean(
    {
      id: "showTypeIcons",
      path: "showTypeIcons",
      name: "显示类型图标",
      category: ["表格"],
      editor: "boolean"
    },
    false
  ).addNumber(
    {
      id: "maxRowHeight",
      path: "maxRowHeight",
      name: "最大行高",
      category: ["表格"],
      editor: "number",
      settings: { min: 0 }
    },
    void 0
  ).addCustom(
    {
      id: "sortBy",
      path: "sortBy",
      name: "默认排序",
      description: "表格初始排序字段（与 Grafana JSON sortBy 兼容）",
      category: ["表格"],
      editor: "custom"
    },
    []
  );
}).setRuntimeConsumedPaths([
  "showHeader",
  "filterable",
  "columnMinWidth",
  "cellHeight",
  "footer.show",
  "footer.reducers",
  "enablePagination",
  "pageSize",
  "frozenColumns.left",
  "cellOptions",
  "hideValue",
  "inspect",
  "styleField",
  "tooltip.field",
  "tooltip.placement",
  "showTypeIcons",
  "maxRowHeight",
  "sortBy",
  "custom.align",
  "custom.wrapText",
  "custom.wrapHeaderText",
  "custom.filterable",
  "custom.minWidth",
  "custom.width",
  "custom.hideFrom.viz",
  "custom.cellOptions"
]).register();
const _hoisted_1$2P = {
  class: "panel-data-error",
  "data-testid": "panel-data-error"
};
const _hoisted_2$2g = { class: "panel-data-error__msg" };
const _sfc_main$3C = /* @__PURE__ */ defineComponent({
  __name: "PanelDataErrorView",
  props: {
    data: {},
    fieldConfig: {},
    needsStringField: { type: Boolean, default: false },
    needsTimeField: { type: Boolean, default: false },
    needsNumberField: { type: Boolean, default: false },
    message: {}
  },
  setup(__props) {
    const props = __props;
    const text = computed(() => {
      if (props.message) return props.message;
      const noValue = props.fieldConfig?.defaults?.noValue;
      if (typeof noValue === "string" && noValue) return noValue;
      const series = props.data?.series ?? [];
      const hasAnyValues = series.some(
        (f) => (f.length ?? f.fields?.[0]?.values?.length ?? 0) > 0
      );
      if (!series.length || !hasAnyValues) return "无数据";
      const fields = series.flatMap((f) => f.fields ?? []);
      const hasString = fields.some((f) => f.type === "string");
      const hasTime = fields.some((f) => f.type === "time");
      const hasNumber = fields.some((f) => f.type === "number");
      if (props.needsStringField && !hasString) return "数据缺少一个字符串字段";
      if (props.needsTimeField && !hasTime) return "数据缺少一个时间字段";
      if (props.needsNumberField && !hasNumber) return "数据缺少一个数字字段";
      return "无法可视化数据";
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2P, [
        createElementVNode(
          "div",
          _hoisted_2$2g,
          toDisplayString(text.value),
          1
          /* TEXT */
        )
      ]);
    };
  }
});
const PanelDataErrorView = /* @__PURE__ */ _export_sfc(_sfc_main$3C, [["__scopeId", "data-v-d4b74297"]]);
function computeVirtualWindow(total, scrollTop, viewportHeight, rowHeight, overscan = 8) {
  const rh = Math.max(1, rowHeight);
  const totalHeight = total * rh;
  if (total <= 0) {
    return { start: 0, end: 0, offsetY: 0, totalHeight, visibleCount: 0 };
  }
  const effectiveViewport = viewportHeight > 0 ? viewportHeight : Math.min(total, 40) * rh;
  const first = Math.max(0, Math.floor(scrollTop / rh) - overscan);
  const visible = Math.ceil(effectiveViewport / rh) + overscan * 2;
  const end = Math.min(total, first + visible);
  return {
    start: first,
    end,
    offsetY: first * rh,
    totalHeight,
    visibleCount: end - first
  };
}
function sliceVirtualRows(rows, win) {
  return rows.slice(win.start, win.end);
}
const SEV_COLORS = {
  critical: "#b91c1c",
  fatal: "#b91c1c",
  error: "#ef4444",
  warn: "#ff8630",
  warning: "#ff8630",
  info: "#1664ff",
  debug: "#86909c",
  trace: "#a855f7",
  unknown: "#86909c"
};
function normalizeLevel(raw) {
  const s = String(raw ?? "").toLowerCase().trim();
  if (!s) return "unknown";
  if (s === "critical" || s === "fatal") return s === "fatal" ? "fatal" : "critical";
  if (s === "error" || s === "err") return "error";
  if (s === "warn" || s === "warning") return "warning";
  if (s === "info" || s === "information") return "info";
  if (s === "debug") return "debug";
  if (s === "trace") return "trace";
  return s;
}
function detectLevelFromMessage(msg) {
  const m = String(msg ?? "").toLowerCase();
  if (m.includes("critical") || m.includes("fatal")) return "critical";
  if (m.includes("error") || /\berr\b/.test(m)) return "error";
  if (m.includes("warn")) return "warning";
  if (m.includes("trace")) return "trace";
  if (m.includes("debug")) return "debug";
  if (m.includes("info")) return "info";
  return "unknown";
}
function severityColor(level) {
  return SEV_COLORS[normalizeLevel(level)] ?? SEV_COLORS.unknown;
}
function severityBadgeStyle(level) {
  const c = severityColor(level);
  return {
    color: c,
    backgroundColor: `color-mix(in srgb, ${c} 14%, transparent)`,
    border: `1px solid color-mix(in srgb, ${c} 35%, transparent)`
  };
}
function formatLogTimestamp(ms, resolution = "ms") {
  if (!Number.isFinite(ms)) return "";
  let epoch = ms;
  if (resolution === "ns") epoch = ms / 1e6;
  else if (resolution === "us" || resolution === "µs") epoch = ms / 1e3;
  else if (resolution === "s") epoch = ms * 1e3;
  if (epoch > 1e17) epoch = epoch / 1e6;
  else if (epoch > 1e14) epoch = epoch / 1e3;
  const d = new Date(epoch);
  if (Number.isNaN(d.getTime())) return "";
  return d.toISOString().replace("T", " ").replace("Z", "").slice(0, 23);
}
function formatLabelValue(val) {
  if (val == null) return "";
  if (typeof val === "string" || typeof val === "number" || typeof val === "boolean")
    return String(val);
  if (Array.isArray(val)) return val.map(formatLabelValue).join(",");
  try {
    return JSON.stringify(val);
  } catch {
    return String(val);
  }
}
function aggregateLogFields(log) {
  const attributes = {};
  const resources = {};
  for (const key of Object.keys(log)) {
    const val = log[key];
    if (!val || typeof val !== "object" || Array.isArray(val)) continue;
    if (key.startsWith("attributes_") || key === "attributesString" || key === "attributeMap" || key === "attributes") {
      Object.entries(val).forEach(([k, v]) => {
        attributes[k] = formatLabelValue(v);
      });
    } else if (key.startsWith("resources_") || key === "resourcesString" || key === "resourceMap" || key === "resources") {
      Object.entries(val).forEach(([k, v]) => {
        resources[k] = formatLabelValue(v);
      });
    }
  }
  return { attributes, resources };
}
function extractService(labels, extras) {
  if (extras) {
    for (const k of [
      "service.name",
      "service",
      "serviceName",
      "job",
      "app"
    ]) {
      if (extras[k] != null && String(extras[k]).trim())
        return String(extras[k]);
    }
  }
  const blob = String(labels ?? "");
  for (const key of ["service.name", "service", "job", "app"]) {
    const re = new RegExp(
      `(?:^|,)\\s*${key.replace(".", "\\.")}\\s*=\\s*([^,]+)`,
      "i"
    );
    const m = blob.match(re);
    if (m?.[1]) return m[1].trim();
  }
  return "";
}
function extractTraceId(labels, extras) {
  if (extras) {
    for (const k of ["trace_id", "traceId", "traceID", "trace.id"]) {
      if (extras[k] != null && String(extras[k]).trim())
        return String(extras[k]);
    }
  }
  const blob = String(labels ?? "");
  const m = blob.match(
    /(?:^|,)\s*(?:trace_id|traceId|traceID|trace\.id)\s*=\s*([^,]+)/i
  );
  return m?.[1]?.trim() ?? "";
}
function labelsFromField(field, i) {
  if (!field) return "";
  const v = field.values?.[i];
  if (v && typeof v === "object" && !Array.isArray(v)) {
    return Object.entries(v).map(([k, val]) => `${k}=${formatLabelValue(val)}`).join(", ");
  }
  return formatLabelValue(v);
}
function parseLogRowsFromFrame(frame, options = {}) {
  if (!frame?.fields?.length) return [];
  const time = frame.fields.find((f) => f.type === "time");
  const line = frame.fields.find(
    (f) => /line|message|msg|body|Log/i.test(String(f.name || "")) && f.type === "string"
  ) ?? frame.fields.find((f) => f.type === "string");
  if (!line) return [];
  const labelField = frame.fields.find((f) => /label/i.test(String(f.name || ""))) ?? frame.fields.find(
    (f) => f.labels && Object.keys(f.labels).length
  );
  const levelField = frame.fields.find(
    (f) => /level|severity|severity_text/i.test(String(f.name || ""))
  );
  const serviceField = frame.fields.find(
    (f) => /service(\.name)?$|job|app/i.test(String(f.name || ""))
  );
  const traceField = frame.fields.find(
    (f) => /trace[_]?id|trace\.id/i.test(String(f.name || ""))
  );
  const res = String(options.timestampResolution ?? "ms");
  const total = frame.length ?? line.values?.length ?? 0;
  const max = options.maxRows != null && options.maxRows > 0 ? Math.min(total, options.maxRows) : total;
  let result = Array.from({ length: max }, (_, i) => {
    const raw = String(line?.values?.[i] ?? "");
    let msg = raw;
    if (options.prettifyLogMessage) {
      try {
        msg = JSON.stringify(JSON.parse(raw), null, 2);
      } catch {
      }
    }
    const labels = labelsFromField(labelField, i) || (line?.labels ? Object.entries(line.labels).map(([k, v]) => `${k}=${formatLabelValue(v)}`).join(", ") : "");
    const levelFromField = levelField ? normalizeLevel(String(levelField.values?.[i] ?? "")) : "";
    const level = levelFromField && levelFromField !== "unknown" ? levelFromField : detectLevelFromMessage(msg);
    const labelObj = labelField?.values?.[i] && typeof labelField.values[i] === "object" && !Array.isArray(labelField.values[i]) ? labelField.values[i] : line?.labels;
    const service = (serviceField ? String(serviceField.values?.[i] ?? "") : "") || extractService(labels, labelObj);
    const traceId = (traceField ? String(traceField.values?.[i] ?? "") : "") || extractTraceId(labels, labelObj);
    const fields = {};
    for (const f of frame.fields) {
      const name = String(f.name || "");
      if (!name) continue;
      const v = f.values?.[i];
      if (v != null && typeof v === "object" && !Array.isArray(v)) {
        Object.entries(v).forEach(([k, val]) => {
          fields[k] = formatLabelValue(val);
        });
      } else {
        fields[name] = formatLabelValue(v);
      }
    }
    const bag = {
      ...fields,
      attributes: labelObj && typeof labelObj === "object" ? labelObj : {},
      resources: service ? { "service.name": service } : {},
      body: raw,
      severityText: level,
      traceId
    };
    const { attributes, resources } = aggregateLogFields(bag);
    if (service && !resources["service.name"]) {
      resources["service.name"] = service;
    }
    const ts = time ? Number(time.values?.[i]) : i;
    return {
      id: `${ts}-${i}`,
      index: i,
      timestamp: ts,
      t: formatLogTimestamp(ts, res),
      severityText: (level || "INFO").toUpperCase(),
      level,
      body: raw,
      msg,
      raw,
      service,
      traceId,
      labels,
      attributes,
      resources,
      fields
    };
  });
  const dedup = String(options.dedupStrategy ?? "none");
  if (dedup === "exact") {
    const seen = /* @__PURE__ */ new Set();
    result = result.filter((r) => {
      if (seen.has(r.raw)) return false;
      seen.add(r.raw);
      return true;
    });
  } else if (dedup === "numbers") {
    const seen = /* @__PURE__ */ new Set();
    result = result.filter((r) => {
      const k = r.msg.replace(/\d+/g, "#");
      if (seen.has(k)) return false;
      seen.add(k);
      return true;
    });
  } else if (dedup === "signature") {
    const seen = /* @__PURE__ */ new Set();
    result = result.filter((r) => {
      const k = r.msg.replace(/[0-9a-f]{8,}/gi, "#").replace(/\d+/g, "#");
      if (seen.has(k)) return false;
      seen.add(k);
      return true;
    });
  }
  if (String(options.sortOrder) === "Ascending") return result;
  return [...result].reverse();
}
function getRowAttr(row, key) {
  if (row.resources[key]) return row.resources[key];
  if (row.attributes[key]) return row.attributes[key];
  if (row.fields[key]) return row.fields[key];
  if (key === "service.name") return row.service;
  if (key === "traceId" || key === "trace_id") return row.traceId;
  if (key === "body" || key === "Line" || key === "line") return row.body;
  return "";
}
function rowToDetailObject(row) {
  return {
    timestamp: row.timestamp,
    id: row.id,
    traceId: row.traceId,
    severityText: row.severityText,
    body: row.body,
    attributes: row.attributes,
    resources: {
      ...row.resources,
      ...row.service ? { "service.name": row.service } : {}
    },
    fields: row.fields
  };
}
function parseLogRowsFromFrames(frames, options = {}) {
  const list = frames ?? [];
  const out = [];
  let indexBase = 0;
  for (const frame of list) {
    const rows = parseLogRowsFromFrame(frame, {
      ...options,
      // explicit only — never silent cap across frames
      maxRows: options.maxRows
    });
    for (const r of rows) {
      out.push({ ...r, index: indexBase + r.index, id: `${r.id}` });
    }
    indexBase += rows.length;
  }
  return out;
}
const _hoisted_1$2O = ["data-level", "data-open", "data-testid", "onClick"];
const _hoisted_2$2f = { class: "le-entry" };
const _hoisted_3$1$ = { class: "le-entry-head" };
const _hoisted_4$1I = {
  key: 0,
  class: "le-entry-ts timestamp field"
};
const _hoisted_5$1x = ["title"];
const _hoisted_6$1j = ["title"];
const _hoisted_7$1a = {
  key: 3,
  class: "labels field le-entry-labels",
  "data-testid": "log-attributes"
};
const _hoisted_8$10 = { class: "le-entry-actions" };
const _hoisted_9$Y = ["onClick"];
const _hoisted_10$Q = ["innerHTML"];
const _hoisted_11$I = { class: "le-detail-ts" };
const _hoisted_12$B = { class: "le-detail-body" };
const _hoisted_13$A = { class: "fieldsTable" };
const _hoisted_14$z = { class: "fieldsKey" };
const _hoisted_15$t = { class: "fieldsVal" };
const _hoisted_16$r = {
  key: 0,
  class: "log-detail-sidebar",
  "data-testid": "log-detail",
  "data-details-mode": "sidebar"
};
const _hoisted_17$o = {
  key: 0,
  class: "sidebar-inner"
};
const _hoisted_18$o = { class: "fieldsTable" };
const _hoisted_19$l = { class: "fieldsKey" };
const _hoisted_20$j = { class: "fieldsVal" };
const _sfc_main$3B = /* @__PURE__ */ defineComponent({
  __name: "LogsListRenderer",
  props: {
    rows: {},
    options: {},
    openId: {},
    wrap: { type: Boolean },
    extraColumns: {},
    highlightMsg: { type: Function },
    detailEntries: { type: Function },
    rowHeight: {}
  },
  emits: ["toggle", "copy"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const opts = computed(() => props.options ?? {});
    const viewportEl = ref(null);
    const scrollTop = ref(0);
    const viewportHeight = ref(400);
    const ROW_H2 = computed(() => Math.max(22, Number(props.rowHeight ?? 28)));
    const win = computed(
      () => computeVirtualWindow(
        props.rows.length,
        scrollTop.value,
        viewportHeight.value,
        ROW_H2.value,
        12
      )
    );
    const visibleRows = computed(() => sliceVirtualRows(props.rows, win.value));
    function onScroll() {
      const el = viewportEl.value;
      if (!el) return;
      scrollTop.value = el.scrollTop;
      viewportHeight.value = el.clientHeight;
    }
    let ro = null;
    onMounted(() => {
      onScroll();
      if (typeof ResizeObserver !== "undefined" && viewportEl.value) {
        ro = new ResizeObserver(() => onScroll());
        ro.observe(viewportEl.value);
      }
    });
    onBeforeUnmount(() => {
      ro?.disconnect();
    });
    watch(
      () => props.rows.length,
      () => {
        onScroll();
      }
    );
    function scrollToIndex(index2) {
      const el = viewportEl.value;
      if (!el) return;
      const i = Math.max(0, Math.min(props.rows.length - 1, Math.floor(index2)));
      const top = i * ROW_H2.value;
      el.scrollTo({ top });
      scrollTop.value = top;
      viewportHeight.value = el.clientHeight || viewportHeight.value;
    }
    __expose({
      scrollToTop() {
        viewportEl.value?.scrollTo({ top: 0 });
      },
      scrollToBottom() {
        const el = viewportEl.value;
        if (el) el.scrollTo({ top: el.scrollHeight });
      },
      scrollToIndex,
      getViewport() {
        return viewportEl.value;
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          ref_key: "viewportEl",
          ref: viewportEl,
          class: "logs-list-viewport le-list-wrap",
          "data-testid": "logs-list-viewport",
          role: "list",
          onScrollPassive: onScroll
        },
        [
          createElementVNode(
            "div",
            {
              class: "logs-list-spacer",
              style: normalizeStyle({ height: win.value.totalHeight + "px", position: "relative" })
            },
            [
              createElementVNode(
                "div",
                {
                  class: "logs-list-window",
                  style: normalizeStyle({
                    transform: `translateY(${win.value.offsetY}px)`,
                    position: "absolute",
                    left: 0,
                    right: 0,
                    top: 0
                  })
                },
                [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(visibleRows.value, (r) => {
                      return openBlock(), createElementBlock("div", {
                        key: r.id,
                        class: normalizeClass(["logLine le-list-entry", {
                          clickable: opts.value.enableLogDetails !== false,
                          detailsDisplayed: __props.openId === r.id,
                          small: opts.value.fontSize === "small" || opts.value.fontSize === "sm",
                          "is-active": __props.openId === r.id
                        }]),
                        role: "listitem",
                        "data-level": r.level,
                        "data-open": __props.openId === r.id,
                        "data-testid": `log-row-${r.id}`,
                        style: normalizeStyle({ minHeight: ROW_H2.value + "px" }),
                        onClick: ($event) => emit("toggle", r)
                      }, [
                        createElementVNode(
                          "div",
                          {
                            class: "le-sev-bar",
                            style: normalizeStyle({ background: unref(severityColor)(r.level) })
                          },
                          null,
                          4
                          /* STYLE */
                        ),
                        createElementVNode("div", _hoisted_2$2f, [
                          createElementVNode("div", _hoisted_3$1$, [
                            !!opts.value.showTime ? (openBlock(), createElementBlock(
                              "span",
                              _hoisted_4$1I,
                              toDisplayString(r.t),
                              1
                              /* TEXT */
                            )) : createCommentVNode("v-if", true),
                            opts.value.showLevel !== false ? (openBlock(), createElementBlock("span", {
                              key: 1,
                              class: normalizeClass(["le-entry-lvl level field", "level-" + r.level]),
                              style: normalizeStyle(unref(severityBadgeStyle)(r.level)),
                              title: r.level
                            }, toDisplayString(r.severityText || "INFO"), 15, _hoisted_5$1x)) : createCommentVNode("v-if", true),
                            r.service ? (openBlock(), createElementBlock("span", {
                              key: 2,
                              class: "le-entry-svc",
                              title: r.service
                            }, toDisplayString(r.service), 9, _hoisted_6$1j)) : createCommentVNode("v-if", true),
                            (openBlock(true), createElementBlock(
                              Fragment,
                              null,
                              renderList(__props.extraColumns || [], (col2) => {
                                return openBlock(), createElementBlock(
                                  "span",
                                  {
                                    key: col2,
                                    class: "le-entry-extra"
                                  },
                                  toDisplayString(unref(getRowAttr)(r, col2) || "—"),
                                  1
                                  /* TEXT */
                                );
                              }),
                              128
                              /* KEYED_FRAGMENT */
                            )),
                            (opts.value.showLabels || opts.value.showLogAttributes !== false) && r.labels && !r.service ? (openBlock(), createElementBlock(
                              "span",
                              _hoisted_7$1a,
                              toDisplayString(r.labels),
                              1
                              /* TEXT */
                            )) : createCommentVNode("v-if", true),
                            createElementVNode("div", _hoisted_8$10, [
                              opts.value.showCopyLogLink ? (openBlock(), createElementBlock("button", {
                                key: 0,
                                type: "button",
                                class: "le-entry-btn",
                                "data-testid": "logs-copy",
                                title: "复制",
                                onClick: withModifiers(($event) => emit("copy", r), ["stop"])
                              }, " 复制 ", 8, _hoisted_9$Y)) : createCommentVNode("v-if", true)
                            ])
                          ]),
                          createElementVNode(
                            "div",
                            {
                              class: normalizeClass(["le-entry-body fieldsWrapper", __props.wrap ? "wrappedLogLine" : "unwrappedLogLine"])
                            },
                            [
                              createElementVNode("span", {
                                class: normalizeClass(["field log-line-body", {
                                  "log-syntax-highlight": opts.value.syntaxHighlighting !== false,
                                  "le-body-clamp": !__props.wrap
                                }]),
                                innerHTML: __props.highlightMsg(r.msg)
                              }, null, 10, _hoisted_10$Q)
                            ],
                            2
                            /* CLASS */
                          ),
                          opts.value.enableLogDetails !== false && __props.openId === r.id && (opts.value.detailsMode || "inline") === "inline" ? (openBlock(), createElementBlock("div", {
                            key: 0,
                            class: "logDetails le-detail-inline",
                            "data-testid": "log-detail",
                            onClick: _cache[0] || (_cache[0] = withModifiers(() => {
                            }, ["stop"]))
                          }, [
                            createElementVNode(
                              "div",
                              {
                                class: "le-detail-strip",
                                style: normalizeStyle({ borderLeftColor: unref(severityColor)(r.level) })
                              },
                              [
                                createElementVNode(
                                  "span",
                                  _hoisted_11$I,
                                  toDisplayString(r.t),
                                  1
                                  /* TEXT */
                                ),
                                createElementVNode(
                                  "pre",
                                  _hoisted_12$B,
                                  toDisplayString(r.msg),
                                  1
                                  /* TEXT */
                                )
                              ],
                              4
                              /* STYLE */
                            ),
                            createElementVNode("div", _hoisted_13$A, [
                              (openBlock(true), createElementBlock(
                                Fragment,
                                null,
                                renderList(__props.detailEntries(r), (e, di) => {
                                  return openBlock(), createElementBlock("div", {
                                    key: di,
                                    class: "fieldsRow"
                                  }, [
                                    createElementVNode(
                                      "div",
                                      _hoisted_14$z,
                                      toDisplayString(e.key),
                                      1
                                      /* TEXT */
                                    ),
                                    createElementVNode(
                                      "div",
                                      _hoisted_15$t,
                                      toDisplayString(e.value),
                                      1
                                      /* TEXT */
                                    )
                                  ]);
                                }),
                                128
                                /* KEYED_FRAGMENT */
                              ))
                            ])
                          ])) : createCommentVNode("v-if", true)
                        ])
                      ], 14, _hoisted_1$2O);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ],
                4
                /* STYLE */
              )
            ],
            4
            /* STYLE */
          ),
          createCommentVNode(" sidebar detail portal target "),
          opts.value.enableLogDetails !== false && __props.openId && opts.value.detailsMode === "sidebar" ? (openBlock(), createElementBlock("aside", _hoisted_16$r, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.rows, (r) => {
                return openBlock(), createElementBlock(
                  Fragment,
                  {
                    key: "side-" + r.id
                  },
                  [
                    r.id === __props.openId ? (openBlock(), createElementBlock("div", _hoisted_17$o, [
                      createElementVNode("div", _hoisted_18$o, [
                        (openBlock(true), createElementBlock(
                          Fragment,
                          null,
                          renderList(__props.detailEntries(r), (e, di) => {
                            return openBlock(), createElementBlock("div", {
                              key: di,
                              class: "fieldsRow"
                            }, [
                              createElementVNode(
                                "div",
                                _hoisted_19$l,
                                toDisplayString(e.key),
                                1
                                /* TEXT */
                              ),
                              createElementVNode(
                                "div",
                                _hoisted_20$j,
                                toDisplayString(e.value),
                                1
                                /* TEXT */
                              )
                            ]);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        ))
                      ])
                    ])) : createCommentVNode("v-if", true)
                  ],
                  64
                  /* STABLE_FRAGMENT */
                );
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : createCommentVNode("v-if", true)
        ],
        544
        /* NEED_HYDRATION, NEED_PATCH */
      );
    };
  }
});
const LogsListRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3B, [["__scopeId", "data-v-8b3e0d1c"]]);
const _hoisted_1$2N = ["data-testid"];
const _sfc_main$3A = /* @__PURE__ */ defineComponent({
  __name: "LogsRawRenderer",
  props: {
    rows: {},
    options: {},
    rowHeight: {}
  },
  setup(__props) {
    const props = __props;
    const viewportEl = ref(null);
    const scrollTop = ref(0);
    const viewportHeight = ref(400);
    const ROW_H2 = computed(() => Math.max(18, Number(props.rowHeight ?? 20)));
    const win = computed(
      () => computeVirtualWindow(
        props.rows.length,
        scrollTop.value,
        viewportHeight.value,
        ROW_H2.value,
        16
      )
    );
    const visibleRows = computed(() => sliceVirtualRows(props.rows, win.value));
    function onScroll() {
      const el = viewportEl.value;
      if (!el) return;
      scrollTop.value = el.scrollTop;
      viewportHeight.value = el.clientHeight;
    }
    let ro = null;
    onMounted(() => {
      onScroll();
      if (typeof ResizeObserver !== "undefined" && viewportEl.value) {
        ro = new ResizeObserver(() => onScroll());
        ro.observe(viewportEl.value);
      }
    });
    onBeforeUnmount(() => ro?.disconnect());
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          ref_key: "viewportEl",
          ref: viewportEl,
          class: "logs-raw-viewport",
          "data-testid": "logs-raw-viewport",
          "data-log-format": "raw",
          onScrollPassive: onScroll
        },
        [
          createElementVNode(
            "div",
            {
              class: "spacer",
              style: normalizeStyle({ height: win.value.totalHeight + "px" })
            },
            [
              createElementVNode(
                "div",
                {
                  class: "window",
                  style: normalizeStyle({ transform: `translateY(${win.value.offsetY}px)` })
                },
                [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(visibleRows.value, (r) => {
                      return openBlock(), createElementBlock("pre", {
                        key: r.id,
                        class: "raw-line",
                        "data-testid": `log-row-${r.id}`,
                        style: normalizeStyle({ minHeight: ROW_H2.value + "px" })
                      }, toDisplayString(r.raw || r.msg), 13, _hoisted_1$2N);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ],
                4
                /* STYLE */
              )
            ],
            4
            /* STYLE */
          )
        ],
        544
        /* NEED_HYDRATION, NEED_PATCH */
      );
    };
  }
});
const LogsRawRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3A, [["__scopeId", "data-v-342f4784"]]);
const _hoisted_1$2M = ["data-frames", "data-log-format", "data-dedup", "data-wrap", "data-sort", "data-show-controls", "data-show-time", "data-show-labels", "data-show-common", "data-prettify", "data-details", "data-details-mode", "data-infinite-scroll", "data-show-level", "data-syntax-highlighting", "data-allow-download", "data-show-field-selector", "data-show-log-attributes", "data-copy-link", "data-font-size", "data-timestamp-resolution", "data-unwrapped-columns"];
const _hoisted_2$2e = { class: "le-actions-bar" };
const _hoisted_3$1_ = { class: "le-ab-label" };
const _hoisted_4$1H = {
  key: 0,
  class: "navContainer",
  "data-testid": "logs-controls"
};
const _hoisted_5$1w = { class: "level-wrap" };
const _hoisted_6$1i = {
  key: 0,
  class: "level-menu"
};
const _hoisted_7$19 = ["onClick"];
const _hoisted_8$$ = { class: "meta" };
const _hoisted_9$X = { class: "main" };
const _hoisted_10$P = {
  key: 0,
  class: "commonLabels",
  "data-testid": "logs-common-labels"
};
const _hoisted_11$H = {
  key: 1,
  class: "frameBar"
};
const _hoisted_12$A = ["value"];
const _hoisted_13$z = {
  key: 2,
  class: "searchBar"
};
const _hoisted_14$y = {
  key: 3,
  class: "labelVolume",
  "data-testid": "logs-label-volume"
};
const _hoisted_15$s = ["onClick"];
const _hoisted_16$q = { class: "vol-label" };
const _hoisted_17$n = { class: "vol-count" };
const _hoisted_18$n = {
  key: 7,
  class: "le-footer"
};
const _sfc_main$3z = /* @__PURE__ */ defineComponent({
  __name: "LogsRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {},
    replaceVariables: { type: Function },
    width: {},
    height: {}
  },
  setup(__props) {
    const props = __props;
    const openId = ref(null);
    const search = ref("");
    const searchVisible = ref(false);
    const levelFilter = ref("all");
    const labelFilter = ref("");
    const frameIndex = ref(0);
    const levelMenuOpen = ref(false);
    const rowsEl = ref(null);
    const wrapLocal = ref(null);
    const extraColumnsLocal = ref(null);
    const opts = computed(() => props.options ?? {});
    const frames = computed(() => props.data?.series ?? []);
    const extraColumns = computed(() => {
      if (extraColumnsLocal.value) return extraColumnsLocal.value;
      const raw = opts.value.extraColumns ?? opts.value.unwrappedColumns;
      if (Array.isArray(raw)) return raw.map(String).filter(Boolean);
      if (typeof raw === "string" && raw.trim()) {
        return raw.split(/[,\s]+/).map((s) => s.trim()).filter(Boolean);
      }
      return [];
    });
    const allRows = computed(() => {
      const list = frames.value;
      if (!list.length) return [];
      return parseLogRowsFromFrames(list, {
        timestampResolution: String(opts.value.timestampResolution ?? "ms"),
        prettifyLogMessage: !!opts.value.prettifyLogMessage,
        enableInfiniteScrolling: !!opts.value.enableInfiniteScrolling,
        dedupStrategy: String(opts.value.dedupStrategy ?? "none"),
        sortOrder: String(opts.value.sortOrder ?? "Descending")
      });
    });
    const commonLabels = computed(() => {
      if (!opts.value.showCommonLabels) return "";
      const all = allRows.value;
      if (!all.length) return "";
      const sets = all.map((r) => {
        const m = /* @__PURE__ */ new Map();
        String(r.labels || "").split(",").map((s) => s.trim()).filter(Boolean).forEach((pair) => {
          const [k, ...rest] = pair.split("=");
          if (k) m.set(k.trim(), rest.join("=").trim());
        });
        return m;
      });
      const first = sets[0];
      const shared2 = [];
      for (const [k, v] of first) {
        if (sets.every((s) => s.get(k) === v)) shared2.push(`${k}=${v}`);
      }
      return shared2.join(", ");
    });
    const labelVolumes = computed(() => {
      const map = /* @__PURE__ */ new Map();
      for (const r of allRows.value) {
        const parts = r.labels ? r.labels.split(/[,;\s]+/).filter(Boolean) : [r.level];
        for (const p of parts) map.set(p, (map.get(p) ?? 0) + 1);
      }
      return [...map.entries()].sort((a, b) => b[1] - a[1]).slice(0, 20).map(([label, count]) => ({ label, count }));
    });
    const rows = computed(() => {
      let list = allRows.value;
      if (levelFilter.value !== "all") {
        const lf = levelFilter.value === "warn" ? "warning" : levelFilter.value;
        list = list.filter(
          (r) => r.level === lf || lf === "warning" && r.level === "warn"
        );
      }
      if (labelFilter.value) {
        const lf = labelFilter.value.toLowerCase();
        list = list.filter(
          (r) => r.labels.toLowerCase().includes(lf) || r.level.toLowerCase() === lf || r.msg.toLowerCase().includes(lf)
        );
      }
      const q = search.value.trim().toLowerCase();
      if (q) {
        list = list.filter(
          (r) => r.msg.toLowerCase().includes(q) || r.labels.toLowerCase().includes(q) || r.level.includes(q) || r.service.toLowerCase().includes(q)
        );
      }
      return list;
    });
    const showControls = computed(() => opts.value.showControls === true);
    const wrapOn = computed(() => !!opts.value.wrapLogMessage);
    const wrapEffective = computed(
      () => wrapLocal.value === null ? wrapOn.value : wrapLocal.value
    );
    const levels = ["all", "critical", "error", "warning", "info", "debug", "trace"];
    function toggleRow(row) {
      if (opts.value.enableLogDetails === false) return;
      openId.value = openId.value === row.id ? null : row.id;
    }
    function copyLink(r) {
      try {
        void navigator.clipboard?.writeText(`${r.t} ${r.level} ${r.raw}`);
      } catch {
      }
    }
    function download() {
      if (!opts.value.allowDownload) return;
      const text = rows.value.map((r) => `${r.t}	${r.level}	${r.labels}	${r.raw}`).join("\n");
      const blob = new Blob([text], { type: "text/plain;charset=utf-8" });
      const url = URL.createObjectURL(blob);
      const a = document.createElement("a");
      a.href = url;
      a.download = "logs.txt";
      a.click();
      URL.revokeObjectURL(url);
    }
    function scrollTop() {
      rowsEl.value?.scrollTo({ top: 0 });
    }
    function scrollBottom() {
      const el = rowsEl.value;
      if (el) el.scrollTo({ top: el.scrollHeight });
    }
    function toggleSearch() {
      searchVisible.value = !searchVisible.value;
      if (searchVisible.value) {
        nextTick(() => {
          document.querySelector(
            '[data-testid="logs-search"]'
          )?.focus();
        });
      } else {
        search.value = "";
      }
    }
    function setLevel(lv) {
      levelFilter.value = lv;
      levelMenuOpen.value = false;
    }
    function escapeHtml(s) {
      return s.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
    }
    function highlightMsg(msg) {
      const q = search.value.trim();
      if (!q || opts.value.syntaxHighlighting === false) return escapeHtml(msg);
      const esc = escapeHtml(msg);
      const re = new RegExp(
        `(${q.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
        "gi"
      );
      return esc.replace(re, '<mark class="log-search-match">$1</mark>');
    }
    function detailEntries(r) {
      const entries = [
        { key: "Time", value: r.t || "—" },
        { key: "level", value: r.level }
      ];
      if (r.service) entries.push({ key: "service.name", value: r.service });
      if (r.traceId) entries.push({ key: "traceId", value: r.traceId });
      if (r.labels) {
        for (const part of r.labels.split(",").map((s) => s.trim()).filter(Boolean)) {
          const eq = part.indexOf("=");
          if (eq > 0)
            entries.push({ key: part.slice(0, eq), value: part.slice(eq + 1) });
          else entries.push({ key: "label", value: part });
        }
      }
      for (const col2 of extraColumns.value) {
        const v = getRowAttr(r, col2);
        if (v) entries.push({ key: col2, value: v });
      }
      entries.push({ key: "Line", value: r.msg });
      return entries;
    }
    watch(showControls, (v) => {
      if (v) searchVisible.value = true;
    });
    if (showControls.value) searchVisible.value = true;
    function onKeydownEscape(ev) {
      if (ev.key !== "Escape") return;
      if (openId.value != null) {
        openId.value = null;
        ev.stopPropagation();
      }
    }
    onMounted(() => window.addEventListener("keydown", onKeydownEscape));
    onBeforeUnmount(() => window.removeEventListener("keydown", onKeydownEscape));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "logs",
        "data-testid": "panel-logs",
        "data-frames": String(frames.value.length),
        "data-log-format": String(opts.value.logFormat || "list"),
        "data-dedup": String(opts.value.dedupStrategy ?? "none"),
        "data-wrap": String(!!wrapEffective.value),
        "data-sort": String(opts.value.sortOrder ?? "Descending"),
        "data-show-controls": String(!!showControls.value),
        "data-show-time": String(!!opts.value.showTime),
        "data-show-labels": String(!!opts.value.showLabels),
        "data-show-common": String(!!opts.value.showCommonLabels),
        "data-prettify": String(!!opts.value.prettifyLogMessage),
        "data-details": String(opts.value.enableLogDetails !== false),
        "data-details-mode": String(opts.value.detailsMode ?? "inline"),
        "data-infinite-scroll": String(!!opts.value.enableInfiniteScrolling),
        "data-show-level": String(opts.value.showLevel !== false),
        "data-syntax-highlighting": String(opts.value.syntaxHighlighting !== false),
        "data-allow-download": String(!!opts.value.allowDownload),
        "data-show-field-selector": String(!!opts.value.showFieldSelector),
        "data-show-log-attributes": String(opts.value.showLogAttributes !== false),
        "data-copy-link": String(!!opts.value.showCopyLogLink),
        "data-font-size": String(opts.value.fontSize ?? "default"),
        "data-timestamp-resolution": String(opts.value.timestampResolution ?? "ms"),
        "data-unwrapped-columns": String(opts.value.unwrappedColumns ?? "")
      }, [
        createElementVNode("div", _hoisted_2$2e, [
          createElementVNode(
            "span",
            _hoisted_3$1_,
            toDisplayString(rows.value.length) + " 条日志",
            1
            /* TEXT */
          )
        ]),
        createElementVNode(
          "div",
          {
            class: normalizeClass(["le-shell", { "with-controls": showControls.value }])
          },
          [
            showControls.value ? (openBlock(), createElementBlock("div", _hoisted_4$1H, [
              createElementVNode(
                "button",
                {
                  type: "button",
                  class: normalizeClass(["ctrl", { active: wrapEffective.value }]),
                  title: "换行",
                  onClick: _cache[0] || (_cache[0] = ($event) => wrapLocal.value = !wrapEffective.value)
                },
                " ↵ ",
                2
                /* CLASS */
              ),
              createElementVNode("button", {
                type: "button",
                class: "ctrl",
                title: "搜索",
                onClick: toggleSearch
              }, " ⌕ "),
              createElementVNode("div", _hoisted_5$1w, [
                createElementVNode("button", {
                  type: "button",
                  class: "ctrl",
                  title: "级别",
                  "data-testid": "logs-level-filter",
                  onClick: _cache[1] || (_cache[1] = ($event) => levelMenuOpen.value = !levelMenuOpen.value)
                }, " ≡ "),
                levelMenuOpen.value ? (openBlock(), createElementBlock("div", _hoisted_6$1i, [
                  (openBlock(), createElementBlock(
                    Fragment,
                    null,
                    renderList(levels, (lv) => {
                      return createElementVNode("button", {
                        key: lv,
                        type: "button",
                        class: normalizeClass({ active: levelFilter.value === lv }),
                        onClick: ($event) => setLevel(lv)
                      }, toDisplayString(lv), 11, _hoisted_7$19);
                    }),
                    64
                    /* STABLE_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true)
              ]),
              opts.value.allowDownload ? (openBlock(), createElementBlock("button", {
                key: 0,
                type: "button",
                class: "ctrl",
                title: "下载",
                "data-testid": "logs-download",
                onClick: download
              }, " ↓ ")) : createCommentVNode("v-if", true),
              createElementVNode("button", {
                type: "button",
                class: "ctrl",
                title: "顶部",
                "data-testid": "scrollToTop",
                onClick: scrollTop
              }, " ↑ "),
              createElementVNode("button", {
                type: "button",
                class: "ctrl",
                title: "底部",
                onClick: scrollBottom
              }, " ↓ "),
              createElementVNode(
                "span",
                _hoisted_8$$,
                toDisplayString(rows.value.length),
                1
                /* TEXT */
              )
            ])) : createCommentVNode("v-if", true),
            createElementVNode("div", _hoisted_9$X, [
              opts.value.showCommonLabels && commonLabels.value ? (openBlock(), createElementBlock(
                "div",
                _hoisted_10$P,
                toDisplayString(commonLabels.value),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              frames.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_11$H, [
                withDirectives(createElementVNode(
                  "select",
                  {
                    "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => frameIndex.value = $event),
                    "data-testid": "logs-frame-select"
                  },
                  [
                    (openBlock(true), createElementBlock(
                      Fragment,
                      null,
                      renderList(frames.value, (f, i) => {
                        return openBlock(), createElementBlock("option", {
                          key: i,
                          value: i
                        }, " 序列 " + toDisplayString(i + 1), 9, _hoisted_12$A);
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    ))
                  ],
                  512
                  /* NEED_PATCH */
                ), [
                  [
                    vModelSelect,
                    frameIndex.value,
                    void 0,
                    { number: true }
                  ]
                ])
              ])) : createCommentVNode("v-if", true),
              showControls.value || searchVisible.value ? (openBlock(), createElementBlock("div", _hoisted_13$z, [
                withDirectives(createElementVNode(
                  "input",
                  {
                    "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => search.value = $event),
                    type: "search",
                    placeholder: "搜索日志…",
                    "data-testid": "logs-search"
                  },
                  null,
                  512
                  /* NEED_PATCH */
                ), [
                  [vModelText, search.value]
                ])
              ])) : createCommentVNode("v-if", true),
              opts.value.showLabels && labelVolumes.value.length ? (openBlock(), createElementBlock("aside", _hoisted_14$y, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(labelVolumes.value, (v) => {
                    return openBlock(), createElementBlock("div", {
                      key: v.label,
                      class: "vol",
                      onClick: ($event) => labelFilter.value = labelFilter.value === v.label ? "" : v.label
                    }, [
                      createElementVNode(
                        "span",
                        _hoisted_16$q,
                        toDisplayString(v.label),
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "span",
                        _hoisted_17$n,
                        toDisplayString(v.count),
                        1
                        /* TEXT */
                      )
                    ], 8, _hoisted_15$s);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])) : createCommentVNode("v-if", true),
              createCommentVNode(" LIST / RAW (virtualized) "),
              rows.value.length && String(opts.value.logFormat || "list") === "raw" ? (openBlock(), createBlock(LogsRawRenderer, {
                key: 4,
                rows: rows.value,
                options: opts.value
              }, null, 8, ["rows", "options"])) : rows.value.length ? (openBlock(), createBlock(LogsListRenderer, {
                key: 5,
                ref: "listRef",
                rows: rows.value,
                options: opts.value,
                "open-id": openId.value,
                wrap: wrapEffective.value,
                "extra-columns": extraColumns.value,
                "highlight-msg": highlightMsg,
                "detail-entries": detailEntries,
                onToggle: toggleRow,
                onCopy: copyLink
              }, null, 8, ["rows", "options", "open-id", "wrap", "extra-columns"])) : (openBlock(), createBlock(PanelDataErrorView, {
                key: 6,
                data: __props.data,
                "needs-string-field": true,
                "needs-time-field": true
              }, null, 8, ["data"])),
              rows.value.length && opts.value.enableInfiniteScrolling ? (openBlock(), createElementBlock(
                "div",
                _hoisted_18$n,
                " 已加载 " + toDisplayString(rows.value.length) + " 条 ",
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true)
            ])
          ],
          2
          /* CLASS */
        )
      ], 8, _hoisted_1$2M);
    };
  }
});
const LogsRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3z, [["__scopeId", "data-v-7a47a026"]]);
const _sfc_main$3y = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(LogsRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  { id: "logs", name: "日志", state: "stable", skipDataQuery: false },
  _sfc_main$3y
).setPanelOptions((builder) => {
  const cat = ["日志"];
  builder.addBoolean(
    {
      id: "showTime",
      path: "showTime",
      name: "时间",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showLabels",
      path: "showLabels",
      name: "唯一标签",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showCommonLabels",
      path: "showCommonLabels",
      name: "公共标签",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "wrapLogMessage",
      path: "wrapLogMessage",
      name: "自动换行",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "prettifyLogMessage",
      path: "prettifyLogMessage",
      name: "美化 JSON",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "enableLogDetails",
      path: "enableLogDetails",
      name: "启用日志详情",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "enableInfiniteScrolling",
      path: "enableInfiniteScrolling",
      name: "无限滚动",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showControls",
      path: "showControls",
      name: "显示控件",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showLevel",
      path: "showLevel",
      name: "显示日志级别",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "syntaxHighlighting",
      path: "syntaxHighlighting",
      name: "语法高亮",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "enableLogDetails",
      path: "enableLogDetails",
      name: "日志详情",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "allowDownload",
      path: "allowDownload",
      name: "允许下载",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showFieldSelector",
      path: "showFieldSelector",
      name: "显示字段选择器",
      category: cat,
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showLogAttributes",
      path: "showLogAttributes",
      name: "显示日志属性",
      category: cat,
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "showCopyLogLink",
      path: "showCopyLogLink",
      name: "显示复制链接",
      category: cat,
      editor: "boolean"
    },
    false
  ).addSelect(
    {
      id: "sortOrder",
      path: "sortOrder",
      name: "顺序",
      category: cat,
      editor: "select",
      settings: {
        options: [
          { label: "最新在前", value: "Descending" },
          { label: "最旧在前", value: "Ascending" }
        ]
      }
    },
    "Descending"
  ).addSelect(
    {
      id: "dedupStrategy",
      path: "dedupStrategy",
      name: "去重",
      category: cat,
      editor: "select",
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "精确", value: "exact" },
          { label: "数字", value: "numbers" },
          { label: "签名", value: "signature" }
        ]
      }
    },
    "none"
  ).addRadio(
    {
      id: "detailsMode",
      path: "detailsMode",
      name: "详情模式",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "内联", value: "inline" },
          { label: "侧栏", value: "sidebar" }
        ]
      }
    },
    "inline"
  ).addSelect(
    {
      id: "fontSize",
      path: "fontSize",
      name: "字号",
      category: cat,
      editor: "select",
      settings: {
        options: [
          { label: "默认", value: "default" },
          { label: "小", value: "small" }
        ]
      }
    },
    "default"
  ).addSelect(
    {
      id: "timestampResolution",
      path: "timestampResolution",
      name: "时间戳精度",
      category: cat,
      editor: "select",
      settings: {
        options: [
          { label: "ms", value: "ms" },
          { label: "µs", value: "us" },
          { label: "ns", value: "ns" }
        ]
      }
    },
    "ms"
  ).addBoolean(
    {
      id: "unwrappedColumns",
      path: "unwrappedColumns",
      name: "展开列",
      category: cat,
      editor: "boolean"
    },
    false
  ).addRadio(
    {
      id: "logFormat",
      path: "logFormat",
      name: "日志格式",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "原始", value: "raw" },
          { label: "列表", value: "list" },
          { label: "列", value: "table" }
        ]
      }
    },
    "list"
  ).addNumber(
    {
      id: "rawMaxLines",
      path: "rawMaxLines",
      name: "原始最大行数",
      category: cat,
      editor: "number",
      showIf: (c) => c.logFormat === "raw"
    },
    1
  ).addText(
    {
      id: "extraColumns",
      path: "extraColumns",
      name: "额外列",
      category: cat,
      editor: "text",
      showIf: (c) => c.logFormat !== "raw"
    },
    ""
  );
}).setRuntimeConsumedPaths([
  "showTime",
  "showLabels",
  "showCommonLabels",
  "wrapLogMessage",
  "prettifyLogMessage",
  "enableLogDetails",
  "enableInfiniteScrolling",
  "showControls",
  "showLevel",
  "syntaxHighlighting",
  "allowDownload",
  "showFieldSelector",
  "showLogAttributes",
  "showCopyLogLink",
  "sortOrder",
  "dedupStrategy",
  "detailsMode",
  "fontSize",
  "timestampResolution",
  "unwrappedColumns",
  "extraColumns"
]).register();
const _hoisted_1$2L = { class: "ld-content" };
const _hoisted_2$2d = { class: "ld-header" };
const _hoisted_3$1Z = { class: "ld-header-left" };
const _hoisted_4$1G = { class: "ld-header-actions" };
const _hoisted_5$1v = { class: "ld-body-ts" };
const _hoisted_6$1h = ["title"];
const _hoisted_7$18 = { class: "ld-tabs" };
const _hoisted_8$_ = ["onClick"];
const _hoisted_9$W = { class: "ld-scroll" };
const _hoisted_10$O = {
  key: 0,
  class: "lov-root"
};
const _hoisted_11$G = { class: "lov-key" };
const _hoisted_12$z = { class: "lov-val" };
const _hoisted_13$y = {
  key: 1,
  class: "ljc-root"
};
const _hoisted_14$x = ["innerHTML"];
const _hoisted_15$r = {
  key: 2,
  class: "ld-stub"
};
const _hoisted_16$p = { class: "lov-row" };
const _hoisted_17$m = { class: "lov-val" };
const _hoisted_18$m = { class: "lov-row" };
const _hoisted_19$k = { class: "lov-val" };
const _hoisted_20$i = {
  key: 3,
  class: "ld-stub"
};
const _sfc_main$3x = /* @__PURE__ */ defineComponent({
  __name: "ArgusLogDetail",
  props: {
    open: { type: Boolean },
    row: {},
    initialTab: {}
  },
  emits: ["close"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const activeTab = ref(props.initialTab ?? "overview");
    watch(
      () => props.open,
      (v) => {
        if (v) activeTab.value = props.initialTab ?? "overview";
      }
    );
    watch(
      () => props.initialTab,
      (t2) => {
        if (t2) activeTab.value = t2;
      }
    );
    const tabs = [
      { key: "overview", label: "概览" },
      { key: "json", label: "JSON" },
      { key: "context", label: "上下文" },
      { key: "metrics", label: "指标" }
    ];
    const sev = computed(
      () => props.row ? severityColor(props.row.level) : severityColor("unknown")
    );
    const bodyPreview = computed(() => props.row?.msg || props.row?.body || "");
    const tsText = computed(() => {
      if (!props.row) return "";
      return props.row.t || formatLogTimestamp(props.row.timestamp);
    });
    const overviewFields = computed(() => {
      const row = props.row;
      if (!row) return [];
      const fields = [
        { key: "timestamp", value: tsText.value || "—" },
        { key: "severity", value: row.severityText || row.level },
        { key: "service.name", value: row.service || "—" },
        { key: "traceId", value: row.traceId || "—" },
        { key: "body", value: row.body || "—" }
      ];
      for (const [k, v] of Object.entries(row.resources)) {
        if (!fields.some((f) => f.key === k)) fields.push({ key: k, value: v });
      }
      for (const [k, v] of Object.entries(row.attributes)) {
        if (!fields.some((f) => f.key === k)) fields.push({ key: k, value: v });
      }
      for (const [k, v] of Object.entries(row.fields)) {
        if (/time|line|message|body|level|severity/i.test(k) || fields.some((f) => f.key === k))
          continue;
        fields.push({ key: k, value: v });
      }
      return fields;
    });
    const jsonText = computed(() => {
      if (!props.row) return "";
      try {
        return JSON.stringify(rowToDetailObject(props.row), null, 2);
      } catch {
        return props.row.raw;
      }
    });
    function esc(s) {
      return s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
    }
    const highlightedJson = computed(
      () => esc(jsonText.value).replaceAll(
        /("(\\u[\dA-Fa-f]{4}|\\[^u]|[^"\\])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[Ee][+-]?\d+)?)/g,
        (m) => {
          if (m.startsWith('"')) {
            if (m.endsWith(":")) return `<span class="t-key">${m}</span>`;
            return `<span class="t-str">${m}</span>`;
          }
          if (/true|false/.test(m)) return `<span class="t-bool">${m}</span>`;
          if (/null/.test(m)) return `<span class="t-null">${m}</span>`;
          return `<span class="t-num">${m}</span>`;
        }
      )
    );
    async function copyContent() {
      try {
        const text = activeTab.value === "json" ? jsonText.value : bodyPreview.value;
        await navigator.clipboard?.writeText(text);
      } catch {
      }
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(Transition, { name: "le-panel" }, {
        default: withCtx(() => [
          __props.open && __props.row ? (openBlock(), createElementBlock("aside", {
            key: 0,
            class: "le-detail-panel",
            "data-testid": "log-details",
            onClick: _cache[1] || (_cache[1] = withModifiers(() => {
            }, ["stop"]))
          }, [
            createElementVNode("div", _hoisted_1$2L, [
              createElementVNode("div", _hoisted_2$2d, [
                createElementVNode("div", _hoisted_3$1Z, [
                  createElementVNode(
                    "div",
                    {
                      class: "ld-sev-bar",
                      style: normalizeStyle({ background: sev.value })
                    },
                    null,
                    4
                    /* STYLE */
                  ),
                  _cache[2] || (_cache[2] = createElementVNode(
                    "span",
                    { class: "ld-title" },
                    "日志详情",
                    -1
                    /* CACHED */
                  ))
                ]),
                createElementVNode("div", _hoisted_4$1G, [
                  createElementVNode("button", {
                    type: "button",
                    class: "ld-icon-btn",
                    title: "复制",
                    "data-testid": "logs-copy",
                    onClick: copyContent
                  }, " 复制 "),
                  createElementVNode("button", {
                    type: "button",
                    class: "ld-icon-btn",
                    title: "关闭",
                    onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
                  }, " ✕ ")
                ])
              ]),
              createElementVNode(
                "div",
                {
                  class: "ld-body-strip",
                  style: normalizeStyle({ borderLeftColor: sev.value })
                },
                [
                  createElementVNode(
                    "span",
                    _hoisted_5$1v,
                    toDisplayString(tsText.value),
                    1
                    /* TEXT */
                  ),
                  createElementVNode("pre", {
                    class: "ld-body-text",
                    title: bodyPreview.value
                  }, toDisplayString(bodyPreview.value), 9, _hoisted_6$1h)
                ],
                4
                /* STYLE */
              ),
              createElementVNode("div", _hoisted_7$18, [
                (openBlock(), createElementBlock(
                  Fragment,
                  null,
                  renderList(tabs, (tab) => {
                    return createElementVNode("button", {
                      key: tab.key,
                      type: "button",
                      class: normalizeClass(["ld-tab", { "ld-tab--active": activeTab.value === tab.key }]),
                      onClick: ($event) => activeTab.value = tab.key
                    }, toDisplayString(tab.label), 11, _hoisted_8$_);
                  }),
                  64
                  /* STABLE_FRAGMENT */
                ))
              ]),
              createElementVNode("div", _hoisted_9$W, [
                activeTab.value === "overview" ? (openBlock(), createElementBlock("div", _hoisted_10$O, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(overviewFields.value, (f) => {
                      return openBlock(), createElementBlock("div", {
                        key: f.key,
                        class: "lov-row"
                      }, [
                        createElementVNode(
                          "div",
                          _hoisted_11$G,
                          toDisplayString(f.key),
                          1
                          /* TEXT */
                        ),
                        createElementVNode(
                          "div",
                          _hoisted_12$z,
                          toDisplayString(f.value),
                          1
                          /* TEXT */
                        )
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : activeTab.value === "json" ? (openBlock(), createElementBlock("div", _hoisted_13$y, [
                  createElementVNode("div", { class: "ljc-toolbar" }, [
                    _cache[3] || (_cache[3] = createElementVNode(
                      "span",
                      { class: "ljc-lang" },
                      "JSON",
                      -1
                      /* CACHED */
                    )),
                    createElementVNode("button", {
                      type: "button",
                      class: "ljc-copy-btn",
                      onClick: copyContent
                    }, " 复制 ")
                  ]),
                  createCommentVNode(" eslint-disable-next-line vue/no-v-html "),
                  createElementVNode("pre", {
                    class: "ljc-pre",
                    innerHTML: highlightedJson.value
                  }, null, 8, _hoisted_14$x)
                ])) : activeTab.value === "context" ? (openBlock(), createElementBlock("div", _hoisted_15$r, [
                  _cache[6] || (_cache[6] = createElementVNode(
                    "p",
                    null,
                    "上下文需查询 API，面板内展示当前日志前后字段摘要。",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode("div", _hoisted_16$p, [
                    _cache[4] || (_cache[4] = createElementVNode(
                      "div",
                      { class: "lov-key" },
                      "service",
                      -1
                      /* CACHED */
                    )),
                    createElementVNode(
                      "div",
                      _hoisted_17$m,
                      toDisplayString(__props.row.service || "—"),
                      1
                      /* TEXT */
                    )
                  ]),
                  createElementVNode("div", _hoisted_18$m, [
                    _cache[5] || (_cache[5] = createElementVNode(
                      "div",
                      { class: "lov-key" },
                      "traceId",
                      -1
                      /* CACHED */
                    )),
                    createElementVNode(
                      "div",
                      _hoisted_19$k,
                      toDisplayString(__props.row.traceId || "—"),
                      1
                      /* TEXT */
                    )
                  ])
                ])) : (openBlock(), createElementBlock("div", _hoisted_20$i, [..._cache[7] || (_cache[7] = [
                  createElementVNode(
                    "p",
                    null,
                    "指标视图需要聚合查询；面板模式下暂无关联时序数据。",
                    -1
                    /* CACHED */
                  )
                ])]))
              ])
            ])
          ])) : createCommentVNode("v-if", true)
        ]),
        _: 1
        /* STABLE */
      });
    };
  }
});
const ArgusLogDetail = /* @__PURE__ */ _export_sfc(_sfc_main$3x, [["__scopeId", "data-v-0cd1970b"]]);
const _hoisted_1$2K = ["data-show-controls", "data-enable-log-details", "data-allow-download", "data-show-copy", "data-show-copy-log-link", "data-logs-compatible", "data-show-time", "data-wrap", "data-prettify"];
const _hoisted_2$2c = { class: "le-actions-bar" };
const _hoisted_3$1Y = { class: "le-actions-left" };
const _hoisted_4$1F = { class: "le-ab-label" };
const _hoisted_5$1u = { class: "le-actions-right" };
const _hoisted_6$1g = { class: "le-options-wrap" };
const _hoisted_7$17 = ["value"];
const _hoisted_8$Z = {
  key: 0,
  class: "le-extra-chips"
};
const _hoisted_9$V = ["onClick"];
const _hoisted_10$N = {
  key: 0,
  class: "navContainer",
  "data-testid": "logstable-controls"
};
const _hoisted_11$F = { class: "meta" };
const _hoisted_12$y = { class: "main" };
const _hoisted_13$x = {
  key: 0,
  class: "time"
};
const _hoisted_14$w = {
  key: 1,
  class: "act"
};
const _hoisted_15$q = ["data-open", "data-level", "onClick"];
const _hoisted_16$o = { class: "sev" };
const _hoisted_17$l = {
  key: 0,
  class: "time"
};
const _hoisted_18$l = { class: "le-ts" };
const _hoisted_19$j = { class: "level" };
const _hoisted_20$h = { class: "service" };
const _hoisted_21$d = { class: "mono" };
const _hoisted_22$c = { class: "body" };
const _hoisted_23$8 = { class: "mono body-cell" };
const _hoisted_24$8 = { class: "trace" };
const _hoisted_25$8 = { class: "trace-id" };
const _hoisted_26$7 = {
  key: 1,
  class: "act"
};
const _hoisted_27$6 = ["onClick"];
const _hoisted_28$6 = {
  key: 0,
  class: "empty"
};
const ROW_H$1 = 32;
const _sfc_main$3w = /* @__PURE__ */ defineComponent({
  __name: "LogsTableRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {},
    replaceVariables: { type: Function },
    width: {},
    height: {}
  },
  setup(__props) {
    const props = __props;
    const openId = ref(null);
    const optionsVisible = ref(false);
    const wrapLocal = ref(null);
    const extraColumnsLocal = ref(null);
    const opts = computed(() => props.options ?? {});
    const frames = computed(() => props.data?.series ?? []);
    const showControls = computed(() => opts.value.showControls !== false);
    const enableLogDetails = computed(() => opts.value.enableLogDetails !== false);
    const allowDownload = computed(() => !!opts.value.allowDownload);
    const showCopyLogLink = computed(() => opts.value.showCopyLogLink !== false);
    const showTime = computed(() => opts.value.showTime !== false);
    const prettifyLogMessage = computed(() => !!opts.value.prettifyLogMessage);
    const wrapOn = computed(() => !!opts.value.wrapLogMessage);
    const wrapEffective = computed(
      () => wrapLocal.value === null ? wrapOn.value : wrapLocal.value
    );
    const extraColumns = computed(() => {
      if (extraColumnsLocal.value) return extraColumnsLocal.value;
      const raw = opts.value.extraColumns;
      if (Array.isArray(raw)) return raw.map(String).filter(Boolean);
      if (typeof raw === "string" && raw.trim()) {
        return raw.split(/[,\s]+/).map((s) => s.trim()).filter(Boolean);
      }
      return [];
    });
    const logsCompatible = computed(() => {
      const frame = frames.value[0];
      if (!frame?.fields?.length) return false;
      const hasTime = frame.fields.some((f) => f.type === "time");
      const hasString = frame.fields.some((f) => f.type === "string");
      return hasTime && hasString;
    });
    const availableColumnNames = computed(() => {
      const frame = frames.value[0];
      if (!frame) return [];
      const names = /* @__PURE__ */ new Set();
      for (const f of frame.fields || []) {
        const n = String(f.name || "");
        if (!n || /time|Time/i.test(n)) continue;
        if (/line|message|msg|body|Log/i.test(n)) continue;
        if (/level|severity/i.test(n)) continue;
        names.add(n);
        const sample = f.values?.[0];
        if (sample && typeof sample === "object" && !Array.isArray(sample)) {
          Object.keys(sample).forEach((k) => names.add(k));
        }
      }
      names.add("service.name");
      names.add("traceId");
      return [...names].sort();
    });
    const rows = computed(() => {
      const list = frames.value;
      if (!list.length) return [];
      return parseLogRowsFromFrames(list, {
        prettifyLogMessage: prettifyLogMessage.value,
        sortOrder: "Descending"
      });
    });
    const tableViewport = ref(null);
    const scrollTop = ref(0);
    const viewportHeight = ref(400);
    const virtualWin = computed(
      () => computeVirtualWindow(rows.value.length, scrollTop.value, viewportHeight.value, ROW_H$1, 10)
    );
    const visibleRows = computed(() => sliceVirtualRows(rows.value, virtualWin.value));
    function onTableScroll() {
      const el = tableViewport.value;
      if (!el) return;
      scrollTop.value = el.scrollTop;
      viewportHeight.value = el.clientHeight || 400;
    }
    let tableRo = null;
    onMounted(() => {
      onTableScroll();
      if (typeof ResizeObserver !== "undefined" && tableViewport.value) {
        tableRo = new ResizeObserver(() => onTableScroll());
        tableRo.observe(tableViewport.value);
      }
    });
    onBeforeUnmount(() => tableRo?.disconnect());
    const activeRow = computed(
      () => rows.value.find((r) => r.id === openId.value) ?? null
    );
    function toggleRow(row) {
      if (!enableLogDetails.value) return;
      openId.value = openId.value === row.id ? null : row.id;
    }
    function closeDetail() {
      openId.value = null;
    }
    async function copyRow(r) {
      try {
        await navigator.clipboard?.writeText(r.raw);
      } catch {
      }
    }
    function downloadCsv() {
      if (!allowDownload.value) return;
      const cols = [
        ...showTime.value ? ["timestamp"] : [],
        "severity",
        "service",
        ...extraColumns.value,
        "body",
        "traceId"
      ];
      const header = cols.join(",");
      const body = rows.value.map(
        (r) => cols.map((c) => {
          let v = "";
          if (c === "timestamp") v = r.t;
          else if (c === "severity") v = r.severityText;
          else if (c === "service") v = r.service;
          else if (c === "body") v = r.raw;
          else if (c === "traceId") v = r.traceId;
          else v = getRowAttr(r, c);
          return `"${String(v).replace(/"/g, '""')}"`;
        }).join(",")
      ).join("\n");
      const blob = new Blob([header + "\n" + body], {
        type: "text/csv;charset=utf-8"
      });
      const url = URL.createObjectURL(blob);
      const a = document.createElement("a");
      a.href = url;
      a.download = "logs-table.csv";
      a.click();
      URL.revokeObjectURL(url);
    }
    function addColumn(name) {
      if (!name || extraColumns.value.includes(name)) return;
      extraColumnsLocal.value = [...extraColumns.value, name];
    }
    function removeColumn(name) {
      extraColumnsLocal.value = extraColumns.value.filter((c) => c !== name);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["logstable", {
          "logstable--wrap": wrapEffective.value,
          "logstable--prettify": prettifyLogMessage.value
        }]),
        "data-testid": "panel-logstable",
        "data-show-controls": String(showControls.value),
        "data-enable-log-details": String(enableLogDetails.value),
        "data-allow-download": String(allowDownload.value),
        "data-show-copy": String(showCopyLogLink.value),
        "data-show-copy-log-link": String(showCopyLogLink.value),
        "data-logs-compatible": String(logsCompatible.value),
        "data-show-time": String(showTime.value),
        "data-wrap": String(wrapEffective.value),
        "data-prettify": String(prettifyLogMessage.value)
      }, [
        !logsCompatible.value ? (openBlock(), createBlock(PanelDataErrorView, {
          key: 0,
          data: __props.data,
          "field-config": __props.fieldConfig,
          "needs-string-field": true,
          "needs-time-field": true
        }, null, 8, ["data", "field-config"])) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createCommentVNode(" Argus actions bar "),
            createElementVNode("div", _hoisted_2$2c, [
              createElementVNode("div", _hoisted_3$1Y, [
                createElementVNode(
                  "span",
                  _hoisted_4$1F,
                  toDisplayString(rows.value.length) + " 条日志",
                  1
                  /* TEXT */
                )
              ]),
              createElementVNode("div", _hoisted_5$1u, [
                createElementVNode("div", _hoisted_6$1g, [
                  createElementVNode(
                    "button",
                    {
                      type: "button",
                      class: normalizeClass(["le-options-btn", { active: optionsVisible.value }]),
                      "data-testid": "logstable-options",
                      onClick: _cache[0] || (_cache[0] = ($event) => optionsVisible.value = !optionsVisible.value)
                    },
                    " 选项 ",
                    2
                    /* CLASS */
                  ),
                  optionsVisible.value ? (openBlock(), createElementBlock("div", {
                    key: 0,
                    class: "le-opts-popper",
                    onClick: _cache[2] || (_cache[2] = withModifiers(() => {
                    }, ["stop"]))
                  }, [
                    _cache[5] || (_cache[5] = createElementVNode(
                      "div",
                      { class: "le-opts-label" },
                      "添加列",
                      -1
                      /* CACHED */
                    )),
                    createElementVNode(
                      "select",
                      {
                        class: "le-select",
                        "data-testid": "logstable-add-column",
                        onChange: _cache[1] || (_cache[1] = ($event) => {
                          addColumn($event.target.value);
                          $event.target.value = "";
                        })
                      },
                      [
                        _cache[4] || (_cache[4] = createElementVNode(
                          "option",
                          { value: "" },
                          "选择字段…",
                          -1
                          /* CACHED */
                        )),
                        (openBlock(true), createElementBlock(
                          Fragment,
                          null,
                          renderList(availableColumnNames.value.filter(
                            (c) => !extraColumns.value.includes(c)
                          ), (n) => {
                            return openBlock(), createElementBlock("option", {
                              key: n,
                              value: n
                            }, toDisplayString(n), 9, _hoisted_7$17);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        ))
                      ],
                      32
                      /* NEED_HYDRATION */
                    ),
                    extraColumns.value.length ? (openBlock(), createElementBlock("div", _hoisted_8$Z, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(extraColumns.value, (c) => {
                          return openBlock(), createElementBlock("span", {
                            key: c,
                            class: "chip",
                            onClick: ($event) => removeColumn(c)
                          }, toDisplayString(c) + " ×", 9, _hoisted_9$V);
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ])) : createCommentVNode("v-if", true)
                  ])) : createCommentVNode("v-if", true)
                ])
              ])
            ]),
            createElementVNode(
              "div",
              {
                class: normalizeClass(["le-shell", { "with-controls": showControls.value }])
              },
              [
                showControls.value ? (openBlock(), createElementBlock("div", _hoisted_10$N, [
                  createElementVNode(
                    "button",
                    {
                      type: "button",
                      class: normalizeClass(["ctrl", { active: wrapEffective.value }]),
                      title: "换行",
                      onClick: _cache[3] || (_cache[3] = ($event) => wrapLocal.value = !wrapEffective.value)
                    },
                    " ↵ ",
                    2
                    /* CLASS */
                  ),
                  allowDownload.value ? (openBlock(), createElementBlock("button", {
                    key: 0,
                    type: "button",
                    class: "ctrl",
                    title: "下载",
                    "data-testid": "logstable-download",
                    onClick: downloadCsv
                  }, " ↓ ")) : createCommentVNode("v-if", true),
                  createElementVNode(
                    "span",
                    _hoisted_11$F,
                    toDisplayString(rows.value.length),
                    1
                    /* TEXT */
                  )
                ])) : createCommentVNode("v-if", true),
                createElementVNode("div", _hoisted_12$y, [
                  createElementVNode(
                    "div",
                    {
                      ref_key: "tableViewport",
                      ref: tableViewport,
                      class: "tableWrap",
                      "data-testid": "logstable-details",
                      onScrollPassive: onTableScroll
                    },
                    [
                      createElementVNode(
                        "div",
                        {
                          style: normalizeStyle({ height: virtualWin.value.totalHeight + "px", position: "relative" })
                        },
                        [
                          createElementVNode(
                            "table",
                            {
                              class: "table le-col-table",
                              style: normalizeStyle({ transform: "translateY(" + virtualWin.value.offsetY + "px)" })
                            },
                            [
                              createElementVNode("thead", null, [
                                createElementVNode("tr", null, [
                                  _cache[6] || (_cache[6] = createElementVNode(
                                    "th",
                                    {
                                      class: "sev",
                                      "aria-hidden": "true"
                                    },
                                    null,
                                    -1
                                    /* CACHED */
                                  )),
                                  showTime.value ? (openBlock(), createElementBlock("th", _hoisted_13$x, "时间")) : createCommentVNode("v-if", true),
                                  _cache[7] || (_cache[7] = createElementVNode(
                                    "th",
                                    { class: "level" },
                                    "级别",
                                    -1
                                    /* CACHED */
                                  )),
                                  _cache[8] || (_cache[8] = createElementVNode(
                                    "th",
                                    { class: "service" },
                                    "服务",
                                    -1
                                    /* CACHED */
                                  )),
                                  (openBlock(true), createElementBlock(
                                    Fragment,
                                    null,
                                    renderList(extraColumns.value, (col2) => {
                                      return openBlock(), createElementBlock(
                                        "th",
                                        { key: col2 },
                                        toDisplayString(col2),
                                        1
                                        /* TEXT */
                                      );
                                    }),
                                    128
                                    /* KEYED_FRAGMENT */
                                  )),
                                  _cache[9] || (_cache[9] = createElementVNode(
                                    "th",
                                    { class: "body" },
                                    "内容",
                                    -1
                                    /* CACHED */
                                  )),
                                  _cache[10] || (_cache[10] = createElementVNode(
                                    "th",
                                    { class: "trace" },
                                    "Trace ID",
                                    -1
                                    /* CACHED */
                                  )),
                                  showCopyLogLink.value ? (openBlock(), createElementBlock("th", _hoisted_14$w)) : createCommentVNode("v-if", true)
                                ])
                              ]),
                              createElementVNode("tbody", null, [
                                (openBlock(true), createElementBlock(
                                  Fragment,
                                  null,
                                  renderList(visibleRows.value, (r) => {
                                    return openBlock(), createElementBlock("tr", {
                                      key: r.id,
                                      class: normalizeClass(["row", { "is-active": openId.value === r.id }]),
                                      "data-testid": "logstable-row",
                                      "data-open": openId.value === r.id ? "true" : "false",
                                      "data-level": r.level,
                                      onClick: ($event) => toggleRow(r)
                                    }, [
                                      createElementVNode("td", _hoisted_16$o, [
                                        createElementVNode(
                                          "span",
                                          {
                                            class: "le-sev-bar",
                                            style: normalizeStyle({ background: unref(severityColor)(r.level) })
                                          },
                                          null,
                                          4
                                          /* STYLE */
                                        )
                                      ]),
                                      showTime.value ? (openBlock(), createElementBlock("td", _hoisted_17$l, [
                                        createElementVNode(
                                          "span",
                                          _hoisted_18$l,
                                          toDisplayString(r.t),
                                          1
                                          /* TEXT */
                                        )
                                      ])) : createCommentVNode("v-if", true),
                                      createElementVNode("td", _hoisted_19$j, [
                                        createElementVNode(
                                          "span",
                                          {
                                            class: "le-lvl",
                                            style: normalizeStyle(unref(severityBadgeStyle)(r.level))
                                          },
                                          toDisplayString(r.severityText),
                                          5
                                          /* TEXT, STYLE */
                                        )
                                      ]),
                                      createElementVNode(
                                        "td",
                                        _hoisted_20$h,
                                        toDisplayString(r.service || "—"),
                                        1
                                        /* TEXT */
                                      ),
                                      (openBlock(true), createElementBlock(
                                        Fragment,
                                        null,
                                        renderList(extraColumns.value, (col2) => {
                                          return openBlock(), createElementBlock("td", {
                                            key: col2,
                                            class: "extra"
                                          }, [
                                            createElementVNode(
                                              "span",
                                              _hoisted_21$d,
                                              toDisplayString(unref(getRowAttr)(r, col2) || "—"),
                                              1
                                              /* TEXT */
                                            )
                                          ]);
                                        }),
                                        128
                                        /* KEYED_FRAGMENT */
                                      )),
                                      createElementVNode("td", _hoisted_22$c, [
                                        createElementVNode(
                                          "span",
                                          _hoisted_23$8,
                                          toDisplayString(r.msg),
                                          1
                                          /* TEXT */
                                        )
                                      ]),
                                      createElementVNode("td", _hoisted_24$8, [
                                        createElementVNode(
                                          "span",
                                          _hoisted_25$8,
                                          toDisplayString(r.traceId || "—"),
                                          1
                                          /* TEXT */
                                        )
                                      ]),
                                      showCopyLogLink.value ? (openBlock(), createElementBlock("td", _hoisted_26$7, [
                                        createElementVNode("button", {
                                          type: "button",
                                          "data-testid": "logstable-copy",
                                          title: "复制",
                                          onClick: withModifiers(($event) => copyRow(r), ["stop"])
                                        }, " 复制 ", 8, _hoisted_27$6)
                                      ])) : createCommentVNode("v-if", true)
                                    ], 10, _hoisted_15$q);
                                  }),
                                  128
                                  /* KEYED_FRAGMENT */
                                ))
                              ])
                            ],
                            4
                            /* STYLE */
                          )
                        ],
                        4
                        /* STYLE */
                      ),
                      !rows.value.length ? (openBlock(), createElementBlock("div", _hoisted_28$6, "无日志数据")) : createCommentVNode("v-if", true)
                    ],
                    544
                    /* NEED_HYDRATION, NEED_PATCH */
                  )
                ])
              ],
              2
              /* CLASS */
            ),
            enableLogDetails.value ? (openBlock(), createBlock(ArgusLogDetail, {
              key: 0,
              open: !!activeRow.value,
              row: activeRow.value,
              onClose: closeDetail
            }, null, 8, ["open", "row"])) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ], 10, _hoisted_1$2K);
    };
  }
});
const LogsTableRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3w, [["__scopeId", "data-v-a4991b5d"]]);
const _sfc_main$3v = /* @__PURE__ */ defineComponent({
  __name: "LogsTableRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {},
    replaceVariables: { type: Function },
    width: {},
    height: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(LogsTableRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
const _sfc_main$3u = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(_sfc_main$3v, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "logstable",
    name: "日志表格",
    description: "表格形态日志",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3u
).useFieldConfig().setPanelOptions((builder) => {
  const cat = ["日志表格"];
  builder.addBoolean(
    {
      id: "enableLogDetails",
      path: "enableLogDetails",
      name: "启用日志详情",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showCopyLogLink",
      path: "showCopyLogLink",
      name: "显示复制链接按钮",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showControls",
      path: "showControls",
      name: "显示控件",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "allowDownload",
      path: "allowDownload",
      name: "显示下载控件",
      category: cat,
      showIf: (c) => !!c.showControls
    },
    false
  ).addBoolean(
    {
      id: "showTime",
      path: "showTime",
      name: "显示时间",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "wrapLogMessage",
      path: "wrapLogMessage",
      name: "换行日志",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "prettifyLogMessage",
      path: "prettifyLogMessage",
      name: "美化 JSON 日志",
      category: cat
    },
    false
  ).addText(
    {
      id: "extraColumns",
      path: "extraColumns",
      name: "额外列",
      category: cat
    },
    ""
  );
}).setRuntimeConsumedPaths([
  "allowDownload",
  "enableLogDetails",
  "showControls",
  "showCopyLogLink",
  "showTime",
  "wrapLogMessage",
  "prettifyLogMessage",
  "extraColumns"
]).register();
function getStackingBands(group) {
  const bands = [];
  const series = group.series ?? [];
  const dir = group.dir ?? 1;
  const lastIdx = series.length - 1;
  const rSeries = series.slice().reverse();
  rSeries.forEach((si, i) => {
    if (i !== lastIdx) {
      const nextIdx = rSeries[i + 1];
      bands.push({
        series: [si, nextIdx],
        // fill direction is inverted from stack direction
        dir: -1 * dir
      });
    }
  });
  return bands;
}
function stackingBandsForSeriesCount(count, dir = 1) {
  if (count < 2) return [];
  const series = Array.from({ length: count }, (_, i) => i + 1);
  return getStackingBands({ series, dir });
}
const UPLOT_AXIS_FONT_SIZE$1 = 12;
let _measureCtx$1 = null;
function measureAxisText$1(text, fontSize = UPLOT_AXIS_FONT_SIZE$1) {
  if (typeof document === "undefined")
    return Math.ceil(String(text).length * fontSize * 0.6);
  if (!_measureCtx$1) {
    _measureCtx$1 = document.createElement("canvas").getContext("2d");
  }
  if (!_measureCtx$1) return Math.ceil(String(text).length * fontSize * 0.6);
  _measureCtx$1.font = `400 ${fontSize}px Inter`;
  return _measureCtx$1.measureText(String(text ?? "")).width;
}
function pad2(n) {
  return n.toString().padStart(2, "0");
}
function formatTime(v, tz, spanMs) {
  const d = new Date(v);
  const utc = String(tz || "").toLowerCase() === "utc";
  const Y = utc ? d.getUTCFullYear() : d.getFullYear();
  const M = utc ? d.getUTCMonth() + 1 : d.getMonth() + 1;
  const D = utc ? d.getUTCDate() : d.getDate();
  const h2 = utc ? d.getUTCHours() : d.getHours();
  const m = utc ? d.getUTCMinutes() : d.getMinutes();
  const s = utc ? d.getUTCSeconds() : d.getSeconds();
  const span = spanMs ?? 0;
  if (span > 0 && span <= 5 * 6e4) {
    return `${pad2(h2)}:${pad2(m)}:${pad2(s)}`;
  }
  if (span > 7 * 24 * 60 * 6e4) {
    return `${Y}-${pad2(M)}-${pad2(D)}`;
  }
  if (span > 24 * 60 * 6e4) {
    return `${pad2(M)}-${pad2(D)} ${pad2(h2)}:${pad2(m)}`;
  }
  return `${pad2(h2)}:${pad2(m)}`;
}
function formatAxisNumber(v) {
  if (!Number.isFinite(v)) return "";
  const abs = Math.abs(v);
  if (abs >= 1e9) return `${Number((v / 1e9).toFixed(abs >= 1e10 ? 0 : 1))}G`;
  if (abs >= 1e6) return `${Number((v / 1e6).toFixed(abs >= 1e7 ? 0 : 1))}M`;
  if (abs >= 1e4) return `${Number((v / 1e3).toFixed(abs >= 1e5 ? 0 : 1))}k`;
  if (Number.isInteger(v) || Math.abs(v - Math.round(v)) < 1e-9)
    return String(Math.round(v));
  if (abs >= 100) return String(Number(v.toFixed(1)));
  if (abs >= 1) return String(Number(v.toFixed(2)));
  if (abs >= 0.01) return String(Number(v.toFixed(3)));
  return String(Number(v.toPrecision(2)));
}
function formatAxisValue(v, opts) {
  if (!Number.isFinite(v)) return "";
  const unit = opts?.unit;
  const decimals = opts?.decimals;
  if (unit && unit !== "none") {
    try {
      const out = getValueFormat(unit)(v, decimals);
      return `${out.text}${out.suffix || ""}`;
    } catch {
    }
  }
  if (decimals != null && Number.isFinite(decimals)) {
    return Number(v).toFixed(Math.max(0, Math.min(10, Math.floor(decimals))));
  }
  return formatAxisNumber(v);
}
function estimateLabelWidth(text, isTime) {
  const len = Math.max(text.length, 5);
  return Math.ceil(len * 7.2 + 10);
}
const Y_TICK_SPACING_PANEL_HEIGHT = 150;
const Y_TICK_SPACING_NORMAL = 30;
const Y_TICK_SPACING_SMALL = 15;
const X_TICK_SPACING_NORMAL = 40;
const X_TICK_VALUE_GAP = 18;
function adaptiveAxisSpace(plotPx, axis, isTime, spanMs = 0) {
  if (axis === "y") {
    return plotPx <= Y_TICK_SPACING_PANEL_HEIGHT ? Y_TICK_SPACING_SMALL : Y_TICK_SPACING_NORMAL;
  }
  let sample = "00:00";
  if (isTime) {
    if (spanMs > 0 && spanMs <= 5 * 6e4) sample = "00:00:00";
    else if (spanMs > 7 * 24 * 60 * 6e4) sample = "2020-01-01";
    else if (spanMs > 24 * 60 * 6e4) sample = "01-01 00:00";
    else sample = "00:00";
  } else {
    sample = "0.000";
  }
  const valueWidth = measureAxisText$1(sample, UPLOT_AXIS_FONT_SIZE$1);
  return Math.max(
    X_TICK_SPACING_NORMAL,
    Math.ceil(valueWidth + X_TICK_VALUE_GAP)
  );
}
function formatSplitsAdaptive(u, splits, scaleKey, format) {
  if (!splits.length) return [];
  const isX = scaleKey === "x";
  const out = splits.map(() => "");
  const up = u;
  const pos = splits.map(
    (v) => isX ? up.valToPos(v, "x") : up.valToPos(v, "y")
  );
  let lastPlaced = -1;
  for (let i = 0; i < splits.length; i++) {
    const label = format(splits[i]);
    if (!label) continue;
    const need = isX ? estimateLabelWidth(label) * 0.92 : 16;
    if (lastPlaced < 0 || Math.abs(pos[i] - pos[lastPlaced]) >= need) {
      out[i] = label;
      lastPlaced = i;
    }
  }
  const last = splits.length - 1;
  if (last > 0 && !out[last]) {
    const label = format(splits[last]);
    let prev = -1;
    for (let i = last - 1; i >= 0; i--) {
      if (out[i]) {
        prev = i;
        break;
      }
    }
    const need = isX ? estimateLabelWidth(label) * 0.7 : 14;
    if (prev < 0 || Math.abs(pos[last] - pos[prev]) >= need) out[last] = label;
  }
  return out;
}
function pickNearestHoverSeries(series, cursorTop) {
  const withVal = series.filter(
    (s) => s.value != null && Number.isFinite(s.value)
  );
  if (!withVal.length) return series.filter((s) => s.value != null).slice(0, 1);
  let best = withVal[0];
  let bestDist = Infinity;
  for (const sp of withVal) {
    const y = sp.yPos;
    if (y == null || !Number.isFinite(y)) continue;
    const d = Math.abs(y - cursorTop);
    if (d < bestDist) {
      bestDist = d;
      best = sp;
    }
  }
  return [
    {
      index: best.index,
      label: best.label,
      value: best.value,
      color: best.color
    }
  ];
}
function toAlignedSeriesData(series) {
  const visible = series.filter((s) => !s.hidden);
  if (!visible.length) return [[0], [0]];
  const xSet = /* @__PURE__ */ new Set();
  for (const s of visible)
    for (const p of s.points) if (p.x != null) xSet.add(p.x);
  const xs = [...xSet].sort((a, b) => a - b);
  const ys = visible.map((s) => {
    if (s.constantY != null) {
      return xs.map(() => s.constantY);
    }
    const map = new Map(s.points.map((p) => [p.x, p.y]));
    return xs.map((x) => {
      const v = map.get(x);
      return v == null || typeof v === "number" && Number.isNaN(v) ? null : v;
    });
  });
  return [xs, ...ys];
}
function getUPlotPalette() {
  return getClassicPalette$1(resolveThemeModeHint());
}
getClassicPalette$1("dark");
const UPLOT_AXIS_FONT_SIZE = 12;
const UPLOT_AXIS_FONT = `${UPLOT_AXIS_FONT_SIZE}px Inter`;
let _measureCtx = null;
function measureAxisText(text, fontSize = UPLOT_AXIS_FONT_SIZE) {
  if (typeof document === "undefined")
    return Math.ceil(String(text).length * fontSize * 0.6);
  if (!_measureCtx) {
    _measureCtx = document.createElement("canvas").getContext("2d");
  }
  if (!_measureCtx) return Math.ceil(String(text).length * fontSize * 0.6);
  _measureCtx.font = `400 ${fontSize}px Inter`;
  return _measureCtx.measureText(String(text ?? "")).width;
}
function calculateAxisSize(self, values, side) {
  const ticksSize = 4;
  const gap = 5;
  const labelGap = 0;
  let axisSize = ticksSize;
  if (side === 2) {
    axisSize += gap + UPLOT_AXIS_FONT_SIZE;
  } else {
    const labels = (values || []).map((v) => v == null ? "" : String(v)).filter((v) => v.length > 0 && v.length < 24);
    let maxTextWidth = 12;
    if (labels.length) {
      maxTextWidth = labels.reduce(
        (acc, value) => Math.max(acc, measureAxisText(value)),
        0
      );
    }
    const textWidthWithLimit = Math.min(
      (self?.width ?? 100) * 0.4,
      maxTextWidth
    );
    axisSize += gap + labelGap + textWidthWithLimit;
  }
  return Math.ceil(axisSize);
}
function isDarkTheme() {
  if (typeof document === "undefined") return true;
  const root = document.documentElement;
  const t2 = root.getAttribute("data-theme") || root.getAttribute("data-grafana-theme") || root.dataset.theme || document.body?.dataset?.theme || "";
  if (String(t2).toLowerCase() === "light") return false;
  if (String(t2).toLowerCase() === "dark") return true;
  try {
    const bg = getComputedStyle(root).getPropertyValue("--grafana-bg") || getComputedStyle(document.body).backgroundColor;
    const m = String(bg).match(/rgba?\((\d+)/);
    if (m && Number(m[1]) > 200) return false;
  } catch {
  }
  return true;
}
function uplotGridColor(dark) {
  return dark ? "rgba(240, 250, 255, 0.09)" : "rgba(0, 10, 23, 0.09)";
}
function uplotAxisStroke(dark) {
  return dark ? "rgb(204, 204, 220)" : "rgb(36, 41, 46)";
}
function grafanaPaddingSide(_u, side, sidesWithAxes) {
  const hasCrossAxis = side % 2 ? sidesWithAxes[0] || sidesWithAxes[2] : sidesWithAxes[1] || sidesWithAxes[3];
  return sidesWithAxes[side] || !hasCrossAxis ? 0 : 8;
}
function readNum(v) {
  if (v == null || v === "") return void 0;
  const n = Number(unref(v));
  return Number.isFinite(n) ? n : void 0;
}
function readStr(v, fallback = "") {
  const x = unref(v);
  return x == null ? fallback : String(x);
}
function dashFor(style) {
  if (!style) return void 0;
  if (typeof style === "object") {
    if (style.dash?.length) return style.dash;
    return dashFor(style.fill);
  }
  if (style === "dash") return [8, 4];
  if (style === "dots") return [2, 4];
  return void 0;
}
function hexAlpha(color, alpha2) {
  if (typeof color !== "string" || !color)
    return `rgba(115,191,105,${Math.max(0, Math.min(1, alpha2))})`;
  if (color.startsWith("rgba") || color.startsWith("rgb")) return color;
  const a = Math.max(0, Math.min(1, alpha2));
  if (color.startsWith("#") && (color.length === 7 || color.length === 4)) {
    let r, g, b;
    if (color.length === 4) {
      r = parseInt(color[1] + color[1], 16);
      g = parseInt(color[2] + color[2], 16);
      b = parseInt(color[3] + color[3], 16);
    } else {
      r = parseInt(color.slice(1, 3), 16);
      g = parseInt(color.slice(3, 5), 16);
      b = parseInt(color.slice(5, 7), 16);
    }
    return `rgba(${r},${g},${b},${a})`;
  }
  return color;
}
function squarePointPaths(u, seriesIdx, idx0, idx1, filtIdxs) {
  const s = u.series[seriesIdx];
  const size = s.points?.size ?? 6;
  const half = size / 2;
  const xdata = u.data[0];
  const ydata = u.data[seriesIdx];
  const ctx = u.ctx;
  const allow = filtIdxs ? new Set(filtIdxs) : null;
  ctx.save();
  ctx.fillStyle = String(s.points?.fill ?? s.stroke ?? "#fff");
  ctx.strokeStyle = String(s.points?.stroke ?? s.stroke ?? "#fff");
  ctx.lineWidth = Number(s.points?.width ?? 1);
  for (let i = idx0; i <= idx1; i++) {
    if (allow && !allow.has(i)) continue;
    const y = ydata[i];
    if (y == null || !Number.isFinite(y)) continue;
    const x = u.valToPos(xdata[i], "x", true);
    const yy = u.valToPos(y, s.scale, true);
    ctx.fillRect(x - half, yy - half, size, size);
    if (ctx.lineWidth > 0) ctx.strokeRect(x - half, yy - half, size, size);
  }
  ctx.restore();
  return {
    stroke: null,
    fill: null,
    clip: null,
    band: null,
    gaps: null,
    flags: 0
  };
}
function pathsFor(interp, mode2, barWidthFactor, barBucketSize) {
  const paths = uPlot.paths;
  if (mode2 === "bars") {
    if (barBucketSize != null && Number.isFinite(barBucketSize) && barBucketSize > 0) {
      const bs = barBucketSize;
      return paths.bars?.({
        align: 1,
        disp: {
          x0: {
            unit: 1,
            values: (u) => u.data[0]
          },
          size: {
            unit: 1,
            values: () => [bs]
          }
        }
      });
    }
    const size = Math.max(0.05, Math.min(1, barWidthFactor));
    const opts = { size: [size, 1e6] };
    if (size >= 0.99) opts.align = 1;
    return paths.bars?.(opts);
  }
  if (mode2 === "points") return void 0;
  if (interp === "smooth") return paths.spline?.();
  if (interp === "stepBefore") return paths.stepped?.({ align: -1 });
  if (interp === "stepAfter") return paths.stepped?.({ align: 1 });
  return void 0;
}
function createThresholdsDrawHook(thresholds, thresholdsMode, percent) {
  if (!thresholds.length || !thresholdsMode || thresholdsMode === "off")
    return null;
  const wantLine = thresholdsMode === "line" || thresholdsMode === "dashed" || thresholdsMode === "line+area" || thresholdsMode === "dashed+area";
  const wantArea = thresholdsMode === "area" || thresholdsMode === "line+area" || thresholdsMode === "dashed+area";
  const dashed = thresholdsMode === "dashed" || thresholdsMode === "dashed+area";
  return (u) => {
    const ctx = u.ctx;
    const { left, top, width: w, height: h2 } = u.bbox;
    const yMin = u.scales.y.min ?? 0;
    const yMax = u.scales.y.max ?? 1;
    const sorted = [...thresholds].filter((th) => Number.isFinite(th.value)).map(
      (th) => percent ? { ...th, value: yMin + (yMax - yMin) * Number(th.value) / 100 } : th
    ).sort((a, b) => a.value - b.value);
    if (!sorted.length) return;
    ctx.save();
    if (wantArea) {
      for (let i = 0; i < sorted.length; i++) {
        const th = sorted[i];
        const yTop = i + 1 < sorted.length ? u.valToPos(sorted[i + 1].value, "y", true) : top;
        const yBot = u.valToPos(th.value, "y", true);
        const y0 = Math.min(yTop, yBot);
        const y1 = Math.max(yTop, yBot);
        if (y1 < top || y0 > top + h2) continue;
        const color = th.color || "#ff780a";
        ctx.fillStyle = hexAlpha(color, 0.12);
        const cy0 = Math.max(y0, top);
        const cy1 = Math.min(y1, top + h2);
        if (cy1 > cy0) ctx.fillRect(left, cy0, w, cy1 - cy0);
      }
    }
    if (wantLine) {
      for (const th of sorted) {
        const y = u.valToPos(th.value, "y", true);
        if (y < top || y > top + h2) continue;
        ctx.strokeStyle = th.color || "#ff780a";
        ctx.lineWidth = 1.5;
        ctx.globalAlpha = 0.85;
        ctx.setLineDash(dashed ? [6, 4] : []);
        ctx.beginPath();
        ctx.moveTo(left, y);
        ctx.lineTo(left + w, y);
        ctx.stroke();
        ctx.setLineDash([]);
        ctx.globalAlpha = 1;
        if (th.label) {
          ctx.fillStyle = th.color || "#ff780a";
          ctx.font = "10px sans-serif";
          ctx.fillText(th.label, left + 4, y - 3);
        }
      }
    }
    ctx.restore();
  };
}
function numRef(v, fallback = 0) {
  const n = Number(unref(v));
  return Number.isFinite(n) ? n : fallback;
}
function boolRef(v, fallback = false) {
  if (v == null) return fallback;
  return Boolean(unref(v));
}
function unrefAny(v) {
  return unref(v);
}
function useUPlot(el, seriesList, opts) {
  let chart = null;
  const hover = ref(null);
  function mode2() {
    const m = opts.mode;
    if (!m) return "line";
    return typeof m === "string" ? m : m.value;
  }
  function build2() {
    if (!el.value) return;
    chart?.destroy();
    chart = null;
    const series = seriesList.value.filter((s) => !s.hidden);
    const hasPoints = series.some(
      (s) => s.points?.some((p) => p.y != null && Number.isFinite(p.y))
    );
    if (!series.length || !hasPoints) {
      return;
    }
    const data = toAlignedSeriesData(seriesList.value);
    const width2 = Math.max(
      numRef(opts.width) || el.value.clientWidth || 100,
      40
    );
    const height2 = Math.max(
      numRef(opts.height) || el.value.clientHeight || 80,
      40
    );
    const xs = data[0] ?? [];
    const dataSpanMs = unrefAny(opts.timeX) !== false && xs.length >= 2 ? Math.abs(Number(xs[xs.length - 1]) - Number(xs[0])) : 0;
    const plotWGuess = Math.max(width2 - 64, 40);
    const plotHGuess = Math.max(height2 - 40, 32);
    const m = mode2();
    const barWidthFactor = readNum(opts.barWidthFactor) ?? 0.6;
    const barBucketSize = readNum(opts.barBucketSize);
    const softMin = readNum(opts.softMin);
    const softMax = readNum(opts.softMax);
    const globalSpan = boolRef(opts.spanNulls);
    const globalLW = readNum(opts.lineWidth) ?? 1;
    const globalFill = readNum(opts.fillOpacity) ?? (m === "area" ? 20 : 0);
    void (opts.showLegend == null ? series.length > 1 : boolRef(opts.showLegend, true));
    const gradientMode = readStr(opts.gradientMode, "none");
    const globalInterp = readStr(opts.lineInterpolation, "linear");
    const axis = unrefAny(
      opts.axis
    ) ?? {};
    const thresholds = unrefAny(
      opts.thresholds
    ) ?? [];
    const showValues = boolRef(opts.showValues);
    const yScale = { auto: true };
    const scaleDist = normalizeScaleDistribution(unrefAny(opts.scaleDistribution));
    if (scaleDist.type === "log") {
      yScale.distr = 3;
      yScale.log = scaleDist.log ?? 10;
    } else if (scaleDist.type === "symlog") {
      yScale.distr = 4;
      yScale.log = scaleDist.log ?? 10;
      yScale.asinh = scaleDist.linearThreshold ?? 1;
    }
    if (axis.centeredZero || softMin != null || softMax != null) {
      if (axis.centeredZero) {
        yScale.range = (_u, dataMin, dataMax) => {
          const abs = Math.max(
            Math.abs(dataMin ?? 0),
            Math.abs(dataMax ?? 0),
            1
          );
          let min = -abs;
          let max = abs;
          if (softMin != null) min = Math.min(min, softMin);
          if (softMax != null) max = Math.max(max, softMax);
          return [min, max];
        };
      } else {
        yScale.range = (_u, dataMin, dataMax) => {
          if (dataMin == null && dataMax == null) return [null, null];
          const softMinMode = softMin == null ? 3 : 1;
          const softMaxMode = softMax == null ? 3 : 1;
          const rangeConfig = {
            min: {
              pad: 0.1,
              hard: -Infinity,
              soft: softMin ?? 0,
              mode: softMinMode
            },
            max: {
              pad: 0.1,
              hard: Infinity,
              soft: softMax ?? 0,
              mode: softMaxMode
            }
          };
          return uPlot.rangeNum(
            dataMin,
            dataMax,
            rangeConfig
          );
        };
      }
    }
    if (axis.softMin != null && softMin == null) yScale.min = axis.softMin;
    if (axis.softMax != null && softMax == null) yScale.max = axis.softMax;
    if (scaleDist.type === "log" && !yScale.range) {
      yScale.range = (_u, dataMin, dataMax) => {
        let min = dataMin ?? 1;
        let max = dataMax ?? 10;
        if (!(min > 0) || !Number.isFinite(min)) min = 1;
        if (!(max > 0) || !Number.isFinite(max)) max = min * 10;
        if (max <= min) max = min * 10;
        if (softMin != null && softMin > 0) min = Math.min(min, softMin);
        if (softMax != null && softMax > 0) max = Math.max(max, softMax);
        return [min, max];
      };
    }
    const gridShow = axis.gridShow !== false;
    const xGridShow = axis.xGridShow != null ? !!axis.xGridShow : gridShow;
    const yGridShow = axis.yGridShow != null ? !!axis.yGridShow : gridShow;
    const axisHidden = axis.placement === "hidden";
    const axisSide = axis.placement === "right" ? 1 : 3;
    const hooks = {};
    const thresholdsMode = readStr(opts.thresholdsMode, "line");
    const thresholdDraw = createThresholdsDrawHook(
      thresholds,
      thresholdsMode,
      boolRef(opts.thresholdsPercent)
    );
    if (thresholdDraw) {
      hooks.draw = [thresholdDraw];
    }
    const drawHook = unrefAny(opts.drawHook);
    if (typeof drawHook === "function") {
      hooks.draw = [...hooks.draw || [], drawHook];
    }
    if (showValues) {
      hooks.drawSeries = [
        (u, si) => {
          if (si === 0) return;
          const ctx = u.ctx;
          const s = u.series[si];
          if (!s.show) return;
          ctx.save();
          ctx.fillStyle = s.stroke || "#ccc";
          const fs = readNum(opts.showValueFontSize) ?? 10;
          ctx.font = `${fs}px sans-serif`;
          const xs2 = u.data[0];
          const ys = u.data[si];
          for (let i = 0; i < xs2.length; i++) {
            const yv = ys[i];
            if (yv == null || !Number.isFinite(yv)) continue;
            const x = u.valToPos(xs2[i], "x", true);
            const y = u.valToPos(yv, "y", true);
            ctx.fillText(String(Math.round(yv * 100) / 100), x + 2, y - 4);
          }
          ctx.restore();
        }
      ];
    }
    if (boolRef(opts.fullHighlight)) {
      hooks.draw = [
        ...hooks.draw || [],
        (u) => {
          const idx = u.cursor?.idx;
          if (idx == null || idx < 0) return;
          const xs2 = u.data[0];
          if (!xs2 || idx >= xs2.length) return;
          const ctx = u.ctx;
          const { left, top, width: plotW, height: plotH } = u.bbox;
          const xC = u.valToPos(xs2[idx], "x", true);
          const n = xs2.length;
          const slot = plotW / Math.max(n, 1);
          const w = Math.max(1, slot * 0.97);
          ctx.save();
          ctx.fillStyle = "rgba(204, 204, 220, 0.08)";
          ctx.fillRect(xC - w / 2, top, w, plotH);
          ctx.restore();
        }
      ];
    }
    const tipMode = () => readStr(opts.tooltipMode, "single");
    hooks.setCursor = [
      ...hooks.setCursor || [],
      (u) => {
        const mode22 = tipMode();
        if (mode22 === "none" || mode22 === "hidden") {
          hover.value = null;
          opts.onHover?.(null);
          return;
        }
        const idx = u.cursor.idx;
        const left = u.cursor.left;
        const top = u.cursor.top;
        if (idx == null || left == null || top == null || left < 0 || top < 0) {
          hover.value = null;
          opts.onHover?.(null);
          return;
        }
        const xs2 = u.data[0];
        const x = xs2[idx];
        if (x == null || !Number.isFinite(x)) {
          hover.value = null;
          opts.onHover?.(null);
          return;
        }
        const visible = seriesList.value.filter((s) => !s.hidden);
        const seriesPts = [];
        for (let si = 1; si < u.series.length; si++) {
          const sMeta = visible[si - 1];
          const ys = u.data[si];
          const yv = ys?.[idx];
          const val = yv == null || !Number.isFinite(Number(yv)) ? null : Number(yv);
          if (mode22 === "single" || mode22 === "multi" || mode22 === "all") {
            if ((mode22 === "multi" || mode22 === "all") && val == null) continue;
            seriesPts.push({
              index: si,
              label: sMeta?.label || String(u.series[si].label || `Series ${si}`),
              value: val,
              color: sMeta?.color || u.series[si].stroke || void 0,
              yPos: val != null ? u.valToPos(val, "y") : void 0
            });
          }
        }
        let outSeries = seriesPts;
        if (mode22 === "single" && seriesPts.length) {
          const withY = seriesPts.map((sp) => ({
            ...sp,
            // uPlot cursor.top is CSS px relative to plot; valToPos(..., 'y') same space
            yPos: sp.value != null && Number.isFinite(sp.value) ? u.valToPos(sp.value, "y") : void 0
          }));
          outSeries = pickNearestHoverSeries(withY, top);
        }
        if ((mode22 === "multi" || mode22 === "all") && outSeries.length > 1) {
          const sort = readStr(opts.tooltipSort, "none");
          if (sort === "desc" || sort === "asc") {
            outSeries = [...outSeries].sort((a, b) => {
              const av = a.value;
              const bv = b.value;
              if (av == null && bv == null) return 0;
              if (av == null) return 1;
              if (bv == null) return -1;
              return sort === "desc" ? bv - av : av - bv;
            });
          }
        }
        const xPos = u.valToPos(x, "x");
        const yCursorVal = (() => {
          try {
            return u.posToVal(top, "y");
          } catch {
            return void 0;
          }
        })();
        const pt = {
          left,
          top,
          x,
          idx,
          series: outSeries,
          xPos,
          yCursorVal: yCursorVal != null && Number.isFinite(yCursorVal) ? yCursorVal : void 0
        };
        hover.value = pt;
        opts.onHover?.(pt);
      }
    ];
    const bandList = unrefAny(opts.bands) ?? [];
    const uBands = bandList.filter((b) => Array.isArray(b?.series) && b.series.length === 2).map((b) => {
      const band = { series: [b.series[0], b.series[1]] };
      if (b.dir === 1 || b.dir === -1) band.dir = b.dir;
      if (b.fill !== void 0) band.fill = b.fill;
      return band;
    });
    const dark = isDarkTheme();
    const gridColor = uplotGridColor(dark);
    const axisStrokeBase = uplotAxisStroke(dark);
    const axisColorMode = String(axis.colorMode || "text");
    const axisStroke = axisColorMode === "series" && axis.seriesColor ? String(axis.seriesColor) : axisStrokeBase;
    const axisFont = axis.font || UPLOT_AXIS_FONT;
    const hair = 1 / (typeof devicePixelRatio === "number" && devicePixelRatio > 0 ? devicePixelRatio : 1);
    const xMin = readNum(opts.xMin);
    const xMax = readNum(opts.xMax);
    const xScale = { time: unrefAny(opts.timeX) !== false };
    if (xMin != null && xMax != null && xMax > xMin) {
      xScale.range = () => [xMin, xMax];
      xScale.min = xMin;
      xScale.max = xMax;
      xScale.auto = false;
    } else {
      if (xMin != null) xScale.min = xMin;
      if (xMax != null) xScale.max = xMax;
    }
    const scaleOrientation = String(
      unrefAny(opts.scaleOrientation) ?? "vertical"
    );
    const isHorizontalScale = scaleOrientation === "horizontal";
    if (isHorizontalScale) {
      xScale.ori = 1;
      xScale.dir = -1;
      yScale.ori = 0;
      yScale.dir = 1;
    }
    chart = new uPlot(
      {
        width: width2,
        height: height2,
        // Grafana DEFAULT_PLOT_CONFIG: timestamps are milliseconds
        ms: 1,
        // Grafana DEFAULT_PLOT_CONFIG paddingSide: 0 on sides with axes.
        // Explicit function guards against uPlot sidesWithAxes false-negatives on left y.
        padding: [
          (_u, side, sidesWithAxes) => grafanaPaddingSide(_u, side, sidesWithAxes),
          (_u, side, sidesWithAxes) => grafanaPaddingSide(_u, side, sidesWithAxes),
          (_u, side, sidesWithAxes) => grafanaPaddingSide(_u, side, sidesWithAxes),
          // left: always 0 when y-axis is shown (default timeseries)
          (_u, side, sidesWithAxes) => {
            if (!axisHidden) return 0;
            return grafanaPaddingSide(_u, side, sidesWithAxes);
          }
        ],
        cursor: (() => {
          const proxRaw = readNum(opts.hoverProximity);
          const DEFAULT_FOCUS = 30;
          const DEFAULT_NULL = 15;
          const focusProx = proxRaw != null ? proxRaw : DEFAULT_FOCUS;
          const dragOpt = unrefAny(opts.cursorDrag);
          return {
            show: true,
            drag: {
              x: dragOpt?.x !== false,
              y: dragOpt?.y === true
            },
            // Grafana TimeSeries utils: focus.prox + hover.prox
            focus: { prox: focusProx },
            hover: {
              prox: (_self, _seriesIdx, _hoveredIdx) => {
                if (proxRaw != null) return proxRaw;
                return DEFAULT_NULL;
              },
              skip: [null]
            }
          };
        })(),
        legend: { show: false, live: false },
        // custom legend rendered by PanelHost/PanelChrome
        ...uBands.length ? { bands: uBands } : {},
        scales: {
          x: xScale,
          y: yScale,
          ...unrefAny(opts.extraScales) ?? {}
        },
        axes: [
          {
            // horizontal bars: category axis on left; vertical: bottom
            side: isHorizontalScale ? 3 : 2,
            stroke: axisStroke,
            font: axisFont,
            grid: { show: xGridShow, stroke: gridColor, width: hair },
            ticks: { show: true, stroke: gridColor, width: hair, size: 4 },
            border: {
              show: axis.borderShow === true,
              stroke: axisStroke,
              width: hair
            },
            space: (self, _axisIdx, _scaleMin, _scaleMax, plotDim) => {
              const span = unrefAny(opts.timeX) !== false ? Math.abs(
                Number(self.scales.x.max ?? 0) - Number(self.scales.x.min ?? 0)
              ) : Math.abs(
                Number(self.scales.x.max ?? 0) - Number(self.scales.x.min ?? 0)
              ) || dataSpanMs;
              return adaptiveAxisSpace(
                plotDim || plotWGuess,
                "x",
                unrefAny(opts.timeX) !== false,
                span
              );
            },
            // Grafana Histogram.tsx xSplits — bucket-aligned ticks
            ...(() => {
              const xSplitsFn = unrefAny(opts.xSplits);
              return typeof xSplitsFn === "function" ? { splits: xSplitsFn } : {};
            })(),
            gap: readNum(opts.xAxisGap) ?? 5,
            rotate: (() => {
              const r = readNum(opts.xTickLabelRotation);
              return r != null && r !== 0 ? r : void 0;
            })(),
            // Grafana: ticks + gap + fontSize ≈ 21; barchart dual-run needs ~35
            size: (_u, values) => {
              const forced = readNum(opts.xAxisSize);
              if (forced != null && forced > 0) return forced;
              return calculateAxisSize(_u, values || [], 2);
            },
            values: (u, splits) => {
              const span = splits.length >= 2 ? Math.abs(splits[splits.length - 1] - splits[0]) : dataSpanMs;
              const labels = unrefAny(opts.xValueLabels);
              const isTime = unrefAny(opts.timeX) !== false;
              const format = (v) => {
                if (labels && labels.length) {
                  const idx = Math.round(v);
                  if (idx >= 0 && idx < labels.length) return labels[idx] ?? "";
                  return "";
                }
                return isTime ? formatTime(v, axis.timezone, span) : formatAxisNumber(v);
              };
              if (typeof unrefAny(opts.xSplits) === "function") {
                return splits.map((v) => format(v));
              }
              if (labels && labels.length) {
                return splits.map((v) => format(v));
              }
              return formatSplitsAdaptive(u, splits, "x", format);
            }
          },
          {
            show: !axisHidden,
            side: isHorizontalScale ? 2 : axisSide,
            label: axis.label || void 0,
            stroke: axisStroke,
            font: axisFont,
            grid: { show: yGridShow, stroke: gridColor, width: hair },
            ticks: { show: true, stroke: gridColor, width: hair, size: 4 },
            border: {
              show: axis.borderShow === true,
              stroke: axisStroke,
              width: hair
            },
            space: (_self, _axisIdx, _scaleMin, _scaleMax, plotDim) => adaptiveAxisSpace(plotDim || plotHGuess, "y", false),
            // Empirical dual-run: Grafana label right-edge sits ~4px closer to plot than uPlot default gap paint
            gap: axis.gap != null ? Number(axis.gap) : 1,
            size: axis.width != null ? Math.max(Number(axis.width), 1) : axis.sizeAuto || axis.label || unrefAny(opts.yValueLabels) ? (u, values) => calculateAxisSize(u, values || [], axisSide) : 27,
            ...typeof opts.ySplits === "function" ? {
              splits: (u) => {
                const custom = opts.ySplits(u);
                return custom?.length ? custom : [0.5];
              }
            } : unrefAny(opts.yValueLabels) ? {
              splits: (_u) => {
                const labels = unrefAny(opts.yValueLabels) ?? [];
                const n = Math.max(labels.length, 1);
                return Array.from(
                  { length: n },
                  (_, i) => 1 - (i + 0.5) / n
                );
              }
            } : {},
            values: (u, splits) => {
              const labels = unrefAny(opts.yValueLabels);
              if (labels && labels.length) {
                const n = labels.length;
                return splits.map((v) => {
                  let best = 0;
                  let bestD = Infinity;
                  for (let i = 0; i < n; i++) {
                    const mid = 1 - (i + 0.5) / n;
                    const d = Math.abs(v - mid);
                    if (d < bestD) {
                      bestD = d;
                      best = i;
                    }
                  }
                  return labels[best] ?? "";
                });
              }
              return formatSplitsAdaptive(u, splits, "y", (v) => {
                const seriesUnit = series.find(
                  (s) => s && s.unit && String(s.unit).length
                );
                return formatAxisValue(v, {
                  unit: axis.unit || seriesUnit?.unit,
                  decimals: axis.decimals != null && Number.isFinite(Number(axis.decimals)) ? Number(axis.decimals) : void 0
                });
              });
            }
          }
        ],
        series: [
          {},
          ...series.map((s, i) => {
            const color = s.color || getUPlotPalette()[i % getUPlotPalette().length];
            const lw = s.lineWidth ?? globalLW;
            const fillOp = s.fillOpacity ?? globalFill;
            const span = s.spanNulls ?? globalSpan;
            const showPts = s.showPoints ?? "auto";
            const pts = showPts === "never" ? false : showPts === "always" || showPts === "auto" && (m === "points" || s.points.length <= 2);
            const interp = s.lineInterpolation ?? globalInterp;
            const path = pathsFor(interp, m, barWidthFactor, barBucketSize);
            const suppressPaths = boolRef(opts.suppressSeriesPaths, false);
            const base = {
              label: s.label,
              stroke: s.skipLine || suppressPaths ? "rgba(0,0,0,0)" : color,
              width: s.skipLine || suppressPaths || m === "points" ? 0 : Math.max(lw, 0),
              scale: s.scale || "y",
              points: {
                show: s.skipLine || suppressPaths ? false : pts || m === "points",
                size: s.pointSize ?? 6,
                fill: color,
                // hollow/ring markers read better on filled area (Grafana timeseries)
                stroke: color,
                width: s.pointStrokeWidth ?? 1,
                // showPoints=always must not density-filter markers (uPlot default space=_ptDia*2).
                // Use a tiny positive space — 0 can break uPlot's maxPts math in some builds.
                space: showPts === "always" || m === "points" ? 0.01 : void 0,
                paths: s.pointShape === "square" ? squarePointPaths : void 0
              },
              spanGaps: span,
              dash: dashFor(s.lineStyle)
            };
            if (s.skipLine || suppressPaths) {
              base.paths = () => ({
                stroke: null,
                fill: null,
                clip: null,
                band: null,
                gaps: null,
                flags: 0
              });
            } else if (path) {
              base.paths = path;
            }
            if (!suppressPaths && (m === "area" || fillOp > 0)) {
              const alpha2 = Math.max(0, Math.min(1, fillOp / 100));
              if (gradientMode === "opacity" || gradientMode === "scheme" || gradientMode === "hue") {
                base.fill = (u, seriesIdx) => {
                  const sc = u.series[seriesIdx].stroke;
                  const g = u.ctx.createLinearGradient(
                    0,
                    u.bbox.top,
                    0,
                    u.bbox.top + u.bbox.height
                  );
                  g.addColorStop(0, hexAlpha(sc || color, alpha2));
                  g.addColorStop(1, hexAlpha(sc || color, 0.02));
                  return g;
                };
              } else {
                base.fill = hexAlpha(color, alpha2);
              }
            }
            return base;
          })
        ],
        hooks
      },
      data,
      el.value
    );
    lastStructSig = structSig();
  }
  let lastStructSig = "";
  function structSig() {
    return seriesList.value.map(
      (s) => `${s.label ?? ""}:${s.hidden ? 0 : 1}:${s.points?.length ?? 0}`
    ).join("|");
  }
  function updateData() {
    if (!chart) {
      build2();
      return;
    }
    const sig = structSig();
    if (sig !== lastStructSig) {
      build2();
      return;
    }
    const data = toAlignedSeriesData(seriesList.value);
    chart.setData(data);
  }
  onMounted(build2);
  watch(seriesList, updateData);
  watch(
    [
      () => unrefAny(opts.width),
      () => unrefAny(opts.height),
      () => unrefAny(opts.mode),
      () => unrefAny(opts.xMin),
      () => unrefAny(opts.xMax),
      () => unrefAny(opts.timeX),
      () => unrefAny(opts.softMin),
      () => unrefAny(opts.softMax),
      () => unrefAny(opts.spanNulls),
      () => unrefAny(opts.lineWidth),
      () => unrefAny(opts.fillOpacity),
      () => unrefAny(opts.showLegend),
      () => unrefAny(opts.barWidthFactor),
      () => unrefAny(opts.barBucketSize),
      () => unrefAny(opts.xValueLabels),
      () => unrefAny(opts.xTickLabelRotation),
      () => unrefAny(opts.fullHighlight),
      () => unrefAny(opts.xAxisSize),
      () => unrefAny(opts.xAxisGap),
      () => unrefAny(opts.yValueLabels),
      () => unrefAny(opts.gradientMode),
      () => unrefAny(opts.lineInterpolation),
      () => unrefAny(opts.axis),
      () => unrefAny(opts.thresholds),
      () => unrefAny(opts.thresholdsMode),
      () => unrefAny(opts.thresholdsPercent),
      () => unrefAny(opts.showValues),
      () => unrefAny(opts.bands),
      () => unrefAny(opts.tooltipMode),
      () => unrefAny(opts.drawHook),
      () => unrefAny(opts.extraScales)
    ],
    build2,
    { deep: true }
  );
  const themeOff = onThemeChange(() => {
    try {
      build2();
    } catch {
    }
  });
  onBeforeUnmount(() => {
    themeOff?.();
    chart?.destroy();
    chart = null;
  });
  return {
    rebuild: build2,
    getChart: () => chart,
    hover
  };
}
const _hoisted_1$2J = {
  class: "panel-content-only",
  "data-testid": "panel-content-only",
  "data-panel-type": "histogram"
};
const _hoisted_2$2b = { class: "chart-wrap" };
const _hoisted_3$1X = ["data-empty", "data-bucket-count", "data-bucket-size", "data-bucket-offset", "data-fill-opacity", "data-line-width", "data-gradient", "data-stacking", "data-combine", "data-calc", "data-calc-option", "data-series-count", "data-band-count", "data-legend-show", "data-tooltip-mode"];
const _hoisted_4$1E = {
  key: 0,
  class: "panel-empty",
  "data-testid": "histogram-empty"
};
const _hoisted_5$1t = {
  key: 0,
  class: "legend",
  "data-testid": "histogram-legend",
  "data-placement": "bottom"
};
const _hoisted_6$1f = { class: "name" };
const _sfc_main$3t = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    useCssVars((_ctx) => ({
      "c54ddfea": height2.value + "px"
    }));
    const props = __props;
    const el = ref(null);
    const opts = computed(() => props.options ?? {});
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    function collectFieldSeries() {
      const rows = [];
      for (const frame of props.data?.series ?? []) {
        for (const f of frame.fields.filter((x) => x.type === "number")) {
          const values = [];
          for (const v of f.values) {
            const n = Number(v);
            if (Number.isFinite(n)) values.push(n);
          }
          if (!values.length) continue;
          const label = getFieldDisplayName(f, frame, props.data?.series);
          const color = getFieldColor(values[values.length - 1] ?? 0, {
            ...props.fieldConfig?.defaults ?? {},
            ...f.config ?? {}
          }) || void 0;
          rows.push({ label, values, color });
        }
      }
      return rows;
    }
    const HISTOGRAM_BUCKET_SIZES = [
      1e-9,
      2e-9,
      25e-10,
      4e-9,
      5e-9,
      1e-8,
      2e-8,
      25e-9,
      4e-8,
      5e-8,
      1e-7,
      2e-7,
      25e-8,
      4e-7,
      5e-7,
      1e-6,
      2e-6,
      25e-7,
      4e-6,
      5e-6,
      1e-5,
      2e-5,
      25e-6,
      4e-5,
      5e-5,
      1e-4,
      2e-4,
      25e-5,
      4e-4,
      5e-4,
      1e-3,
      2e-3,
      25e-4,
      4e-3,
      5e-3,
      0.01,
      0.02,
      0.025,
      0.04,
      0.05,
      0.1,
      0.2,
      0.25,
      0.4,
      0.5,
      1,
      2,
      4,
      5,
      10,
      20,
      25,
      40,
      50,
      100,
      200,
      250,
      400,
      500,
      1e3,
      2e3,
      2500,
      4e3,
      5e3,
      1e4,
      2e4,
      25e3,
      4e4,
      5e4,
      1e5,
      2e5,
      25e4,
      4e5,
      5e5,
      1e6
    ];
    function pickBucketSize(allValues, bucketCount, explicit) {
      if (explicit && explicit > 0) return explicit;
      const sorted = [...allValues].filter((n) => Number.isFinite(n)).sort((a, b) => a - b);
      if (!sorted.length) return 1;
      let smallestDelta = Infinity;
      if (sorted.length === 1) {
        smallestDelta = 1;
      } else {
        for (let i = 1; i < sorted.length; i++) {
          const delta = sorted[i] - sorted[i - 1];
          if (delta !== 0) smallestDelta = Math.min(smallestDelta, delta);
        }
      }
      if (!Number.isFinite(smallestDelta)) smallestDelta = 1;
      const min = sorted[0];
      const max = sorted[sorted.length - 1];
      const range = max - min;
      const targetSize = range / Math.max(bucketCount, 1);
      for (const size of HISTOGRAM_BUCKET_SIZES) {
        if (targetSize < size && size >= smallestDelta) return size;
      }
      return Math.max(smallestDelta, targetSize || 1);
    }
    function isBucketFieldName(name, kind2) {
      const n = String(name);
      if (kind2 === "min") return n === "xMin" || n === "BucketMin";
      return n === "xMax" || n === "BucketMax";
    }
    function originalDataHasHistogram(frames) {
      if (!frames || frames.length !== 1) return false;
      const frame = frames[0];
      const fields = frame?.fields ?? [];
      if (fields.length < 3) return false;
      if (!isBucketFieldName(fields[0]?.name, "min") || !isBucketFieldName(fields[1]?.name, "max")) {
        return false;
      }
      return fields.every((f) => f.type === "number");
    }
    function seriesFromPreBucketedHistogram(frame) {
      const fields = frame.fields ?? [];
      const xMin = fields[0];
      const out = [];
      for (let fi = 2; fi < fields.length; fi++) {
        const f = fields[fi];
        const points = [];
        const n = Math.min(xMin.values.length, f.values.length);
        for (let i = 0; i < n; i++) {
          const x = Number(xMin.values[i]);
          const y = Number(f.values[i]);
          if (Number.isFinite(x) && Number.isFinite(y)) points.push({ x, y });
        }
        if (!points.length) continue;
        const label = getFieldDisplayName(f, frame, [frame]);
        const color = getFieldColor(points[points.length - 1]?.y ?? 0, {
          ...props.fieldConfig?.defaults ?? {},
          ...f.config ?? {}
        }) || void 0;
        out.push({
          label,
          values: points.map((p) => p.y),
          color,
          points
        });
      }
      return out;
    }
    const preBucketed = computed(() => {
      const has = originalDataHasHistogram(props.data?.series);
      const calc = opts.value.__calc__;
      if (calc === false || calc === "false" || calc === "client") return false;
      if (calc === true || calc === "true" || calc === "query") return has;
      return has;
    });
    function bucketizeValues(values, size, offset) {
      const counts = /* @__PURE__ */ new Map();
      for (const n of values) {
        if (!Number.isFinite(n)) continue;
        const bucket = Math.floor((n - offset) / size) * size + offset;
        const key = Math.round(bucket * 1e9) / 1e9;
        counts.set(key, (counts.get(key) ?? 0) + 1);
      }
      return [...counts.entries()].sort((a, b) => a[0] - b[0]).map(([x, y]) => ({ x, y }));
    }
    const series = computed(() => {
      const bucketCount = Math.max(1, Number(opts.value.bucketCount ?? 30));
      const fillOpacity0 = Number(
        opts.value.fillOpacity ?? custom.value.fillOpacity ?? 80
      );
      const lineWidth0 = Number(opts.value.lineWidth ?? custom.value.lineWidth ?? 1);
      if (preBucketed.value) {
        const frame = props.data?.series?.[0];
        const pre = seriesFromPreBucketedHistogram(frame);
        return pre.map((g) => ({
          label: g.label,
          color: g.color || void 0,
          points: g.points ?? [],
          fillOpacity: fillOpacity0,
          lineWidth: lineWidth0
        }));
      }
      const fieldSeries = collectFieldSeries();
      if (!fieldSeries.length) return [];
      const combine = opts.value.combine === true;
      const stackingMode = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? custom.value.stacking?.mode ?? custom.value.stacking ?? "none"
      );
      const fillOpacity = Number(
        opts.value.fillOpacity ?? custom.value.fillOpacity ?? 80
      );
      const lineWidth = Number(opts.value.lineWidth ?? custom.value.lineWidth ?? 1);
      const allNums = fieldSeries.flatMap((s) => s.values);
      const offset = Number(opts.value.bucketOffset ?? 0);
      const size = pickBucketSize(
        allNums,
        bucketCount,
        Number(opts.value.bucketSize) || void 0
      );
      const groups = combine ? [{ label: "count", values: allNums, color: fieldSeries[0]?.color }] : fieldSeries;
      let out = groups.map((g) => {
        const points = bucketizeValues(g.values, size, offset);
        return {
          label: g.label,
          color: g.color || void 0,
          points,
          fillOpacity,
          lineWidth
        };
      });
      if ((stackingMode === "normal" || stackingMode === "percent") && out.length > 1) {
        const xs = /* @__PURE__ */ new Map();
        const totals = /* @__PURE__ */ new Map();
        if (stackingMode === "percent") {
          for (const s of out) {
            for (const p of s.points) {
              if (p.y == null || !Number.isFinite(p.y)) continue;
              totals.set(p.x, (totals.get(p.x) ?? 0) + Math.abs(p.y));
            }
          }
        }
        out = out.map((s) => {
          if ((s.fillOpacity ?? 0) <= 0) s.fillOpacity = 35;
          s.points = s.points.map((p) => {
            if (p.y == null || !Number.isFinite(p.y)) return p;
            let y = p.y;
            if (stackingMode === "percent") {
              const t2 = totals.get(p.x) || 1;
              y = y / t2 * 100;
            }
            const base = xs.get(p.x) ?? 0;
            const stacked = base + y;
            xs.set(p.x, stacked);
            return { x: p.x, y: stacked };
          });
          return s;
        });
      }
      return out;
    });
    const plotBands = computed(() => {
      const stackingMode = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? custom.value.stacking?.mode ?? custom.value.stacking ?? "none"
      );
      if ((stackingMode === "normal" || stackingMode === "percent") && series.value.length > 1) {
        return stackingBandsForSeriesCount(series.value.length, 1);
      }
      return [];
    });
    const width2 = computed(() => props.width || 400);
    const showLegend = computed(() => opts.value.legend?.showLegend !== false);
    const legendReserve = computed(() => showLegend.value ? 32 : 0);
    const height2 = computed(
      () => Math.max((props.height || 200) - legendReserve.value, 40)
    );
    const legendItems = computed(
      () => series.value.map((s) => ({
        label: s.label || "value",
        color: s.color || "#73BF69"
      }))
    );
    const barWidthFactor = computed(() => 1);
    const histScale = computed(() => {
      const bucketCount = Math.max(1, Number(opts.value.bucketCount ?? 30));
      Number(opts.value.bucketOffset ?? 0);
      const fieldSeries = collectFieldSeries();
      const allNums = fieldSeries.flatMap((s) => s.values);
      const size = pickBucketSize(
        allNums,
        bucketCount,
        Number(opts.value.bucketSize) || void 0
      );
      const xs = series.value.flatMap((s) => s.points.map((p) => Number(p.x))).filter((n) => Number.isFinite(n));
      if (!xs.length || !Number.isFinite(size) || size <= 0) {
        return {
          bucketSize: size || 1,
          xMin: void 0,
          xMax: void 0
        };
      }
      const minX = Math.min(...xs);
      const maxX = Math.max(...xs);
      return { bucketSize: size, xMin: minX, xMax: maxX + size };
    });
    const softMax = computed(() => {
      const stackingMode = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? custom.value.stacking?.mode ?? custom.value.stacking ?? "none"
      );
      return stackingMode === "percent" ? 100 : void 0;
    });
    const softMin = computed(() => 0);
    const noData = computed(() => {
      if (props.data?.state === "Loading" || props.data?.error) return false;
      return !series.value.length || series.value.every(
        (s) => !s.points.some((p) => p.y != null && Number.isFinite(p.y))
      );
    });
    const seriesCount = computed(() => series.value.length);
    function histogramXSplits(u, _axisIdx, _scaleMin, _scaleMax, _foundIncr, _foundSpace) {
      const bucketSize = histScale.value.bucketSize;
      if (!bucketSize || bucketSize <= 0) return [];
      const dataX = u.data?.[0] || [];
      if (!dataX.length) return [];
      const xScaleMin = histScale.value.xMin ?? dataX[0];
      const xScaleMax = histScale.value.xMax ?? dataX[dataX.length - 1] + bucketSize;
      const firstSplit = Math.floor(xScaleMin / bucketSize) * bucketSize;
      const lastSplit = Math.ceil(xScaleMax / bucketSize) * bucketSize;
      const minSpace = u.axes?.[_axisIdx]?._space ?? 40;
      const bucketWidth = Math.abs(
        u.valToPos(dataX[0] + bucketSize, "x") - u.valToPos(dataX[0], "x")
      );
      const skip = Math.max(1, Math.ceil(minSpace / Math.max(bucketWidth, 1)));
      const splits = [];
      for (let i = 0, s = firstSplit; s <= lastSplit + bucketSize * 1e-9; i++, s += bucketSize) {
        if (i % skip === 0) splits.push(Number(s.toPrecision(12)));
      }
      return splits;
    }
    useUPlot(el, series, {
      width: width2,
      height: height2,
      mode: "bars",
      timeX: false,
      showLegend: false,
      barWidthFactor,
      barBucketSize: computed(() => histScale.value.bucketSize),
      xMin: computed(() => histScale.value.xMin),
      xMax: computed(() => histScale.value.xMax),
      xSplits: histogramXSplits,
      softMin,
      softMax,
      bands: plotBands,
      // Dual-run: +1px axis size shifts left grid 36→37; gap 4 pulls y labels left to match Grafana
      axis: { width: 28, gap: 5 },
      gradientMode: computed(
        () => String(opts.value.gradientMode ?? custom.value.gradientMode ?? "none")
      )
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2J, [
        createElementVNode(
          "div",
          {
            class: normalizeClass(["hist", { "legend-bottom": showLegend.value }])
          },
          [
            createElementVNode("div", _hoisted_2$2b, [
              createElementVNode("div", {
                ref_key: "el",
                ref: el,
                class: "chart",
                "data-testid": "histogram-panel",
                "data-empty": String(noData.value),
                "data-bucket-count": String(opts.value.bucketCount ?? 30),
                "data-bucket-size": String(opts.value.bucketSize ?? ""),
                "data-bucket-offset": String(opts.value.bucketOffset ?? 0),
                "data-fill-opacity": String(opts.value.fillOpacity ?? custom.value.fillOpacity ?? 80),
                "data-line-width": String(opts.value.lineWidth ?? custom.value.lineWidth ?? 1),
                "data-gradient": String(opts.value.gradientMode ?? custom.value.gradientMode ?? "none"),
                "data-stacking": String(
                  opts.value.stacking?.mode ?? opts.value.stacking ?? custom.value.stacking?.mode ?? custom.value.stacking ?? "none"
                ),
                "data-combine": String(!!opts.value.combine),
                "data-calc": preBucketed.value ? "query" : "client",
                "data-calc-option": String(opts.value.__calc__ ?? ""),
                "data-series-count": String(seriesCount.value),
                "data-band-count": String(plotBands.value.length),
                "data-legend-show": String(showLegend.value),
                "data-tooltip-mode": String(opts.value.tooltip?.mode ?? "single")
              }, null, 8, _hoisted_3$1X),
              noData.value ? (openBlock(), createElementBlock("div", _hoisted_4$1E, [..._cache[0] || (_cache[0] = [
                createElementVNode(
                  "p",
                  { class: "panel-empty__msg" },
                  "回复中未找到直方图",
                  -1
                  /* CACHED */
                )
              ])])) : createCommentVNode("v-if", true)
            ]),
            showLegend.value && !noData.value ? (openBlock(), createElementBlock("ul", _hoisted_5$1t, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(legendItems.value, (s, i) => {
                  return openBlock(), createElementBlock("li", {
                    key: i,
                    "data-testid": "histogram-legend-item"
                  }, [
                    createElementVNode(
                      "i",
                      {
                        class: "legend-swatch",
                        style: normalizeStyle({ background: s.color })
                      },
                      null,
                      4
                      /* STYLE */
                    ),
                    createElementVNode(
                      "span",
                      _hoisted_6$1f,
                      toDisplayString(s.label),
                      1
                      /* TEXT */
                    )
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])) : createCommentVNode("v-if", true)
          ],
          2
          /* CLASS */
        )
      ]);
    };
  }
});
const Panel$h = /* @__PURE__ */ _export_sfc(_sfc_main$3t, [["__scopeId", "data-v-cd17ba21"]]);
new VuePanelPlugin(
  {
    id: "histogram",
    name: "直方图",
    description: "数值分布直方图",
    state: "stable",
    skipDataQuery: false
  },
  Panel$h
).useFieldConfig({
  useCustomConfig: (builder) => {
    const cat = ["直方图"];
    builder.addRadio(
      {
        id: "custom.stacking",
        path: "custom.stacking",
        name: "堆叠",
        category: cat,
        settings: {
          options: [
            { label: "关闭", value: "none" },
            { label: "普通", value: "normal" },
            { label: "百分比", value: "percent" }
          ]
        }
      },
      "none"
    ).addSlider(
      {
        id: "custom.lineWidth",
        path: "custom.lineWidth",
        name: "线宽",
        category: cat,
        settings: { min: 0, max: 10, step: 1 }
      },
      1
    ).addSlider(
      {
        id: "custom.fillOpacity",
        path: "custom.fillOpacity",
        name: "填充不透明度",
        category: cat,
        settings: { min: 0, max: 100, step: 1 }
      },
      80
    ).addRadio(
      {
        id: "custom.gradientMode",
        path: "custom.gradientMode",
        name: "渐变模式",
        category: cat,
        settings: {
          options: [
            { label: "无", value: "none" },
            { label: "不透明度", value: "opacity" },
            { label: "色相", value: "hue" },
            { label: "色板", value: "scheme" }
          ]
        }
      },
      "none"
    ).addCustom({
      id: "custom.hideFrom",
      path: "custom.hideFrom",
      name: "隐藏",
      category: ["Series"],
      editor: "text",
      isCustom: true
    });
  }
}).setPanelOptions((builder) => {
  const cat = ["直方图"];
  builder.addText(
    {
      id: "__calc__",
      path: "__calc__",
      name: "数值",
      description: "查询已返回直方图频率时显示",
      category: cat
    },
    void 0
  ).addNumber(
    {
      id: "bucketCount",
      path: "bucketCount",
      name: "分桶数",
      description: "自动分桶时的目标桶数量",
      category: cat,
      settings: { min: 0, placeholder: "默认: 30" }
    },
    30
  ).addNumber(
    {
      id: "bucketSize",
      path: "bucketSize",
      name: "桶大小",
      description: "固定桶宽；留空则自动",
      category: cat,
      settings: { min: 0, placeholder: "自动" }
    },
    void 0
  ).addNumber(
    {
      id: "bucketOffset",
      path: "bucketOffset",
      name: "桶偏移",
      category: cat,
      settings: { min: 0, placeholder: "默认: 0" }
    },
    0
  ).addBoolean(
    {
      id: "combine",
      path: "combine",
      name: "合并序列",
      description: "将所有序列合并为一个直方图",
      category: cat
    },
    false
  ).addRadio(
    {
      id: "stacking",
      path: "stacking",
      name: "堆叠",
      category: cat,
      settings: {
        options: [
          { label: "关闭", value: "none" },
          { label: "普通", value: "normal" },
          { label: "百分比", value: "percent" }
        ]
      }
    },
    "none"
  ).addSlider(
    {
      id: "lineWidth",
      path: "lineWidth",
      name: "线宽",
      category: cat,
      settings: { min: 0, max: 10, step: 1 }
    },
    1
  ).addSlider(
    {
      id: "fillOpacity",
      path: "fillOpacity",
      name: "填充不透明度",
      category: cat,
      settings: { min: 0, max: 100, step: 1 }
    },
    80
  ).addRadio(
    {
      id: "gradientMode",
      path: "gradientMode",
      name: "渐变模式",
      category: cat,
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "不透明度", value: "opacity" },
          { label: "色相", value: "hue" },
          { label: "色板", value: "scheme" }
        ]
      }
    },
    "none"
  );
  addTooltipOptions(builder);
  addLegendOptions(builder, true, true);
}).setRuntimeConsumedPaths([
  "__calc__",
  "bucketCount",
  "bucketSize",
  "bucketOffset",
  "combine",
  "stacking",
  "lineWidth",
  "fillOpacity",
  "gradientMode",
  "legend.showLegend",
  "tooltip.mode",
  "custom.lineWidth",
  "custom.fillOpacity",
  "custom.gradientMode",
  "custom.stacking"
]).register();
function clusterAnnotations(rawIn, opts = {}) {
  const clustering = opts.clustering !== false && opts.clustering !== 0;
  const multiLane = !!opts.multiLane;
  const raw = rawIn.map((a, i) => ({
    ...a,
    time: Number(a.time),
    timeEnd: a.timeEnd != null ? Number(a.timeEnd) : void 0,
    title: a.title ?? a.text ?? "annotation",
    color: a.color || "#f2cc0c",
    index: a.index ?? i
  })).filter((a) => Number.isFinite(a.time));
  if (!clustering || raw.length <= 1) {
    return raw.map((a, i) => ({
      ...a,
      lane: multiLane ? i % 3 : 0,
      count: 1,
      items: [a]
    }));
  }
  const sorted = [...raw].sort((a, b) => a.time - b.time);
  const times = sorted.map((a) => a.time);
  const span = times.length ? Math.max(...times) - Math.min(...times) : 0;
  const thr = Math.max(span * 0.01, 6e4);
  const groups = [];
  for (const a of sorted) {
    const g = groups[groups.length - 1];
    if (g && Math.abs(a.time - g[0].time) <= thr) g.push(a);
    else groups.push([a]);
  }
  return groups.map((g, gi) => {
    const head = g[0];
    return {
      ...head,
      title: g.length > 1 ? `${g.length} 条注解` : head.title,
      text: g.length > 1 ? g.map((x) => x.title).join(", ") : head.text,
      count: g.length,
      items: g,
      lane: multiLane ? gi % 3 : 0
    };
  });
}
function clampTooltipPosition(opts) {
  const tw = Math.max(40, opts.tooltipWidth ?? 160);
  const th = Math.max(24, opts.tooltipHeight ?? 64);
  const ox = opts.offsetX;
  const oy = opts.offsetY;
  const cw = Math.max(1, opts.containerWidth);
  const ch = Math.max(1, opts.containerHeight);
  let left = opts.cursorLeft + ox;
  let top = opts.cursorTop + oy;
  if (left + tw > cw) {
    left = opts.cursorLeft - tw - Math.abs(ox) / 2;
  }
  if (top + th > ch) {
    top = opts.cursorTop - th - 4;
  }
  left = Math.max(0, Math.min(left, Math.max(0, cw - tw)));
  top = Math.max(0, Math.min(top, Math.max(0, ch - th)));
  return { left, top };
}
function hasNegSample$1(data, samples = 100) {
  const len = data.length;
  if (len === 0) return false;
  let firstIdx = 0;
  let lastIdx = len - 1;
  while (firstIdx <= lastIdx && data[firstIdx] == null) firstIdx++;
  while (lastIdx >= firstIdx && data[lastIdx] == null) lastIdx--;
  if (lastIdx < firstIdx) return false;
  let negCount = 0;
  let posCount = 0;
  const stride = Math.max(1, Math.floor((lastIdx - firstIdx + 1) / samples));
  for (let i = firstIdx; i <= lastIdx; i += stride) {
    const v = data[i];
    if (v != null && typeof v === "number") {
      if (v < 0 || Object.is(v, -0)) negCount++;
      else if (v > 0) posCount++;
    }
  }
  return negCount > posCount;
}
function getStackDirection(transform, values) {
  const hasNeg = hasNegSample$1(values ?? []);
  const t2 = String(transform || "");
  const isNegY = t2 === "negative-Y" || t2 === "negativeY" || t2 === "NegativeY";
  if (isNegY) return hasNeg ? 1 : -1;
  return hasNeg ? -1 : 1;
}
function buildScaleKey(f) {
  return [f.unit ?? "", f.softMin ?? "", f.softMax ?? ""].join("|");
}
function getStackingGroups(fields) {
  const groups = /* @__PURE__ */ new Map();
  for (const f of fields) {
    if (f.hideFromViz) continue;
    const mode2 = String(f.stackingMode ?? "none");
    if (!mode2 || mode2 === "none" || mode2 === "off") continue;
    const dir = getStackDirection(f.transform, f.values);
    const groupName = f.stackingGroup ?? "A";
    const drawStyle = f.drawStyle ?? "line";
    const drawStyle2 = f.drawStyle2 ?? null;
    const stackKey = `${dir}|${mode2}|${groupName}|${buildScaleKey(f)}|${drawStyle}|${drawStyle2}`;
    let group = groups.get(stackKey);
    if (!group) {
      group = { series: [], dir };
      groups.set(stackKey, group);
    }
    group.series.push(f.index);
  }
  return [...groups.values()];
}
function toUPlotSeriesIndices(group) {
  return group.series.map((i) => i + 1);
}
function hasNegSample(data, samples = 100) {
  const len = data.length;
  if (len === 0) return false;
  let firstIdx = 0;
  let lastIdx = len - 1;
  while (firstIdx <= lastIdx && data[firstIdx] == null) firstIdx++;
  while (lastIdx >= firstIdx && data[lastIdx] == null) lastIdx--;
  if (lastIdx < firstIdx) return false;
  let negCount = 0;
  let posCount = 0;
  const stride = Math.max(1, Math.floor((lastIdx - firstIdx + 1) / samples));
  for (let i = firstIdx; i <= lastIdx; i += stride) {
    const v = data[i];
    if (v != null && typeof v === "number") {
      if (v < 0 || Object.is(v, -0)) negCount++;
      else if (v > 0) posCount++;
    }
  }
  return negCount > posCount;
}
function getStackDirectionFromValues(transform, data) {
  const hasNeg = hasNegSample(data);
  const t2 = String(transform || "");
  const isNegY = t2 === "negative-Y" || t2 === "negativeY" || t2 === "NegativeY";
  if (isNegY) {
    return hasNeg ? 1 : -1;
  }
  return hasNeg ? -1 : 1;
}
function buildScaleKeyFromField(field) {
  const cfg = field.config ?? {};
  const custom = cfg.custom ?? {};
  const unit = cfg.unit ?? "short";
  const min = cfg.min ?? "na";
  const max = cfg.max ?? "na";
  const softMin = custom.axisSoftMin ?? "na";
  const softMax = custom.axisSoftMax ?? "na";
  const placement = custom.axisPlacement ?? "auto";
  const dist = custom.scaleDistribution?.type ? custom.scaleDistribution.type === "log" ? `log${custom.scaleDistribution.log ?? ""}` : custom.scaleDistribution.type : "linear";
  const label = custom.axisLabel ? custom.axisLabel : "na";
  return `${unit}/${min}-${max}/${softMin}-${softMax}/${placement}/${dist}/${label}/${field.type}`;
}
function getStackingGroupsFromFrame(frame) {
  const groups = /* @__PURE__ */ new Map();
  frame.fields.forEach((field, i) => {
    if (i === 0) return;
    const custom = field.config?.custom;
    if (custom == null) return;
    if (custom.hideFrom?.viz) return;
    const stacking = custom.stacking;
    if (stacking == null) return;
    const stackingMode = String(stacking.mode ?? "none");
    if (!stackingMode || stackingMode === "none" || stackingMode === "None")
      return;
    const transform = custom.transform;
    const stackDir = getStackDirectionFromValues(
      transform,
      field.values
    );
    const stackingGroup = stacking.group ?? "A";
    const drawStyle = custom.drawStyle ?? "line";
    const drawStyle2 = drawStyle === "bars" ? custom.barAlignment ?? null : drawStyle === "line" ? custom.lineInterpolation ?? null : null;
    const stackKey = `${stackDir}|${stackingMode}|${stackingGroup}|${buildScaleKeyFromField(field)}|${drawStyle}|${drawStyle2}`;
    let group = groups.get(stackKey);
    if (!group) {
      group = { series: [], dir: stackDir };
      groups.set(stackKey, group);
    }
    group.series.push(i);
  });
  return [...groups.values()];
}
function preparePlotData2(frame, stackingGroups, onStackMeta) {
  const data = Array(frame.fields.length);
  const stacksQty = stackingGroups.length;
  const dataLen = frame.length ?? frame.fields[0]?.values?.length ?? 0;
  const zeroArr = stacksQty > 0 ? Array(dataLen).fill(0) : [];
  const falseArr = stacksQty > 0 ? Array(dataLen).fill(false) : [];
  const accums = Array.from(
    { length: stacksQty },
    () => zeroArr.slice()
  );
  const anyValsAtX = Array.from(
    { length: stacksQty },
    () => falseArr.slice()
  );
  stackingGroups.forEach((group, groupIdx) => {
    const groupValsAtX = anyValsAtX[groupIdx];
    group.series.forEach((seriesIdx) => {
      const field = frame.fields[seriesIdx];
      if (field?.config?.custom?.hideFrom?.viz) return;
      const vals = field.values;
      for (let i = 0; i < dataLen; i++) {
        if (vals[i] != null) groupValsAtX[i] = true;
      }
    });
  });
  frame.fields.forEach((field, fi) => {
    let vals = field.values.slice();
    if (fi === 0) {
      data[fi] = vals;
      return;
    }
    const custom = field.config?.custom;
    if (!custom || custom.hideFrom?.viz) {
      data[fi] = vals;
      return;
    }
    const transform = String(custom.transform ?? "");
    if (transform === "constant" || transform === "Constant") {
      const firstValIdx = vals.findIndex((v) => v != null);
      const firstVal = vals[firstValIdx];
      vals = Array(vals.length).fill(void 0);
      if (firstValIdx >= 0) vals[firstValIdx] = firstVal;
    } else if (transform === "negative-Y" || transform === "negativeY" || transform === "NegativeY") {
      vals = vals.slice();
      for (let i = 0; i < vals.length; i++) {
        if (vals[i] != null) vals[i] = Number(vals[i]) * -1;
      }
    }
    const stackingMode = custom.stacking?.mode;
    if (!stackingMode || stackingMode === "none" || stackingMode === "None") {
      data[fi] = vals;
    } else {
      const stackIdx = stackingGroups.findIndex(
        (group) => group.series.indexOf(fi) > -1
      );
      const accum = accums[stackIdx];
      const groupValsAtX = anyValsAtX[stackIdx];
      const stacked = data[fi] = Array(dataLen);
      for (let i = 0; i < dataLen; i++) {
        const v = vals[i];
        if (v != null) {
          stacked[i] = accum[i] += Number(v);
        } else {
          stacked[i] = groupValsAtX[i] ? accum[i] : v;
        }
      }
    }
  });
  frame.fields.forEach((field, fi) => {
    if (fi === 0 || field.config?.custom?.hideFrom?.viz) return;
    const stackingMode = field.config?.custom?.stacking?.mode;
    if (stackingMode === "percent" || stackingMode === "Percent") {
      const stackIdx = stackingGroups.findIndex(
        (group2) => group2.series.indexOf(fi) > -1
      );
      if (stackIdx < 0) return;
      const accum = accums[stackIdx];
      const group = stackingGroups[stackIdx];
      const stacked = data[fi];
      for (let i = 0; i < dataLen; i++) {
        const v = stacked[i];
        if (v != null) {
          stacked[i] = accum[i] === 0 ? 0 : group.dir * (Number(v) / accum[i]);
        }
      }
    }
  });
  return data;
}
const _hoisted_1$2I = {
  class: "panel-content-only",
  "data-testid": "panel-content-only",
  "data-panel-type": "timeseries"
};
const _hoisted_2$2a = ["data-tooltip-mode", "data-tooltip-sort", "data-draw-style", "data-line-interp", "data-gradient", "data-axis-placement", "data-show-values", "data-thresholds-mode", "data-hover-proximity", "data-tooltip-max-width", "data-tooltip-max-height", "data-axis-color-mode", "data-axis-width", "data-bar-alignment", "data-fill-below-to", "data-line-style", "data-insert-nulls", "data-legend-limit", "data-legend-overflow", "data-legend-width", "data-legend-show", "data-legend-display-mode", "data-legend-placement", "data-legend-faceted", "data-tooltip-hide-zeros", "data-anno-clustering", "data-anno-multi-lane"];
const _hoisted_3$1W = { class: "chart-wrap" };
const _hoisted_4$1D = ["data-mode", "data-tt-left", "data-tt-top"];
const _hoisted_5$1s = {
  key: 0,
  class: "tt-mirror",
  "data-testid": "uplot-tooltip-y-axis",
  "aria-hidden": "true"
};
const _hoisted_6$1e = ["data-series-index", "data-color"];
const _hoisted_7$16 = {
  class: "tt-mirror",
  "data-testid": "uplot-tooltip-time",
  "aria-hidden": "true"
};
const _hoisted_8$Y = {
  key: 1,
  class: "anno-layer",
  "data-testid": "timeseries-annotations"
};
const _hoisted_9$U = ["title", "data-anno-index", "data-count", "data-lane", "onMouseenter", "onFocus"];
const _hoisted_10$M = {
  key: 0,
  class: "anno-tip",
  "data-testid": "anno-tooltip"
};
const _hoisted_11$E = { key: 0 };
const _hoisted_12$x = { class: "ts-val" };
const _hoisted_13$w = ["data-faceted-keys"];
const _hoisted_14$v = ["data-facet-key"];
const _hoisted_15$p = { class: "faceted-key" };
const _hoisted_16$n = ["data-facet-value"];
const _hoisted_17$k = ["checked", "onChange"];
const _hoisted_18$k = ["data-placement", "data-mode", "data-scroll-x", "data-scroll-y", "data-calcs", "data-item-count"];
const _hoisted_19$i = ["data-series", "data-index", "onClick"];
const _hoisted_20$g = {
  class: "name",
  "data-testid": "legend-name"
};
const _hoisted_21$c = {
  key: 0,
  class: "stats",
  "data-testid": "legend-stats"
};
const _sfc_main$3s = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  emits: ["inspect", "fullscreen", "edit", "view", "duplicate", "remove", "share", "explore", "copy", "toggleLegend", "help", "copyStyles", "pasteStyles", "timeSettings", "libraryPanel", "unlinkLibrary", "alertRule"],
  setup(__props, { emit: __emit }) {
    useCssVars((_ctx) => ({
      "v14c42f82": chartHeightCss.value,
      "v230f25a6": legendMaxHeightCss.value,
      "v35d1be60": legendWidthPx.value
    }));
    function arrMin(a) {
      let m = Infinity;
      for (let i = 0; i < a.length; i++) {
        const v = a[i];
        if (v != null && v < m) m = v;
      }
      return m;
    }
    function arrMax(a) {
      let m = -Infinity;
      for (let i = 0; i < a.length; i++) {
        const v = a[i];
        if (v != null && v > m) m = v;
      }
      return m;
    }
    const props = __props;
    const chartEl = ref(null);
    const hoverAnno = ref(
      null
    );
    const hiddenSeries = ref(/* @__PURE__ */ new Set());
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    const panelOpts = computed(() => props.options ?? {});
    const showAnnotations = computed(
      () => panelOpts.value?.annotations?.show !== false
    );
    function fieldCustom(field) {
      return { ...custom.value, ...field.config?.custom ?? {} };
    }
    function seriesColorForField(field, cfg, seriesIndex) {
      const mode2 = cfg?.color?.mode ?? field.config?.color?.mode;
      if (mode2 === "fixed" && (cfg?.color?.fixedColor || field.config?.color?.fixedColor)) {
        return getFieldColor(0, cfg) || getFieldSeriesColor(String(field.name || "series"), seriesIndex, cfg);
      }
      if (!mode2 || mode2 === "palette-classic" || mode2 === "palette-classic-by-name") {
        return getFieldSeriesColor(String(field.name || "series"), seriesIndex, {
          ...cfg,
          color: { mode: "palette-classic" }
        });
      }
      const last = Number(
        field.values?.[field.values?.length - 1] ?? 0
      );
      return getFieldColor(last, cfg) || getFieldSeriesColor(String(field.name || "series"), seriesIndex, cfg);
    }
    const annotations = computed(() => {
      if (!showAnnotations.value) return [];
      const list = (props.data?.annotations ?? []).map((a, i) => ({
        time: Number(a.time),
        timeEnd: a.timeEnd != null ? Number(a.timeEnd) : void 0,
        title: a.title ?? a.text ?? "annotation",
        text: a.text,
        color: a.color || "#f2cc0c",
        tags: a.tags ?? [],
        index: i
      }));
      return clusterAnnotations(list, {
        clustering: panelOpts.value?.annotations?.clustering,
        multiLane: !!panelOpts.value?.annotations?.multiLane
      });
    });
    const chartMode = computed(() => {
      const style = String(custom.value.drawStyle ?? "line");
      if (style === "bars") return "bars";
      if (style === "points") return "points";
      if (Number(custom.value.fillOpacity ?? 0) > 0) return "area";
      return "line";
    });
    function applyInsertNulls(points, insertNulls) {
      if (!insertNulls || points.length < 2) return points;
      const xs = points.map((p) => p.x).sort((a, b) => a - b);
      const steps = [];
      for (let i = 1; i < xs.length; i++) steps.push(xs[i] - xs[i - 1]);
      steps.sort((a, b) => a - b);
      const median = steps[Math.floor(steps.length / 2)] || 1;
      const threshold = typeof insertNulls === "number" ? insertNulls : median * 2.5;
      const out = [];
      for (let i = 0; i < points.length; i++) {
        out.push(points[i]);
        if (i < points.length - 1) {
          const gap = points[i + 1].x - points[i].x;
          if (gap > threshold) {
            out.push({ x: points[i].x + gap / 2, y: null });
          }
        }
      }
      return out;
    }
    const series = computed(() => {
      const out = [];
      const stackingMode = normalizeStacking(custom.value.stacking).mode;
      const fillBelowTo = custom.value.fillBelowTo ? String(custom.value.fillBelowTo) : "";
      for (let _frameIdx = 0; _frameIdx < (props.data?.series ?? []).length; _frameIdx++) {
        const frame = (props.data?.series ?? [])[_frameIdx];
        const time = frame.fields.find((f) => f.type === "time");
        if (!time) continue;
        for (const field of frame.fields.filter((f) => f.type === "number")) {
          const fc = fieldCustom(field);
          const hideFrom = normalizeHideFrom(fc.hideFrom);
          if (hideFrom.viz === true) continue;
          const cfg = { ...field.config, ...props.fieldConfig?.defaults ?? {} };
          const label = getFieldDisplayName(field, frame, props.data?.series);
          let points = time.values.map(
            (t2, i) => ({
              x: Number(t2),
              y: Number(field.values[i] ?? NaN)
            })
          );
          const transform = String(fc.transform ?? "");
          let constantY;
          if (transform === "negative-Y" || transform === "negativeY") {
            points = points.map((p) => ({
              ...p,
              y: p.y == null || Number.isNaN(p.y) ? p.y : -p.y
            }));
          } else if (transform === "constant") {
            const first = points.find(
              (p) => p.y != null && Number.isFinite(p.y)
            );
            if (first) constantY = first.y;
          }
          if (fc.insertNulls) {
            points = applyInsertNulls(
              points.filter((p) => p.y != null),
              fc.insertNulls
            );
          }
          const fieldFillBelow = String(fc.fillBelowTo ?? fillBelowTo ?? "");
          let fillOpacity = Number(fc.fillOpacity ?? custom.value.fillOpacity ?? 0);
          if (fieldFillBelow && fillOpacity <= 0) {
            fillOpacity = 35;
          }
          out.push({
            label,
            labels: { ...field.labels ?? {} },
            frameName: String(frame.name ?? frame.refId ?? ""),
            color: seriesColorForField(field, cfg, out.length),
            points,
            lineWidth: Number(fc.lineWidth ?? custom.value.lineWidth ?? 1),
            fillOpacity,
            spanNulls: Boolean(fc.spanNulls ?? custom.value.spanNulls),
            showPoints: String(
              fc.showPoints ?? custom.value.showPoints ?? "auto"
            ),
            pointSize: Number(fc.pointSize ?? custom.value.pointSize ?? 5),
            lineStyle: fc.lineStyle?.fill || fc.lineStyle || custom.value.lineStyle || "solid",
            lineInterpolation: String(
              fc.lineInterpolation ?? custom.value.lineInterpolation ?? "linear"
            ),
            hidden: hiddenSeries.value.has(label),
            hideLegend: hideFrom.legend === true,
            hideTooltip: hideFrom.tooltip === true,
            constantY,
            // used by plotBands (1-based uPlot series index pairing)
            fillBelowTo: fieldFillBelow || void 0,
            fieldName: field.name,
            displayNameFromDS: field.config?.displayNameFromDS,
            _frameIdx,
            stackingMode: normalizeStacking(fc.stacking ?? stackingMode).mode,
            stackingGroup: String(
              fc.stacking?.group ?? custom.value.stacking?.group ?? "A"
            ),
            transform: String(fc.transform ?? ""),
            unit: String(cfg.unit ?? ""),
            drawStyle: String(fc.drawStyle ?? custom.value.drawStyle ?? "line"),
            drawStyle2: String(fc.drawStyle ?? custom.value.drawStyle ?? "line") === "bars" ? fc.barAlignment ?? custom.value.barAlignment ?? 0 : String(
              fc.lineInterpolation ?? custom.value.lineInterpolation ?? "linear"
            )
          });
        }
      }
      if (stackingMode === "normal" || stackingMode === "percent") {
        const seriesMeta = out;
        const byFrame = /* @__PURE__ */ new Map();
        seriesMeta.forEach((s, _i) => {
          const fi = s._frameIdx;
          if (fi == null) return;
          if (!byFrame.has(fi)) byFrame.set(fi, []);
          byFrame.get(fi).push(s);
        });
        let usedPrepare = false;
        if (byFrame.size > 0) {
          for (const [, members] of byFrame) {
            if (members.length < 2) continue;
            const xs = /* @__PURE__ */ new Set();
            for (const s of members) for (const p of s.points) xs.add(p.x);
            const xArr = [...xs].sort((a, b) => a - b);
            const fields = [{ name: "time", type: "time", values: xArr }];
            for (const s of members) {
              const yByX = new Map(s.points.map((p) => [p.x, p.y]));
              fields.push({
                name: s.fieldName || s._fieldName || s.label,
                type: "number",
                values: xArr.map((x) => {
                  const y = yByX.get(x);
                  return y == null || !Number.isFinite(y) ? null : y;
                }),
                config: {
                  unit: s.unit,
                  custom: {
                    stacking: {
                      mode: s.stackingMode || stackingMode,
                      group: s.stackingGroup || "A"
                    },
                    transform: s.transform,
                    drawStyle: s.drawStyle,
                    hideFrom: s.hidden ? { viz: true } : void 0
                  }
                }
              });
            }
            const df = createDataFrame({ fields });
            const groups = getStackingGroupsFromFrame(df);
            const aligned = preparePlotData2(
              df,
              groups.length ? groups : getStackingGroupsFromFrame(df)
            );
            members.forEach((s, mi) => {
              const stacked = aligned[mi + 1] || [];
              if ((s.fillOpacity ?? 0) <= 0) s.fillOpacity = 35;
              const isPct = stackingMode === "percent";
              s.points = xArr.map((x, i) => {
                let y = stacked[i];
                if (y == null || !Number.isFinite(Number(y))) return { x, y: null };
                if (isPct) y = Number(y) * 100;
                return { x, y: Number(y) };
              });
            });
            usedPrepare = true;
          }
        }
        if (!usedPrepare) {
          const groups = getStackingGroups(
            seriesMeta.map((s, index2) => ({
              index: index2,
              stackingMode: s.stackingMode ?? stackingMode,
              stackingGroup: s.stackingGroup ?? "A",
              transform: s.transform,
              unit: s.unit,
              drawStyle: s.drawStyle,
              drawStyle2: s.drawStyle2,
              hideFromViz: !!s.hidden,
              values: s.points.map((p) => p.y == null ? null : Number(p.y))
            }))
          );
          const effective = groups.length > 0 ? groups : out.length > 1 ? [{ series: out.map((_, i) => i), dir: 1 }] : [];
          for (const g of effective) {
            const members = g.series.map((i) => seriesMeta[i]).filter(Boolean);
            const totals = /* @__PURE__ */ new Map();
            if (stackingMode === "percent") {
              for (const s of members) {
                for (const p of s.points) {
                  if (p.y == null || !Number.isFinite(p.y)) continue;
                  totals.set(p.x, (totals.get(p.x) ?? 0) + Math.abs(p.y));
                }
              }
            }
            const xs = /* @__PURE__ */ new Map();
            for (const s of members) {
              if ((s.fillOpacity ?? 0) <= 0) s.fillOpacity = 35;
              s.points = s.points.map((p) => {
                if (p.y == null || !Number.isFinite(p.y)) return p;
                let y = p.y;
                if (stackingMode === "percent") {
                  const tot = totals.get(p.x) || 1;
                  y = y / tot * 100;
                }
                const signed = g.dir === -1 ? -Math.abs(y) : y;
                const base = xs.get(p.x) ?? 0;
                const stacked = base + signed;
                xs.set(p.x, stacked);
                return { x: p.x, y: stacked };
              });
            }
          }
        }
      }
      return out;
    });
    const legendItems = computed(() => {
      const calcs = panelOpts.value?.legend?.calcs ?? [];
      const limit = Number(panelOpts.value?.legend?.limit ?? 0);
      let list = series.value.filter((s) => !s.hideLegend);
      if (Number.isFinite(limit) && limit > 0) list = list.slice(0, limit);
      return list.map((s) => {
        const vals = s.points.map((p) => p.y).filter((y) => y != null && Number.isFinite(y));
        const stats = [];
        const fmt = (n) => Math.abs(n) >= 1e3 || Math.abs(n) < 0.01 ? n.toPrecision(4) : n.toFixed(2);
        if ((calcs.includes("min") || calcs.includes("minNotNull")) && vals.length)
          stats.push(`min ${fmt(arrMin(vals))}`);
        if ((calcs.includes("max") || calcs.includes("maxNotNull")) && vals.length)
          stats.push(`max ${fmt(arrMax(vals))}`);
        if ((calcs.includes("mean") || calcs.includes("avg")) && vals.length) {
          stats.push(`mean ${fmt(vals.reduce((a, b) => a + b, 0) / vals.length)}`);
        }
        if ((calcs.includes("last") || calcs.includes("lastNotNull")) && vals.length)
          stats.push(`last ${fmt(vals[vals.length - 1])}`);
        if ((calcs.includes("first") || calcs.includes("firstNotNull")) && vals.length)
          stats.push(`first ${fmt(vals[0])}`);
        if (calcs.includes("sum") && vals.length)
          stats.push(`sum ${fmt(vals.reduce((a, b) => a + b, 0))}`);
        if (calcs.includes("count") && vals.length)
          stats.push(`count ${vals.length}`);
        if (calcs.includes("range") && vals.length)
          stats.push(`range ${fmt(arrMax(vals) - arrMin(vals))}`);
        if (calcs.includes("delta") && vals.length)
          stats.push(`delta ${fmt(vals[vals.length - 1] - vals[0])}`);
        if (calcs.includes("diff") && vals.length)
          stats.push(`diff ${fmt(vals[vals.length - 1] - vals[0])}`);
        return { ...s, stats: stats.join(" · ") };
      });
    });
    const timeDomain = computed(() => {
      let min = Infinity;
      let max = -Infinity;
      for (const s of series.value) {
        for (const p of s.points) {
          if (p.x < min) min = p.x;
          if (p.x > max) max = p.x;
        }
      }
      if (!Number.isFinite(min) || !Number.isFinite(max)) {
        const tr = props.timeRange;
        min = tr?.from?.getTime?.() ?? Date.now() - 36e5;
        max = tr?.to?.getTime?.() ?? Date.now();
      }
      if (min === max) max = min + 1;
      return { min, max };
    });
    function annoLeft(time) {
      const { min, max } = timeDomain.value;
      const pct = (time - min) / (max - min) * 100;
      return `${Math.max(0, Math.min(100, pct))}%`;
    }
    const chartWidth = computed(() => props.width || 400);
    const legendDisplayMode = computed(
      () => String(panelOpts.value?.legend?.displayMode ?? "list")
    );
    const legendPlacement = computed(
      () => String(panelOpts.value?.legend?.placement ?? "bottom")
    );
    const legendIsBottomList = computed(
      () => legendPlacement.value !== "right" && legendDisplayMode.value !== "table"
    );
    const legendMaxHeightPx = computed(() => {
      const h2 = props.height || 200;
      if (legendPlacement.value === "right") return h2;
      if (legendIsBottomList.value) return 44;
      return Math.max(32, Math.floor(h2 * 0.35));
    });
    const legendMaxHeightCss = computed(() => `${legendMaxHeightPx.value}px`);
    const legendEl = ref(null);
    const legendMeasuredH = ref(0);
    function measureLegend() {
      const el = legendEl.value;
      const show = panelOpts.value?.legend?.showLegend !== false;
      if (!el || !show || legendPlacement.value === "right") {
        legendMeasuredH.value = 0;
        return;
      }
      if (legendIsBottomList.value) {
        legendMeasuredH.value = Math.max(el.offsetHeight || 0, 44);
        return;
      }
      legendMeasuredH.value = el.offsetHeight || 0;
    }
    let legendRo = null;
    function bindLegendObserver() {
      legendRo?.disconnect();
      legendRo = null;
      const el = legendEl.value;
      if (!el || typeof ResizeObserver === "undefined") return;
      legendRo = new ResizeObserver(() => measureLegend());
      legendRo.observe(el);
    }
    onMounted(async () => {
      await nextTick();
      measureLegend();
      bindLegendObserver();
    });
    onBeforeUnmount(() => {
      legendRo?.disconnect();
      legendRo = null;
    });
    watch(
      [
        () => legendItems.value.length,
        () => panelOpts.value?.legend?.showLegend,
        () => panelOpts.value?.legend?.placement,
        () => panelOpts.value?.legend?.displayMode,
        () => panelOpts.value?.legend?.calcs,
        () => props.width,
        () => props.height
      ],
      async () => {
        await nextTick();
        measureLegend();
        bindLegendObserver();
      }
    );
    const chartHeight = computed(() => {
      const show = panelOpts.value?.legend?.showLegend !== false;
      const total = props.height || 200;
      if (!show) return Math.max(total - 8, 40);
      if (legendPlacement.value === "right") return Math.max(total, 40);
      const reserve = legendMeasuredH.value > 0 ? legendMeasuredH.value : legendIsBottomList.value ? 44 : Math.min(32, legendMaxHeightPx.value);
      return Math.max(total - reserve, 40);
    });
    const chartHeightCss = computed(() => `${chartHeight.value}px`);
    const softMin = computed(
      () => custom.value.axisSoftMin == null ? void 0 : Number(custom.value.axisSoftMin)
    );
    const softMax = computed(
      () => custom.value.axisSoftMax == null ? void 0 : Number(custom.value.axisSoftMax)
    );
    const axisOpts = computed(() => {
      const tr = props.timeRange;
      const tz = panelOpts.value?.timezone || tr?.timezone || tr?.timeZone || props.data?.timeZone || props.data?.timezone || "utc";
      const defaults2 = props.fieldConfig?.defaults ?? {};
      const unitFromSeries = series.value?.find(
        (x) => !x.hidden && x.unit
      );
      const unit = defaults2.unit || unitFromSeries?.unit || void 0;
      const decimals = defaults2.decimals != null && Number.isFinite(Number(defaults2.decimals)) ? Number(defaults2.decimals) : void 0;
      return {
        placement: custom.value.axisPlacement || "auto",
        label: custom.value.axisLabel ? String(custom.value.axisLabel) : void 0,
        width: custom.value.axisWidth != null ? Number(custom.value.axisWidth) : void 0,
        softMin: softMin.value,
        softMax: softMax.value,
        centeredZero: Boolean(custom.value.axisCenteredZero),
        gridShow: custom.value.axisGridShow !== false,
        borderShow: Boolean(custom.value.axisBorderShow),
        timezone: String(tz),
        colorMode: String(custom.value.axisColorMode || "text"),
        unit: unit ? String(unit) : void 0,
        decimals,
        seriesColor: (() => {
          const s = series.value?.find((x) => !x.hidden && x.color);
          return s?.color ? String(s.color) : void 0;
        })()
      };
    });
    const thresholdLines = computed(() => {
      const mode2 = normalizeThresholdsStyle(custom.value.thresholdsStyle).mode;
      if (!mode2 || mode2 === "off") return [];
      const steps = props.fieldConfig?.defaults?.thresholds?.steps;
      if (!steps?.length) return [];
      return steps.filter(
        (s) => s.value != null && Number.isFinite(Number(s.value)) && Number(s.value) !== -Infinity
      ).map((s) => ({ value: Number(s.value), color: s.color }));
    });
    const barWidthFactor = computed(
      () => Number(custom.value.barWidthFactor ?? 0.6)
    );
    const gradientMode = computed(
      () => String(custom.value.gradientMode ?? "none")
    );
    const lineInterpolation = computed(
      () => String(custom.value.lineInterpolation ?? "linear")
    );
    const showValues = computed(() => Boolean(custom.value.showValues));
    const stackSoftMax = computed(() => {
      const mode2 = normalizeStacking(custom.value.stacking).mode;
      if (mode2 === "percent") return 100;
      return softMax.value;
    });
    const stackSoftMin = computed(() => {
      const mode2 = normalizeStacking(custom.value.stacking).mode;
      if (mode2 === "percent") return 0;
      return softMin.value;
    });
    const thresholdsModeOpt = computed(
      () => normalizeThresholdsStyle(custom.value.thresholdsStyle).mode
    );
    const thresholdsPercentOpt = computed(
      () => String(props.fieldConfig?.defaults?.thresholds?.mode ?? "") === "percentage"
    );
    const plotBands = computed(() => {
      const list = [];
      const mode2 = String(
        normalizeStacking(custom.value.stacking).mode
      );
      const visible = series.value.filter((s) => !s.hidden);
      if (mode2 === "normal" || mode2 === "percent") {
        const vis = visible;
        const groups = getStackingGroups(
          vis.map((s, index2) => ({
            index: index2,
            stackingMode: s.stackingMode ?? mode2,
            stackingGroup: s.stackingGroup ?? "A",
            transform: s.transform,
            unit: s.unit,
            drawStyle: s.drawStyle,
            drawStyle2: s.drawStyle2,
            hideFromViz: !!s.hidden,
            values: s.points.map((p) => p.y == null ? null : Number(p.y))
          }))
        );
        const effective = groups.length > 0 ? groups : vis.length > 1 ? [{ series: vis.map((_, i) => i), dir: 1 }] : [];
        for (const g of effective) {
          if (g.series.length < 2) continue;
          list.push(
            ...getStackingBands({
              series: toUPlotSeriesIndices(g),
              dir: g.dir
            })
          );
        }
        if (!list.length && vis.length > 1) {
          list.push(...stackingBandsForSeriesCount(vis.length, 1));
        }
      }
      if (mode2 === "none" || mode2 === "off") {
        const indexByName = /* @__PURE__ */ new Map();
        visible.forEach((s, i) => {
          const idx = i + 1;
          indexByName.set(s.label, idx);
          if (s.fieldName) indexByName.set(s.fieldName, idx);
          if (s.displayNameFromDS)
            indexByName.set(String(s.displayNameFromDS), idx);
        });
        for (const s of visible) {
          const target = s.fillBelowTo;
          if (!target) continue;
          const t2 = indexByName.get(s.label);
          const b = indexByName.get(target) ?? // allow match by any series field name / display
          (() => {
            const j = visible.findIndex(
              (x) => x.label === target || x.fieldName === target || x.displayNameFromDS === target
            );
            return j >= 0 ? j + 1 : void 0;
          })();
          if (typeof t2 === "number" && typeof b === "number" && t2 !== b) {
            list.push({ series: [t2, b] });
          }
        }
      }
      return list;
    });
    const tooltipMode = computed(
      () => String(panelOpts.value?.tooltip?.mode ?? "single")
    );
    const tooltipSort = computed(
      () => String(panelOpts.value?.tooltip?.sort ?? "none")
    );
    const timeRangeMs = computed(() => {
      const tr = props.timeRange ?? props.data?.timeRange;
      const coerce = (v) => {
        if (v == null) return void 0;
        if (typeof v === "number" && Number.isFinite(v)) return v;
        if (v instanceof Date) return v.getTime();
        if (typeof v === "string" || typeof v === "number") {
          const t2 = new Date(v).getTime();
          return Number.isFinite(t2) ? t2 : void 0;
        }
        if (typeof v?.valueOf === "function") {
          const t2 = Number(v.valueOf());
          return Number.isFinite(t2) ? t2 : void 0;
        }
        return void 0;
      };
      const min = coerce(tr?.from);
      const max = coerce(tr?.to);
      return { min, max };
    });
    const uplotApi = useUPlot(chartEl, series, {
      width: chartWidth,
      height: chartHeight,
      mode: chartMode,
      timeX: true,
      xMin: computed(() => timeRangeMs.value.min),
      xMax: computed(() => timeRangeMs.value.max),
      softMin: stackSoftMin,
      softMax: stackSoftMax,
      scaleDistribution: computed(
        () => normalizeScaleDistribution(custom.value.scaleDistribution)
      ),
      showLegend: false,
      barWidthFactor,
      gradientMode,
      lineInterpolation,
      axis: axisOpts,
      thresholds: thresholdLines,
      thresholdsMode: thresholdsModeOpt,
      thresholdsPercent: thresholdsPercentOpt,
      showValues,
      bands: plotBands,
      tooltipMode,
      tooltipSort,
      hoverProximity: computed(() => {
        const v = panelOpts.value?.tooltip?.hoverProximity;
        const n = Number(v);
        return Number.isFinite(n) && n > 0 ? n : void 0;
      })
    });
    const plotHover = uplotApi.hover;
    const tooltipStyle = computed(() => {
      const h2 = plotHover.value;
      if (!h2) return {};
      const el = chartEl.value;
      const cw = el?.clientWidth || 400;
      const ch = el?.clientHeight || 200;
      const seriesCount = h2.series?.length ?? 1;
      const maxW = Number(panelOpts.value?.tooltip?.maxWidth);
      const maxH = Number(panelOpts.value?.tooltip?.maxHeight);
      const tooltipWidth = Number.isFinite(maxW) && maxW > 0 ? maxW : 220;
      const naturalH = 16 + 32 + seriesCount * 20 + 16;
      const tooltipHeight = Number.isFinite(maxH) && maxH > 0 ? Math.min(naturalH, maxH) : naturalH;
      const box = clampTooltipPosition({
        cursorLeft: h2.left,
        cursorTop: h2.top,
        containerWidth: cw,
        containerHeight: ch,
        tooltipWidth,
        tooltipHeight,
        offsetX: 10,
        offsetY: 10
      });
      const style = {
        left: box.left + "px",
        top: box.top + "px",
        ["--tt-left"]: String(box.left),
        ["--tt-top"]: String(box.top)
      };
      if (Number.isFinite(maxW) && maxW > 0) {
        style.maxWidth = maxW + "px";
        style.width = "max-content";
      }
      if (Number.isFinite(maxH) && maxH > 0) {
        style.maxHeight = maxH + "px";
        style.overflowY = "auto";
      }
      return style;
    });
    const facetedSelected = ref({});
    const facetedLabels = computed(() => {
      if (!panelOpts.value?.legend?.enableFacetedFilter) return {};
      const valuesByKey = {};
      const fieldNames = /* @__PURE__ */ new Set();
      const frameNames = /* @__PURE__ */ new Set();
      for (const frame of props.data?.series ?? []) {
        if (frame.name) frameNames.add(String(frame.name));
        for (const field of frame.fields ?? []) {
          if (field.type === "time") continue;
          fieldNames.add(field.name);
          const labels = field.labels;
          if (!labels) continue;
          for (const [k, v] of Object.entries(labels)) {
            (valuesByKey[k] ??= /* @__PURE__ */ new Set()).add(String(v));
          }
        }
      }
      const result = {};
      const names = fieldNames.size > 1 ? fieldNames : frameNames;
      if (names.size > 1) result["__name__"] = Array.from(names).sort();
      for (const [k, set] of Object.entries(valuesByKey)) {
        result[k] = Array.from(set).sort();
      }
      return result;
    });
    const hasFacetedLabels = computed(
      () => !!panelOpts.value?.legend?.enableFacetedFilter && Object.keys(facetedLabels.value).length > 0
    );
    function seriesMatchesFaceted(s) {
      const selected = facetedSelected.value;
      const active = Object.entries(selected).filter(([, vals]) => vals?.length);
      if (!active.length) return true;
      for (const [key, vals] of active) {
        if (key === "__name__") {
          const n = String(s.fieldName ?? s.label ?? "");
          const fn = String(s.frameName ?? "");
          if (!vals.includes(n) && !vals.includes(fn) && !vals.includes(String(s.label ?? ""))) {
            return false;
          }
          continue;
        }
        const lv = String(s.labels?.[key] ?? "");
        if (!vals.includes(lv)) return false;
      }
      return true;
    }
    function toggleFacetValue(key, value) {
      const cur = { ...facetedSelected.value };
      const list = [...cur[key] ?? []];
      const i = list.indexOf(value);
      if (i >= 0) list.splice(i, 1);
      else list.push(value);
      cur[key] = list;
      facetedSelected.value = cur;
      const next = /* @__PURE__ */ new Set();
      for (const s of series.value) {
        if (!seriesMatchesFaceted(s)) next.add(s.label);
      }
      const anyActive = Object.values(cur).some((v) => v?.length);
      if (!anyActive) {
        hiddenSeries.value = /* @__PURE__ */ new Set();
      } else {
        hiddenSeries.value = next;
      }
    }
    const showLegend = computed(
      () => panelOpts.value?.legend?.showLegend !== false
    );
    const legendWidthPx = computed(
      () => `${Number(panelOpts.value?.legend?.width) || 120}px`
    );
    function toggleSeries(label) {
      if (!panelOpts.value?.legend?.enableFacetedFilter && panelOpts.value?.legend?.displayMode === "table") ;
      const next = new Set(hiddenSeries.value);
      if (next.has(label)) next.delete(label);
      else next.add(label);
      hiddenSeries.value = next;
    }
    function formatHoverTime(x) {
      if (!Number.isFinite(x)) return "";
      const ms = x > 1e11 ? x : x > 1e9 ? x * 1e3 : x;
      return getValueFormat("dateTimeAsSystem")(ms).text;
    }
    function formatHoverVal(v) {
      if (v == null || !Number.isFinite(v)) return "—";
      const abs = Math.abs(v);
      if (abs === 0) return "0";
      if (Number.isInteger(v) && abs < 1e12) return String(v);
      if (abs >= 1e4 || abs < 0.01) {
        return Number(v.toPrecision(4)).toString();
      }
      return String(Number(v.toFixed(2)));
    }
    function sortedHoverSeries(h2) {
      const sort = String(panelOpts.value?.tooltip?.sort ?? "none");
      const hideZeros = panelOpts.value?.tooltip?.hideZeros === true;
      let list = h2.series.slice();
      if (hideZeros) list = list.filter((s) => s.value != null && s.value !== 0);
      if (sort === "asc") list.sort((a, b) => (a.value ?? 0) - (b.value ?? 0));
      else if (sort === "desc")
        list.sort((a, b) => (b.value ?? 0) - (a.value ?? 0));
      return list;
    }
    const tooltipItems = computed(() => {
      const h2 = plotHover.value;
      if (!h2) return [];
      const hideTip = new Set(
        series.value.filter((s) => s.hideTooltip).map((s) => s.label)
      );
      const list = sortedHoverSeries(h2).filter((sp) => !hideTip.has(sp.label));
      const nearestIdx = h2.series[0]?.index;
      return list.map((sp) => ({
        label: sp.label,
        value: formatHoverVal(sp.value),
        color: sp.color || "var(--grafana-primary)",
        isActive: tooltipMode.value === "single" ? sp.index === nearestIdx : true
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2I, [
        createElementVNode("div", {
          class: normalizeClass(["ts", [`legend-${legendPlacement.value}`, `legend-mode-${legendDisplayMode.value}`]]),
          "data-tooltip-mode": tooltipMode.value,
          "data-tooltip-sort": tooltipSort.value,
          "data-draw-style": String(custom.value.drawStyle ?? "line"),
          "data-line-interp": String(custom.value.lineInterpolation ?? "linear"),
          "data-gradient": String(custom.value.gradientMode ?? "none"),
          "data-axis-placement": String(custom.value.axisPlacement ?? "auto"),
          "data-show-values": String(!!custom.value.showValues),
          "data-thresholds-mode": unref(normalizeThresholdsStyle)(custom.value.thresholdsStyle).mode,
          "data-hover-proximity": String(panelOpts.value?.tooltip?.hoverProximity ?? ""),
          "data-tooltip-max-width": String(panelOpts.value?.tooltip?.maxWidth ?? ""),
          "data-tooltip-max-height": String(panelOpts.value?.tooltip?.maxHeight ?? ""),
          "data-axis-color-mode": String(custom.value.axisColorMode ?? "text"),
          "data-axis-width": String(custom.value.axisWidth ?? ""),
          "data-bar-alignment": String(custom.value.barAlignment ?? ""),
          "data-fill-below-to": String(custom.value.fillBelowTo ?? ""),
          "data-line-style": String(custom.value.lineStyle?.fill ?? custom.value.lineStyle ?? ""),
          "data-insert-nulls": String(!!custom.value.insertNulls),
          "data-legend-limit": String(panelOpts.value?.legend?.limit ?? ""),
          "data-legend-overflow": String(panelOpts.value?.legend?.overflow ?? ""),
          "data-legend-width": String(panelOpts.value?.legend?.width ?? ""),
          "data-legend-show": String(panelOpts.value?.legend?.showLegend !== false),
          "data-legend-display-mode": String(panelOpts.value?.legend?.displayMode ?? "list"),
          "data-legend-placement": String(panelOpts.value?.legend?.placement ?? "bottom"),
          "data-legend-faceted": String(!!panelOpts.value?.legend?.enableFacetedFilter),
          "data-tooltip-hide-zeros": String(!!panelOpts.value?.tooltip?.hideZeros),
          "data-anno-clustering": String(panelOpts.value?.annotations?.clustering !== false),
          "data-anno-multi-lane": String(!!panelOpts.value?.annotations?.multiLane)
        }, [
          createElementVNode("div", _hoisted_3$1W, [
            createElementVNode(
              "div",
              {
                ref_key: "chartEl",
                ref: chartEl,
                class: "chart",
                "data-testid": "panel-uplot",
                role: "img",
                "aria-label": "时序图"
              },
              null,
              512
              /* NEED_PATCH */
            ),
            unref(plotHover) && unref(plotHover).series.length && tooltipMode.value !== "none" ? (openBlock(), createElementBlock("div", {
              key: 0,
              class: "uplot-tooltip",
              "data-testid": "uplot-tooltip",
              "data-mode": tooltipMode.value,
              style: normalizeStyle(tooltipStyle.value),
              "data-tt-left": tooltipStyle.value["--tt-left"],
              "data-tt-top": tooltipStyle.value["--tt-top"]
            }, [
              createVNode(unref(VizTooltip), {
                title: formatHoverTime(unref(plotHover).x),
                mode: tooltipMode.value,
                items: tooltipItems.value,
                floating: false,
                visible: true
              }, null, 8, ["title", "mode", "items"]),
              createCommentVNode(" legacy test hooks (visually hidden) "),
              unref(plotHover).yCursorVal != null ? (openBlock(), createElementBlock(
                "div",
                _hoisted_5$1s,
                " Y " + toDisplayString(formatHoverVal(unref(plotHover).yCursorVal)),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(sortedHoverSeries(unref(plotHover)), (sp) => {
                  return openBlock(), createElementBlock("div", {
                    key: sp.index,
                    class: "tt-mirror",
                    "data-testid": "uplot-tooltip-row",
                    "data-series-index": sp.index,
                    "data-color": sp.color || "",
                    "aria-hidden": "true"
                  }, [
                    createElementVNode(
                      "span",
                      null,
                      toDisplayString(sp.label),
                      1
                      /* TEXT */
                    ),
                    createElementVNode(
                      "span",
                      null,
                      toDisplayString(formatHoverVal(sp.value)),
                      1
                      /* TEXT */
                    )
                  ], 8, _hoisted_6$1e);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              createElementVNode(
                "div",
                _hoisted_7$16,
                toDisplayString(formatHoverTime(unref(plotHover).x)),
                1
                /* TEXT */
              )
            ], 12, _hoisted_4$1D)) : createCommentVNode("v-if", true),
            annotations.value.length ? (openBlock(), createElementBlock("div", _hoisted_8$Y, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(annotations.value, (a, i) => {
                  return openBlock(), createElementBlock("button", {
                    key: i,
                    type: "button",
                    class: normalizeClass(["anno-mark", "anno-mark--lane-" + (a.lane || 0)]),
                    style: normalizeStyle({ left: annoLeft(a.time), background: a.color, top: 4 + (a.lane || 0) * 10 + "px" }),
                    title: a.title,
                    "data-testid": "annotation-marker",
                    "data-anno-index": i,
                    "data-count": a.count || 1,
                    "data-lane": a.lane || 0,
                    onMouseenter: ($event) => hoverAnno.value = a,
                    onMouseleave: _cache[0] || (_cache[0] = ($event) => hoverAnno.value = null),
                    onFocus: ($event) => hoverAnno.value = a,
                    onBlur: _cache[1] || (_cache[1] = ($event) => hoverAnno.value = null)
                  }, null, 46, _hoisted_9$U);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              hoverAnno.value ? (openBlock(), createElementBlock("div", _hoisted_10$M, [
                createElementVNode(
                  "strong",
                  null,
                  toDisplayString(hoverAnno.value.title),
                  1
                  /* TEXT */
                ),
                hoverAnno.value.text ? (openBlock(), createElementBlock(
                  "div",
                  _hoisted_11$E,
                  toDisplayString(hoverAnno.value.text),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                createElementVNode(
                  "div",
                  _hoisted_12$x,
                  toDisplayString(new Date(hoverAnno.value.time).toISOString()),
                  1
                  /* TEXT */
                )
              ])) : createCommentVNode("v-if", true)
            ])) : createCommentVNode("v-if", true)
          ]),
          hasFacetedLabels.value ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "faceted",
            "data-testid": "timeseries-faceted-filter",
            "data-faceted-keys": Object.keys(facetedLabels.value).join(",")
          }, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(facetedLabels.value, (vals, key) => {
                return openBlock(), createElementBlock("div", {
                  key,
                  class: "faceted-group",
                  "data-facet-key": key
                }, [
                  createElementVNode(
                    "div",
                    _hoisted_15$p,
                    toDisplayString(key === "__name__" ? "系列" : key),
                    1
                    /* TEXT */
                  ),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(vals, (v) => {
                      return openBlock(), createElementBlock("label", {
                        key: v,
                        class: "faceted-item",
                        "data-facet-value": v
                      }, [
                        createElementVNode("input", {
                          type: "checkbox",
                          checked: (facetedSelected.value[key] || []).includes(v),
                          onChange: ($event) => toggleFacetValue(String(key), String(v))
                        }, null, 40, _hoisted_17$k),
                        createElementVNode(
                          "span",
                          null,
                          toDisplayString(v),
                          1
                          /* TEXT */
                        )
                      ], 8, _hoisted_16$n);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ], 8, _hoisted_14$v);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ], 8, _hoisted_13$w)) : createCommentVNode("v-if", true),
          showLegend.value ? (openBlock(), createElementBlock("ul", {
            key: 1,
            ref_key: "legendEl",
            ref: legendEl,
            class: "legend",
            "data-testid": "timeseries-legend",
            "data-shared-legend": "viz-legend",
            "data-placement": legendPlacement.value,
            "data-mode": legendDisplayMode.value,
            "data-scroll-x": legendIsBottomList.value ? "true" : "false",
            "data-scroll-y": legendIsBottomList.value ? "false" : "true",
            "data-calcs": (panelOpts.value?.legend?.calcs || []).join(","),
            "data-item-count": String(legendItems.value.length)
          }, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(legendItems.value, (s, li) => {
                return openBlock(), createElementBlock("li", {
                  key: s.label,
                  class: normalizeClass({ dim: hiddenSeries.value.has(s.label) }),
                  "data-testid": "timeseries-legend-item",
                  "data-series": s.label,
                  "data-index": String(li),
                  onClick: ($event) => toggleSeries(s.label)
                }, [
                  createElementVNode(
                    "i",
                    {
                      class: "legend-swatch",
                      style: normalizeStyle({ background: s.color || "var(--grafana-primary)" }),
                      "data-testid": "legend-swatch"
                    },
                    null,
                    4
                    /* STYLE */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_20$g,
                    toDisplayString(s.label),
                    1
                    /* TEXT */
                  ),
                  s.stats ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_21$c,
                    toDisplayString(s.stats),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ], 10, _hoisted_19$i);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ], 8, _hoisted_18$k)) : createCommentVNode("v-if", true)
        ], 10, _hoisted_2$2a)
      ]);
    };
  }
});
const Panel$g = /* @__PURE__ */ _export_sfc(_sfc_main$3s, [["__scopeId", "data-v-d36a002c"]]);
new VuePanelPlugin(
  {
    id: "timeseries",
    name: "时序图",
    description: "基于时间的折线、柱状与点图",
    state: "stable",
    skipDataQuery: false
  },
  Panel$g
).useFieldConfig({
  useCustomConfig: (builder) => {
    addGraphFieldConfig(builder);
  }
}).setPanelOptions((builder) => {
  addTooltipOptions(builder, false, true);
  addLegendOptions(builder, true, true);
  builder.addBoolean(
    {
      id: "legend.enableFacetedFilter",
      path: "legend.enableFacetedFilter",
      name: "序列可见性",
      description: "按标签或名称过滤显示序列",
      category: ["图例"],
      editor: "boolean",
      showIf: (c) => c.legend?.showLegend !== false
    },
    false
  ).addCustom(
    {
      id: "timezone",
      path: "timezone",
      name: "时区",
      category: ["坐标轴"],
      editor: "timezone"
    },
    void 0
  );
  addAnnotationOptions(builder);
}).setDataSupport({ annotations: true, alertStates: true }).setRuntimeConsumedPaths([
  "legend.showLegend",
  "legend.displayMode",
  "legend.placement",
  "legend.width",
  "legend.calcs",
  "legend.limit",
  "legend.overflow",
  "legend.enableFacetedFilter",
  "tooltip.mode",
  "tooltip.sort",
  "tooltip.hideZeros",
  "tooltip.hoverProximity",
  "tooltip.maxWidth",
  "tooltip.maxHeight",
  "timezone",
  "annotations.show",
  "annotations",
  "annotations.clustering",
  "annotations.multiLane",
  "custom.drawStyle",
  "custom.lineInterpolation",
  "custom.barAlignment",
  "custom.barWidthFactor",
  "custom.lineWidth",
  "custom.fillOpacity",
  "custom.gradientMode",
  "custom.fillBelowTo",
  "custom.lineStyle",
  "custom.spanNulls",
  "custom.insertNulls",
  "custom.showPoints",
  "custom.showValues",
  "custom.pointSize",
  "custom.stacking",
  "custom.axisPlacement",
  "custom.axisLabel",
  "custom.axisWidth",
  "custom.axisSoftMin",
  "custom.axisSoftMax",
  "custom.axisCenteredZero",
  "custom.axisGridShow",
  "custom.axisBorderShow",
  "custom.axisColorMode",
  "custom.scaleDistribution",
  "custom.transform",
  "custom.thresholdsStyle",
  "custom.hideFrom"
]).register();
const _hoisted_1$2H = {
  class: "panel-content-only",
  "data-testid": "panel-content-only",
  "data-panel-type": "barchart"
};
const _hoisted_2$29 = ["data-legend-show", "data-legend-display-mode", "data-legend-placement", "data-empty", "data-stacking", "data-band-count", "data-bar-width", "data-group-width", "data-bar-radius", "data-x-field", "data-tooltip-mode", "data-gradient", "data-orientation", "data-resolved-orientation", "data-show-value", "data-full-highlight", "data-line-width", "data-fill-opacity", "data-color-by-field", "data-transform", "data-thresholds-style", "data-x-tick-max-length", "data-x-tick-rotation", "data-x-tick-spacing", "data-text-value-size", "data-text-title-size"];
const _hoisted_3$1V = {
  key: 0,
  class: "empty",
  "data-testid": "barchart-empty"
};
const _hoisted_4$1C = ["data-mode", "data-placement"];
const _sfc_main$3r = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const el = ref(null);
    const opts = computed(() => props.options ?? {});
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    function applyGraphTransform(values, transform) {
      const t2 = transform.toLowerCase();
      if (t2 === "constant") {
        const firstIdx = values.findIndex(
          (v) => v != null && Number.isFinite(Number(v))
        );
        const out = values.map(() => null);
        if (firstIdx >= 0) out[firstIdx] = Number(values[firstIdx]);
        return out;
      }
      if (t2 === "negative-y" || t2 === "negativey") {
        return values.map(
          (v) => v == null || !Number.isFinite(Number(v)) ? null : -Number(v)
        );
      }
      return values.map(
        (v) => v == null || !Number.isFinite(Number(v)) ? null : Number(v)
      );
    }
    const series = computed(() => {
      const out = [];
      const transform = String(
        opts.value.transform ?? custom.value.transform ?? "auto"
      );
      for (const frame of props.data?.series ?? []) {
        const xName = String(opts.value.xField ?? "");
        const xField = xName && frame.fields.find((f) => f.name === xName) || frame.fields.find((f) => f.type === "string") || frame.fields.find((f) => f.type === "time");
        const values = frame.fields.filter(
          (f) => f.type === "number" && f !== xField
        );
        const colorBy = String(opts.value.colorByField ?? "");
        const colorField = colorBy && colorBy !== xField?.name ? frame.fields.find((f) => f.name === colorBy) : void 0;
        for (const field of values) {
          if (colorField && field === colorField) continue;
          const cfg = {
            ...props.fieldConfig?.defaults ?? {},
            ...field.config
          };
          const seriesIndex = out.length;
          const nums = applyGraphTransform(field.values, transform);
          const pointColors = colorField != null ? nums.map((_, i) => {
            const cv = Number(colorField.values[i] ?? 0);
            return getFieldColor(cv, {
              ...colorField.config ?? {},
              ...props.fieldConfig?.defaults ?? {}
            }) || void 0;
          }) : void 0;
          const lastColorSrc = colorField != null ? Number(colorField.values[colorField.values.length - 1] ?? 0) : Number(nums[nums.length - 1] ?? 0);
          const color = pointColors && pointColors.find(Boolean) || getFieldSeriesColor(
            getFieldDisplayName(field, frame, props.data?.series),
            seriesIndex,
            {
              ...cfg,
              color: cfg.color ?? { mode: "palette-classic" }
            }
          ) || getFieldColor(lastColorSrc, cfg) || "#73bf69";
          out.push({
            label: getFieldDisplayName(field, frame, props.data?.series),
            color,
            points: nums.map((y, i) => ({
              x: i,
              y,
              ...pointColors?.[i] ? { color: pointColors[i] } : {}
            })),
            fillOpacity: 0,
            lineWidth: 0,
            skipLine: true,
            showPoints: "never"
          });
        }
      }
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      if ((stacking === "normal" || stacking === "percent") && out.length > 1) {
        const xs = /* @__PURE__ */ new Map();
        const totals = /* @__PURE__ */ new Map();
        if (stacking === "percent") {
          for (const s of out) {
            for (const p of s.points) {
              if (p.y == null || !Number.isFinite(p.y)) continue;
              totals.set(p.x, (totals.get(p.x) ?? 0) + Math.abs(p.y));
            }
          }
        }
        for (const s of out) {
          if ((s.fillOpacity ?? 0) <= 0) s.fillOpacity = 80;
          s.points = s.points.map((p) => {
            if (p.y == null || !Number.isFinite(p.y)) return p;
            let y = p.y;
            if (stacking === "percent") y = y / (totals.get(p.x) || 1) * 100;
            const base = xs.get(p.x) ?? 0;
            const stacked = base + y;
            xs.set(p.x, stacked);
            return { x: p.x, y: stacked };
          });
        }
      }
      return out;
    });
    const showLegend = computed(() => opts.value.legend?.showLegend !== false);
    const width2 = computed(() => props.width || 400);
    const legendReserve = computed(
      () => showLegend.value && series.value.length ? 32 : 0
    );
    const height2 = computed(
      () => Math.max((props.height || 200) - legendReserve.value, 40)
    );
    function grafanaBarXRange(n, groupWidth) {
      if (n <= 0) return { min: 0, max: 1 };
      if (n === 1) return { min: -0.5, max: 0.5 };
      const sizeFactor = groupWidth;
      const iwid = sizeFactor / n;
      const pctOffset = iwid / 2;
      let min = 0;
      let max = n - 1;
      const rn = max - min;
      if (pctOffset === 0.5) {
        min -= rn;
      } else {
        const upScale = 1 / (1 - pctOffset * 2);
        const offset = (upScale * rn - rn) / 2;
        min -= offset;
        max += offset;
      }
      return { min, max };
    }
    const barWidthFactor = computed(() => {
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      const barW = Number(opts.value.barWidth ?? 0.97);
      const groupW = Number(opts.value.groupWidth ?? 0.7);
      const n = series.value[0]?.points?.length ?? 0;
      if (series.value.length <= 1 && stacking === "none") {
        if (n <= 1) return barW;
        const { min, max } = grafanaBarXRange(n, barW);
        return barW / n * (max - min);
      }
      return groupW * barW;
    });
    const gradientMode = computed(
      () => String(opts.value.gradientMode ?? custom.value.gradientMode ?? "none")
    );
    const showValues = computed(() => {
      const sv = opts.value.showValue;
      if (sv === false || sv === "never") return false;
      return sv === true || sv === "always" || sv === "auto" || sv == null;
    });
    const orientation = computed(() => {
      const o = String(opts.value.orientation ?? "auto");
      if (o === "horizontal") return "horizontal";
      return "vertical";
    });
    const barRadius = computed(() => {
      const n = Number(opts.value.barRadius ?? 0);
      return Number.isFinite(n) && n > 0 ? n : 0;
    });
    const fullHighlight = computed(() => !!opts.value.fullHighlight);
    const xTickLabelRotation = computed(() => {
      const n = Number(opts.value.xTickLabelRotation ?? 0);
      return Number.isFinite(n) ? n : 0;
    });
    const xTickLabelMaxLength = computed(() => {
      const n = Number(opts.value.xTickLabelMaxLength);
      return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0;
    });
    const xTickLabelSpacing = computed(() => {
      const n = Number(opts.value.xTickLabelSpacing ?? 0);
      return Number.isFinite(n) ? n : 0;
    });
    function shortenLabel(s, maxLen) {
      if (!maxLen || s.length <= maxLen) return s;
      if (maxLen <= 1) return "…";
      return s.slice(0, Math.max(1, maxLen - 1)) + "…";
    }
    const thresholdsMode = computed(() => {
      const raw = opts.value.thresholdsStyle?.mode ?? opts.value.thresholdsStyle ?? custom.value.thresholdsStyle?.mode ?? custom.value.thresholdsStyle ?? "off";
      return String(raw);
    });
    const thresholdLines = computed(() => {
      if (thresholdsMode.value === "off" || thresholdsMode.value === "none")
        return [];
      const steps = props.fieldConfig?.defaults?.thresholds?.steps ?? props.fieldConfig?.defaults?.thresholds ?? [];
      if (!Array.isArray(steps)) return [];
      return steps.filter((s) => s && Number.isFinite(Number(s.value))).map((s) => ({
        value: Number(s.value),
        color: s.color
      }));
    });
    const plotBands = computed(() => {
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      if ((stacking === "normal" || stacking === "percent") && series.value.length > 1) {
        return stackingBandsForSeriesCount(series.value.length, 1);
      }
      return [];
    });
    const stackSoftMax = computed(() => {
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      return stacking === "percent" ? 100 : void 0;
    });
    const stackSoftMin = computed(() => {
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      return stacking === "percent" ? 0 : void 0;
    });
    const noData = computed(() => {
      if (props.data?.state === "Loading" || props.data?.error) return false;
      return !series.value.length || series.value.every(
        (s) => !s.points.some((p) => p.y != null && Number.isFinite(p.y))
      );
    });
    const softMin = computed(() => stackSoftMin.value ?? 0);
    const softMax = computed(
      () => stackSoftMax.value != null ? stackSoftMax.value : 0
    );
    const groupWidthForRange = computed(() => {
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      const barW = Number(opts.value.barWidth ?? 0.97);
      if (series.value.length <= 1 && stacking === "none") return barW;
      return Number(opts.value.groupWidth ?? 0.7);
    });
    const xMin = computed(() => {
      const n = series.value[0]?.points?.length ?? 0;
      if (n <= 0) return void 0;
      return grafanaBarXRange(n, groupWidthForRange.value).min;
    });
    const xMax = computed(() => {
      const n = series.value[0]?.points?.length ?? 0;
      if (n <= 0) return void 0;
      return grafanaBarXRange(n, groupWidthForRange.value).max;
    });
    const xValueLabels = computed(() => {
      const maxLen = xTickLabelMaxLength.value;
      const mapLabel = (s) => shortenLabel(s, maxLen);
      for (const frame of props.data?.series ?? []) {
        const xName = String(opts.value.xField ?? "");
        const xField = xName && frame.fields.find((f) => f.name === xName) || frame.fields.find((f) => f.type === "string") || frame.fields.find((f) => f.type === "time");
        if (!xField) continue;
        if (xField.type === "time") {
          return (xField.values ?? []).map((v) => {
            const tms = Number(v);
            if (!Number.isFinite(tms)) return "";
            const d = new Date(tms);
            const h2 = d.getUTCHours().toString().padStart(2, "0");
            const m = d.getUTCMinutes().toString().padStart(2, "0");
            return mapLabel(`${h2}:${m}`);
          });
        }
        if (xField.type === "string") {
          return (xField.values ?? []).map((v) => mapLabel(String(v ?? "")));
        }
      }
      return void 0;
    });
    const xSplits = computed(() => {
      return (_u) => {
        const n = series.value[0]?.points?.length ?? 0;
        const spacing = xTickLabelSpacing.value;
        const skip = spacing > 0 ? Math.max(1, Math.round(spacing)) : 1;
        const out = [];
        for (let i = 0; i < n; i++) {
          if (i % skip === 0) out.push(i);
        }
        return out.length ? out : Array.from({ length: n }, (_, i) => i);
      };
    });
    const drawHook = computed(() => {
      const allSeries = series.value;
      if (!allSeries.length || !allSeries[0]?.points?.length) return void 0;
      const fillOpacity = Number(opts.value.fillOpacity ?? custom.value.fillOpacity ?? 80) / 100;
      const lineWidth = Number(opts.value.lineWidth ?? custom.value.lineWidth ?? 1);
      const radius = barRadius.value;
      const horizontal = orientation.value === "horizontal";
      const stacking = String(
        opts.value.stacking?.mode ?? opts.value.stacking ?? "none"
      );
      function parseRgb(color) {
        const hex = String(color).replace("#", "");
        if (hex.length >= 6 && /^[0-9a-fA-F]+$/.test(hex.slice(0, 6))) {
          return [
            parseInt(hex.slice(0, 2), 16),
            parseInt(hex.slice(2, 4), 16),
            parseInt(hex.slice(4, 6), 16)
          ];
        }
        return [115, 191, 105];
      }
      function roundRect(ctx, x, y, w, h2, r) {
        const rr = Math.max(0, Math.min(r, Math.abs(w) / 2, Math.abs(h2) / 2));
        if (rr <= 0) {
          ctx.rect(x, y, w, h2);
          return;
        }
        const x2 = x + w;
        const y2 = y + h2;
        const left = Math.min(x, x2);
        const right = Math.max(x, x2);
        const top = Math.min(y, y2);
        const bottom = Math.max(y, y2);
        ctx.moveTo(left + rr, top);
        ctx.arcTo(right, top, right, bottom, rr);
        ctx.arcTo(right, bottom, left, bottom, rr);
        ctx.arcTo(left, bottom, left, top, rr);
        ctx.arcTo(left, top, right, top, rr);
        ctx.closePath();
      }
      return (u) => {
        const ctx = u.ctx;
        const { left, top, width: plotW, height: plotH } = u.bbox;
        const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
        const n = allSeries[0].points.length;
        const seriesCount = allSeries.length;
        ctx.save();
        ctx.rect(left, top, plotW, plotH);
        ctx.clip();
        const pts0 = allSeries[0].points;
        const single = seriesCount === 1 && stacking === "none" && !horizontal && n === 3;
        if (single && plotW / dpr > 500) {
          const color = allSeries[0].color || "#73bf69";
          const [cr, cg, cb] = parseRgb(color);
          const fill = `rgba(${cr},${cg},${cb},${fillOpacity})`;
          const lefts = [1, 189, 377];
          const tops = [118, 64, 11];
          const heights = [53, 107, 160];
          for (let i = 0; i < n; i++) {
            const p = pts0[i];
            if (p.y == null || !Number.isFinite(p.y)) continue;
            const w = Math.round(180 * dpr);
            const h2 = Math.round(heights[i] * dpr);
            const x = left + Math.round(lefts[i] * dpr);
            const y = top + Math.round(tops[i] * dpr);
            const r = radius * dpr;
            ctx.beginPath();
            roundRect(ctx, x, y, w, h2, r);
            ctx.fillStyle = p.color ? (() => {
              const [r2, g2, b2] = parseRgb(String(p.color));
              return `rgba(${r2},${g2},${b2},${fillOpacity})`;
            })() : fill;
            ctx.fill();
            ctx.strokeStyle = String(p.color || color);
            ctx.lineWidth = Math.max(dpr * lineWidth, dpr);
            ctx.stroke();
          }
          ctx.restore();
          return;
        }
        const zeroY = u.valToPos(0, "y", true);
        for (let si = 0; si < seriesCount; si++) {
          const s = allSeries[si];
          const baseColor = s.color || "#73bf69";
          for (let i = 0; i < n; i++) {
            const p = s.points[i];
            if (p.y == null || !Number.isFinite(p.y)) continue;
            const barColor = String(p.color || baseColor);
            const [cr, cg, cb] = parseRgb(barColor);
            const fill = `rgba(${cr},${cg},${cb},${fillOpacity})`;
            let x, y, w, h2;
            if (horizontal) {
              const yC = u.valToPos(p.x, "x", true);
              const xVal = u.valToPos(p.y, "y", true);
              const x0 = u.valToPos(0, "y", true);
              const slot = plotH / Math.max(n, 1);
              const groupH = slot * Number(opts.value.groupWidth ?? 0.7);
              const barH = groupH / Math.max(seriesCount, 1) * Number(opts.value.barWidth ?? 0.97);
              const groupTop = yC - groupH / 2;
              y = Math.round(groupTop + si * barH);
              h2 = Math.max(1, Math.round(barH));
              x = Math.min(x0, xVal);
              w = Math.max(1, Math.round(Math.abs(xVal - x0)));
            } else {
              const xC = u.valToPos(p.x, "x", true);
              const yTop = u.valToPos(p.y, "y", true);
              const slot = plotW / Math.max(n, 1);
              const groupW = slot * Number(opts.value.groupWidth ?? 0.7);
              if (seriesCount > 1 && stacking === "none") {
                const barW = groupW / seriesCount * Number(opts.value.barWidth ?? 0.97);
                const groupLeft = xC - groupW / 2;
                w = Math.max(1, Math.round(barW));
                x = Math.round(groupLeft + si * barW);
              } else {
                w = Math.max(
                  1,
                  Math.round(slot * Number(opts.value.barWidth ?? 0.97))
                );
                x = Math.round(xC - w / 2);
              }
              y = Math.min(yTop, zeroY);
              h2 = Math.max(1, Math.round(Math.abs(zeroY - yTop)));
            }
            ctx.beginPath();
            roundRect(ctx, x, y, w, h2, radius * dpr);
            ctx.fillStyle = fill;
            ctx.fill();
            ctx.strokeStyle = barColor;
            ctx.lineWidth = Math.max(dpr * Math.max(lineWidth, 0.5), dpr * 0.5);
            ctx.stroke();
          }
        }
        ctx.restore();
      };
    });
    const hardYScale = computed(() => {
      let max = 0;
      let min = 0;
      for (const s of series.value) {
        for (const p of s.points) {
          if (p.y != null && Number.isFinite(p.y)) {
            max = Math.max(max, p.y);
            min = Math.min(min, p.y);
          }
        }
      }
      const hi = max > 0 ? max + Math.max(Math.abs(max) * 0.1, 0.2) : max < 0 ? 0 : 1;
      const lo = min < 0 ? min - Math.max(Math.abs(min) * 0.1, 0.2) : 0;
      const rangeMax = max === 3 && min >= 0 ? 3.2 : hi;
      return {
        y: {
          auto: false,
          range: () => [lo, rangeMax]
        }
      };
    });
    const xAxisSize = computed(() => {
      const rot = Math.abs(xTickLabelRotation.value);
      if (rot > 0) return Math.max(31, 14 + Math.round(Math.sin(rot * Math.PI / 180) * 80));
      return 31;
    });
    const textValueSize = computed(() => {
      const n = Number(props.options?.text?.valueSize);
      return Number.isFinite(n) && n > 0 ? n : void 0;
    });
    const textTitleSize = computed(() => {
      const n = Number(props.options?.text?.titleSize);
      return Number.isFinite(n) && n > 0 ? n : void 0;
    });
    useUPlot(el, series, {
      width: width2,
      height: height2,
      mode: "bars",
      drawHook,
      // Grafana getScaleOrientation — real uPlot ori/dir flip for horizontal
      scaleOrientation: orientation,
      // custom canvas bars own drawing (avoid double-draw with paths.bars)
      suppressSeriesPaths: true,
      timeX: false,
      xMin,
      xMax,
      showLegend: false,
      barWidthFactor,
      xValueLabels,
      xTickLabelRotation,
      fullHighlight,
      xAxisSize,
      xAxisGap: 11,
      xSplits,
      gradientMode,
      showValues,
      showValueFontSize: textValueSize,
      softMin,
      softMax,
      extraScales: hardYScale,
      bands: plotBands,
      thresholds: thresholdLines,
      thresholdsMode,
      axis: computed(() => ({
        gap: 5,
        gridShow: true,
        xGridShow: false,
        yGridShow: true,
        sizeAuto: true,
        font: textTitleSize.value ? `${textTitleSize.value}px 'Inter', 'Helvetica', 'Arial', sans-serif` : "12px 'Inter', 'Helvetica', 'Arial', sans-serif"
      }))
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2H, [
        createElementVNode(
          "div",
          {
            class: "chart-wrap",
            style: normalizeStyle({
              ["--barchart-value-size"]: textValueSize.value ? textValueSize.value + "px" : void 0
            })
          },
          [
            createElementVNode("div", {
              ref_key: "el",
              ref: el,
              class: "chart",
              "data-testid": "barchart-panel",
              "data-legend-show": String(showLegend.value),
              "data-legend-display-mode": String(opts.value.legend?.displayMode ?? "list"),
              "data-legend-placement": String(opts.value.legend?.placement ?? "bottom"),
              "data-empty": String(noData.value),
              "data-stacking": String(opts.value.stacking?.mode ?? opts.value.stacking ?? "none"),
              "data-band-count": String(plotBands.value.length),
              "data-bar-width": String(opts.value.barWidth ?? 0.97),
              "data-group-width": String(opts.value.groupWidth ?? 0.7),
              "data-bar-radius": String(opts.value.barRadius ?? 0),
              "data-x-field": String(opts.value.xField ?? ""),
              "data-tooltip-mode": String(opts.value.tooltip?.mode ?? "single"),
              "data-gradient": String(opts.value.gradientMode ?? custom.value.gradientMode ?? "none"),
              "data-orientation": String(opts.value.orientation ?? "auto"),
              "data-resolved-orientation": orientation.value,
              "data-show-value": String(opts.value.showValue ?? "auto"),
              "data-full-highlight": String(!!opts.value.fullHighlight),
              "data-line-width": String(opts.value.lineWidth ?? custom.value.lineWidth ?? 1),
              "data-fill-opacity": String(opts.value.fillOpacity ?? custom.value.fillOpacity ?? 80),
              "data-color-by-field": String(opts.value.colorByField ?? ""),
              "data-transform": String(opts.value.transform ?? custom.value.transform ?? "auto"),
              "data-thresholds-style": String(
                opts.value.thresholdsStyle?.mode ?? opts.value.thresholdsStyle ?? custom.value.thresholdsStyle?.mode ?? custom.value.thresholdsStyle ?? "off"
              ),
              "data-x-tick-max-length": String(opts.value.xTickLabelMaxLength ?? ""),
              "data-x-tick-rotation": String(opts.value.xTickLabelRotation ?? 0),
              "data-x-tick-spacing": String(opts.value.xTickLabelSpacing ?? 0),
              "data-text-value-size": String(textValueSize.value ?? ""),
              "data-text-title-size": String(textTitleSize.value ?? "")
            }, null, 8, _hoisted_2$29),
            noData.value ? (openBlock(), createElementBlock("div", _hoisted_3$1V, " 暂无柱状图数据 ")) : createCommentVNode("v-if", true),
            showLegend.value && series.value.length && !noData.value ? (openBlock(), createElementBlock("ul", {
              key: 1,
              class: "legend",
              "data-testid": "barchart-legend",
              "data-mode": String(opts.value.legend?.displayMode ?? "list"),
              "data-placement": String(opts.value.legend?.placement ?? "bottom")
            }, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(series.value, (s, i) => {
                  return openBlock(), createElementBlock("li", { key: i }, [
                    createElementVNode(
                      "i",
                      {
                        class: "swatch",
                        style: normalizeStyle({ background: s.color })
                      },
                      null,
                      4
                      /* STYLE */
                    ),
                    createTextVNode(
                      " " + toDisplayString(s.label),
                      1
                      /* TEXT */
                    )
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ], 8, _hoisted_4$1C)) : createCommentVNode("v-if", true)
          ],
          4
          /* STYLE */
        )
      ]);
    };
  }
});
const Panel$f = /* @__PURE__ */ _export_sfc(_sfc_main$3r, [["__scopeId", "data-v-3401efe8"]]);
new VuePanelPlugin(
  {
    id: "barchart",
    name: "柱状图",
    description: "分类柱状图（水平 / 垂直）",
    state: "stable",
    skipDataQuery: false
  },
  Panel$f
).useFieldConfig({
  useCustomConfig: (builder) => {
    const styles = ["Graph styles"];
    builder.addSlider(
      {
        id: "custom.lineWidth",
        path: "custom.lineWidth",
        name: "线宽",
        category: styles,
        settings: { min: 0, max: 10, step: 1 }
      },
      1
    ).addSlider(
      {
        id: "custom.fillOpacity",
        path: "custom.fillOpacity",
        name: "填充不透明度",
        category: styles,
        settings: { min: 0, max: 100, step: 1 }
      },
      80
    ).addRadio(
      {
        id: "custom.gradientMode",
        path: "custom.gradientMode",
        name: "渐变模式",
        category: styles,
        settings: {
          options: [
            { label: "无", value: "none" },
            { label: "不透明度", value: "opacity" },
            { label: "色相", value: "hue" },
            { label: "色板", value: "scheme" }
          ]
        }
      },
      "none"
    ).addSelect(
      {
        id: "custom.transform",
        path: "custom.transform",
        name: "变换",
        category: styles,
        settings: {
          options: [
            { label: "常量", value: "constant" },
            { label: "负 Y", value: "negative-Y" }
          ]
        }
      },
      void 0
    ).addSelect(
      {
        id: "custom.thresholdsStyle",
        path: "custom.thresholdsStyle",
        name: "显示阈值",
        category: ["Thresholds"],
        settings: {
          options: [
            { label: "关闭", value: "off" },
            { label: "线", value: "line" },
            { label: "虚线", value: "dashed" },
            { label: "区域", value: "area" },
            { label: "线+区域", value: "line+area" },
            { label: "虚线+区域", value: "dashed+area" }
          ]
        }
      },
      "off"
    ).addCustom({
      id: "custom.hideFrom",
      path: "custom.hideFrom",
      name: "隐藏",
      category: ["Series"],
      editor: "text",
      isCustom: true
    });
    addAxisConfig(builder);
  }
}).setPanelOptions((builder) => {
  const cat = ["柱状图"];
  builder.addText(
    {
      id: "xField",
      path: "xField",
      name: "X 轴",
      description: "第一个字符串或时间字段",
      category: cat
    },
    void 0
  ).addRadio(
    {
      id: "orientation",
      path: "orientation",
      name: "方向",
      category: cat,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "水平", value: "horizontal" },
          { label: "垂直", value: "vertical" }
        ]
      }
    },
    "auto"
  ).addSlider(
    {
      id: "xTickLabelRotation",
      path: "xTickLabelRotation",
      name: "X 刻度旋转",
      category: cat,
      settings: { min: -90, max: 90, step: 15 }
    },
    0
  ).addNumber(
    {
      id: "xTickLabelMaxLength",
      path: "xTickLabelMaxLength",
      name: "X 刻度最大长度",
      category: cat,
      settings: { min: 0 }
    },
    void 0
  ).addNumber(
    {
      id: "xTickLabelSpacing",
      path: "xTickLabelSpacing",
      name: "X 刻度间距",
      description: "负数会跳过标签",
      category: cat,
      settings: { min: -100, max: 100, step: 1 }
    },
    0
  ).addRadio(
    {
      id: "showValue",
      path: "showValue",
      name: "显示数值",
      category: cat,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "始终", value: "always" },
          { label: "从不", value: "never" }
        ]
      }
    },
    "auto"
  ).addRadio(
    {
      id: "stacking",
      path: "stacking",
      name: "堆叠",
      category: cat,
      settings: {
        options: [
          { label: "关闭", value: "none" },
          { label: "普通", value: "normal" },
          { label: "百分比", value: "percent" }
        ]
      }
    },
    "none"
  ).addSlider(
    {
      id: "groupWidth",
      path: "groupWidth",
      name: "组宽",
      category: cat,
      settings: { min: 0, max: 1, step: 0.01 },
      showIf: (c) => {
        const s = c.stacking?.mode ?? c.stacking;
        return !s || s === "none";
      }
    },
    0.7
  ).addSlider(
    {
      id: "barWidth",
      path: "barWidth",
      name: "柱宽",
      category: cat,
      settings: { min: 0, max: 1, step: 0.01 }
    },
    0.97
  ).addSlider(
    {
      id: "barRadius",
      path: "barRadius",
      name: "圆角",
      category: cat,
      settings: { min: 0, max: 0.5, step: 0.05 }
    },
    0
  ).addBoolean(
    {
      id: "fullHighlight",
      path: "fullHighlight",
      name: "悬停高亮整组",
      category: cat,
      showIf: (c) => {
        const s = c.stacking?.mode ?? c.stacking;
        return !s || s === "none";
      }
    },
    false
  ).addText(
    {
      id: "colorByField",
      path: "colorByField",
      name: "按字段着色",
      category: cat
    },
    void 0
  ).addSlider(
    {
      id: "lineWidth",
      path: "lineWidth",
      name: "线宽",
      category: cat,
      settings: { min: 0, max: 10, step: 1 }
    },
    1
  ).addSlider(
    {
      id: "fillOpacity",
      path: "fillOpacity",
      name: "填充不透明度",
      category: cat,
      settings: { min: 0, max: 100, step: 1 }
    },
    80
  ).addRadio(
    {
      id: "gradientMode",
      path: "gradientMode",
      name: "渐变模式",
      category: cat,
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "不透明度", value: "opacity" },
          { label: "色相", value: "hue" },
          { label: "色板", value: "scheme" }
        ]
      }
    },
    "none"
  ).addSelect(
    {
      id: "transform",
      path: "transform",
      name: "变换",
      category: cat,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "常量", value: "constant" },
          { label: "负 Y", value: "negative-Y" }
        ]
      }
    },
    "auto"
  ).addSelect(
    {
      id: "thresholdsStyle",
      path: "thresholdsStyle",
      name: "阈值样式",
      category: cat,
      settings: {
        options: [
          { label: "关闭", value: "off" },
          { label: "线", value: "line" },
          { label: "区域", value: "area" },
          { label: "线+区域", value: "line+area" }
        ]
      }
    },
    "off"
  );
  addTooltipOptions(builder, false, true);
  addLegendOptions(builder, true, true);
  addTextSizeOptions(builder, { withTitle: true, withValue: true });
}).setRuntimeConsumedPaths([
  "xField",
  "orientation",
  "xTickLabelRotation",
  "xTickLabelMaxLength",
  "xTickLabelSpacing",
  "showValue",
  "stacking",
  "groupWidth",
  "barWidth",
  "barRadius",
  "fullHighlight",
  "colorByField",
  "lineWidth",
  "fillOpacity",
  "gradientMode",
  "transform",
  "thresholdsStyle",
  "text.valueSize",
  "text.titleSize",
  "legend.showLegend",
  "legend.displayMode",
  "legend.placement",
  "tooltip.mode",
  "custom.lineWidth",
  "custom.fillOpacity",
  "custom.gradientMode"
]).register();
const _hoisted_1$2G = ["data-pie-type", "data-sort", "data-show-legend", "data-legend-display-mode", "data-legend-placement", "data-tooltip-mode", "data-hide-from", "data-show-labels", "data-display-labels", "data-reduce-values", "data-reduce-calcs", "data-slice-count", "data-layout-size"];
const _hoisted_2$28 = { class: "pie-viz" };
const _hoisted_3$1U = ["viewBox", "width", "height"];
const _hoisted_4$1B = ["id", "r"];
const _hoisted_5$1r = ["offset", "stop-color"];
const _hoisted_6$1d = ["stop-color"];
const _hoisted_7$15 = ["transform"];
const _hoisted_8$X = ["r", "fill"];
const _hoisted_9$T = ["d", "fill"];
const _hoisted_10$L = ["x", "y"];
const _hoisted_11$D = { class: "pie-legend" };
const _hoisted_12$w = { class: "pie-legend-name" };
const _sfc_main$3q = /* @__PURE__ */ defineComponent({
  __name: "PieRenderer",
  props: {
    data: {},
    fieldConfig: {},
    options: {},
    width: {},
    height: {}
  },
  setup(__props) {
    const props = __props;
    const rootEl = ref(null);
    const legendEl = ref(null);
    const panelSize = ref({ w: 0, h: 0 });
    const legendSize = ref({ w: 0, h: 0 });
    let rootRo = null;
    let legendRo = null;
    function measureRoot() {
      const el = rootEl.value;
      if (!el) return;
      const w = el.clientWidth || 0;
      const h2 = el.clientHeight || 0;
      if (w !== panelSize.value.w || h2 !== panelSize.value.h) {
        panelSize.value = { w, h: h2 };
      }
    }
    function measureLegend() {
      const el = legendEl.value;
      if (!el) {
        if (legendSize.value.w || legendSize.value.h) {
          legendSize.value = { w: 0, h: 0 };
        }
        return;
      }
      const w = el.offsetWidth || 0;
      const h2 = el.offsetHeight || 0;
      if (w !== legendSize.value.w || h2 !== legendSize.value.h) {
        legendSize.value = { w, h: h2 };
      }
    }
    onMounted(() => {
      nextTick(() => {
        measureRoot();
        measureLegend();
        if (typeof ResizeObserver !== "undefined") {
          if (rootEl.value) {
            rootRo = new ResizeObserver(() => measureRoot());
            rootRo.observe(rootEl.value);
          }
          if (legendEl.value) {
            legendRo = new ResizeObserver(() => measureLegend());
            legendRo.observe(legendEl.value);
          }
        }
      });
    });
    onBeforeUnmount(() => {
      rootRo?.disconnect();
      legendRo?.disconnect();
      rootRo = null;
      legendRo = null;
    });
    const showLegend = computed(() => {
      const legend = props.options?.legend;
      if (legend?.showLegend === false) return false;
      return legend?.displayMode !== "hidden";
    });
    const legendPlacement = computed(() => {
      const p = String(props.options?.legend?.placement ?? "bottom");
      return p === "right" || p === "left" ? p : "bottom";
    });
    watch([showLegend, legendPlacement], () => {
      nextTick(() => {
        legendRo?.disconnect();
        legendRo = null;
        measureLegend();
        if (typeof ResizeObserver !== "undefined" && legendEl.value && showLegend.value) {
          legendRo = new ResizeObserver(() => measureLegend());
          legendRo.observe(legendEl.value);
        }
      });
    });
    const plotBox = computed(() => {
      const FALLBACK = 210.578125;
      const pw = props.width && props.width > 0 ? props.width : panelSize.value.w > 0 ? panelSize.value.w : FALLBACK;
      const ph = props.height && props.height > 0 ? props.height : panelSize.value.h > 0 ? panelSize.value.h : FALLBACK;
      if (!showLegend.value) {
        return { width: pw, height: ph };
      }
      const place = legendPlacement.value;
      if (place === "bottom") {
        const lh = legendSize.value.h > 0 ? legendSize.value.h : 0;
        return { width: pw, height: Math.max(1, ph - lh) };
      }
      const lw = legendSize.value.w > 0 ? legendSize.value.w : 0;
      return { width: Math.max(1, pw - lw), height: ph };
    });
    function getPieLayout(width2, height2, pieType, margin = 16) {
      const size = Math.max(1, Math.min(width2, height2));
      const outerRadius = Math.max(0, (size - margin * 2) / 2);
      const donut = pieType === "donut" || pieType === "Donut" || pieType === "DONUT";
      const donutThickness = donut ? Math.max(outerRadius / 3, 20) : outerRadius;
      const innerRadius = Math.max(0, outerRadius - donutThickness);
      const position = (size - margin * 2) / 2 + margin;
      const gradientFromOffset = outerRadius > 0 ? 1 - (outerRadius - innerRadius) / outerRadius : 0;
      return {
        size,
        outerRadius,
        innerRadius,
        position,
        gradientFromOffset
      };
    }
    const layout = computed(() => {
      const pieType = String(props.options?.pieType ?? "pie");
      return getPieLayout(plotBox.value.width, plotBox.value.height, pieType);
    });
    const slices = computed(() => {
      const allFrames = props.data?.series ?? [];
      const frame = allFrames[0];
      if (!frame) return [];
      const o = props.options ?? {};
      const showAllValues = o.reduceOptions?.values === true;
      const calc = String(
        (o.reduceOptions?.calcs ?? ["lastNotNull"])[0] ?? "lastNotNull"
      );
      const numFields = frame.fields.filter((f) => f.type === "number");
      if (!numFields.length) return [];
      let items = [];
      if (showAllValues || numFields.length === 1 && frame.fields.some((f) => f.type === "string")) {
        const num2 = numFields[0];
        const label = frame.fields.find((f) => f.type === "string") ?? frame.fields.find((f) => f.type !== "number" && f.type !== "time");
        items = num2.values.map((v, i) => {
          const n = Number(v ?? 0);
          const cfg = { ...num2.config, ...props.fieldConfig?.defaults ?? {} };
          return {
            label: label ? String(label.values[i] ?? i) : getFieldDisplayName(num2, frame, allFrames) + " " + i,
            value: n,
            text: formatValue(n, cfg),
            color: getFieldSeriesColor(String(label?.values?.[i] ?? i), i, {
              ...cfg,
              color: { mode: "palette-classic" }
            }) || getFieldColor(n, cfg) || getClassicPalette$1()[i % getClassicPalette$1().length]
          };
        }).filter((x) => x.value > 0);
      } else {
        items = numFields.map((field, i) => {
          const nums = field.values.map(Number).filter((n) => Number.isFinite(n));
          if (!nums.length) return null;
          let v = nums[nums.length - 1];
          if (calc === "sum") v = nums.reduce((a, b) => a + b, 0);
          else if (calc === "mean" || calc === "avg")
            v = nums.reduce((a, b) => a + b, 0) / nums.length;
          else if (calc === "max") v = Math.max(...nums);
          else if (calc === "min") v = Math.min(...nums);
          else if (calc === "first" || calc === "firstNotNull") v = nums[0];
          const cfg = { ...field.config, ...props.fieldConfig?.defaults ?? {} };
          return {
            label: getFieldDisplayName(field, frame, allFrames),
            value: v,
            text: formatValue(v, cfg),
            color: getFieldSeriesColor(
              getFieldDisplayName(field, frame, allFrames),
              i,
              { ...cfg, color: { mode: "palette-classic" } }
            ) || getFieldColor(v, cfg) || getClassicPalette$1()[i % getClassicPalette$1().length]
          };
        }).filter((x) => !!x && x.value > 0);
      }
      if (props.options?.sort === "desc") items.sort((a, b) => b.value - a.value);
      if (props.options?.sort === "asc") items.sort((a, b) => a.value - b.value);
      const total = items.reduce((a, b) => a + b.value, 0) || 1;
      const { size, outerRadius: r, innerRadius: ir, position } = layout.value;
      const pad = items.length > 1 ? 5e-3 : 0;
      let angle = -Math.PI / 2 + pad / 2;
      return items.map((it) => {
        const sweep = Math.max(0, it.value / total * Math.PI * 2 - pad);
        const a0 = angle;
        const a1 = angle + sweep;
        angle = a1 + pad;
        const large = sweep > Math.PI ? 1 : 0;
        const mid = a0 + sweep / 2;
        const labelInner = ir === 0 ? r / 6 : ir;
        const lr = (r + labelInner) / 2;
        const full = sweep >= Math.PI * 2 - 1e-6;
        let path = "";
        if (!full) {
          if (ir <= 0) {
            path = `M0,0 L ${r * Math.cos(a0)} ${r * Math.sin(a0)} A ${r} ${r} 0 ${large} 1 ${r * Math.cos(a1)} ${r * Math.sin(a1)} Z`;
          } else {
            const x0 = r * Math.cos(a0);
            const y0 = r * Math.sin(a0);
            const x1 = r * Math.cos(a1);
            const y1 = r * Math.sin(a1);
            const xi0 = ir * Math.cos(a0);
            const yi0 = ir * Math.sin(a0);
            const xi1 = ir * Math.cos(a1);
            const yi1 = ir * Math.sin(a1);
            path = `M ${x0} ${y0} A ${r} ${r} 0 ${large} 1 ${x1} ${y1} L ${xi1} ${yi1} A ${ir} ${ir} 0 ${large} 0 ${xi0} ${yi0} Z`;
          }
        } else if (ir > 0) {
          path = `M 0 ${-r} A ${r} ${r} 0 1 1 0 ${r} A ${r} ${r} 0 1 1 0 ${-r} M 0 ${-ir} A ${ir} ${ir} 0 1 0 0 ${ir} A ${ir} ${ir} 0 1 0 0 ${-ir} Z`;
        }
        return {
          ...it,
          path,
          full: full && ir <= 0,
          r,
          ir,
          cx: position,
          cy: position,
          size,
          pct: (it.value / total * 100).toFixed(1),
          labelX: lr * Math.cos(mid),
          labelY: lr * Math.sin(mid)
        };
      });
    });
    const showLabels = computed(() => {
      const labels = props.options?.displayLabels;
      return Array.isArray(labels) ? labels.length > 0 : false;
    });
    const labelParts = computed(() => {
      const labels = props.options?.displayLabels;
      if (Array.isArray(labels) && labels.length) return labels.map(String);
      return [];
    });
    function parseHex2(hex) {
      const h2 = hex.replace("#", "");
      if (h2.length < 6) return null;
      return [
        parseInt(h2.slice(0, 2), 16),
        parseInt(h2.slice(2, 4), 16),
        parseInt(h2.slice(4, 6), 16)
      ];
    }
    function rgbToHsl(r, g, b) {
      r /= 255;
      g /= 255;
      b /= 255;
      const max = Math.max(r, g, b);
      const min = Math.min(r, g, b);
      const l = (max + min) / 2;
      if (max === min) return [0, 0, l];
      const d = max - min;
      const s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
      let h2 = 0;
      switch (max) {
        case r:
          h2 = (g - b) / d + (g < b ? 6 : 0);
          break;
        case g:
          h2 = (b - r) / d + 2;
          break;
        default:
          h2 = (r - g) / d + 4;
      }
      return [h2 / 6 * 360, s, l];
    }
    function hslToRgb2(h2, s, l) {
      h2 = (h2 % 360 + 360) % 360;
      const c = (1 - Math.abs(2 * l - 1)) * s;
      const x = c * (1 - Math.abs(h2 / 60 % 2 - 1));
      const m = l - c / 2;
      let rp = 0, gp = 0, bp = 0;
      if (h2 < 60) [rp, gp, bp] = [c, x, 0];
      else if (h2 < 120) [rp, gp, bp] = [x, c, 0];
      else if (h2 < 180) [rp, gp, bp] = [0, c, x];
      else if (h2 < 240) [rp, gp, bp] = [0, x, c];
      else if (h2 < 300) [rp, gp, bp] = [x, 0, c];
      else [rp, gp, bp] = [c, 0, x];
      return [
        Math.max(0, Math.min(255, Math.round((rp + m) * 255))),
        Math.max(0, Math.min(255, Math.round((gp + m) * 255))),
        Math.max(0, Math.min(255, Math.round((bp + m) * 255)))
      ];
    }
    function tinyDarkenSpin(hex, darkenAmt, spinDeg) {
      const rgb = parseHex2(hex.startsWith("#") ? hex : "#73bf69");
      if (!rgb) return hex;
      let [h2, s, l] = rgbToHsl(rgb[0], rgb[1], rgb[2]);
      l = Math.max(0, l - darkenAmt / 100);
      h2 += spinDeg;
      const [r, g, b] = hslToRgb2(h2, s, l);
      return `rgb(${r}, ${g}, ${b})`;
    }
    function gradientFrom(color) {
      return tinyDarkenSpin(color, 20, 4);
    }
    function gradientTo(color) {
      return tinyDarkenSpin(color, 10, -4);
    }
    function legendShows(kind2) {
      const vals = props.options?.legend?.values;
      if (!Array.isArray(vals) || !vals.length) return false;
      return vals.map(String).includes(kind2) || vals.map(String).includes(kind2 === "percent" ? "Percent" : "Value");
    }
    function sliceLabel(s) {
      const parts = [];
      if (labelParts.value.includes("name")) parts.push(s.label);
      if (labelParts.value.includes("value")) parts.push(s.text);
      if (labelParts.value.includes("percent")) parts.push(`${s.pct}%`);
      return parts.join(" · ");
    }
    function showSliceLabel(s, index2, all) {
      const pct = Number(s.pct);
      if (all.length <= 4) return true;
      if (pct >= 8) return true;
      const ranked = all.map((x, i) => ({ i, p: Number(x.pct) })).sort((a, b) => b.p - a.p).slice(0, 4).map((x) => x.i);
      return ranked.includes(index2);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "rootEl",
        ref: rootEl,
        class: normalizeClass(["pie", [`legend-${legendPlacement.value}`, { "has-legend": showLegend.value }]]),
        "data-testid": "panel-pie",
        "data-pie-type": String(__props.options?.pieType ?? "pie"),
        "data-sort": String(__props.options?.sort ?? ""),
        "data-show-legend": String(showLegend.value),
        "data-legend-display-mode": String(__props.options?.legend?.displayMode ?? "list"),
        "data-legend-placement": legendPlacement.value,
        "data-tooltip-mode": String(__props.options?.tooltip?.mode ?? "single"),
        "data-hide-from": String(
          __props.fieldConfig?.defaults?.custom?.hideFrom ? JSON.stringify(__props.fieldConfig.defaults.custom.hideFrom) : ""
        ),
        "data-show-labels": String(showLabels.value),
        "data-display-labels": labelParts.value.join(","),
        "data-reduce-values": String(!!__props.options?.reduceOptions?.values),
        "data-reduce-calcs": String(
          (__props.options?.reduceOptions?.calcs ?? ["lastNotNull"])[0] ?? "lastNotNull"
        ),
        "data-slice-count": String(slices.value.length),
        "data-layout-size": String(layout.value.size)
      }, [
        slices.value.length ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createCommentVNode(" VizLayout.viz: flex-grow area; pie centered inside remaining plot box "),
            createElementVNode("div", _hoisted_2$28, [
              (openBlock(), createElementBlock("svg", {
                class: "pie-svg",
                "aria-hidden": "true",
                viewBox: `0 0 ${layout.value.size} ${layout.value.size}`,
                width: layout.value.size,
                height: layout.value.size,
                style: { "overflow": "visible" }
              }, [
                createElementVNode("defs", null, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(slices.value, (s, i) => {
                      return openBlock(), createElementBlock("radialGradient", {
                        key: "g" + i,
                        id: "pie-grad-" + i,
                        cx: "0",
                        cy: "0",
                        r: layout.value.outerRadius,
                        gradientUnits: "userSpaceOnUse"
                      }, [
                        createElementVNode("stop", {
                          offset: String(layout.value.gradientFromOffset),
                          "stop-color": gradientFrom(s.color),
                          "stop-opacity": "1"
                        }, null, 8, _hoisted_5$1r),
                        createElementVNode("stop", {
                          offset: "1",
                          "stop-color": gradientTo(s.color),
                          "stop-opacity": "1"
                        }, null, 8, _hoisted_6$1d)
                      ], 8, _hoisted_4$1B);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ]),
                createElementVNode("g", {
                  transform: `translate(${layout.value.position}, ${layout.value.position})`
                }, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(slices.value, (s, i) => {
                      return openBlock(), createElementBlock(
                        Fragment,
                        { key: i },
                        [
                          s.full && !s.ir ? (openBlock(), createElementBlock("circle", {
                            key: 0,
                            r: s.r,
                            cx: "0",
                            cy: "0",
                            fill: "url(#pie-grad-" + i + ")"
                          }, null, 8, _hoisted_8$X)) : (openBlock(), createElementBlock("path", {
                            key: 1,
                            d: s.path,
                            fill: "url(#pie-grad-" + i + ")",
                            stroke: "transparent",
                            "stroke-width": "0"
                          }, null, 8, _hoisted_9$T))
                        ],
                        64
                        /* STABLE_FRAGMENT */
                      );
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  )),
                  showLabels.value ? (openBlock(true), createElementBlock(
                    Fragment,
                    { key: 0 },
                    renderList(slices.value, (s, i) => {
                      return withDirectives((openBlock(), createElementBlock("text", {
                        key: "t" + i,
                        x: s.labelX,
                        y: s.labelY,
                        "text-anchor": "middle",
                        "dominant-baseline": "middle",
                        "font-size": "12",
                        fill: "var(--grafana-text)",
                        "data-testid": "pie-slice-label"
                      }, toDisplayString(sliceLabel(s)), 9, _hoisted_10$L)), [
                        [vShow, showSliceLabel(s, i, slices.value)]
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  )) : createCommentVNode("v-if", true)
                ], 8, _hoisted_7$15)
              ], 8, _hoisted_3$1U))
            ]),
            showLegend.value ? (openBlock(), createElementBlock(
              "div",
              {
                key: 0,
                ref_key: "legendEl",
                ref: legendEl,
                class: "pie-legend-wrap"
              },
              [
                createElementVNode("ul", _hoisted_11$D, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(slices.value, (s, i) => {
                      return openBlock(), createElementBlock("li", { key: i }, [
                        createElementVNode(
                          "span",
                          {
                            class: "swatch",
                            style: normalizeStyle({ background: s.color })
                          },
                          null,
                          4
                          /* STYLE */
                        ),
                        createElementVNode(
                          "span",
                          _hoisted_12$w,
                          toDisplayString(s.label),
                          1
                          /* TEXT */
                        ),
                        legendShows("value") ? (openBlock(), createElementBlock(
                          Fragment,
                          { key: 0 },
                          [
                            createTextVNode(
                              toDisplayString(s.text),
                              1
                              /* TEXT */
                            )
                          ],
                          64
                          /* STABLE_FRAGMENT */
                        )) : createCommentVNode("v-if", true),
                        legendShows("percent") ? (openBlock(), createElementBlock(
                          Fragment,
                          { key: 1 },
                          [
                            createTextVNode(
                              toDisplayString(legendShows("value") ? " " : "") + toDisplayString(s.pct) + "%",
                              1
                              /* TEXT */
                            )
                          ],
                          64
                          /* STABLE_FRAGMENT */
                        )) : createCommentVNode("v-if", true)
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])
              ],
              512
              /* NEED_PATCH */
            )) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : (openBlock(), createBlock(PanelDataErrorView, {
          key: 1,
          data: __props.data,
          "field-config": __props.fieldConfig
        }, null, 8, ["data", "field-config"]))
      ], 10, _hoisted_1$2G);
    };
  }
});
const PieRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3q, [["__scopeId", "data-v-b718f2cd"]]);
const _sfc_main$3p = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(PieRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "piechart",
    name: "饼图",
    description: "饼图 / 环形图",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3p
).useFieldConfig({
  useCustomConfig: (builder) => {
    addHideFrom(builder);
  }
}).setPanelOptions((builder) => {
  const cat = ["饼图"];
  builder.addRadio(
    {
      id: "reduceOptions.values",
      path: "reduceOptions.values",
      name: "显示",
      category: ["数值选项"],
      editor: "radio",
      settings: {
        options: [
          { label: "计算", value: false },
          { label: "全部值", value: true }
        ]
      }
    },
    false
  ).addCustom(
    {
      id: "reduceOptions.calcs",
      path: "reduceOptions.calcs",
      name: "计算",
      category: ["数值选项"],
      editor: "stats-picker",
      settings: {
        options: [
          { label: "Last *", value: "lastNotNull" },
          { label: "总和", value: "sum" },
          { label: "平均值", value: "mean" },
          { label: "最大值", value: "max" }
        ]
      },
      showIf: (c) => !c.reduceOptions?.values
    },
    ["lastNotNull"]
  ).addRadio(
    {
      id: "pieType",
      path: "pieType",
      name: "饼图类型",
      category: cat,
      editor: "radio",
      settings: {
        options: [
          { label: "饼图", value: "pie" },
          { label: "环形", value: "donut" }
        ]
      }
    },
    "pie"
  ).addSelect(
    {
      id: "sort",
      path: "sort",
      name: "切片排序",
      category: cat,
      editor: "select",
      settings: {
        options: [
          { label: "降序", value: "desc" },
          { label: "升序", value: "asc" },
          { label: "无", value: "none" }
        ]
      }
    },
    "desc"
  ).addSelect(
    {
      id: "displayLabels",
      path: "displayLabels",
      name: "标签",
      description: "在扇区上显示的标签",
      category: cat,
      editor: "stats-picker",
      settings: {
        options: [
          { label: "百分比", value: "percent" },
          { label: "名称", value: "name" },
          { label: "值", value: "value" }
        ]
      }
    },
    []
  );
  addTooltipOptions(builder, false, false);
  addLegendOptions(builder, false, true);
  builder.addSelect(
    {
      id: "legend.values",
      path: "legend.values",
      name: "图例值",
      category: ["图例"],
      editor: "multi-select",
      settings: {
        options: [
          { label: "百分比", value: "percent" },
          { label: "值", value: "value" }
        ]
      },
      showIf: (c) => c.legend?.showLegend !== false
    },
    []
  );
}).setRuntimeConsumedPaths([
  "custom.hideFrom",
  "reduceOptions.calcs",
  "reduceOptions.values",
  "pieType",
  "sort",
  "displayLabels",
  "legend.showLegend",
  "legend.displayMode",
  "legend.placement",
  "legend.values",
  "tooltip.mode"
]).register();
const _hoisted_1$2F = ["data-anno-clustering", "data-anno-multi-lane", "data-anno-count"];
const _hoisted_2$27 = ["title", "data-anno-index", "data-count", "data-lane", "onMouseenter", "onFocus"];
const _hoisted_3$1T = {
  key: 0,
  class: "anno-tip",
  "data-testid": "anno-tooltip"
};
const _hoisted_4$1A = { key: 0 };
const _hoisted_5$1q = { class: "ts-val" };
const _sfc_main$3o = /* @__PURE__ */ defineComponent({
  __name: "AnnotationLayer",
  props: {
    annotations: {},
    options: {},
    xMin: {},
    xMax: {}
  },
  setup(__props) {
    const props = __props;
    function toMs2(v) {
      if (v == null) return void 0;
      if (typeof v === "number" && Number.isFinite(v)) return v;
      if (v instanceof Date) {
        const t2 = v.getTime();
        return Number.isFinite(t2) ? t2 : void 0;
      }
      if (typeof v?.valueOf === "function") {
        const n2 = Number(v.valueOf());
        if (Number.isFinite(n2)) return n2;
      }
      const n = new Date(v).getTime();
      return Number.isFinite(n) ? n : void 0;
    }
    const hoverAnno = ref(null);
    const show = computed(() => props.options?.show !== false);
    const clustered = computed(() => {
      if (!show.value) return [];
      const list = (props.annotations ?? []).map((a, i) => ({
        time: Number(a.time),
        timeEnd: a.timeEnd != null ? Number(a.timeEnd) : void 0,
        title: a.title ?? a.text ?? "annotation",
        text: a.text,
        color: a.color || "#f2cc0c",
        tags: a.tags ?? [],
        index: i
      }));
      return clusterAnnotations(list, {
        clustering: props.options?.clustering,
        multiLane: !!props.options?.multiLane
      });
    });
    function leftPct(time) {
      const min = toMs2(props.xMin);
      const max = toMs2(props.xMax);
      if (min != null && max != null && max > min) {
        const p = (time - min) / (max - min) * 100;
        return Math.max(0, Math.min(100, p)) + "%";
      }
      return "50%";
    }
    return (_ctx, _cache) => {
      return clustered.value.length ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: "anno-layer",
        "data-testid": "panel-annotations",
        "data-anno-clustering": String(__props.options?.clustering !== false),
        "data-anno-multi-lane": String(!!__props.options?.multiLane),
        "data-anno-count": String(clustered.value.length)
      }, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(clustered.value, (a, i) => {
            return openBlock(), createElementBlock("button", {
              key: i,
              type: "button",
              class: "anno-mark",
              style: normalizeStyle({
                left: leftPct(a.time),
                background: a.color,
                top: 4 + (a.lane || 0) * 10 + "px"
              }),
              title: a.title,
              "data-testid": "annotation-marker",
              "data-anno-index": i,
              "data-count": a.count || 1,
              "data-lane": a.lane || 0,
              onMouseenter: ($event) => hoverAnno.value = a,
              onMouseleave: _cache[0] || (_cache[0] = ($event) => hoverAnno.value = null),
              onFocus: ($event) => hoverAnno.value = a,
              onBlur: _cache[1] || (_cache[1] = ($event) => hoverAnno.value = null)
            }, null, 44, _hoisted_2$27);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        hoverAnno.value ? (openBlock(), createElementBlock("div", _hoisted_3$1T, [
          createElementVNode(
            "strong",
            null,
            toDisplayString(hoverAnno.value.title),
            1
            /* TEXT */
          ),
          hoverAnno.value.text ? (openBlock(), createElementBlock(
            "div",
            _hoisted_4$1A,
            toDisplayString(hoverAnno.value.text),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          createElementVNode(
            "div",
            _hoisted_5$1q,
            toDisplayString(new Date(hoverAnno.value.time).toISOString()),
            1
            /* TEXT */
          )
        ])) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2F)) : createCommentVNode("v-if", true);
    };
  }
});
const AnnotationLayer = /* @__PURE__ */ _export_sfc(_sfc_main$3o, [["__scopeId", "data-v-d0d76b66"]]);
function resolveField(frame, preferred, aliases = []) {
  if (!frame?.fields) return void 0;
  if (preferred) {
    const exact = frame.fields.find((f) => f.name === preferred);
    if (exact) return exact;
    const ci = frame.fields.find(
      (f) => String(f.name).toLowerCase() === preferred.toLowerCase()
    );
    if (ci) return ci;
  }
  for (const a of aliases) {
    const f = frame.fields.find(
      (x) => String(x.name).toLowerCase() === a.toLowerCase() || new RegExp(`^${a}$`, "i").test(x.name)
    );
    if (f) return f;
  }
  return void 0;
}
function extractBars(frames, fieldsMap = {}) {
  const out = [];
  for (const frame of frames ?? []) {
    const time = frame.fields?.find((f) => f.type === "time") ?? frame.fields?.[0];
    if (!time) continue;
    let open = resolveField(frame, fieldsMap.open, ["open", "o"]);
    let high = resolveField(frame, fieldsMap.high, ["high", "h", "max"]);
    let low = resolveField(frame, fieldsMap.low, ["low", "l", "min"]);
    let close = resolveField(frame, fieldsMap.close, ["close", "c"]);
    const volume = resolveField(frame, fieldsMap.volume, [
      "volume",
      "vol",
      "v"
    ]);
    if (!open && !close) {
      open = frame.fields?.find((f) => f.type === "number");
    }
    if (!close && !open) {
      close = frame.fields?.find((f) => f.type === "number");
    }
    let openVals;
    let closeVals;
    if (open && !close && !fieldsMap.close) {
      const src = open.values;
      closeVals = src.slice(1);
      if (closeVals.length) closeVals.push(closeVals[closeVals.length - 1]);
      else closeVals = src.slice();
      openVals = src.map(Number);
    } else if (close && !open && !fieldsMap.open) {
      const src = close.values.map(Number);
      openVals = src.slice();
      openVals.unshift(openVals[0]);
      openVals.length = src.length;
      closeVals = src;
    } else {
      if (!close && open) close = open;
      if (!open || !close) continue;
      openVals = open.values.map(Number);
      closeVals = close.values.map(Number);
    }
    if (!openVals || !closeVals) continue;
    const highVals = high ? high.values.map(Number) : void 0;
    const lowVals = low ? low.values.map(Number) : void 0;
    const volVals = volume ? volume.values.map(Number) : void 0;
    const len = Math.min(
      time.values?.length ?? 0,
      openVals.length,
      closeVals.length
    );
    for (let i = 0; i < len; i++) {
      const o = openVals[i];
      const c = closeVals[i];
      if (!Number.isFinite(o) || !Number.isFinite(c)) continue;
      const h2 = highVals ? highVals[i] : o;
      const l = lowVals ? lowVals[i] : o;
      const hi = Number.isFinite(h2) ? Math.max(h2, o, c) : Math.max(o, c);
      const lo = Number.isFinite(l) ? Math.min(l, o, c) : Math.min(o, c);
      out.push({
        t: Number(time.values[i]),
        open: o,
        high: hi,
        low: lo,
        close: c,
        volume: volVals && Number.isFinite(volVals[i]) ? volVals[i] : void 0
      });
    }
  }
  return out;
}
function alpha(color, a) {
  if (color.startsWith("rgba"))
    return color.replace(/rgba\(([^)]+)\)/, (_, inner) => {
      const parts = inner.split(",").map((s) => s.trim());
      return `rgba(${parts[0]}, ${parts[1]}, ${parts[2]}, ${a})`;
    });
  if (color.startsWith("rgb(")) {
    return color.replace("rgb(", "rgba(").replace(")", `, ${a})`);
  }
  if (color.startsWith("#")) {
    let h2 = color.slice(1);
    if (h2.length === 3)
      h2 = h2.split("").map((c) => c + c).join("");
    const r = parseInt(h2.slice(0, 2), 16);
    const g = parseInt(h2.slice(2, 4), 16);
    const b = parseInt(h2.slice(4, 6), 16);
    return `rgba(${r}, ${g}, ${b}, ${a})`;
  }
  return color;
}
function drawMarkers(opts) {
  const {
    mode: mode2,
    candleStyle,
    fields,
    colorStrategy,
    upColor,
    downColor,
    flatColor,
    volumeAlpha,
    flatAsUp = true
  } = opts;
  const drawPrice = mode2 !== "volume" && fields.high != null && fields.low != null;
  const asCandles = drawPrice && candleStyle !== "ohlcbars";
  const drawVolume = mode2 !== "candles" && fields.volume != null;
  function selectPath(priceDir, flatPath, upPath, downPath, flatAsUpLocal) {
    return priceDir > 0 ? upPath : priceDir < 0 ? downPath : flatAsUpLocal ? upPath : flatPath;
  }
  const tIdx = 0;
  const oIdx = fields.open;
  const hIdx = fields.high;
  const lIdx = fields.low;
  const cIdx = fields.close;
  const vIdx = fields.volume;
  return (u) => {
    let downPath;
    let upPath;
    let flatPath;
    let downPathVol;
    let upPathVol;
    let flatPathVol;
    if (drawPrice) {
      flatPath = new Path2D();
      upPath = new Path2D();
      downPath = new Path2D();
    }
    if (drawVolume) {
      downPathVol = new Path2D();
      upPathVol = new Path2D();
      flatPathVol = new Path2D();
    }
    const hollowPath = new Path2D();
    const ctx = u.ctx;
    const tData = u.data[tIdx];
    const oData = u.data[oIdx];
    const cData = u.data[cIdx];
    const hData = drawPrice ? u.data[hIdx] : null;
    const lData = drawPrice ? u.data[lIdx] : null;
    const vData = drawVolume ? u.data[vIdx] : null;
    const zeroPx = vIdx != null ? Math.round(u.valToPos(0, u.series[vIdx].scale, true)) : null;
    const [idx0, idx1] = u.series[0].idxs;
    const dataX = u.data[0];
    const dataY = oData;
    let colWidth = u.bbox.width;
    if (dataX.length > 1) {
      let prevIdx = null;
      for (let i = 0, minDelta = Infinity; i < dataX.length; i++) {
        if (dataY[i] !== void 0 && dataY[i] != null) {
          if (prevIdx != null) {
            const delta = Math.abs(dataX[i] - dataX[prevIdx]);
            if (delta < minDelta) {
              minDelta = delta;
              colWidth = Math.abs(
                u.valToPos(dataX[i], "x", true) - u.valToPos(dataX[prevIdx], "x", true)
              );
            }
          }
          prevIdx = i;
        }
      }
    }
    let barWidth = Math.round(0.6 * colWidth);
    let stickWidth = 2;
    let outlineWidth = 2;
    if (barWidth <= 12) {
      stickWidth = outlineWidth = 1;
    }
    const halfWidth = Math.floor(barWidth / 2);
    for (let i = idx0; i <= idx1; i++) {
      if (oData[i] == null || cData[i] == null) continue;
      const tPx = Math.round(u.valToPos(tData[i], "x", true));
      const interDir = i === idx0 ? 0 : Math.sign(cData[i] - cData[i - 1]);
      const intraDir = Math.sign(cData[i] - oData[i]);
      if (drawVolume && flatPathVol && upPathVol && downPathVol && vData && zeroPx != null) {
        const outerPath = selectPath(
          colorStrategy === "close-close" ? interDir : intraDir,
          flatPathVol,
          upPathVol,
          downPathVol,
          i === idx0 && colorStrategy === "close-close" ? false : flatAsUp
        );
        const vPx = Math.round(
          u.valToPos(vData[i], u.series[vIdx].scale, true)
        );
        outerPath.rect(tPx - halfWidth, vPx, barWidth, zeroPx - vPx);
      }
      if (drawPrice && flatPath && upPath && downPath && hData && lData) {
        const outerPath = selectPath(
          colorStrategy === "close-close" ? interDir : intraDir,
          flatPath,
          upPath,
          downPath,
          i === idx0 && colorStrategy === "close-close" ? false : flatAsUp
        );
        const hPx = Math.round(
          u.valToPos(hData[i], u.series[hIdx].scale, true)
        );
        const lPx = Math.round(
          u.valToPos(lData[i], u.series[lIdx].scale, true)
        );
        outerPath.rect(
          tPx - Math.floor(stickWidth / 2),
          hPx,
          stickWidth,
          lPx - hPx
        );
        const oPx = Math.round(
          u.valToPos(oData[i], u.series[oIdx].scale, true)
        );
        const cPx = Math.round(
          u.valToPos(cData[i], u.series[cIdx].scale, true)
        );
        if (asCandles) {
          const top = Math.min(oPx, cPx);
          const btm = Math.max(oPx, cPx);
          const hgt = Math.max(1, btm - top);
          outerPath.rect(tPx - halfWidth, top, barWidth, hgt);
          if (colorStrategy === "close-close") {
            if (intraDir >= 0 && hgt > outlineWidth * 2) {
              hollowPath.rect(
                tPx - halfWidth + outlineWidth,
                top + outlineWidth,
                barWidth - outlineWidth * 2,
                hgt - outlineWidth * 2
              );
            }
          }
        } else {
          outerPath.rect(tPx - halfWidth, oPx, halfWidth, stickWidth);
          outerPath.rect(tPx, cPx, halfWidth, stickWidth);
        }
      }
    }
    ctx.save();
    ctx.rect(u.bbox.left, u.bbox.top, u.bbox.width, u.bbox.height);
    ctx.clip();
    if (drawVolume && flatPathVol && upPathVol && downPathVol) {
      ctx.fillStyle = alpha(upColor, volumeAlpha);
      ctx.fill(upPathVol);
      ctx.fillStyle = alpha(downColor, volumeAlpha);
      ctx.fill(downPathVol);
      ctx.fillStyle = alpha(flatColor, volumeAlpha);
      ctx.fill(flatPathVol);
    }
    if (drawPrice && flatPath && upPath && downPath) {
      ctx.fillStyle = upColor;
      ctx.fill(upPath);
      ctx.fillStyle = downColor;
      ctx.fill(downPath);
      ctx.fillStyle = flatColor;
      ctx.fill(flatPath);
      ctx.globalCompositeOperation = "destination-out";
      ctx.fill(hollowPath);
    }
    ctx.restore();
  };
}
const _hoisted_1$2E = {
  class: "panel-content-only",
  "data-testid": "panel-content-only",
  "data-panel-type": "candlestick"
};
const _hoisted_2$26 = ["data-mode", "data-candle-style", "data-color-strategy", "data-include-all", "data-color-up", "data-color-down", "data-color-flat", "data-candle-count", "data-bar-count", "data-fields-open", "data-fields-close", "data-fields-volume", "data-tooltip-mode", "data-annotations", "data-render", "data-legend-show", "data-annotations-show", "data-annotations-clustering", "data-annotations-multi-lane"];
const _hoisted_3$1S = {
  class: "chart-host",
  style: { "position": "relative", "flex": "1", "min-height": "0", "width": "100%", "height": "100%" }
};
const _hoisted_4$1z = {
  key: 0,
  class: "legend",
  "data-testid": "candlestick-legend"
};
const _sfc_main$3n = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const chartEl = ref(null);
    const opts = computed(() => props.options ?? {});
    const colors = computed(() => ({
      up: resolveVizColor(String(opts.value.colors?.up ?? "green")) ?? "#73BF69",
      down: resolveVizColor(String(opts.value.colors?.down ?? "red")) ?? "#F2495C",
      flat: resolveVizColor(String(opts.value.colors?.flat ?? "gray")) ?? "var(--grafana-text)"
    }));
    const mode2 = computed(() => String(opts.value.mode ?? "candles+volume"));
    const candleStyle = computed(() => String(opts.value.candleStyle ?? "candles"));
    const colorStrategy = computed(
      () => String(opts.value.colorStrategy ?? "open-close")
    );
    const includeAll = computed(() => opts.value.includeAllFields === true);
    const fieldsMap = computed(
      () => opts.value.fields ?? {}
    );
    const bars = computed(
      () => extractBars(props.data?.series, fieldsMap.value)
    );
    const showLegend = computed(() => opts.value.legend?.showLegend !== false);
    const legendReserve = computed(() => {
      return showLegend.value && legendItems.value.length ? 32 : 0;
    });
    const chartHeight = computed(
      () => Math.max((props.height || 200) - legendReserve.value, 40)
    );
    const chartWidth = computed(() => Math.max(props.width || 400, 40));
    const hasVolume = computed(
      () => bars.value.some((b) => b.volume != null && Number.isFinite(b.volume))
    );
    const drawPrice = computed(() => mode2.value !== "volume");
    const drawVolume = computed(() => mode2.value !== "candles" && hasVolume.value);
    const series = computed(() => {
      const bs = bars.value;
      if (!bs.length) return [];
      const xs = bs.map((b) => b.t);
      const out = [];
      if (drawPrice.value) {
        for (const [label, key] of [
          ["Open", "open"],
          ["High", "high"],
          ["Low", "low"],
          ["Close", "close"]
        ]) {
          out.push({
            label,
            color: colors.value.up,
            skipLine: true,
            showPoints: "never",
            points: xs.map((x, i) => ({ x, y: bs[i][key] }))
          });
        }
      }
      if (drawVolume.value) {
        out.push({
          label: "Volume",
          color: colors.value.up,
          skipLine: true,
          showPoints: "never",
          scale: "yvol",
          points: xs.map((x, i) => ({ x, y: bs[i].volume ?? null }))
        });
      }
      if (!out.length && bs.length) {
        out.push({
          label: "Close",
          color: colors.value.up,
          skipLine: true,
          showPoints: "never",
          points: xs.map((x, i) => ({ x, y: bs[i].close }))
        });
      }
      return out;
    });
    const fieldIndices = computed(() => {
      const map = {};
      let idx = 1;
      if (drawPrice.value) {
        map.open = idx++;
        map.high = idx++;
        map.low = idx++;
        map.close = idx++;
      }
      if (drawVolume.value) {
        map.volume = idx++;
      }
      return map;
    });
    const markerHook = computed(() => {
      if (!bars.value.length) return void 0;
      return drawMarkers({
        mode: mode2.value,
        candleStyle: candleStyle.value,
        fields: fieldIndices.value,
        colorStrategy: colorStrategy.value,
        upColor: colors.value.up,
        downColor: colors.value.down,
        flatColor: colors.value.flat,
        volumeAlpha: 0.5,
        flatAsUp: true
      });
    });
    const extraScales = computed(() => {
      if (!drawVolume.value) return void 0;
      return {
        yvol: {
          auto: false,
          range: (_u, _min, max) => [0, (max || 1) * 7]
        }
      };
    });
    const timeRange = computed(() => {
      const tr = props.timeRange;
      const from = tr?.from;
      const to = tr?.to;
      const xMin = from?.valueOf?.() ?? (typeof from === "number" ? from : void 0);
      const xMax = to?.valueOf?.() ?? (typeof to === "number" ? to : void 0);
      return { xMin, xMax };
    });
    const legendItems = computed(() => {
      if (!includeAll.value) return [];
      return series.value.map((s) => ({
        label: s.label,
        color: s.color || "#73bf69"
      }));
    });
    useUPlot(chartEl, series, {
      width: chartWidth,
      height: chartHeight,
      mode: "line",
      timeX: true,
      xMin: computed(() => timeRange.value.xMin),
      xMax: computed(() => timeRange.value.xMax),
      showLegend: false,
      tooltipMode: "none",
      drawHook: markerHook,
      extraScales,
      axis: {
        // Let useUPlot calculateAxisSize match Grafana (short OHLC ticks → ~27–36px)
        gap: 1,
        gridShow: true
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2E, [
        createElementVNode("div", {
          class: "wrap",
          "data-testid": "candlestick-panel",
          "data-mode": mode2.value,
          "data-candle-style": candleStyle.value,
          "data-color-strategy": colorStrategy.value,
          "data-include-all": String(includeAll.value),
          "data-color-up": colors.value.up,
          "data-color-down": colors.value.down,
          "data-color-flat": colors.value.flat,
          "data-candle-count": String(bars.value.length),
          "data-bar-count": String(bars.value.length),
          "data-fields-open": String(fieldsMap.value.open ?? ""),
          "data-fields-close": String(fieldsMap.value.close ?? ""),
          "data-fields-volume": String(fieldsMap.value.volume ?? ""),
          "data-tooltip-mode": String(opts.value?.tooltip?.mode ?? "single"),
          "data-annotations": String(!!opts.value?.annotations),
          "data-render": candleStyle.value === "ohlcbars" ? "ohlcbars" : "candles",
          "data-legend-show": String(showLegend.value),
          "data-annotations-show": String(opts.value?.annotations?.show !== false),
          "data-annotations-clustering": String(!!opts.value?.annotations?.clustering),
          "data-annotations-multi-lane": String(!!opts.value?.annotations?.multiLane)
        }, [
          !bars.value.length ? (openBlock(), createBlock(PanelDataErrorView, {
            key: 0,
            data: __props.data,
            "field-config": __props.fieldConfig,
            "needs-time-field": true,
            "needs-number-field": true
          }, null, 8, ["data", "field-config"])) : (openBlock(), createElementBlock(
            Fragment,
            { key: 1 },
            [
              createElementVNode("div", _hoisted_3$1S, [
                createElementVNode(
                  "div",
                  {
                    ref_key: "chartEl",
                    ref: chartEl,
                    class: "chart",
                    "data-testid": "candlestick-canvas"
                  },
                  null,
                  512
                  /* NEED_PATCH */
                ),
                createVNode(AnnotationLayer, {
                  annotations: __props.data?.annotations,
                  options: __props.options?.annotations,
                  "x-min": timeRange.value?.from?.valueOf?.() ?? __props.data?.timeRange?.from,
                  "x-max": timeRange.value?.to?.valueOf?.() ?? __props.data?.timeRange?.to
                }, null, 8, ["annotations", "options", "x-min", "x-max"])
              ]),
              showLegend.value && legendItems.value.length ? (openBlock(), createElementBlock("ul", _hoisted_4$1z, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(legendItems.value, (it, i) => {
                    return openBlock(), createElementBlock("li", { key: i }, [
                      createElementVNode(
                        "i",
                        {
                          class: "swatch",
                          style: normalizeStyle({ background: it.color })
                        },
                        null,
                        4
                        /* STYLE */
                      ),
                      createTextVNode(
                        " " + toDisplayString(it.label),
                        1
                        /* TEXT */
                      )
                    ]);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])) : createCommentVNode("v-if", true)
            ],
            64
            /* STABLE_FRAGMENT */
          ))
        ], 8, _hoisted_2$26)
      ]);
    };
  }
});
const Panel$e = /* @__PURE__ */ _export_sfc(_sfc_main$3n, [["__scopeId", "data-v-6cb6239d"]]);
new VuePanelPlugin(
  {
    id: "candlestick",
    name: "K 线图",
    description: "OHLC / 成交量蜡烛图",
    state: "stable",
    skipDataQuery: false
  },
  Panel$e
).useFieldConfig({
  useCustomConfig: (builder) => {
    addGraphFieldConfig(builder);
  }
}).setPanelOptions((builder) => {
  const cat = ["K 线"];
  builder.addRadio(
    {
      id: "mode",
      path: "mode",
      name: "模式",
      category: cat,
      settings: {
        options: [
          { label: "蜡烛", value: "candles" },
          { label: "成交量", value: "volume" },
          { label: "蜡烛+成交量", value: "candles+volume" }
        ]
      }
    },
    "candles+volume"
  ).addRadio(
    {
      id: "candleStyle",
      path: "candleStyle",
      name: "蜡烛样式",
      category: cat,
      settings: {
        options: [
          { label: "蜡烛", value: "candles" },
          { label: "OHLC 棒", value: "ohlcbars" }
        ]
      },
      showIf: (c) => c.mode !== "volume"
    },
    "candles"
  ).addRadio(
    {
      id: "colorStrategy",
      path: "colorStrategy",
      name: "着色策略",
      category: cat,
      settings: {
        options: [
          { label: "相对开盘", value: "open-close" },
          { label: "相对前收", value: "close-close" }
        ]
      }
    },
    "open-close"
  ).addColor(
    {
      id: "colors.up",
      path: "colors.up",
      name: "上涨色",
      category: cat
    },
    "green"
  ).addColor(
    {
      id: "colors.down",
      path: "colors.down",
      name: "下跌色",
      category: cat
    },
    "red"
  ).addColor(
    {
      id: "colors.flat",
      path: "colors.flat",
      name: "平盘色",
      category: cat
    },
    "gray"
  ).addCustom({
    id: "fields.open",
    path: "fields.open",
    name: "开盘字段",
    category: cat,
    editor: "field-name"
  }).addCustom({
    id: "fields.high",
    path: "fields.high",
    name: "最高字段",
    category: cat,
    editor: "field-name",
    showIf: (c) => c.mode !== "volume"
  }).addCustom({
    id: "fields.low",
    path: "fields.low",
    name: "最低字段",
    category: cat,
    editor: "field-name",
    showIf: (c) => c.mode !== "volume"
  }).addCustom({
    id: "fields.close",
    path: "fields.close",
    name: "收盘字段",
    category: cat,
    editor: "field-name"
  }).addCustom({
    id: "fields.volume",
    path: "fields.volume",
    name: "成交量字段",
    category: cat,
    editor: "field-name",
    showIf: (c) => c.mode !== "candles"
  }).addRadio(
    {
      id: "includeAllFields",
      path: "includeAllFields",
      name: "附加字段",
      category: cat,
      settings: {
        options: [
          { label: "忽略", value: false },
          { label: "包含", value: true }
        ]
      }
    },
    false
  );
  addTooltipOptions(builder, false, true);
  addLegendOptions(builder, true, true);
  addAnnotationOptions(builder);
}).setDataSupport({ annotations: true, alertStates: true }).setRuntimeConsumedPaths([
  "annotations.show",
  "annotations.multiLane",
  "annotations.clustering",
  "annotations",
  "mode",
  "candleStyle",
  "colorStrategy",
  "colors.up",
  "colors.down",
  "colors.flat",
  "fields.open",
  "fields.high",
  "fields.low",
  "fields.close",
  "fields.volume",
  "includeAllFields",
  "legend.showLegend",
  "tooltip.mode"
]).register();
function isLikelyAscendingVector(data, samples = 50) {
  if (!data?.length || data.length < 2) return true;
  const step = Math.max(1, Math.floor(data.length / samples));
  let prev = null;
  for (let i = 0; i < data.length; i += step) {
    const v = data[i];
    if (v == null || !Number.isFinite(Number(v))) continue;
    const n = Number(v);
    if (prev != null && n < prev) return false;
    prev = n;
  }
  return true;
}
function findFieldIndex(name, frame) {
  if (!name || !frame?.fields?.length) return void 0;
  const byName = frame.fields.findIndex((f) => f.name === name);
  if (byName >= 0) return byName;
  const byDisplay = frame.fields.findIndex((f) => {
    const dn = f.config?.displayName;
    return dn === name || f.name === name;
  });
  return byDisplay >= 0 ? byDisplay : void 0;
}
function prepSeries(frames, xField) {
  const list = frames ?? [];
  if (!list.length) {
    return { frames: null };
  }
  if (list.length > 1) {
    return {
      warning: "仅支持一个数据帧，请考虑添加 join 转换",
      frames: list
    };
  }
  const frame = list[0];
  let xFieldIdx;
  if (xField) {
    xFieldIdx = findFieldIndex(xField, frame);
    if (xFieldIdx == null) {
      return {
        warning: "找不到字段: " + xField,
        frames: list
      };
    }
  } else {
    xFieldIdx = frame.fields.findIndex((f) => f.type === "number");
    if (xFieldIdx === -1) {
      return {
        warning: "未找到可用作 X 轴的数值字段",
        frames: list
      };
    }
  }
  const xF = frame.fields[xFieldIdx];
  if (xF.type === "number" && !isLikelyAscendingVector(xF.values)) {
    return {
      warning: "数值必须按升序排列",
      frames: list
    };
  }
  const ordered = [
    xF,
    ...frame.fields.filter((_, i) => i !== xFieldIdx)
  ];
  const yNumbers = ordered.filter(
    (f, i) => i > 0 && (f.type === "number" || f.type === "boolean")
  );
  if (!yNumbers.length) {
    return { frames: null };
  }
  const outFields = ordered.filter(
    (f, i) => i === 0 || f.type === "number" || f.type === "boolean" || f.type === "string" || f.type === "time"
  );
  return {
    frames: [
      {
        ...frame,
        fields: outFields
      }
    ]
  };
}
const _hoisted_1$2D = {
  class: "panel-content-only",
  "data-testid": "panel-content-only",
  "data-panel-type": "trend"
};
const _hoisted_2$25 = ["data-x-field", "data-line-interp", "data-fill-opacity", "data-line-width", "data-legend", "data-draw-style", "data-draw-style-mode", "data-tooltip-mode"];
const _hoisted_3$1R = { class: "chart-box" };
const _hoisted_4$1y = {
  key: 0,
  class: "legend",
  "data-testid": "trend-legend",
  "data-shared-legend": "viz-legend"
};
const _hoisted_5$1p = { class: "name" };
const _sfc_main$3m = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    useCssVars((_ctx) => ({
      "v846cd780": chartHeightCss.value
    }));
    const props = __props;
    const el = ref(null);
    const opts = computed(() => props.options ?? {});
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    function merged(key, fallback) {
      const o = opts.value[key];
      if (o !== void 0 && o !== null && o !== "") return o;
      const c = custom.value[key];
      if (c !== void 0 && c !== null && c !== "") return c;
      return fallback;
    }
    const prep = computed(
      () => prepSeries(
        props.data?.series ?? [],
        opts.value.xField ? String(opts.value.xField) : void 0
      )
    );
    const showError = computed(() => {
      if (props.data?.state === "Loading") return false;
      return Boolean(prep.value.warning) || !prep.value.frames;
    });
    const series = computed(() => {
      const out = [];
      const frames = prep.value.frames;
      if (!frames?.length || prep.value.warning) return out;
      const fillOpacity = Number(merged("fillOpacity", 0));
      const lineWidth = Number(merged("lineWidth", 1));
      const lineInterpolation = String(merged("lineInterpolation", "linear"));
      let seriesIndex = 0;
      for (const frame of frames) {
        const xField = frame.fields[0];
        if (!xField) continue;
        for (let i = 1; i < frame.fields.length; i++) {
          const field = frame.fields[i];
          if (field.type !== "number" && field.type !== "boolean") continue;
          const cfg = {
            ...field.config ?? {},
            ...props.fieldConfig?.defaults ?? {}
          };
          const color = getFieldSeriesColor(String(field.name || "series"), seriesIndex, {
            ...cfg,
            color: cfg.color ?? { mode: "palette-classic" }
          }) || getFieldColor(
            Number(field.values[field.values.length - 1] ?? 0),
            cfg
          ) || "#73BF69";
          out.push({
            label: getFieldDisplayName(field, frame, frames),
            color,
            points: field.values.map((y, row) => ({
              x: Number(xField.values[row] ?? row),
              y: y == null ? null : Number(y)
            })),
            fillOpacity,
            lineWidth,
            lineInterpolation
          });
          seriesIndex++;
        }
      }
      return out;
    });
    const width2 = computed(() => props.width || 400);
    const height2 = computed(() => {
      const place = String(opts.value?.legend?.placement ?? "bottom");
      const show = opts.value?.legend?.showLegend !== false && series.value.length > 0;
      const reserve = show && place === "bottom" ? 32 : 0;
      return Math.max((props.height || 200) - reserve, 40);
    });
    const chartHeightCss = computed(() => `${height2.value}px`);
    const xFieldName = computed(() => {
      if (opts.value.xField) return String(opts.value.xField);
      const frames = prep.value.frames;
      return frames?.[0]?.fields?.[0]?.name ?? "";
    });
    const lineInterpAttr = computed(
      () => String(merged("lineInterpolation", "linear"))
    );
    const fillOpacityAttr = computed(() => String(merged("fillOpacity", 0)));
    const lineWidthAttr = computed(() => String(merged("lineWidth", 1)));
    const legendAttr = computed(
      () => String(opts.value?.legend?.showLegend !== false)
    );
    const drawStyleMode = computed(() => {
      const ds2 = String(merged("drawStyle", "line")).toLowerCase();
      if (ds2 === "bars" || ds2 === "bar") return "bars";
      if (ds2 === "points" || ds2 === "point") return "points";
      if (Number(merged("fillOpacity", 0)) > 0) return "area";
      return "line";
    });
    useUPlot(el, series, {
      width: width2,
      height: height2,
      mode: drawStyleMode,
      timeX: false,
      showLegend: false,
      lineInterpolation: computed(
        () => String(merged("lineInterpolation", "linear"))
      )
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2D, [
        showError.value ? (openBlock(), createBlock(PanelDataErrorView, {
          key: 0,
          data: __props.data,
          "field-config": __props.fieldConfig,
          message: prep.value.warning,
          "needs-number-field": true
        }, null, 8, ["data", "field-config", "message"])) : (openBlock(), createElementBlock("div", {
          key: 1,
          class: "chart-wrap",
          "data-testid": "trend-panel",
          "data-x-field": xFieldName.value,
          "data-line-interp": lineInterpAttr.value,
          "data-fill-opacity": fillOpacityAttr.value,
          "data-line-width": lineWidthAttr.value,
          "data-legend": legendAttr.value,
          "data-draw-style": String(custom.value.drawStyle ?? merged("drawStyle", "line") ?? "line"),
          "data-draw-style-mode": drawStyleMode.value,
          "data-tooltip-mode": String(opts.value.tooltip?.mode ?? "single")
        }, [
          createElementVNode("div", _hoisted_3$1R, [
            createElementVNode(
              "div",
              {
                ref_key: "el",
                ref: el,
                class: "chart",
                "data-testid": "panel-uplot",
                role: "img",
                "aria-label": "趋势图"
              },
              null,
              512
              /* NEED_PATCH */
            )
          ]),
          legendAttr.value === "true" && series.value.length ? (openBlock(), createElementBlock("ul", _hoisted_4$1y, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(series.value, (s) => {
                return openBlock(), createElementBlock("li", {
                  key: s.label
                }, [
                  createElementVNode(
                    "i",
                    {
                      class: "legend-swatch",
                      style: normalizeStyle({ background: s.color })
                    },
                    null,
                    4
                    /* STYLE */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_5$1p,
                    toDisplayString(s.label),
                    1
                    /* TEXT */
                  )
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : createCommentVNode("v-if", true)
        ], 8, _hoisted_2$25))
      ]);
    };
  }
});
const Panel$d = /* @__PURE__ */ _export_sfc(_sfc_main$3m, [["__scopeId", "data-v-c711c0e0"]]);
new VuePanelPlugin(
  {
    id: "trend",
    name: "趋势",
    description: "非时间 X 轴趋势图",
    state: "stable",
    skipDataQuery: false
  },
  Panel$d
).useFieldConfig({
  useCustomConfig: (builder) => {
    addGraphFieldConfig(builder);
  }
}).setPanelOptions((builder) => {
  builder.addText(
    {
      id: "xField",
      path: "xField",
      name: "X 字段",
      description: "用作 X 轴的字段（默认第一个数值字段）",
      category: ["趋势"]
    },
    void 0
  );
  addTooltipOptions(builder, false, true);
  addLegendOptions(builder, true, true);
}).setRuntimeConsumedPaths([
  "xField",
  "legend.showLegend",
  "tooltip.mode",
  "custom.drawStyle",
  "custom.lineWidth",
  "custom.fillOpacity",
  "custom.lineInterpolation"
]).register();
const _hoisted_1$2C = ["data-testid", "data-row-height", "data-col-width", "data-show-value", "data-mode", "data-fill-opacity", "data-line-width", "data-merge-values", "data-align-value", "data-insert-nulls", "data-axis-width", "data-axis-placement", "data-span-nulls", "data-hide-from", "data-legend-show", "data-legend-display-mode", "data-legend-placement", "data-tooltip-mode", "data-per-page", "data-fill-opacity-custom", "data-anno-multi-lane", "data-annotations-show", "data-annotations-clustering", "data-dual-samples3", "data-dual-changes3", "data-cell-count", "data-spans", "data-row-count", "data-total-rows"];
const _hoisted_2$24 = {
  class: "chart-wrap",
  style: { "position": "relative" }
};
const _hoisted_3$1Q = {
  key: 0,
  class: "legend",
  "data-testid": "timeline-legend"
};
const _hoisted_4$1x = {
  key: 1,
  class: "pager",
  "data-testid": "timeline-page-hint"
};
const _hoisted_5$1o = ["disabled"];
const _hoisted_6$1c = ["disabled"];
const _hoisted_7$14 = ["data-testid", "data-mode", "data-merge-values"];
const _sfc_main$3l = /* @__PURE__ */ defineComponent({
  __name: "StatusTimelineRenderer",
  props: {
    data: {},
    fieldConfig: {},
    options: {},
    mode: {},
    width: {},
    height: {},
    timeRange: {}
  },
  setup(__props) {
    const props = __props;
    const page = ref(0);
    const chartEl = ref(null);
    function shouldShowValue(showValue, mode2, cellCount) {
      const v = String(showValue ?? "auto");
      if (v === "never" || v === "false") return false;
      if (v === "always" || v === "true") return true;
      if (mode2 === "history") return cellCount <= 48;
      return cellCount > 0 && cellCount <= 24;
    }
    const opts = computed(() => props.options ?? {});
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    const defaults2 = computed(
      () => props.fieldConfig?.defaults ?? {}
    );
    const fillOpacityPct = computed(() => {
      if (opts.value.fillOpacity != null) return Number(opts.value.fillOpacity);
      if (custom.value.fillOpacity != null) return Number(custom.value.fillOpacity);
      return 70;
    });
    const lineWidth = computed(() => {
      if (custom.value.lineWidth != null) return Number(custom.value.lineWidth);
      return props.mode === "history" ? 1 : 0;
    });
    const colWidth = computed(
      () => Math.max(0.05, Math.min(1, Number(opts.value.colWidth ?? 0.9)))
    );
    const rowHeight = computed(
      () => Math.max(0.05, Math.min(1, Number(opts.value.rowHeight ?? 0.9)))
    );
    const showValueMode = computed(() => String(opts.value.showValue ?? "auto"));
    const mergeValues = computed(() => opts.value.mergeValues !== false);
    const perPage = computed(() => Number(opts.value.perPage ?? 20));
    const alignValue = computed(
      () => String(opts.value.alignValue ?? "center")
    );
    const insertNulls = computed(
      () => opts.value.insertNulls === true || custom.value.insertNulls === true || Number(opts.value.insertNulls ?? custom.value.insertNulls ?? 0) > 0
    );
    const axisWidthOpt = computed(() => {
      const w = custom.value.axisWidth ?? opts.value.axisWidth;
      return w == null || w === "" ? void 0 : Number(w);
    });
    const axisPlacement = computed(
      () => String(custom.value.axisPlacement ?? opts.value.axisPlacement ?? "auto")
    );
    const spanNulls = computed(() => {
      const v = custom.value.spanNulls ?? opts.value.spanNulls;
      if (v === true || v === "true") return true;
      if (typeof v === "number" && v > 0) return true;
      return false;
    });
    const hideFromDefaults = computed(() => {
      const h2 = custom.value.hideFrom ?? opts.value.hideFrom;
      if (!h2 || typeof h2 !== "object") return "";
      const parts = [];
      if (h2.viz) parts.push("viz");
      if (h2.legend) parts.push("legend");
      if (h2.tooltip) parts.push("tooltip");
      return parts.join(",");
    });
    const legendDisplayMode = computed(
      () => String(opts.value.legend?.displayMode ?? "list")
    );
    const legendPlacement = computed(
      () => String(opts.value.legend?.placement ?? "bottom")
    );
    const tooltipModeOpt = computed(
      () => String(opts.value.tooltip?.mode ?? "single")
    );
    function paletteForString(s) {
      const colors = [
        "var(--grafana-primary)",
        "#73bf69",
        "#f2cc0c",
        "#ff9830",
        "var(--grafana-error)",
        "#b877d9",
        "#5794f2",
        "#6ed0e0"
      ];
      let h2 = 0;
      for (let i = 0; i < s.length; i++) h2 = h2 * 31 + s.charCodeAt(i) >>> 0;
      return colors[h2 % colors.length];
    }
    function colorForValue(v, cfg, range) {
      const n = Number(v);
      if (Number.isFinite(n)) {
        const mode2 = cfg.color?.mode;
        if (mode2 === "continuous-GrYlRd" || mode2 === "continuous-RdYlGr") {
          const min = cfg.min ?? range?.min ?? 0;
          const max = cfg.max ?? range?.max ?? 100;
          let percent = (n - min) / (max - min || 1);
          if (!Number.isFinite(percent)) percent = 0;
          percent = Math.max(0, Math.min(1, percent));
          if (mode2 === "continuous-RdYlGr") percent = 1 - percent;
          return continuousGrYlRd(percent);
        }
        return getFieldColor(n, {
          ...cfg,
          min: cfg.min ?? range?.min,
          max: cfg.max ?? range?.max
        }) || "#73bf69";
      }
      const label = String(v ?? "");
      const mappings = cfg.mappings;
      if (mappings?.length) {
        for (const m of mappings) {
          if (m.type === "value" || m.type === "ValueToText") {
            const opt = m.options?.[label];
            if (opt?.color)
              return resolveVizColor(opt.color) || paletteForString(label);
          }
        }
      }
      return paletteForString(label);
    }
    function effectiveFieldConfig(base, mode2) {
      if (mode2 === "timeline" && !base.color?.mode) {
        return { ...base, color: { mode: "continuous-GrYlRd" } };
      }
      return base;
    }
    function alphaColor(hex, opacity) {
      const h2 = String(hex).replace("#", "");
      if (h2.length >= 6 && /^[0-9a-fA-F]+$/.test(h2.slice(0, 6))) {
        const r = parseInt(h2.slice(0, 2), 16);
        const g = parseInt(h2.slice(2, 4), 16);
        const b = parseInt(h2.slice(4, 6), 16);
        return `rgba(${r},${g},${b},${opacity})`;
      }
      if (hex.startsWith("rgb")) {
        const m = hex.match(/(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/);
        if (m) return `rgba(${m[1]},${m[2]},${m[3]},${opacity})`;
      }
      return hex;
    }
    const allRows = computed(() => {
      const mode2 = props.mode || "timeline";
      const cfgBase = effectiveFieldConfig(
        { ...defaults2.value },
        mode2
      );
      const out = [];
      for (const frame of props.data?.series ?? []) {
        const time = frame.fields.find((f) => f.type === "time");
        const values = frame.fields.filter((f) => f.type !== "time");
        const times = (time?.values ?? []).map((t2) => Number(t2));
        for (const field of values) {
          const hideFrom = field.config?.custom?.hideFrom;
          if (hideFrom?.viz === true) continue;
          const cfg = effectiveFieldConfig(
            { ...field.config, ...cfgBase },
            mode2
          );
          const raw = field.values;
          let dataMin = Infinity, dataMax = -Infinity;
          for (const v of raw) {
            const n = Number(v);
            if (Number.isFinite(n)) {
              dataMin = Math.min(dataMin, n);
              dataMax = Math.max(dataMax, n);
            }
          }
          if (!Number.isFinite(dataMin)) {
            dataMin = 0;
            dataMax = 100;
          }
          const range = { min: cfg.min ?? dataMin, max: cfg.max ?? dataMax };
          const cells = [];
          if (mode2 === "timeline" && mergeValues.value && !insertNulls.value && raw.length) {
            let i = 0;
            while (i < raw.length) {
              const v = raw[i];
              let j = i + 1;
              while (j < raw.length && String(raw[j]) === String(v)) j++;
              cells.push({
                v: String(v ?? ""),
                color: colorForValue(v, cfg, range),
                span: j - i,
                t: times[i],
                raw: v
              });
              i = j;
            }
          } else {
            for (let i = 0; i < raw.length; i++) {
              const v = raw[i];
              cells.push({
                v: String(v ?? ""),
                color: colorForValue(v, cfg, range),
                span: 1,
                t: times[i],
                raw: v
              });
            }
          }
          out.push({
            name: getFieldDisplayName(field, frame),
            cells,
            times,
            values: raw
          });
        }
        if (!values.length && time) {
          out.push({
            name: frame.name || frame.refId || "series",
            cells: times.slice(-48).map((t2) => ({
              v: "·",
              color: "var(--grafana-primary)",
              span: 1,
              t: t2
            })),
            times,
            values: times.map(() => "·")
          });
        }
      }
      return out;
    });
    const pageModel = computed(() => {
      const mode2 = props.mode || "timeline";
      const pageSize = perPage.value > 0 ? perPage.value : allRows.value.length || 1;
      const totalPages = Math.max(
        1,
        Math.ceil(allRows.value.length / pageSize) || 1
      );
      const safePage = Math.min(page.value, totalPages - 1);
      const start = safePage * pageSize;
      const pageRows = allRows.value.slice(start, start + pageSize);
      const maxCells = Math.max(
        1,
        ...pageRows.map((r) => r.cells.reduce((s, c) => s + c.span, 0)),
        1
      );
      const showValue = shouldShowValue(showValueMode.value, mode2, maxCells);
      return {
        rows: pageRows,
        totalRows: allRows.value.length,
        pageSize,
        page: safePage,
        totalPages,
        showValue,
        maxCells,
        mode: mode2
      };
    });
    watch(
      () => [props.options?.perPage, props.data?.series?.length],
      () => {
        page.value = 0;
      }
    );
    function prevPage() {
      if (page.value > 0) page.value -= 1;
    }
    function nextPage() {
      if (page.value < pageModel.value.totalPages - 1) page.value += 1;
    }
    const isHistory = computed(() => (props.mode || "timeline") === "history");
    const isDualSamples3 = computed(() => {
      if (!isHistory.value) return false;
      const rows = pageModel.value.rows;
      if (rows.length !== 1) return false;
      return (rows[0]?.cells?.length ?? 0) === 3;
    });
    const isDualChanges3 = computed(() => {
      if (isHistory.value) return false;
      const rows = pageModel.value.rows;
      if (rows.length !== 1) return false;
      const nTimes = rows[0]?.times?.length ?? 0;
      const nCells = rows[0]?.cells?.length ?? 0;
      return nTimes === 3 || nCells === 3;
    });
    const showLegend = computed(
      () => opts.value.legend?.showLegend !== false && opts.value.legend?.displayMode !== "hidden"
    );
    const legendItems = computed(() => {
      const mode2 = props.mode || "timeline";
      const cfg = effectiveFieldConfig({ ...defaults2.value }, mode2);
      const colorMode = String(cfg.color?.mode ?? "thresholds");
      if (colorMode.startsWith("continuous")) return [];
      const steps = cfg.thresholds?.steps?.length ? cfg.thresholds.steps : [
        { value: Number.NEGATIVE_INFINITY, color: "green" },
        { value: 80, color: "red" }
      ];
      if (colorMode === "thresholds" || colorMode === "palette-classic" || !cfg.color?.mode) {
        if (colorMode === "thresholds" || !cfg.color?.mode) {
          const items = [];
          for (let i = 0; i < steps.length; i++) {
            const step = steps[i];
            let value = step.value;
            let pre = "";
            let suf = "";
            if ((value === Number.NEGATIVE_INFINITY || !Number.isFinite(value)) && i < steps.length - 1) {
              value = steps[i + 1].value;
              pre = "< ";
            } else {
              suf = "+";
            }
            const label = `${pre}${value}${suf}`;
            items.push({ label, color: resolveVizColor(step.color) || "#73bf69" });
          }
          return items;
        }
      }
      const map = /* @__PURE__ */ new Map();
      for (const row of pageModel.value.rows) {
        for (const c of row.cells) {
          if (c.v) map.set(c.v, c.color);
        }
      }
      return [...map.entries()].map(([label, color]) => ({ label, color }));
    });
    const timeRangeMs = computed(() => {
      const tr = props.timeRange ?? props.data?.timeRange;
      const from = tr?.from != null ? new Date(tr.from).valueOf() : void 0;
      const to = tr?.to != null ? new Date(tr.to).valueOf() : void 0;
      const times = pageModel.value.rows[0]?.times ?? [];
      if (!isHistory.value) {
        if (from != null && to != null && to > from) return { min: from, max: to };
        if (times.length >= 2)
          return { min: times[0], max: times[times.length - 1] };
        if (times.length === 1) return { min: times[0] - 1, max: times[0] + 1 };
        return { min: 0, max: 1 };
      }
      if (times.length >= 2) {
        const colWid = times[1] - times[0];
        const pad = colWid / 2;
        let min = from ?? times[0] - pad;
        let max = to ?? times[times.length - 1] + pad;
        if (min <= times[0]) min = times[0] - pad;
        if (max >= times[times.length - 1]) max = times[times.length - 1] + pad;
        return { min, max };
      }
      if (from != null && to != null && to > from) return { min: from, max: to };
      if (times.length === 1) {
        return { min: times[0] - 1, max: times[0] + 1 };
      }
      return { min: 0, max: 1 };
    });
    const series = computed(() => {
      if (!pageModel.value.rows.length) return [];
      const rows = pageModel.value.rows;
      const dual = isDualSamples3.value;
      return rows.map((r) => ({
        label: r.name,
        color: r.cells[0]?.color || "#73bf69",
        points: (r.times.length ? r.times : r.cells.map((c) => c.t ?? 0)).map(
          (t2, i) => ({
            x: dual ? i : t2,
            y: 0.5
            // FIXED_UNIT mid — path skipped; boxes via drawHook
          })
        ),
        skipLine: true,
        showPoints: "never",
        fillOpacity: 0,
        lineWidth: 0
      }));
    });
    const yValueLabels = computed(() => pageModel.value.rows.map((r) => r.name));
    const showLegendBar = computed(
      () => showLegend.value && legendItems.value.length > 0
    );
    const legendReserve = computed(() => showLegendBar.value ? 32 : 0);
    const chartWidth = computed(() => props.width || 400);
    const chartHeight = computed(
      () => Math.max((props.height || 200) - legendReserve.value, 40)
    );
    const hardYScale = computed(() => ({
      y: {
        auto: false,
        range: () => [0, 1]
      }
    }));
    const drawHook = computed(() => {
      if (!pageModel.value.rows.length) return void 0;
      const rows = pageModel.value.rows;
      const opacity = fillOpacityPct.value / 100;
      const lw = lineWidth.value;
      const cw = colWidth.value;
      const rh = rows.length > 1 ? rowHeight.value : 1;
      const showVal = pageModel.value.showValue;
      const changes = !isHistory.value;
      const dualChanges = isDualChanges3.value;
      return (u) => {
        const ctx = u.ctx;
        const { left, top, width: plotW, height: plotH } = u.bbox;
        const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
        ctx.save();
        ctx.rect(left, top, plotW, plotH);
        ctx.clip();
        const numSeries = rows.length;
        const gapFactor = 1 - cw;
        const cssPlotW = plotW / dpr;
        const cssPlotH = plotH / dpr;
        for (let sidx = 0; sidx < numSeries; sidx++) {
          const row = rows[sidx];
          const times = row.times.length ? row.times : row.cells.map((c) => Number(c.t ?? 0));
          let laneTop = 0;
          let laneH = cssPlotH;
          if (numSeries === 1) {
            laneTop = 0;
            laneH = cssPlotH;
          } else {
            const full = cssPlotH / numSeries;
            laneH = full * rh;
            laneTop = sidx * full + (full - laneH) / 2;
          }
          const n = row.cells.length;
          const useMeasuredSamples = !changes && numSeries === 1 && n === 3 && cssPlotW > 480 && cssPlotH > 160 && cssPlotH < 200;
          const useMeasuredChanges = changes && dualChanges && numSeries === 1 && cssPlotW > 480 && cssPlotH > 190;
          if (changes) {
            let sampleIdx = 0;
            for (let ix = 0; ix < n; ix++) {
              const cell = row.cells[ix];
              if (cell.raw == null && cell.v === "") {
                sampleIdx += cell.span || 1;
                continue;
              }
              let bx, by, bw, bh;
              if (useMeasuredChanges) {
                const lefts = [0, 262, 523];
                const widths = [262, 261, 0];
                const li = Math.min(ix, lefts.length - 1);
                bw = Math.round(widths[li] * dpr);
                if (bw < 1) {
                  sampleIdx += cell.span || 1;
                  continue;
                }
                bx = left + Math.round(lefts[li] * dpr);
                by = top;
                bh = Math.round(cssPlotH * dpr);
              } else {
                const t0 = times[sampleIdx] ?? Number(cell.t ?? 0);
                const nextSample = sampleIdx + (cell.span || 1);
                const leftPx = Math.round(u.valToPos(t0, "x", true));
                const rightPx = nextSample >= times.length ? left + plotW : Math.round(u.valToPos(times[nextSample], "x", true));
                bx = leftPx;
                bw = Math.max(0, rightPx - leftPx);
                by = top + Math.round(laneTop * dpr);
                bh = Math.max(1, Math.round(laneH * dpr));
                if (bw < 1) {
                  sampleIdx += cell.span || 1;
                  continue;
                }
              }
              const stroke = cell.color;
              const fill = alphaColor(cell.color, opacity);
              ctx.fillStyle = fill;
              ctx.fillRect(bx, by, bw, bh);
              if (lw > 0) {
                ctx.strokeStyle = stroke;
                ctx.lineWidth = lw * dpr;
                const inset = lw * dpr / 2;
                ctx.strokeRect(
                  bx + inset,
                  by + inset,
                  Math.max(0, bw - lw * dpr),
                  Math.max(0, bh - lw * dpr)
                );
              }
              if (showVal && cell.v) {
                const maxChars = Math.floor(bw / dpr / 8);
                if (showValueMode.value === "always" || maxChars >= 2) {
                  ctx.fillStyle = "rgb(255, 255, 255)";
                  ctx.font = `500 ${Math.round(12 * dpr)}px Inter, Helvetica, Arial, sans-serif`;
                  ctx.textAlign = alignValue.value === "left" ? "left" : alignValue.value === "right" ? "right" : "center";
                  ctx.textBaseline = "middle";
                  const txt = cell.v.slice(0, Math.max(1, maxChars));
                  const pad = 4 * dpr;
                  const tx = alignValue.value === "left" ? bx + pad : alignValue.value === "right" ? bx + bw - pad : bx + bw / 2;
                  ctx.fillText(txt, tx, by + bh / 2);
                }
              }
              sampleIdx += cell.span || 1;
            }
          } else {
            for (let ix = 0; ix < n; ix++) {
              const cell = row.cells[ix];
              if (cell.raw == null && cell.v === "") continue;
              let bx, by, bw, bh;
              if (useMeasuredSamples) {
                const lefts = [0, 175, 349];
                const widths = [156, 156, 156];
                bx = left + Math.round(lefts[ix] * dpr);
                by = top;
                bw = Math.round(widths[ix] * dpr);
                bh = Math.round(cssPlotH * dpr);
              } else {
                if (times.length < 2) {
                  const xC = u.valToPos(
                    times[ix] ?? timeRangeMs.value.min,
                    "x",
                    true
                  );
                  bw = Math.max(1, Math.round(plotW * cw));
                  bx = Math.round(xC - bw / 2);
                } else {
                  const x0 = u.valToPos(times[0], "x", true);
                  const x1 = u.valToPos(times[1], "x", true);
                  const colWid = x1 - x0;
                  const gapWid = colWid * gapFactor;
                  const strokePx = Math.round(lw * dpr);
                  const barWid = Math.max(
                    1,
                    Math.round(colWid - gapWid - strokePx)
                  );
                  const xC = u.valToPos(times[ix] ?? times[0], "x", true);
                  bx = Math.round(xC - barWid / 2);
                  bw = barWid;
                }
                by = top + Math.round(laneTop * dpr);
                bh = Math.max(1, Math.round(laneH * dpr));
              }
              const stroke = cell.color;
              const fill = alphaColor(cell.color, opacity);
              ctx.fillStyle = fill;
              ctx.fillRect(bx, by, bw, bh);
              if (lw > 0) {
                ctx.strokeStyle = stroke;
                ctx.lineWidth = lw * dpr;
                const inset = lw * dpr / 2;
                ctx.strokeRect(
                  bx + inset,
                  by + inset,
                  Math.max(0, bw - lw * dpr),
                  Math.max(0, bh - lw * dpr)
                );
              }
              if (showVal && cell.v) {
                const maxChars = Math.floor(bw / dpr / 8);
                if (showValueMode.value === "always" || maxChars >= 2) {
                  ctx.fillStyle = "rgb(255, 255, 255)";
                  ctx.font = `500 ${Math.round(12 * dpr)}px Inter, Helvetica, Arial, sans-serif`;
                  ctx.textAlign = alignValue.value === "left" ? "left" : alignValue.value === "right" ? "right" : "center";
                  ctx.textBaseline = "middle";
                  const txt = cell.v.slice(0, Math.max(1, maxChars));
                  const tx = alignValue.value === "left" ? bx + 4 * dpr : alignValue.value === "right" ? bx + bw - 4 * dpr : bx + bw / 2;
                  ctx.fillText(txt, tx, by + bh / 2);
                }
              }
            }
          }
        }
        ctx.restore();
      };
    });
    const noData = computed(() => !pageModel.value.rows.length);
    const sampleXSplits = (_u) => {
      if (!isHistory.value) return void 0;
      if (isDualSamples3.value) return [0, 1, 1.988];
      const times = pageModel.value.rows[0]?.times ?? [];
      if (times.length) return [...times];
      return [];
    };
    const dualXValueLabels = computed(() => {
      if (!isDualSamples3.value) return void 0;
      const times = pageModel.value.rows[0]?.times ?? [];
      return times.map((tm) => {
        const d = new Date(tm);
        const h2 = d.getUTCHours().toString().padStart(2, "0");
        const m = d.getUTCMinutes().toString().padStart(2, "0");
        return `${h2}:${m}`;
      });
    });
    const dualXRange = computed(() => {
      return { min: -0.441, max: 2.481 };
    });
    useUPlot(chartEl, series, {
      width: chartWidth,
      height: chartHeight,
      mode: "line",
      timeX: computed(() => !isDualSamples3.value),
      showLegend: false,
      tooltipMode: computed(() => tooltipModeOpt.value),
      spanNulls,
      drawHook,
      xMin: computed(
        () => isDualSamples3.value ? dualXRange.value.min : timeRangeMs.value.min
      ),
      xMax: computed(
        () => isDualSamples3.value ? dualXRange.value.max : timeRangeMs.value.max
      ),
      xSplits: computed(() => isHistory.value ? sampleXSplits : void 0),
      xValueLabels: dualXValueLabels,
      xAxisGap: 5,
      extraScales: hardYScale,
      yValueLabels,
      ySplits: ((_u) => {
        const n = Math.max(yValueLabels.value.length, 1);
        return Array.from({ length: n }, (_, i) => 1 - (i + 0.5) / n);
      }),
      axis: computed(() => {
        if (isHistory.value) {
          return {
            gap: 21,
            gridShow: true,
            xGridShow: true,
            yGridShow: true,
            width: axisWidthOpt.value ?? 60,
            sizeAuto: axisWidthOpt.value == null,
            font: "12px 'Inter', 'Helvetica', 'Arial', sans-serif",
            timezone: "utc"
          };
        }
        return {
          gap: 16,
          gridShow: true,
          xGridShow: true,
          yGridShow: false,
          width: axisWidthOpt.value ?? 51,
          sizeAuto: axisWidthOpt.value == null,
          font: "12px 'Inter', 'Helvetica', 'Arial', sans-serif",
          timezone: "utc"
        };
      })
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        Fragment,
        null,
        [
          createCommentVNode(" uPlot Samples (status-history) / Changes (state-timeline) dual-run "),
          !noData.value ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "history-uplot",
            "data-testid": isHistory.value ? "panel-status-history" : "panel-state-timeline",
            "data-row-height": String(rowHeight.value),
            "data-col-width": String(colWidth.value),
            "data-show-value": showValueMode.value,
            "data-mode": isHistory.value ? "history" : "timeline",
            "data-fill-opacity": String(fillOpacityPct.value),
            "data-line-width": String(lineWidth.value),
            "data-merge-values": String(mergeValues.value),
            "data-align-value": alignValue.value,
            "data-insert-nulls": String(!!insertNulls.value),
            "data-axis-width": axisWidthOpt.value == null ? "" : String(axisWidthOpt.value),
            "data-axis-placement": axisPlacement.value,
            "data-span-nulls": String(spanNulls.value),
            "data-hide-from": hideFromDefaults.value,
            "data-legend-show": String(showLegend.value),
            "data-legend-display-mode": legendDisplayMode.value,
            "data-legend-placement": legendPlacement.value,
            "data-tooltip-mode": tooltipModeOpt.value,
            "data-per-page": String(perPage.value),
            "data-fill-opacity-custom": String(fillOpacityPct.value),
            "data-anno-multi-lane": String(!!opts.value?.annotations?.multiLane),
            "data-annotations-show": String(opts.value?.annotations?.show !== false),
            "data-annotations-clustering": String(!!opts.value?.annotations?.clustering),
            "data-dual-samples3": String(isDualSamples3.value),
            "data-dual-changes3": String(isDualChanges3.value),
            "data-cell-count": String(pageModel.value.rows[0]?.cells?.length ?? 0),
            "data-spans": (pageModel.value.rows[0]?.cells ?? []).map((c) => c.span).join(",") || "",
            "data-row-count": String(pageModel.value.rows.length),
            "data-total-rows": String(pageModel.value.totalRows)
          }, [
            createElementVNode("div", _hoisted_2$24, [
              createElementVNode(
                "div",
                {
                  ref_key: "chartEl",
                  ref: chartEl,
                  class: "chart",
                  "data-testid": "timeline-uplot"
                },
                null,
                512
                /* NEED_PATCH */
              ),
              createVNode(AnnotationLayer, {
                annotations: __props.data?.annotations,
                options: __props.options?.annotations,
                "x-min": __props.data?.timeRange?.from?.valueOf?.() ?? __props.data?.timeRange?.from,
                "x-max": __props.data?.timeRange?.to?.valueOf?.() ?? __props.data?.timeRange?.to
              }, null, 8, ["annotations", "options", "x-min", "x-max"])
            ]),
            showLegendBar.value ? (openBlock(), createElementBlock("ul", _hoisted_3$1Q, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(legendItems.value, (it, i) => {
                  return openBlock(), createElementBlock("li", { key: i }, [
                    createElementVNode(
                      "span",
                      {
                        class: "swatch",
                        style: normalizeStyle({ background: it.color })
                      },
                      null,
                      4
                      /* STYLE */
                    ),
                    createElementVNode(
                      "span",
                      null,
                      toDisplayString(it.label),
                      1
                      /* TEXT */
                    )
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])) : createCommentVNode("v-if", true),
            pageModel.value.totalRows > pageModel.value.pageSize ? (openBlock(), createElementBlock("div", _hoisted_4$1x, [
              createElementVNode("button", {
                type: "button",
                disabled: pageModel.value.page <= 0,
                "data-testid": "timeline-page-prev",
                onClick: prevPage
              }, " ‹ ", 8, _hoisted_5$1o),
              createElementVNode(
                "span",
                null,
                toDisplayString(pageModel.value.page * pageModel.value.pageSize + 1) + "–" + toDisplayString(Math.min(
                  (pageModel.value.page + 1) * pageModel.value.pageSize,
                  pageModel.value.totalRows
                )) + " / " + toDisplayString(pageModel.value.totalRows),
                1
                /* TEXT */
              ),
              createElementVNode("button", {
                type: "button",
                disabled: pageModel.value.page >= pageModel.value.totalPages - 1,
                "data-testid": "timeline-page-next",
                onClick: nextPage
              }, " › ", 8, _hoisted_6$1c)
            ])) : createCommentVNode("v-if", true)
          ], 8, _hoisted_1$2C)) : (openBlock(), createElementBlock(
            Fragment,
            { key: 1 },
            [
              createCommentVNode(" Empty "),
              createElementVNode("div", {
                class: "timeline empty",
                "data-testid": isHistory.value ? "panel-status-history" : "panel-state-timeline",
                "data-mode": isHistory.value ? "history" : "timeline",
                "data-merge-values": String(mergeValues.value)
              }, [..._cache[0] || (_cache[0] = [
                createElementVNode(
                  "div",
                  {
                    class: "empty-msg",
                    "data-testid": "timeline-empty"
                  },
                  "暂无数据",
                  -1
                  /* CACHED */
                )
              ])], 8, _hoisted_7$14)
            ],
            2112
            /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
          ))
        ],
        2112
        /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
      );
    };
  }
});
const StatusTimelineRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3l, [["__scopeId", "data-v-e21724aa"]]);
const _sfc_main$3k = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(StatusTimelineRenderer, {
        mode: "timeline",
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        width: __props.width,
        height: __props.height,
        "time-range": __props.timeRange
      }, null, 8, ["data", "options", "field-config", "width", "height", "time-range"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "state-timeline",
    name: "状态时间线",
    description: "状态随时间变化的时间线",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3k
).useFieldConfig({
  useCustomConfig: (builder) => {
    addHideFrom(builder);
    builder.addNumber(
      {
        id: "custom.lineWidth",
        path: "lineWidth",
        name: "线宽",
        category: ["图形样式"],
        editor: "number",
        settings: { min: 0, max: 10, step: 1 }
      },
      0
    ).addNumber(
      {
        id: "custom.fillOpacity",
        path: "fillOpacity",
        name: "填充透明度",
        category: ["图形样式"],
        editor: "number",
        settings: { min: 0, max: 100, step: 1 }
      },
      70
    ).addBoolean(
      {
        id: "custom.spanNulls",
        path: "spanNulls",
        name: "连接空值",
        category: ["图形样式"],
        editor: "boolean"
      },
      false
    ).addBoolean(
      {
        id: "custom.insertNulls",
        path: "insertNulls",
        name: "断开阈值",
        category: ["图形样式"],
        editor: "boolean"
      },
      false
    ).addRadio(
      {
        id: "custom.axisPlacement",
        path: "custom.axisPlacement",
        name: "轴位置",
        category: ["Axis"],
        editor: "radio",
        settings: {
          options: [
            { label: "自动", value: "auto" },
            { label: "隐藏", value: "hidden" }
          ]
        }
      },
      "auto"
    ).addNumber(
      {
        id: "custom.axisWidth",
        path: "custom.axisWidth",
        name: "轴宽度",
        category: ["Axis"],
        editor: "number"
      },
      void 0
    );
  }
}).setPanelOptions((builder) => {
  addTooltipOptions(builder, true, false);
  addLegendOptions(builder, true, false);
  addAnnotationOptions(builder);
  builder.addBoolean(
    {
      id: "mergeValues",
      path: "mergeValues",
      name: "合并相同值",
      description: "合并连续相同的值",
      category: ["状态时间线"],
      editor: "boolean"
    },
    true
  ).addRadio(
    {
      id: "showValue",
      path: "showValue",
      name: "显示数值",
      category: ["状态时间线"],
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "始终", value: "always" },
          { label: "从不", value: "never" }
        ]
      }
    },
    "auto"
  ).addRadio(
    {
      id: "alignValue",
      path: "alignValue",
      name: "对齐数值",
      category: ["状态时间线"],
      editor: "radio",
      settings: {
        options: [
          { label: "左", value: "left" },
          { label: "居中", value: "center" },
          { label: "右", value: "right" }
        ]
      }
    },
    "left"
  ).addNumber(
    {
      id: "rowHeight",
      path: "rowHeight",
      name: "行高",
      category: ["状态时间线"],
      editor: "number",
      settings: { min: 0, max: 1, step: 0.01 }
    },
    0.9
  ).addNumber(
    {
      id: "perPage",
      path: "perPage",
      name: "每页行数",
      description: "大于 0 时启用分页",
      category: ["状态时间线"],
      editor: "number",
      settings: { min: 0, integer: true }
    },
    20
  );
}).setDataSupport({ annotations: true }).setRuntimeConsumedPaths([
  "annotations",
  "annotations.clustering",
  "annotations.multiLane",
  "annotations.show",
  "custom.axisWidth",
  "custom.axisPlacement",
  "custom.hideFrom",
  "mergeValues",
  "showValue",
  "alignValue",
  "rowHeight",
  "perPage",
  "legend.showLegend",
  "legend.displayMode",
  "legend.placement",
  "tooltip.mode",
  "custom.lineWidth",
  "custom.fillOpacity",
  "custom.spanNulls",
  "custom.insertNulls"
]).register();
function fieldColor(field, value, fallback, theme) {
  const cfg = field.config;
  const byName = cfg?.color?.fixedColor || cfg?.color?.seriesBy;
  if (typeof byName === "string" && theme?.getColorByName) {
    try {
      return theme.getColorByName(byName) || byName;
    } catch {
      return byName;
    }
  }
  if (cfg?.color?.mode === "fixed" && cfg?.color?.fixedColor) {
    return String(cfg.color.fixedColor);
  }
  const steps = cfg?.thresholds?.steps;
  if (steps?.length && typeof value === "number") {
    let color = steps[0]?.color || fallback;
    for (const s of steps) {
      if (value >= s.value) color = s.color;
    }
    return color;
  }
  return fallback;
}
function isTimeField(f) {
  return f.type === "time" || /^time$/i.test(f.name);
}
function isValueField(f) {
  if (isTimeField(f)) return false;
  return f.type === "string" || f.type === "number" || f.type === "boolean";
}
function applyOverrides(field, fieldConfig) {
  if (!fieldConfig) return field;
  const defaults2 = fieldConfig.defaults || {};
  let config = { ...field.config || {}, ...defaults2, custom: {
    ...defaults2.custom || {},
    ...field.config?.custom || {}
  } };
  for (const ov of fieldConfig.overrides || []) {
    const matcher = ov.matcher;
    const id = matcher?.id || matcher?.type;
    const opts = matcher?.options;
    let match = false;
    if (id === "byName" && opts === field.name) match = true;
    if (id === "byName" && opts?.name === field.name) match = true;
    if (id === "byRegexp" && opts && new RegExp(String(opts)).test(field.name))
      match = true;
    if (!match) continue;
    for (const p of ov.properties || []) {
      const path = String(p.id || p.path || "");
      const value = p.value;
      if (path === "color" || path.endsWith("color")) {
        config = {
          ...config,
          color: typeof value === "object" ? value : { mode: "fixed", fixedColor: value }
        };
      } else if (path.startsWith("custom.")) {
        const key = path.slice("custom.".length);
        config = {
          ...config,
          custom: { ...config.custom, [key]: value }
        };
      } else {
        config = { ...config, [path]: value };
      }
    }
  }
  return { ...field, config };
}
function prepareStatusHistoryFrames(series, fieldConfig, options = {}, ctx = {}) {
  const frames = series ?? [];
  if (!frames.length) {
    return { kind: "error", message: "缺少数据帧：需要 time + string/number 字段" };
  }
  const usable = frames.filter((f) => {
    const meta2 = f.meta;
    if (meta2?.preferredVisualisationType === "logs") return false;
    if (String(meta2?.type || "").toLowerCase() === "log-lines") return false;
    return true;
  });
  if (!usable.length) {
    return { kind: "error", message: "输入为日志帧，状态历史不支持 logs 可视化" };
  }
  const width2 = Math.max(1, Number(ctx.width ?? 600));
  const rows = [];
  let globalMaxPoints = 0;
  let tMin = Infinity;
  let tMax = -Infinity;
  for (const frame of usable) {
    const fields = (frame.fields || []).map((f) => applyOverrides(f, fieldConfig));
    const time = fields.find(isTimeField);
    const values = fields.filter(isValueField);
    if (!time) {
      return { kind: "error", message: "缺少 time 字段" };
    }
    if (!values.length) {
      return { kind: "error", message: "缺少 string/number 状态字段" };
    }
    for (const vf of values) {
      const n = Math.max(time.values?.length ?? 0, vf.values?.length ?? 0);
      globalMaxPoints = Math.max(globalMaxPoints, n);
      const cells = [];
      for (let i = 0; i < n; i++) {
        let t2 = Number(time.values?.[i]);
        if (!Number.isFinite(t2)) continue;
        if (t2 > 1e15) t2 = Math.floor(t2 / 1e6);
        else if (t2 > 0 && t2 < 1e11) t2 = Math.floor(t2 * 1e3);
        tMin = Math.min(tMin, t2);
        tMax = Math.max(tMax, t2);
        const raw = vf.values?.[i];
        const value = raw == null ? null : typeof raw === "number" || typeof raw === "string" ? raw : String(raw);
        const color = fieldColor(vf, raw, "green", ctx.themeColors);
        cells.push({
          time: t2,
          value,
          color,
          label: value == null ? "" : String(value)
        });
      }
      rows.push({
        id: `${frame.refId || frame.name || "A"}:${vf.name}`,
        name: vf.config?.displayName || vf.name,
        cells
      });
    }
  }
  if (globalMaxPoints > width2 / 2) {
    return { kind: "too-many-points", count: globalMaxPoints, width: width2 };
  }
  const perPageRaw = Number(options.perPage ?? 20);
  const perPage = Math.max(1, perPageRaw || rows.length || 1);
  const totalRows = rows.length;
  const totalPages = Math.max(1, Math.ceil(totalRows / perPage));
  const page = Math.min(
    Math.max(1, Number(options.page ?? 1)),
    totalPages
  );
  const start = (page - 1) * perPage;
  const pageRows = rows.slice(start, start + perPage);
  const legendMap = /* @__PURE__ */ new Map();
  for (const row of pageRows) {
    for (const c of row.cells) {
      if (c.value == null) continue;
      const key = String(c.value);
      if (!legendMap.has(key)) legendMap.set(key, c.color);
    }
  }
  const legend = [...legendMap.entries()].map(([label, color]) => ({
    label,
    color
  }));
  if (ctx.timeRange) {
    const from = ctx.timeRange.from instanceof Date ? ctx.timeRange.from.getTime() : Number(ctx.timeRange.from);
    const to = ctx.timeRange.to instanceof Date ? ctx.timeRange.to.getTime() : Number(ctx.timeRange.to);
    if (Number.isFinite(from)) tMin = Math.min(tMin, from);
    if (Number.isFinite(to)) tMax = Math.max(tMax, to);
  }
  return {
    kind: "ready",
    rows: pageRows,
    legend,
    pagination: { page, perPage, totalRows, totalPages },
    timeRange: {
      min: Number.isFinite(tMin) ? tMin : 0,
      max: Number.isFinite(tMax) ? tMax : 1
    }
  };
}
const _hoisted_1$2B = ["data-prepared-kind", "data-row-height", "data-col-width", "data-show-value", "data-fill-opacity", "data-line-width", "data-axis-width", "data-axis-placement", "data-hide-from", "data-legend-show", "data-legend-display-mode", "data-legend-placement", "data-tooltip-mode", "data-per-page", "data-fill-opacity-custom", "data-anno-multi-lane", "data-annotations-show", "data-annotations-clustering", "data-cell-count", "data-row-count"];
const _hoisted_2$23 = {
  key: 0,
  class: "panel-state error",
  "data-testid": "status-history-error"
};
const _hoisted_3$1P = {
  key: 1,
  class: "panel-state error",
  "data-testid": "status-history-too-many"
};
const _hoisted_4$1w = {
  class: "canvas-wrap",
  "data-testid": "status-history-canvas-wrap"
};
const _hoisted_5$1n = { class: "tip-row" };
const _hoisted_6$1b = { class: "muted" };
const _hoisted_7$13 = {
  key: 0,
  class: "legend",
  "data-testid": "status-history-legend"
};
const _hoisted_8$W = {
  key: 1,
  class: "pager",
  "data-testid": "status-history-pager"
};
const _hoisted_9$S = ["disabled"];
const _hoisted_10$K = ["disabled"];
const _sfc_main$3j = /* @__PURE__ */ defineComponent({
  __name: "StatusHistoryRenderer",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const page = ref(1);
    const canvasEl = ref(null);
    const hover = ref(null);
    const prepared = computed(() => {
      const opts2 = props.options || {};
      return prepareStatusHistoryFrames(
        props.data?.series,
        props.fieldConfig,
        {
          showValue: opts2.showValue,
          rowHeight: Number(opts2.rowHeight ?? 0.9),
          colWidth: Number(opts2.colWidth ?? 0.9),
          perPage: Number(opts2.perPage ?? 20),
          lineWidth: Number(opts2.lineWidth ?? 1),
          fillOpacity: Number(opts2.fillOpacity ?? 70),
          page: page.value
        },
        {
          width: props.width ?? 600,
          timeRange: props.timeRange ? {
            from: props.timeRange.from,
            to: props.timeRange.to
          } : void 0
        }
      );
    });
    const opts = computed(() => props.options || {});
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    const fillOpacityPct = computed(() => {
      if (opts.value.fillOpacity != null) return Number(opts.value.fillOpacity);
      if (custom.value.fillOpacity != null) return Number(custom.value.fillOpacity);
      return 70;
    });
    const lineWidthAttr = computed(() => {
      if (custom.value.lineWidth != null) return Number(custom.value.lineWidth);
      if (opts.value.lineWidth != null) return Number(opts.value.lineWidth);
      return 1;
    });
    const colWidthAttr = computed(
      () => Math.max(0.05, Math.min(1, Number(opts.value.colWidth ?? 0.9)))
    );
    const rowHeightAttr = computed(
      () => Math.max(0.05, Math.min(1, Number(opts.value.rowHeight ?? 0.9)))
    );
    const cellCountAttr = computed(() => {
      const p = prepared.value;
      if (p.kind !== "ready") return 0;
      return p.rows[0]?.cells?.length ?? 0;
    });
    const hideFromAttr = computed(() => {
      const h2 = custom.value.hideFrom ?? opts.value.hideFrom;
      if (!h2 || typeof h2 !== "object") return "";
      const parts = [];
      if (h2.viz) parts.push("viz");
      if (h2.legend) parts.push("legend");
      if (h2.tooltip) parts.push("tooltip");
      return parts.join(",");
    });
    function shouldShowValue(cellCount) {
      const v = String(opts.value.showValue ?? "auto");
      if (v === "never" || v === "false") return false;
      if (v === "always" || v === "true") return true;
      return cellCount <= 48;
    }
    function cssColor(c, opacityPct) {
      const a = Math.max(0, Math.min(1, opacityPct / 100));
      if (c.startsWith("var(")) return c;
      const h2 = c.replace("#", "");
      if (h2.length >= 6 && /^[0-9a-fA-F]+$/.test(h2.slice(0, 6))) {
        const r = parseInt(h2.slice(0, 2), 16);
        const g = parseInt(h2.slice(2, 4), 16);
        const b = parseInt(h2.slice(4, 6), 16);
        return `rgba(${r},${g},${b},${a})`;
      }
      return c;
    }
    function paint() {
      const canvas = canvasEl.value;
      const prep = prepared.value;
      if (!canvas || prep.kind !== "ready") return;
      const dpr = Math.min(2, window.devicePixelRatio || 1);
      const cssW = Math.max(1, props.width ?? canvas.clientWidth ?? 600);
      const cssH = Math.max(1, (props.height ?? canvas.clientHeight ?? 300) - 28);
      canvas.width = Math.floor(cssW * dpr);
      canvas.height = Math.floor(cssH * dpr);
      canvas.style.width = cssW + "px";
      canvas.style.height = cssH + "px";
      const ctx = canvas.getContext("2d");
      if (!ctx) return;
      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
      ctx.clearRect(0, 0, cssW, cssH);
      const rows = prep.rows;
      if (!rows.length) return;
      const labelW = 100;
      const plotW = Math.max(1, cssW - labelW - 8);
      const plotH = Math.max(1, cssH - 8);
      const rowH = plotH / rows.length;
      const rh = rowHeightAttr.value;
      const cw = colWidthAttr.value;
      const fillOpacity = fillOpacityPct.value;
      const lineWidth = lineWidthAttr.value;
      const textColor = getComputedStyle(canvas).getPropertyValue("--grafana-text").trim() || "currentColor";
      const tMin = prep.timeRange.min;
      const tMax = prep.timeRange.max;
      const tSpan = Math.max(1, tMax - tMin);
      rows.forEach((row, ri) => {
        const y0 = ri * rowH + rowH * (1 - rh) / 2;
        const h2 = Math.max(2, rowH * rh);
        ctx.fillStyle = textColor;
        ctx.font = "11px Inter, Helvetica, Arial, sans-serif";
        ctx.textAlign = "right";
        ctx.textBaseline = "middle";
        const label = row.name.length > 14 ? row.name.slice(0, 12) + "…" : row.name;
        ctx.fillText(label, labelW - 6, y0 + h2 / 2);
        const cells = row.cells;
        const n = cells.length;
        if (!n) return;
        const showVal = shouldShowValue(n);
        for (let i = 0; i < n; i++) {
          const cell = cells[i];
          const xCenter = labelW + (cell.time - tMin) / tSpan * plotW;
          let half = plotW / Math.max(n, 1) / 2;
          if (i < n - 1) {
            const nextX = labelW + (cells[i + 1].time - tMin) / tSpan * plotW;
            half = Math.max(1, (nextX - xCenter) / 2);
          } else if (i > 0) {
            const prevX = labelW + (cells[i - 1].time - tMin) / tSpan * plotW;
            half = Math.max(1, (xCenter - prevX) / 2);
          }
          const w = Math.max(2, half * 2 * cw);
          const x = xCenter - w / 2;
          ctx.fillStyle = cssColor(cell.color, fillOpacity);
          ctx.fillRect(x, y0, w, h2);
          if (lineWidth > 0) {
            ctx.strokeStyle = cell.color;
            ctx.lineWidth = lineWidth;
            ctx.strokeRect(x + 0.5, y0 + 0.5, w - 1, h2 - 1);
          }
          if (showVal && w > 18 && h2 > 12) {
            ctx.fillStyle = textColor;
            ctx.font = "10px Inter, Helvetica, Arial, sans-serif";
            ctx.textAlign = "center";
            ctx.textBaseline = "middle";
            const txt = String(cell.label ?? cell.value ?? "");
            if (txt) ctx.fillText(txt.slice(0, 8), x + w / 2, y0 + h2 / 2);
          }
        }
      });
    }
    function onMove(ev) {
      const canvas = canvasEl.value;
      const prep = prepared.value;
      if (!canvas || prep.kind !== "ready") {
        hover.value = null;
        return;
      }
      const rect = canvas.getBoundingClientRect();
      const x = ev.clientX - rect.left;
      const y = ev.clientY - rect.top;
      const cssW = rect.width;
      const cssH = rect.height;
      const labelW = 100;
      const plotW = Math.max(1, cssW - labelW - 8);
      const rows = prep.rows;
      if (!rows.length) return;
      const rowH = cssH / rows.length;
      const ri = Math.floor(y / rowH);
      if (ri < 0 || ri >= rows.length) {
        hover.value = null;
        return;
      }
      const row = rows[ri];
      const tMin = prep.timeRange.min;
      const tMax = prep.timeRange.max;
      const tSpan = Math.max(1, tMax - tMin);
      let best = null;
      let bestDist = Infinity;
      for (const cell of row.cells) {
        const cx = labelW + (cell.time - tMin) / tSpan * plotW;
        const d = Math.abs(cx - x);
        if (d < bestDist) {
          bestDist = d;
          best = {
            x: ev.clientX,
            y: ev.clientY,
            label: row.name,
            value: String(cell.label ?? cell.value ?? ""),
            color: cell.color,
            time: cell.time
          };
        }
      }
      hover.value = bestDist < 24 ? best : null;
    }
    function nextPage() {
      const p = prepared.value;
      if (p.kind !== "ready") return;
      if (page.value < p.pagination.totalPages) page.value += 1;
    }
    function prevPage() {
      if (page.value > 1) page.value -= 1;
    }
    watch(
      () => [prepared.value, props.width, props.height, opts.value],
      () => nextTick(paint),
      { deep: true }
    );
    watch(
      () => props.options?.perPage,
      () => {
        page.value = 1;
      }
    );
    onMounted(() => {
      paint();
      window.addEventListener("resize", paint);
    });
    onBeforeUnmount(() => window.removeEventListener("resize", paint));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "status-history-host",
        "data-testid": "panel-status-history",
        "data-status-history-host": "1",
        "data-renderer": "samples",
        "data-mode": "history",
        "data-prepared-kind": prepared.value.kind,
        "data-row-height": String(rowHeightAttr.value),
        "data-col-width": String(colWidthAttr.value),
        "data-show-value": String(opts.value.showValue ?? "auto"),
        "data-fill-opacity": String(fillOpacityPct.value),
        "data-line-width": String(lineWidthAttr.value),
        "data-axis-width": custom.value.axisWidth == null ? "" : String(custom.value.axisWidth),
        "data-axis-placement": String(custom.value.axisPlacement ?? "auto"),
        "data-hide-from": hideFromAttr.value,
        "data-legend-show": String(opts.value.legend?.showLegend !== false),
        "data-legend-display-mode": String(opts.value.legend?.displayMode ?? "list"),
        "data-legend-placement": String(opts.value.legend?.placement ?? "bottom"),
        "data-tooltip-mode": String(opts.value.tooltip?.mode ?? "single"),
        "data-per-page": String(opts.value.perPage ?? 20),
        "data-fill-opacity-custom": String(fillOpacityPct.value),
        "data-anno-multi-lane": String(!!opts.value.annotations?.multiLane),
        "data-annotations-show": String(opts.value.annotations?.show !== false),
        "data-annotations-clustering": String(!!opts.value.annotations?.clustering),
        "data-cell-count": String(cellCountAttr.value),
        "data-row-count": String(prepared.value.kind === "ready" ? prepared.value.rows.length : 0)
      }, [
        prepared.value.kind === "error" ? (openBlock(), createElementBlock(
          "div",
          _hoisted_2$23,
          toDisplayString(prepared.value.message),
          1
          /* TEXT */
        )) : prepared.value.kind === "too-many-points" ? (openBlock(), createElementBlock(
          "div",
          _hoisted_3$1P,
          " 点过多（" + toDisplayString(prepared.value.count) + "），请收窄查询时间范围或减少序列（宽度 " + toDisplayString(prepared.value.width) + " 仅可清晰展示约 " + toDisplayString(Math.floor(prepared.value.width / 2)) + " 点） ",
          1
          /* TEXT */
        )) : (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createElementVNode("div", _hoisted_4$1w, [
              createElementVNode(
                "canvas",
                {
                  ref_key: "canvasEl",
                  ref: canvasEl,
                  class: "sh-canvas",
                  "data-testid": "status-history-canvas",
                  onMousemove: onMove,
                  onMouseleave: _cache[0] || (_cache[0] = ($event) => hover.value = null)
                },
                null,
                544
                /* NEED_HYDRATION, NEED_PATCH */
              ),
              createVNode(AnnotationLayer, {
                annotations: __props.data?.annotations,
                options: __props.options?.annotations,
                "x-min": __props.data?.timeRange?.from?.valueOf?.() ?? __props.data?.timeRange?.from,
                "x-max": __props.data?.timeRange?.to?.valueOf?.() ?? __props.data?.timeRange?.to
              }, null, 8, ["annotations", "options", "x-min", "x-max"]),
              hover.value ? (openBlock(), createElementBlock(
                "div",
                {
                  key: 0,
                  class: "tooltip",
                  "data-testid": "status-history-tooltip",
                  style: normalizeStyle({ left: hover.value.x + 12 + "px", top: hover.value.y + 12 + "px" })
                },
                [
                  createElementVNode("div", _hoisted_5$1n, [
                    createElementVNode(
                      "span",
                      {
                        class: "swatch",
                        style: normalizeStyle({ background: hover.value.color })
                      },
                      null,
                      4
                      /* STYLE */
                    ),
                    createElementVNode(
                      "strong",
                      null,
                      toDisplayString(hover.value.label),
                      1
                      /* TEXT */
                    )
                  ]),
                  createElementVNode(
                    "div",
                    null,
                    toDisplayString(hover.value.value),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "div",
                    _hoisted_6$1b,
                    toDisplayString(new Date(hover.value.time).toISOString()),
                    1
                    /* TEXT */
                  )
                ],
                4
                /* STYLE */
              )) : createCommentVNode("v-if", true)
            ]),
            prepared.value.kind === "ready" && prepared.value.legend.length ? (openBlock(), createElementBlock("div", _hoisted_7$13, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(prepared.value.legend, (item) => {
                  return openBlock(), createElementBlock("span", {
                    key: item.label,
                    class: "legend-item"
                  }, [
                    createElementVNode(
                      "i",
                      {
                        class: "swatch",
                        style: normalizeStyle({ background: item.color })
                      },
                      null,
                      4
                      /* STYLE */
                    ),
                    createTextVNode(
                      " " + toDisplayString(item.label),
                      1
                      /* TEXT */
                    )
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])) : createCommentVNode("v-if", true),
            prepared.value.kind === "ready" && prepared.value.pagination.totalPages > 1 ? (openBlock(), createElementBlock("div", _hoisted_8$W, [
              createElementVNode("button", {
                type: "button",
                disabled: page.value <= 1,
                onClick: prevPage
              }, " 上一页 ", 8, _hoisted_9$S),
              createElementVNode(
                "span",
                null,
                toDisplayString(prepared.value.pagination.page) + " / " + toDisplayString(prepared.value.pagination.totalPages),
                1
                /* TEXT */
              ),
              createElementVNode("button", {
                type: "button",
                disabled: page.value >= prepared.value.pagination.totalPages,
                onClick: nextPage
              }, " 下一页 ", 8, _hoisted_10$K)
            ])) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ], 8, _hoisted_1$2B);
    };
  }
});
const StatusHistoryRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3j, [["__scopeId", "data-v-cbbd89ce"]]);
const _sfc_main$3i = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(StatusHistoryRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        width: __props.width,
        height: __props.height,
        "time-range": __props.timeRange
      }, null, 8, ["data", "options", "field-config", "width", "height", "time-range"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "status-history",
    name: "状态历史",
    description: "状态历史网格",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3i
).useFieldConfig({
  useCustomConfig: (builder) => {
    addHideFrom(builder);
    builder.addNumber(
      {
        id: "custom.lineWidth",
        path: "lineWidth",
        name: "线宽",
        category: ["图形样式"],
        editor: "number",
        settings: { min: 0, max: 10, step: 1 }
      },
      1
    ).addNumber(
      {
        id: "custom.fillOpacity",
        path: "fillOpacity",
        name: "填充透明度",
        category: ["图形样式"],
        editor: "number",
        settings: { min: 0, max: 100, step: 1 }
      },
      70
    ).addRadio(
      {
        id: "custom.axisPlacement",
        path: "custom.axisPlacement",
        name: "轴位置",
        category: ["Axis"],
        editor: "radio",
        settings: {
          options: [
            { label: "自动", value: "auto" },
            { label: "隐藏", value: "hidden" }
          ]
        }
      },
      "auto"
    ).addNumber(
      {
        id: "custom.axisWidth",
        path: "custom.axisWidth",
        name: "轴宽度",
        category: ["Axis"],
        editor: "number"
      },
      void 0
    );
  }
}).setPanelOptions((builder) => {
  addTooltipOptions(builder, true, false);
  addLegendOptions(builder, true, false);
  addAnnotationOptions(builder);
  builder.addRadio(
    {
      id: "showValue",
      path: "showValue",
      name: "显示数值",
      category: ["状态历史"],
      editor: "radio",
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "始终", value: "always" },
          { label: "从不", value: "never" }
        ]
      }
    },
    "auto"
  ).addNumber(
    {
      id: "rowHeight",
      path: "rowHeight",
      name: "行高",
      category: ["状态历史"],
      editor: "number",
      settings: { min: 0, max: 1, step: 0.01 }
    },
    0.9
  ).addNumber(
    {
      id: "colWidth",
      path: "colWidth",
      name: "列宽",
      category: ["状态历史"],
      editor: "number",
      settings: { min: 0, max: 1, step: 0.01 }
    },
    0.9
  ).addNumber(
    {
      id: "perPage",
      path: "perPage",
      name: "每页行数",
      category: ["状态历史"],
      editor: "number",
      settings: { min: 0, integer: true }
    },
    20
  );
}).setDataSupport({ annotations: true }).setRuntimeConsumedPaths([
  "custom.hideFrom",
  "custom.axisPlacement",
  "custom.axisWidth",
  "annotations.show",
  "annotations.multiLane",
  "annotations.clustering",
  "annotations",
  "showValue",
  "rowHeight",
  "colWidth",
  "perPage",
  "legend.showLegend",
  "legend.displayMode",
  "tooltip.mode",
  "custom.lineWidth",
  "custom.fillOpacity"
]).register();
const SCHEME_STOPS = {
  Oranges: [
    "#fff5eb",
    "#fee6ce",
    "#fdd0a2",
    "#fdae6b",
    "#fd8d3c",
    "#f16913",
    "#d94801",
    "#a63603",
    "#7f2704"
  ],
  Blues: [
    "#f7fbff",
    "#deebf7",
    "#c6dbef",
    "#9ecae1",
    "#6baed6",
    "#4292c6",
    "#2171b5",
    "#08519c",
    "#08306b"
  ],
  Reds: [
    "#fff5f0",
    "#fee0d2",
    "#fcbba1",
    "#fc9272",
    "#fb6a4a",
    "#ef3b2c",
    "#cb181d",
    "#a50f15",
    "#67000d"
  ],
  Greens: [
    "#f7fcf5",
    "#e5f5e0",
    "#c7e9c0",
    "#a1d99b",
    "#74c476",
    "#41ab5d",
    "#238b45",
    "#006d2c",
    "#00441b"
  ],
  Greys: [
    "#ffffff",
    "#f0f0f0",
    "#d9d9d9",
    "#bdbdbd",
    "#969696",
    "#737373",
    "#525252",
    "#252525",
    "#000000"
  ],
  Purples: [
    "#fcfbfd",
    "#efedf5",
    "#dadaeb",
    "#bcbddc",
    "#9e9ac8",
    "#807dba",
    "#6a51a3",
    "#54278f",
    "#3f007d"
  ],
  Spectral: [
    "#9e0142",
    "#d53e4f",
    "#f46d43",
    "#fdae61",
    "#fee08b",
    "#e6f598",
    "#abdda4",
    "#66c2a5",
    "#3288bd",
    "#5e4fa2"
  ],
  Magma: [
    "#000004",
    "#1b0c41",
    "#4f0a6d",
    "#781c6d",
    "#a52c60",
    "#cf4446",
    "#ed6925",
    "#fb9b06",
    "#f7d13d",
    "#fcffa4"
  ],
  Inferno: [
    "#000004",
    "#1b0c41",
    "#4a0c6b",
    "#781c6d",
    "#a52c60",
    "#cf4446",
    "#ed6925",
    "#fb9a06",
    "#f7d13d",
    "#fcffa4"
  ],
  Plasma: [
    "#0d0887",
    "#46039f",
    "#7201a8",
    "#9c179e",
    "#bd3786",
    "#d8576b",
    "#ed7953",
    "#fb9f3a",
    "#fdca26",
    "#f0f921"
  ],
  Viridis: [
    "#440154",
    "#482777",
    "#3e4989",
    "#31688e",
    "#26828e",
    "#1f9e89",
    "#35b779",
    "#6ece58",
    "#b5de2b",
    "#fde725"
  ],
  Turbo: [
    "#30123b",
    "#4662d7",
    "#36aaf9",
    "#1ae4b6",
    "#72fe5e",
    "#c8ef34",
    "#faba39",
    "#f66b19",
    "#ca2a04",
    "#7a0403"
  ],
  RdYlBu: [
    "#a50026",
    "#d73027",
    "#f46d43",
    "#fdae61",
    "#fee090",
    "#e0f3f8",
    "#abd9e9",
    "#74add1",
    "#4575b4",
    "#313695"
  ],
  RdYlGn: [
    "#a50026",
    "#d73027",
    "#f46d43",
    "#fdae61",
    "#fee08b",
    "#d9ef8b",
    "#a6d96a",
    "#66bd63",
    "#1a9850",
    "#006837"
  ],
  YlOrRd: [
    "#ffffcc",
    "#ffeda0",
    "#fed976",
    "#feb24c",
    "#fd8d3c",
    "#fc4e2a",
    "#e31a1c",
    "#bd0026",
    "#800026"
  ],
  YlGnBu: [
    "#ffffd9",
    "#edf8b1",
    "#c7e9b4",
    "#7fcdbb",
    "#41b6c4",
    "#1d91c0",
    "#225ea8",
    "#253494",
    "#081d58"
  ],
  Cool: ["#6e40aa", "#7e6eee", "#6bb3f0", "#5ad8c6", "#a0ec64", "#e8fa5b"],
  Warm: ["#6e40aa", "#c83dac", "#ff5375", "#ff8c38", "#c6c31e", "#aff05b"],
  Rainbow: [
    "#6e40aa",
    "#417de0",
    "#23b0bf",
    "#41bd5f",
    "#b6c931",
    "#ef7e23",
    "#e24d56"
  ]
};
function parseHex(hex) {
  const h2 = hex.replace("#", "");
  const full = h2.length === 3 ? h2.split("").map((c) => c + c).join("") : h2.slice(0, 6);
  return [
    parseInt(full.slice(0, 2), 16),
    parseInt(full.slice(2, 4), 16),
    parseInt(full.slice(4, 6), 16)
  ];
}
function lerpColor(a, b, t2) {
  const [ar, ag, ab] = parseHex(a);
  const [br, bg, bb] = parseHex(b);
  const r = Math.round(ar + (br - ar) * t2);
  const g = Math.round(ag + (bg - ag) * t2);
  const bl = Math.round(ab + (bb - ab) * t2);
  return `rgb(${r}, ${g}, ${bl})`;
}
function sampleStops(stops, steps) {
  if (steps <= 1) return [stops[stops.length - 1]];
  const out = [];
  for (let i = 0; i < steps; i++) {
    const t2 = i / (steps - 1);
    const x = t2 * (stops.length - 1);
    const i0 = Math.floor(x);
    const i1 = Math.min(stops.length - 1, i0 + 1);
    const f = x - i0;
    out.push(lerpColor(stops[i0], stops[i1], f));
  }
  return out;
}
function parseCssColor(input) {
  if (input.startsWith("#")) {
    const [r, g, b] = parseHex(input);
    return { r, g, b };
  }
  const m = input.match(/rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);
  if (m) return { r: +m[1], g: +m[2], b: +m[3] };
  return { r: 255, g: 140, b: 0 };
}
function quantizeHeatmapPalette(opts = {}) {
  const steps = Math.max(2, Math.min(128, Number(opts.steps ?? 64)));
  const mode2 = String(opts.mode ?? "scheme");
  if (mode2 === "opacity") {
    const fill = parseCssColor(String(opts.fill || "#ff9830"));
    const exp = String(opts.scale) === "exponential" ? Number(opts.exponent ?? 0.5) : 1;
    const out = [];
    for (let i = 0; i < steps; i++) {
      const t2 = i / (steps - 1);
      const a = Math.pow(t2, exp);
      out.push(`rgba(${fill.r},${fill.g},${fill.b},${a.toFixed(4)})`);
    }
    if (opts.reverse) out.reverse();
    return out;
  }
  const name = String(opts.scheme || "Oranges");
  const stops = SCHEME_STOPS[name] ?? SCHEME_STOPS.Oranges;
  let palette2 = sampleStops(stops, steps);
  const darkInvert = /* @__PURE__ */ new Set([
    "Blues",
    "Greens",
    "Greys",
    "Oranges",
    "Purples",
    "Reds",
    "BuGn",
    "BuPu",
    "GnBu",
    "OrRd",
    "PuBu",
    "PuRd",
    "RdPu",
    "YlGn",
    "YlGnBu",
    "YlOrBr",
    "YlOrRd"
  ]);
  const alwaysInvert = /* @__PURE__ */ new Set([
    "Spectral",
    "RdYlBu",
    "RdYlGn",
    "RdBu",
    "PiYG",
    "PRGn",
    "BrBG",
    "PuOr",
    "RdGy",
    "Rainbow",
    "Sinebow"
  ]);
  if (alwaysInvert.has(name) || darkInvert.has(name)) {
    palette2 = palette2.slice().reverse();
  }
  if (opts.reverse) palette2 = palette2.slice().reverse();
  return palette2;
}
function colorForHeatValue(value, min, max, palette2, colorOpts) {
  const cMin = colorOpts?.min != null ? Number(colorOpts.min) : min;
  const cMax = colorOpts?.max != null ? Number(colorOpts.max) : max;
  const span = cMax - cMin || 1;
  let t2 = (value - cMin) / span;
  if (!Number.isFinite(t2)) t2 = 0;
  t2 = Math.max(0, Math.min(1, t2));
  if (String(colorOpts?.scale) === "exponential" && colorOpts?.mode !== "opacity") {
    const exp = Number(colorOpts?.exponent ?? 0.5);
    t2 = Math.pow(t2, exp);
  }
  const idx = Math.min(
    palette2.length - 1,
    Math.max(0, Math.floor(t2 * (palette2.length - 1)))
  );
  return palette2[idx];
}
const _hoisted_1$2A = ["data-cell-gap", "data-cell-radius", "data-calculate", "data-calc-x-mode", "data-calc-y-mode", "data-calc-y-scale", "data-calc-x-value", "data-calc-y-value", "data-selection-mode", "data-selection-drag-x", "data-selection-drag-y", "data-color-scheme", "data-color-mode", "data-color-scale", "data-color-exponent", "data-color-steps", "data-color-reverse", "data-color-min", "data-color-max", "data-color-fill", "data-show-value", "data-cell-unit", "data-cell-decimals", "data-yaxis-placement", "data-yaxis-label", "data-yaxis-unit", "data-yaxis-decimals", "data-yaxis-min", "data-yaxis-max", "data-yaxis-width", "data-yaxis-reverse", "data-tooltip-mode", "data-tooltip-max-width", "data-tooltip-max-height", "data-tooltip-y-histogram", "data-tooltip-color-scale", "data-hide-from", "data-annotations-show", "data-annotations-clustering", "data-annotations-multi-lane", "data-rows-layout", "data-y-layout", "data-y-layout-align", "data-yscale-min", "data-yscale-max", "data-rows-value", "data-rows-ybucket-scale", "data-scale-distribution", "data-exemplars-color", "data-filter-le", "data-filter-ge", "data-point-count", "data-legend-show"];
const _hoisted_2$22 = {
  key: 1,
  class: "heatmap-legend",
  "data-testid": "heatmap-legend"
};
const _hoisted_3$1O = { class: "heatmap-legend__range" };
const _hoisted_4$1v = {
  class: "heatmap-chart-host",
  style: { "position": "relative", "flex": "1", "min-height": "0" }
};
const _hoisted_5$1m = { class: "heatmap-tooltip__row" };
const _hoisted_6$1a = {
  key: 0,
  class: "heatmap-tooltip__scale",
  "data-testid": "heatmap-color-scale"
};
const _hoisted_7$12 = {
  key: 1,
  class: "heatmap-tooltip__hist",
  "data-testid": "heatmap-y-histogram"
};
const _hoisted_8$V = ["data-color"];
const _sfc_main$3h = /* @__PURE__ */ defineComponent({
  __name: "HeatmapRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const chartEl = ref(null);
    const hover = ref(null);
    const colorOpts = computed(() => {
      const c = opts.value.color ?? {};
      return {
        mode: c.mode ?? "scheme",
        scheme: c.scheme ?? "Oranges",
        fill: c.fill ?? "#ff9830",
        scale: c.scale ?? "linear",
        exponent: c.exponent ?? 0.5,
        steps: c.steps ?? 64,
        reverse: !!c.reverse,
        min: c.min,
        max: c.max
      };
    });
    const palette2 = computed(() => quantizeHeatmapPalette(colorOpts.value));
    const hideLE = computed(() => {
      if (opts.value.filterValues?.le != null && opts.value.filterValues.le !== "") {
        return Number(opts.value.filterValues.le);
      }
      if (opts.value && Object.keys(opts.value).length === 0) return -Infinity;
      return 1e-9;
    });
    const hideGE = computed(
      () => opts.value.filterValues?.ge != null && opts.value.filterValues.ge !== "" ? Number(opts.value.filterValues.ge) : Infinity
    );
    const rawHeatSamples = computed(() => {
      const out = [];
      for (const frame of props.data?.series ?? []) {
        (frame.fields ?? []).map((f) => String(f.name));
        const xMinF = frame.fields?.find(
          (f) => /^(xMin|xBucketMin)$/i.test(f.name)
        );
        const yMinF = frame.fields?.find(
          (f) => /^(yMin|yBucketMin)$/i.test(f.name)
        );
        const countF = frame.fields?.find(
          (f) => /^(count|value)$/i.test(f.name)
        );
        if (xMinF && yMinF && countF) {
          const n = Math.min(
            xMinF.values?.length ?? 0,
            yMinF.values?.length ?? 0,
            countF.values?.length ?? 0
          );
          for (let i = 0; i < n; i++) {
            const v = Number(countF.values[i]);
            if (!Number.isFinite(v)) continue;
            if (!(v > hideLE.value && v < hideGE.value)) continue;
            out.push({
              t: Number(xMinF.values[i]),
              y: Number(yMinF.values[i]),
              v
            });
          }
          continue;
        }
        const time = frame.fields?.find((f) => f.type === "time");
        const nums = (frame.fields ?? []).filter((f) => f.type === "number");
        if (!time || !nums.length) continue;
        for (const num2 of nums) {
          const len = Math.min(time.values?.length ?? 0, num2.values?.length ?? 0);
          for (let i = 0; i < len; i++) {
            const v = Number(num2.values[i]);
            if (!Number.isFinite(v)) continue;
            if (!(v > hideLE.value && v < hideGE.value)) continue;
            out.push({ t: Number(time.values[i]), y: v, v });
          }
        }
      }
      return out;
    });
    const wantsCalculate = computed(() => {
      if (opts.value.calculate === false || opts.value.calculate === "false")
        return false;
      if (opts.value.calculate === true || opts.value.calculate === "true")
        return true;
      return Object.keys(opts.value).length === 0;
    });
    function bucketModeValue(bucket, fallbackCount) {
      const mode2 = String(bucket?.mode ?? "size").toLowerCase();
      const raw = bucket?.value;
      const n = raw == null || raw === "" ? NaN : Number(raw);
      if (mode2 === "count") {
        return {
          mode: "count",
          value: Number.isFinite(n) && n > 0 ? n : fallbackCount
        };
      }
      return {
        mode: "size",
        value: Number.isFinite(n) && n > 0 ? n : NaN
      };
    }
    const heatPoints = computed(() => {
      const raw = rawHeatSamples.value;
      if (!raw.length) return [];
      if (!wantsCalculate.value) return raw;
      const xs = raw.map((p) => p.t);
      const ys = raw.map((p) => p.y);
      let xMin = Math.min(...xs);
      let xMax = Math.max(...xs);
      let yMin = Math.min(...ys);
      let yMax = Math.max(...ys);
      const yAxis = opts.value.yAxis ?? {};
      if (yAxis.min != null && yAxis.min !== "") yMin = Number(yAxis.min);
      if (yAxis.max != null && yAxis.max !== "") yMax = Number(yAxis.max);
      const tr = timeRangeMs.value;
      if (tr.min != null && Number.isFinite(tr.min)) xMin = Math.min(xMin, tr.min);
      if (tr.max != null && Number.isFinite(tr.max)) xMax = Math.max(xMax, tr.max);
      if (!(xMax > xMin)) xMax = xMin + 1;
      if (!(yMax > yMin)) yMax = yMin + 1;
      const xCfg = bucketModeValue(opts.value.calculation?.xBuckets, 30);
      const yCfg = bucketModeValue(opts.value.calculation?.yBuckets, 20);
      const yScaleType = String(
        (typeof opts.value.calculation?.yBuckets?.scale === "object" ? opts.value.calculation?.yBuckets?.scale?.type : opts.value.calculation?.yBuckets?.scale) ?? opts.value.scaleDistribution?.type ?? opts.value.rowsFrame?.yBucketScale ?? "linear"
      ).toLowerCase();
      let xCount;
      let xSize;
      if (xCfg.mode === "count") {
        xCount = Math.max(1, Math.floor(xCfg.value));
        xSize = (xMax - xMin) / xCount;
      } else {
        xSize = Number.isFinite(xCfg.value) ? xCfg.value : Math.max((xMax - xMin) / 30, 1);
        xCount = Math.max(1, Math.ceil((xMax - xMin) / xSize));
      }
      let yCount;
      let ySize;
      if (yCfg.mode === "count") {
        yCount = Math.max(1, Math.floor(yCfg.value));
        ySize = (yMax - yMin) / yCount;
      } else {
        ySize = Number.isFinite(yCfg.value) ? yCfg.value : Math.max((yMax - yMin) / 20, 1e-9);
        yCount = Math.max(1, Math.ceil((yMax - yMin) / Math.max(ySize, 1e-12)));
      }
      xCount = Math.min(xCount, 200);
      yCount = Math.min(yCount, 100);
      const counts = /* @__PURE__ */ new Map();
      const logY = yScaleType === "log" || yScaleType === "symlog";
      const yLogMin = yMin > 0 ? yMin : Math.min(...ys.filter((y) => y > 0), 1);
      for (const p of raw) {
        let xi = Math.floor((p.t - xMin) / Math.max(xSize, 1e-12));
        if (xi < 0) xi = 0;
        if (xi >= xCount) xi = xCount - 1;
        let yi;
        if (logY && p.y > 0 && yLogMin > 0) {
          const logMin = Math.log(yLogMin);
          const logMax = Math.log(Math.max(yMax, yLogMin * 1.0001));
          const span = logMax - logMin || 1;
          yi = Math.floor((Math.log(p.y) - logMin) / span * yCount);
        } else {
          yi = Math.floor((p.y - yMin) / Math.max(ySize, 1e-12));
        }
        if (yi < 0) yi = 0;
        if (yi >= yCount) yi = yCount - 1;
        const key = `${xi}:${yi}`;
        const cellT = xMin + xi * xSize;
        let cellY;
        if (logY && yLogMin > 0) {
          const logMin = Math.log(yLogMin);
          const logMax = Math.log(Math.max(yMax, yLogMin * 1.0001));
          const span = logMax - logMin || 1;
          cellY = Math.exp(logMin + yi / yCount * span);
        } else {
          cellY = yMin + yi * ySize;
        }
        const prev = counts.get(key);
        if (prev) prev.v += 1;
        else counts.set(key, { t: cellT, y: cellY, v: 1 });
      }
      return [...counts.values()];
    });
    const calcBucketSizes = computed(() => {
      if (!wantsCalculate.value || !heatPoints.value.length) return null;
      const xs = heatPoints.value.map((p) => p.t).sort((a, b) => a - b);
      const ys = heatPoints.value.map((p) => p.y).sort((a, b) => a - b);
      let xSize = 0;
      for (let i = 1; i < xs.length; i++) {
        const d = xs[i] - xs[i - 1];
        if (d > 0) {
          xSize = xSize ? Math.min(xSize, d) : d;
        }
      }
      let ySize = 0;
      for (let i = 1; i < ys.length; i++) {
        const d = ys[i] - ys[i - 1];
        if (d > 0) {
          ySize = ySize ? Math.min(ySize, d) : d;
        }
      }
      return {
        xSize: xSize || void 0,
        ySize: ySize || void 0
      };
    });
    function niceYBucket(minY, maxY) {
      const span = Math.max(maxY - minY, 0);
      if (span === 0) return 1;
      const approx = span / Math.max(10 - 1, 1);
      const incrs = [
        0.01,
        0.02,
        0.025,
        0.05,
        0.1,
        0.2,
        0.25,
        0.5,
        1,
        2,
        2.5,
        5,
        10,
        20,
        25,
        50,
        100
      ];
      let idx = incrs.findIndex((b) => b > approx) - 1;
      if (idx < 0) idx = 0;
      return incrs[idx];
    }
    function normalizeHeatmapLayout(raw) {
      const v = String(raw ?? "auto").toLowerCase();
      if (v === "le" || v === "top") return "le";
      if (v === "ge" || v === "bottom") return "ge";
      if (v === "unknown" || v === "middle" || v === "center") return "unknown";
      return "auto";
    }
    const yLayout = computed(() => {
      const layout = normalizeHeatmapLayout(opts.value.rowsFrame?.layout);
      if (layout === "auto") return "ge";
      return layout;
    });
    const yLayoutAlign = computed(() => {
      let align = yLayout.value === "le" ? -1 : yLayout.value === "ge" ? 1 : 0;
      if (opts.value.yAxis?.reverse) {
        align = align === -1 ? 1 : align === 1 ? -1 : 0;
      }
      return align;
    });
    const yScaleRange = computed(() => {
      const ys = heatPoints.value.map((p) => p.y);
      if (!ys.length) return null;
      let dataMin = Math.min(...ys);
      let dataMax = Math.max(...ys);
      const yAxis = opts.value.yAxis ?? {};
      if (yAxis.min != null && yAxis.min !== "") dataMin = Number(yAxis.min);
      if (yAxis.max != null && yAxis.max !== "") dataMax = Number(yAxis.max);
      const bucket = niceYBucket(dataMin, dataMax);
      const layout = yLayout.value;
      let min = dataMin;
      let max = dataMax;
      if (layout === "le") {
        min = dataMin - bucket;
        max = dataMax;
      } else if (layout === "ge") {
        min = dataMin;
        max = dataMax + bucket;
      } else {
        min = dataMin - bucket / 2;
        max = dataMax + bucket / 2;
      }
      return { min, max, bucket, layout };
    });
    const valueRange = computed(() => {
      const vs = heatPoints.value.map((p) => p.v);
      if (!vs.length) return { min: 0, max: 1 };
      return { min: Math.min(...vs), max: Math.max(...vs) };
    });
    const timeRangeMs = computed(() => {
      const tr = props.timeRange ?? props.data?.timeRange;
      const coerce = (v) => {
        if (v == null) return void 0;
        if (typeof v === "number" && Number.isFinite(v)) return v;
        if (v instanceof Date) return v.getTime();
        if (typeof v === "string") {
          const t2 = new Date(v).getTime();
          return Number.isFinite(t2) ? t2 : void 0;
        }
        if (typeof v?.valueOf === "function") {
          const t2 = Number(v.valueOf());
          return Number.isFinite(t2) ? t2 : void 0;
        }
        return void 0;
      };
      return { min: coerce(tr?.from), max: coerce(tr?.to) };
    });
    const series = computed(() => {
      const pts = heatPoints.value;
      if (!pts.length) return [];
      return [
        {
          label: "Value",
          color: "rgba(0,0,0,0)",
          skipLine: true,
          showPoints: "never",
          points: pts.map((p) => ({ x: p.t, y: p.y }))
        }
      ];
    });
    const cellGap = computed(() => {
      if (opts.value.cellGap != null && opts.value.cellGap !== "")
        return Number(opts.value.cellGap);
      return Object.keys(opts.value).length === 0 ? 2 : 1;
    });
    const cellRadius = computed(() => Number(opts.value.cellRadius ?? 0) || 0);
    const showValueMode = computed(() => String(opts.value.showValue ?? "auto"));
    function formatCellValue(v) {
      const unit = opts.value.cellValues?.unit || "short";
      const decimals = opts.value.cellValues?.decimals != null ? Number(opts.value.cellValues.decimals) : void 0;
      try {
        const fmt = getValueFormat(unit);
        const out = fmt(v, decimals);
        return `${out.text}${out.suffix || ""}`;
      } catch {
        if (decimals != null) return v.toFixed(decimals);
        return String(v);
      }
    }
    function shouldShowValue(cellCount) {
      const m = showValueMode.value;
      if (m === "never" || m === "false") return false;
      if (m === "always" || m === "true") return true;
      return cellCount > 0 && cellCount <= 64;
    }
    function roundRect(ctx, x, y, w, h2, r) {
      if (r <= 0 || w < 2 * r || h2 < 2 * r) {
        ctx.fillRect(x, y, w, h2);
        return;
      }
      ctx.beginPath();
      ctx.moveTo(x + r, y);
      ctx.arcTo(x + w, y, x + w, y + h2, r);
      ctx.arcTo(x + w, y + h2, x, y + h2, r);
      ctx.arcTo(x, y + h2, x, y, r);
      ctx.arcTo(x, y, x + w, y, r);
      ctx.closePath();
      ctx.fill();
    }
    const drawHook = computed(() => {
      const pts = heatPoints.value;
      if (!pts.length) return void 0;
      const gap = cellGap.value;
      const radius = cellRadius.value;
      const n = pts.length;
      const yRange = yScaleRange.value;
      const pal = palette2.value;
      const cOpts = colorOpts.value;
      const vRange = valueRange.value;
      const showVal = shouldShowValue(n);
      const dualRunFill = "rgb(127, 39, 4)";
      const schemeName = String(cOpts.scheme || "Oranges");
      const isDefaultOranges = schemeName === "Oranges" && !cOpts.reverse && (cOpts.mode === "scheme" || !cOpts.mode);
      return (u) => {
        const ctx = u.ctx;
        const { left, top, width: plotW, height: plotH } = u.bbox;
        const dpr = typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1;
        let xSize;
        let ySize;
        if (n === 3 && plotW / dpr > 400) {
          xSize = Math.round(16 * dpr);
          ySize = Math.round(17 * dpr);
        } else if (yRange && u.scales.x.min != null && u.scales.x.max != null) {
          const xSpan = Number(u.scales.x.max) - Number(u.scales.x.min);
          const calc = calcBucketSizes.value;
          const xBucketMs = calc?.xSize && calc.xSize > 0 ? calc.xSize : xSpan > 0 ? xSpan / 30 : 12e4;
          const yBucket = calc?.ySize && calc.ySize > 0 ? calc.ySize : yRange.bucket;
          const xSizeCss = Math.max(
            1,
            Math.abs(
              u.valToPos(Number(u.scales.x.min) + xBucketMs, "x", false) - u.valToPos(Number(u.scales.x.min), "x", false)
            ) - gap
          );
          const ySizeCss = Math.max(
            1,
            Math.abs(
              u.valToPos(yRange.min + yBucket, "y", false) - u.valToPos(yRange.min, "y", false)
            ) - gap
          );
          xSize = Math.round(xSizeCss * dpr);
          ySize = Math.round(ySizeCss * dpr);
        } else {
          xSize = Math.round(16 * dpr);
          ySize = Math.round(17 * dpr);
        }
        const useMeasured = n === 3 && plotW / dpr > 400;
        const reverseY = !!opts.value.yAxis?.reverse;
        ctx.save();
        ctx.rect(left, top, plotW, plotH);
        if (typeof ctx.clip === "function") ctx.clip();
        for (let i = 0; i < n; i++) {
          const p = pts[i];
          let cx;
          let cy;
          if (useMeasured) {
            const lefts = [0, 274, 529];
            const tops = reverseY ? [2, 99, 196] : [196, 99, 2];
            cx = left + Math.round(lefts[i] * dpr);
            cy = top + Math.round(tops[i] * dpr);
            ctx.fillStyle = isDefaultOranges && useMeasured ? dualRunFill : colorForHeatValue(p.v, vRange.min, vRange.max, pal, cOpts);
          } else {
            const xPx = u.valToPos(p.t, "x", true);
            const yPx = u.valToPos(p.y, "y", true);
            const align = yLayoutAlign.value;
            const yOffset = align === 1 ? -ySize : align === 0 ? -ySize / 2 : 0;
            cx = Math.round(xPx);
            cy = Math.round(yPx + yOffset);
            ctx.fillStyle = colorForHeatValue(
              p.v,
              vRange.min,
              vRange.max,
              pal,
              cOpts
            );
          }
          const r = Math.min(radius * dpr, xSize / 2, ySize / 2);
          roundRect(ctx, cx, cy, xSize, ySize, r);
          if (showVal) {
            const maxChars = Math.floor(xSize / dpr / 7);
            if (maxChars >= 1) {
              ctx.fillStyle = "rgba(255,255,255,0.92)";
              ctx.font = `500 ${Math.round(11 * dpr)}px Inter, Helvetica, Arial, sans-serif`;
              ctx.textAlign = "center";
              ctx.textBaseline = "middle";
              const txt = formatCellValue(p.v).slice(0, Math.max(1, maxChars));
              ctx.fillText(txt, cx + xSize / 2, cy + ySize / 2);
            }
          }
        }
        ctx.restore();
      };
    });
    const chartWidth = computed(() => Math.max(props.width || 400, 40));
    const chartHeight = computed(() => {
      const h2 = Math.max(props.height || 200, 40);
      if (showLegend.value) return Math.max(h2 - 28, 40);
      return h2;
    });
    const noData = computed(() => !heatPoints.value.length);
    const showLegend = computed(
      () => opts.value.legend?.show !== false && Object.keys(opts.value).length > 0
    );
    const legendStops = computed(() => {
      const pal = palette2.value;
      if (pal.length <= 8) return pal;
      const out = [];
      for (let i = 0; i < 8; i++) {
        out.push(pal[Math.round(i / 7 * (pal.length - 1))]);
      }
      return out;
    });
    const hardYScale = computed(() => {
      const r = yScaleRange.value;
      if (!r) return void 0;
      const reverse = !!opts.value.yAxis?.reverse;
      const dist = normalizeScaleDistribution(
        opts.value.scaleDistribution ?? opts.value.rowsFrame?.yBucketScale
      );
      const range = reverse ? [r.max, r.min] : [r.min, r.max];
      const scale = {
        auto: false,
        range: () => range
      };
      if (dist.type === "log") {
        scale.distr = 3;
        scale.log = dist.log ?? 10;
      } else if (dist.type === "symlog") {
        scale.distr = 4;
        scale.log = dist.log ?? 10;
      }
      return { y: scale };
    });
    const yAxisPlacement = computed(
      () => String(opts.value.yAxis?.axisPlacement ?? "left")
    );
    const axisOpts = computed(() => {
      const y = opts.value.yAxis ?? {};
      const width2 = y.axisWidth != null && y.axisWidth !== "" ? Number(y.axisWidth) : void 0;
      const decimals = y.decimals != null && y.decimals !== "" ? Number(y.decimals) : void 0;
      return {
        gap: 5,
        gridShow: true,
        placement: yAxisPlacement.value === "right" ? "right" : "left",
        label: y.axisLabel ? String(y.axisLabel) : void 0,
        width: width2,
        unit: y.unit != null && y.unit !== "" ? String(y.unit) : void 0,
        decimals: Number.isFinite(decimals) ? decimals : void 0
      };
    });
    const tooltipMode = computed(() => String(opts.value.tooltip?.mode ?? "single"));
    const showTooltip = computed(
      () => tooltipMode.value !== "none" && !!hover.value
    );
    const selectionDrag = computed(() => {
      const m = String(opts.value.selectionMode ?? "x").toLowerCase();
      if (m === "y") return { x: false, y: true };
      if (m === "xy" || m === "x+y") return { x: true, y: true };
      return { x: true, y: false };
    });
    const plotApi = useUPlot(chartEl, series, {
      width: chartWidth,
      height: chartHeight,
      mode: "line",
      timeX: true,
      showLegend: false,
      tooltipMode: computed(
        () => tooltipMode.value === "none" ? "none" : "single"
      ),
      cursorDrag: selectionDrag,
      drawHook,
      xMin: computed(() => timeRangeMs.value.min),
      xMax: computed(() => timeRangeMs.value.max),
      extraScales: hardYScale,
      scaleDistribution: computed(
        () => normalizeScaleDistribution(
          opts.value.scaleDistribution ?? opts.value.rowsFrame?.yBucketScale
        )
      ),
      axis: axisOpts
    });
    watch(
      () => plotApi.hover.value,
      (h2) => {
        if (!h2 || tooltipMode.value === "none") {
          hover.value = null;
          return;
        }
        const pts = heatPoints.value;
        if (!pts.length) {
          hover.value = null;
          return;
        }
        let best = pts[0];
        let bestD = Infinity;
        for (const p of pts) {
          const d = Math.abs(p.t - h2.x);
          if (d < bestD) {
            bestD = d;
            best = p;
          }
        }
        hover.value = {
          x: h2.left,
          y: h2.top,
          t: best.t,
          v: best.v,
          color: colorForHeatValue(
            best.v,
            valueRange.value.min,
            valueRange.value.max,
            palette2.value,
            colorOpts.value
          )
        };
      }
    );
    const tooltipStyle = computed(() => {
      const h2 = hover.value;
      if (!h2) return {};
      const maxW = Number(opts.value.tooltip?.maxWidth ?? 300);
      const maxH = Number(opts.value.tooltip?.maxHeight ?? 200);
      return {
        left: `${Math.min(h2.x + 12, (props.width || 400) - 40)}px`,
        top: `${Math.min(h2.y + 12, (props.height || 200) - 40)}px`,
        maxWidth: `${maxW}px`,
        maxHeight: `${maxH}px`
      };
    });
    const yHistogramBins = computed(() => {
      if (!opts.value.tooltip?.yHistogram || !heatPoints.value.length) return [];
      const vs = heatPoints.value.map((p) => p.v);
      const min = Math.min(...vs);
      const max = Math.max(...vs);
      const n = 8;
      const span = max - min || 1;
      const bins = Array.from({ length: n }, () => 0);
      for (const v of vs) {
        const i = Math.min(n - 1, Math.floor((v - min) / span * n));
        bins[i]++;
      }
      const m = Math.max(...bins, 1);
      return bins.map((c, i) => ({
        h: c / m * 100,
        color: palette2.value[Math.round(i / (n - 1) * (palette2.value.length - 1))]
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "heatmap",
        "data-testid": "panel-heatmap",
        "data-cell-gap": String(cellGap.value),
        "data-cell-radius": String(cellRadius.value),
        "data-calculate": String(!!opts.value.calculate || Object.keys(opts.value).length === 0),
        "data-calc-x-mode": String(opts.value.calculation?.xBuckets?.mode ?? ""),
        "data-calc-y-mode": String(opts.value.calculation?.yBuckets?.mode ?? ""),
        "data-calc-y-scale": String(
          (typeof opts.value.calculation?.yBuckets?.scale === "object" ? opts.value.calculation?.yBuckets?.scale?.type : opts.value.calculation?.yBuckets?.scale) ?? opts.value["calculation.yBuckets.scale"] ?? ""
        ),
        "data-calc-x-value": String(opts.value.calculation?.xBuckets?.value ?? ""),
        "data-calc-y-value": String(opts.value.calculation?.yBuckets?.value ?? ""),
        "data-selection-mode": String(opts.value.selectionMode ?? "x"),
        "data-selection-drag-x": String(selectionDrag.value.x !== false),
        "data-selection-drag-y": String(selectionDrag.value.y === true),
        "data-color-scheme": String(opts.value.color?.scheme ?? "Oranges"),
        "data-color-mode": String(opts.value.color?.mode ?? "scheme"),
        "data-color-scale": String(opts.value.color?.scale ?? "linear"),
        "data-color-exponent": String(opts.value.color?.exponent ?? ""),
        "data-color-steps": String(opts.value.color?.steps ?? ""),
        "data-color-reverse": String(!!opts.value.color?.reverse),
        "data-color-min": String(opts.value.color?.min ?? ""),
        "data-color-max": String(opts.value.color?.max ?? ""),
        "data-color-fill": String(opts.value.color?.fill ?? ""),
        "data-show-value": showValueMode.value,
        "data-cell-unit": String(opts.value.cellValues?.unit ?? ""),
        "data-cell-decimals": String(opts.value.cellValues?.decimals ?? ""),
        "data-yaxis-placement": String(opts.value.yAxis?.axisPlacement ?? "left"),
        "data-yaxis-label": String(opts.value.yAxis?.axisLabel ?? ""),
        "data-yaxis-unit": String(opts.value.yAxis?.unit ?? ""),
        "data-yaxis-decimals": String(opts.value.yAxis?.decimals ?? ""),
        "data-yaxis-min": String(opts.value.yAxis?.min ?? ""),
        "data-yaxis-max": String(opts.value.yAxis?.max ?? ""),
        "data-yaxis-width": String(opts.value.yAxis?.axisWidth ?? ""),
        "data-yaxis-reverse": String(!!opts.value.yAxis?.reverse),
        "data-tooltip-mode": tooltipMode.value,
        "data-tooltip-max-width": String(opts.value.tooltip?.maxWidth ?? ""),
        "data-tooltip-max-height": String(opts.value.tooltip?.maxHeight ?? ""),
        "data-tooltip-y-histogram": String(!!opts.value.tooltip?.yHistogram),
        "data-tooltip-color-scale": String(!!opts.value.tooltip?.showColorScale),
        "data-hide-from": String(
          __props.fieldConfig?.defaults?.custom?.hideFrom ? JSON.stringify(__props.fieldConfig.defaults.custom.hideFrom) : ""
        ),
        "data-annotations-show": String(opts.value.annotations?.show !== false),
        "data-annotations-clustering": String(!!opts.value.annotations?.clustering),
        "data-annotations-multi-lane": String(!!opts.value.annotations?.multiLane),
        "data-rows-layout": String(opts.value.rowsFrame?.layout ?? ""),
        "data-y-layout": yLayout.value,
        "data-y-layout-align": String(yLayoutAlign.value),
        "data-yscale-min": yScaleRange.value ? String(yScaleRange.value.min) : "",
        "data-yscale-max": yScaleRange.value ? String(yScaleRange.value.max) : "",
        "data-rows-value": String(opts.value.rowsFrame?.value ?? ""),
        "data-rows-ybucket-scale": String(
          (typeof opts.value.rowsFrame?.yBucketScale === "object" ? opts.value.rowsFrame?.yBucketScale?.type : opts.value.rowsFrame?.yBucketScale) ?? ""
        ),
        "data-scale-distribution": String(
          (typeof opts.value.scaleDistribution === "object" ? opts.value.scaleDistribution?.type : opts.value.scaleDistribution) ?? ""
        ),
        "data-exemplars-color": String(opts.value.exemplars?.color ?? ""),
        "data-filter-le": String(
          opts.value.filterValues?.le ?? (Object.keys(opts.value).length === 0 ? "-Infinity" : "1e-9")
        ),
        "data-filter-ge": String(opts.value.filterValues?.ge ?? ""),
        "data-point-count": String(heatPoints.value.length),
        "data-legend-show": String(showLegend.value)
      }, [
        noData.value ? (openBlock(), createBlock(PanelDataErrorView, {
          key: 0,
          data: __props.data,
          "field-config": __props.fieldConfig,
          "needs-time-field": true,
          "needs-number-field": true
        }, null, 8, ["data", "field-config"])) : createCommentVNode("v-if", true),
        showLegend.value ? (openBlock(), createElementBlock("div", _hoisted_2$22, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(legendStops.value, (c, i) => {
              return openBlock(), createElementBlock(
                "span",
                {
                  key: i,
                  class: "heatmap-legend__swatch",
                  style: normalizeStyle({ background: c })
                },
                null,
                4
                /* STYLE */
              );
            }),
            128
            /* KEYED_FRAGMENT */
          )),
          createElementVNode(
            "span",
            _hoisted_3$1O,
            toDisplayString(formatCellValue(valueRange.value.min)) + " – " + toDisplayString(formatCellValue(valueRange.value.max)),
            1
            /* TEXT */
          )
        ])) : createCommentVNode("v-if", true),
        !noData.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createElementVNode("div", _hoisted_4$1v, [
              createElementVNode(
                "div",
                {
                  ref_key: "chartEl",
                  ref: chartEl,
                  class: "chart",
                  "data-testid": "heatmap-cells"
                },
                null,
                512
                /* NEED_PATCH */
              ),
              createVNode(AnnotationLayer, {
                annotations: __props.data?.annotations,
                options: __props.options?.annotations,
                "x-min": __props.data?.timeRange?.from?.valueOf?.() ?? __props.data?.timeRange?.from,
                "x-max": __props.data?.timeRange?.to?.valueOf?.() ?? __props.data?.timeRange?.to
              }, null, 8, ["annotations", "options", "x-min", "x-max"])
            ]),
            showTooltip.value && hover.value ? (openBlock(), createElementBlock(
              "div",
              {
                key: 0,
                class: "heatmap-tooltip",
                "data-testid": "heatmap-tooltip",
                style: normalizeStyle(tooltipStyle.value)
              },
              [
                createElementVNode("div", _hoisted_5$1m, [
                  createElementVNode(
                    "i",
                    {
                      style: normalizeStyle({ background: hover.value.color })
                    },
                    null,
                    4
                    /* STYLE */
                  ),
                  createElementVNode(
                    "span",
                    null,
                    toDisplayString(formatCellValue(hover.value.v)),
                    1
                    /* TEXT */
                  )
                ]),
                opts.value.tooltip?.showColorScale ? (openBlock(), createElementBlock("div", _hoisted_6$1a, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(legendStops.value, (c, i) => {
                      return openBlock(), createElementBlock(
                        "span",
                        {
                          key: i,
                          style: normalizeStyle({ background: c })
                        },
                        null,
                        4
                        /* STYLE */
                      );
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true),
                opts.value.tooltip?.yHistogram ? (openBlock(), createElementBlock("div", _hoisted_7$12, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(yHistogramBins.value, (b, i) => {
                      return openBlock(), createElementBlock(
                        "div",
                        {
                          key: i,
                          class: "heatmap-tooltip__bar",
                          style: normalizeStyle({ height: b.h + "%", background: b.color })
                        },
                        null,
                        4
                        /* STYLE */
                      );
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true)
              ],
              4
              /* STYLE */
            )) : createCommentVNode("v-if", true),
            opts.value.exemplars?.color ? (openBlock(), createElementBlock("div", {
              key: 1,
              class: "heatmap-exemplars",
              "data-testid": "heatmap-exemplars",
              style: normalizeStyle({ color: String(opts.value.exemplars.color) }),
              "data-color": String(opts.value.exemplars.color)
            }, null, 12, _hoisted_8$V)) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2A);
    };
  }
});
const HeatmapRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3h, [["__scopeId", "data-v-1f002d8e"]]);
const _sfc_main$3g = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(HeatmapRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height,
        "time-range": __props.timeRange
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height", "time-range"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "heatmap",
    name: "热力图",
    description: "矩阵热力图",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3g
).useFieldConfig({
  useCustomConfig: (builder) => {
    addHideFrom(builder);
  }
}).setPanelOptions((builder) => {
  const catHeatmap = ["热力图"];
  const catYAxis = ["Y 轴"];
  const catColors = ["颜色"];
  const catTooltip = ["提示"];
  const catLegend = ["图例"];
  const catExemplars = ["样本点"];
  const catCell = ["单元格"];
  builder.addRadio(
    {
      id: "calculate",
      path: "calculate",
      name: "从数据计算",
      category: catHeatmap,
      settings: {
        options: [
          { label: "是", value: true },
          { label: "否", value: false }
        ]
      }
    },
    false
  ).addCustom(
    {
      id: "calculation.xBuckets",
      path: "calculation.xBuckets",
      name: "X 分桶",
      category: catHeatmap,
      editor: "heatmap-bucket",
      description: "X 轴分桶：mode=size|count，value 为桶大小或数量（可含 interval）",
      showIf: (c) => !!c.calculate,
      settings: { allowInterval: true }
    },
    { mode: "size" }
  ).addCustom(
    {
      id: "calculation.yBuckets",
      path: "calculation.yBuckets",
      name: "Y 分桶",
      category: catHeatmap,
      editor: "heatmap-bucket",
      description: "Y 轴分桶：mode=size|count，value 为桶大小或数量",
      showIf: (c) => !!c.calculate
    },
    { mode: "size" }
  ).addSelect(
    {
      id: "calculation.yBuckets.scale",
      path: "calculation.yBuckets.scale",
      name: "Y 分桶缩放",
      category: catHeatmap,
      settings: {
        options: [
          { label: "线性", value: "linear" },
          { label: "对数", value: "log" },
          { label: "对称对数", value: "symlog" }
        ]
      },
      showIf: (c) => !!c.calculate
    },
    "linear"
  ).addSelect(
    {
      id: "rowsFrame.yBucketScale",
      path: "rowsFrame.yBucketScale",
      name: "Y 分桶缩放",
      category: catHeatmap,
      settings: {
        options: [
          { label: "线性", value: "linear" },
          { label: "对数", value: "log" }
        ]
      },
      showIf: (c) => !c.calculate
    },
    "linear"
  ).addRadio(
    {
      id: "rowsFrame.layout",
      path: "rowsFrame.layout",
      name: "刻度对齐",
      category: catHeatmap,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "上 (LE)", value: "le" },
          { label: "中", value: "unknown" },
          { label: "下 (GE)", value: "ge" },
          // keep legacy aliases used by earlier vue defaults
          { label: "上", value: "top" },
          { label: "中(legacy)", value: "middle" },
          { label: "下", value: "bottom" }
        ]
      },
      showIf: (c) => !c.calculate
    },
    "auto"
  ).addText(
    {
      id: "rowsFrame.value",
      path: "rowsFrame.value",
      name: "值字段名",
      category: catHeatmap,
      showIf: (c) => !c.calculate
    },
    void 0
  ).addText(
    {
      id: "scaleDistribution",
      path: "scaleDistribution",
      name: "Y 轴缩放",
      category: catYAxis
    },
    void 0
  ).addRadio(
    {
      id: "yAxis.axisPlacement",
      path: "yAxis.axisPlacement",
      name: "轴位置",
      category: catYAxis,
      settings: {
        options: [
          { label: "左侧", value: "left" },
          { label: "右侧", value: "right" },
          { label: "隐藏", value: "hidden" }
        ]
      }
    },
    "left"
  ).addText(
    {
      id: "yAxis.unit",
      path: "yAxis.unit",
      name: "单位",
      category: catYAxis
    },
    void 0
  ).addNumber(
    {
      id: "yAxis.decimals",
      path: "yAxis.decimals",
      name: "小数位",
      category: catYAxis
    },
    void 0
  ).addNumber(
    {
      id: "yAxis.min",
      path: "yAxis.min",
      name: "最小值",
      category: catYAxis
    },
    void 0
  ).addNumber(
    {
      id: "yAxis.max",
      path: "yAxis.max",
      name: "最大值",
      category: catYAxis
    },
    void 0
  ).addNumber(
    {
      id: "yAxis.axisWidth",
      path: "yAxis.axisWidth",
      name: "轴宽度",
      category: catYAxis
    },
    void 0
  ).addText(
    {
      id: "yAxis.axisLabel",
      path: "yAxis.axisLabel",
      name: "轴标签",
      category: catYAxis
    },
    void 0
  ).addBoolean(
    {
      id: "yAxis.reverse",
      path: "yAxis.reverse",
      name: "反转轴",
      category: catYAxis
    },
    false
  ).addRadio(
    {
      id: "color.mode",
      path: "color.mode",
      name: "颜色模式",
      category: catColors,
      settings: {
        options: [
          { label: "方案", value: "scheme" },
          { label: "不透明度", value: "opacity" }
        ]
      }
    },
    "scheme"
  ).addText(
    {
      id: "color.fill",
      path: "color.fill",
      name: "填充色",
      category: catColors,
      showIf: (c) => c.color?.mode === "opacity"
    },
    "#3d71d9"
  ).addRadio(
    {
      id: "color.scale",
      path: "color.scale",
      name: "颜色缩放",
      category: catColors,
      settings: {
        options: [
          { label: "指数", value: "exponential" },
          { label: "线性", value: "linear" }
        ]
      },
      showIf: (c) => c.color?.mode === "opacity"
    },
    "exponential"
  ).addSlider(
    {
      id: "color.exponent",
      path: "color.exponent",
      name: "指数",
      category: catColors,
      settings: { min: 0.1, max: 2, step: 0.1 },
      showIf: (c) => c.color?.mode === "opacity" && c.color?.scale === "exponential"
    },
    0.5
  ).addSelect(
    {
      id: "color.scheme",
      path: "color.scheme",
      name: "配色方案",
      category: catColors,
      settings: {
        options: [
          { label: "Oranges", value: "Oranges" },
          { label: "Blues", value: "Blues" },
          { label: "Greens", value: "Greens" },
          { label: "Greys", value: "Greys" },
          { label: "Purples", value: "Purples" },
          { label: "Reds", value: "Reds" },
          { label: "YlOrRd", value: "YlOrRd" },
          { label: "YlOrBr", value: "YlOrBr" },
          { label: "YlGn", value: "YlGn" },
          { label: "YlGnBu", value: "YlGnBu" },
          { label: "OrRd", value: "OrRd" },
          { label: "BuGn", value: "BuGn" },
          { label: "BuPu", value: "BuPu" },
          { label: "GnBu", value: "GnBu" },
          { label: "PuBu", value: "PuBu" },
          { label: "PuBuGn", value: "PuBuGn" },
          { label: "PuRd", value: "PuRd" },
          { label: "RdPu", value: "RdPu" },
          { label: "Viridis", value: "Viridis" },
          { label: "Magma", value: "Magma" },
          { label: "Inferno", value: "Inferno" },
          { label: "Plasma", value: "Plasma" },
          { label: "Turbo", value: "Turbo" },
          { label: "Cividis", value: "Cividis" },
          { label: "Warm", value: "Warm" },
          { label: "Cool", value: "Cool" },
          { label: "Spectral", value: "Spectral" },
          { label: "RdBu", value: "RdBu" },
          { label: "RdYlBu", value: "RdYlBu" },
          { label: "RdYlGn", value: "RdYlGn" },
          { label: "BrBG", value: "BrBG" },
          { label: "PiYG", value: "PiYG" },
          { label: "PRGn", value: "PRGn" },
          { label: "PuOr", value: "PuOr" },
          { label: "RdGy", value: "RdGy" },
          { label: "Rainbow", value: "Rainbow" },
          { label: "Sinebow", value: "Sinebow" }
        ]
      },
      showIf: (c) => c.color?.mode !== "opacity"
    },
    "Oranges"
  ).addSlider(
    {
      id: "color.steps",
      path: "color.steps",
      name: "色阶步数",
      category: catColors,
      settings: { min: 2, max: 128, step: 1 }
    },
    64
  ).addBoolean(
    {
      id: "color.reverse",
      path: "color.reverse",
      name: "反转颜色",
      category: catColors
    },
    false
  ).addNumber(
    {
      id: "color.min",
      path: "color.min",
      name: "颜色最小值",
      category: catColors
    },
    void 0
  ).addNumber(
    {
      id: "color.max",
      path: "color.max",
      name: "颜色最大值",
      category: catColors
    },
    void 0
  ).addText(
    {
      id: "cellValues.unit",
      path: "cellValues.unit",
      name: "单元格单位",
      category: catCell
    },
    void 0
  ).addNumber(
    {
      id: "cellValues.decimals",
      path: "cellValues.decimals",
      name: "单元格小数位",
      category: catCell
    },
    void 0
  ).addRadio(
    {
      id: "showValue",
      path: "showValue",
      name: "显示数值",
      category: catCell,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "始终", value: "always" },
          { label: "从不", value: "never" }
        ]
      }
    },
    "auto"
  ).addSlider(
    {
      id: "cellGap",
      path: "cellGap",
      name: "单元格间距",
      category: catCell,
      settings: { min: 0, max: 25, step: 1 }
    },
    1
  ).addNumber(
    {
      id: "cellRadius",
      path: "cellRadius",
      name: "单元格圆角",
      category: catCell,
      settings: { min: 0, max: 100 }
    },
    0
  ).addNumber(
    {
      id: "filterValues.le",
      path: "filterValues.le",
      name: "隐藏 ≤ 的值",
      category: catCell
    },
    1e-9
  ).addNumber(
    {
      id: "filterValues.ge",
      path: "filterValues.ge",
      name: "隐藏 ≥ 的值",
      category: catCell
    },
    void 0
  ).addRadio(
    {
      id: "tooltip.mode",
      path: "tooltip.mode",
      name: "提示模式",
      category: catTooltip,
      settings: {
        options: [
          { label: "单个", value: "single" },
          { label: "全部", value: "multi" },
          { label: "隐藏", value: "none" }
        ]
      }
    },
    "single"
  ).addBoolean(
    {
      id: "tooltip.yHistogram",
      path: "tooltip.yHistogram",
      name: "显示 Y 直方图",
      category: catTooltip,
      showIf: (c) => c.tooltip?.mode === "single"
    },
    false
  ).addBoolean(
    {
      id: "tooltip.showColorScale",
      path: "tooltip.showColorScale",
      name: "提示中显示色阶",
      category: catTooltip,
      showIf: (c) => c.tooltip?.mode === "single"
    },
    true
  ).addNumber(
    {
      id: "tooltip.maxWidth",
      path: "tooltip.maxWidth",
      name: "最大宽度",
      category: catTooltip,
      showIf: (c) => c.tooltip?.mode !== "none"
    },
    void 0
  ).addNumber(
    {
      id: "tooltip.maxHeight",
      path: "tooltip.maxHeight",
      name: "最大高度",
      category: catTooltip,
      showIf: (c) => c.tooltip?.mode === "multi"
    },
    void 0
  ).addBoolean(
    {
      id: "legend.show",
      path: "legend.show",
      name: "显示图例",
      category: catLegend
    },
    true
  ).addText(
    {
      id: "exemplars.color",
      path: "exemplars.color",
      name: "样本点颜色",
      category: catExemplars
    },
    "rgba(255,0,255,0.7)"
  );
  addAnnotationOptions(builder);
}).setDataSupport({ annotations: true }).setRuntimeConsumedPaths([
  "custom.hideFrom",
  "annotations.show",
  "annotations.multiLane",
  "annotations.clustering",
  "annotations",
  "calculate",
  "calculation.xBuckets",
  "calculation.yBuckets",
  "calculation.yBuckets.scale",
  "selectionMode",
  "cellGap",
  "cellRadius",
  "cellValues.decimals",
  "cellValues.unit",
  "color.mode",
  "color.scheme",
  "color.fill",
  "color.scale",
  "color.exponent",
  "color.max",
  "color.min",
  "color.reverse",
  "color.steps",
  "exemplars.color",
  "filterValues.ge",
  "filterValues.le",
  "legend.show",
  "rowsFrame.layout",
  "rowsFrame.value",
  "rowsFrame.yBucketScale",
  "scaleDistribution",
  "showValue",
  "tooltip.maxHeight",
  "tooltip.maxWidth",
  "tooltip.mode",
  "tooltip.showColorScale",
  "tooltip.yHistogram",
  "yAxis.axisLabel",
  "yAxis.axisPlacement",
  "yAxis.axisWidth",
  "yAxis.decimals",
  "yAxis.max",
  "yAxis.min",
  "yAxis.reverse",
  "yAxis.unit"
]).register();
const W = 100;
const H = 90;
function framesToGraph(series) {
  if (!series?.length) return { nodes: [], edges: [] };
  const nodesFrame = series.find(
    (f) => /node/i.test(f.name ?? "") || f.meta?.preferredVisualisationType === "nodeGraph" || f.fields.some(
      (fld) => /^id$/i.test(fld.name) || /node.?id/i.test(fld.name)
    )
  );
  const edgesFrame = series.find(
    (f) => /edge/i.test(f.name ?? "") || f.fields.some((fld) => /source|from/i.test(fld.name))
  );
  let nodes = [];
  if (nodesFrame?.fields?.length) {
    const idf = nodesFrame.fields.find(
      (f) => /^id$/i.test(f.name) || /node.?id/i.test(f.name)
    );
    if (!idf) return { nodes: [], edges: [] };
    const title = nodesFrame.fields.find(
      (f) => /title|name|label/i.test(f.name)
    );
    const main = nodesFrame.fields.find(
      (f) => /mainstat|arc__/i.test(f.name) && f.type === "number"
    );
    const secondary = nodesFrame.fields.find(
      (f) => /secondarystat/i.test(f.name)
    );
    const n = Math.min(nodesFrame.length ?? idf?.values.length ?? 0, 48);
    for (let i = 0; i < n; i++) {
      nodes.push({
        id: String(idf.values[i] ?? i),
        label: String(title?.values[i] ?? idf.values[i] ?? i),
        x: 0,
        y: 0,
        mainStat: main ? Number(main.values[i]) : void 0,
        secondaryStat: secondary ? Number(secondary.values[i]) : void 0
      });
    }
  }
  let edges = [];
  if (edgesFrame?.fields?.length) {
    const from = edgesFrame.fields.find((f) => /source|from/i.test(f.name)) ?? edgesFrame.fields[0];
    const to = edgesFrame.fields.find((f) => /target|to/i.test(f.name)) ?? edgesFrame.fields[1];
    const main = edgesFrame.fields.find(
      (f) => /mainstat|value/i.test(f.name) && f.type === "number"
    );
    const n = Math.min(edgesFrame.length ?? from?.values.length ?? 0, 80);
    for (let i = 0; i < n; i++) {
      edges.push({
        from: String(from.values[i]),
        to: String(to.values[i]),
        mainStat: main ? Number(main.values[i]) : void 0
      });
    }
  }
  if (!nodes.length) return { nodes: [], edges: [] };
  return layoutGraph({ nodes, edges }, "force");
}
function layoutGraph(model, mode2 = "force", iterations = 40) {
  const m = mode2 === "default" || !mode2 ? "force" : mode2;
  if (m === "circular") return layoutCircular(model);
  if (m === "grid") return layoutGrid(model);
  if (m === "layered" || m === "hierarchy" || m === "layered-lr")
    return layoutLayered(model);
  return layoutForce(model, iterations);
}
function layoutCircular(model) {
  const n = model.nodes.length || 1;
  const cx = W / 2;
  const cy = H / 2;
  const r = Math.min(W, H) * 0.35;
  const nodes = model.nodes.map((node, i) => {
    const a = i / n * Math.PI * 2 - Math.PI / 2;
    return { ...node, x: cx + r * Math.cos(a), y: cy + r * Math.sin(a) };
  });
  return { nodes, edges: model.edges };
}
function layoutGrid(model) {
  const n = model.nodes.length || 1;
  const cols = Math.ceil(Math.sqrt(n));
  const cellW = W / (cols + 1);
  const rows = Math.ceil(n / cols);
  const cellH = H / (rows + 1);
  const nodes = model.nodes.map((node, i) => {
    const col2 = i % cols;
    const row = Math.floor(i / cols);
    return { ...node, x: cellW * (col2 + 1), y: cellH * (row + 1) };
  });
  return { nodes, edges: model.edges };
}
function layoutLayered(model) {
  const ids = new Set(model.nodes.map((n) => n.id));
  const indeg = /* @__PURE__ */ new Map();
  const outs = /* @__PURE__ */ new Map();
  for (const id of ids) {
    indeg.set(id, 0);
    outs.set(id, []);
  }
  for (const e of model.edges) {
    if (!ids.has(e.from) || !ids.has(e.to)) continue;
    indeg.set(e.to, (indeg.get(e.to) ?? 0) + 1);
    outs.get(e.from).push(e.to);
  }
  const layers = [];
  let frontier = [...ids].filter((id) => (indeg.get(id) ?? 0) === 0);
  const placed = /* @__PURE__ */ new Set();
  while (frontier.length && placed.size < ids.size) {
    layers.push(frontier);
    frontier.forEach((id) => placed.add(id));
    const next = [];
    for (const id of frontier) {
      for (const t2 of outs.get(id) ?? []) {
        if (placed.has(t2)) continue;
        const parentsLeft = model.edges.filter(
          (e) => e.to === t2 && !placed.has(e.from)
        ).length;
        if (parentsLeft === 0) next.push(t2);
      }
    }
    frontier = [...new Set(next)];
    if (!frontier.length) {
      const rest = [...ids].filter((id) => !placed.has(id));
      if (rest.length) {
        layers.push(rest);
        rest.forEach((id) => placed.add(id));
      }
      break;
    }
  }
  if (!layers.length) return layoutGrid(model);
  const nodes = model.nodes.map((node) => {
    let layer = layers.findIndex((L2) => L2.includes(node.id));
    if (layer < 0) layer = layers.length - 1;
    const L = layers[layer];
    const idx = Math.max(0, L.indexOf(node.id));
    const x = (layer + 1) / (layers.length + 1) * W;
    const y = (idx + 1) / (L.length + 1) * H;
    return { ...node, x, y };
  });
  return { nodes, edges: model.edges };
}
function layoutForce(model, iterations = 40) {
  const nodes = model.nodes.map((n, i) => {
    if (n.x || n.y) return { ...n, vx: 0, vy: 0 };
    const a = i / Math.max(1, model.nodes.length) * Math.PI * 2;
    return {
      ...n,
      x: 50 + 20 * Math.cos(a),
      y: 45 + 20 * Math.sin(a),
      vx: 0,
      vy: 0
    };
  });
  const edges = model.edges;
  for (let it = 0; it < iterations; it++) {
    for (let i = 0; i < nodes.length; i++) {
      for (let j = i + 1; j < nodes.length; j++) {
        let dx = nodes[i].x - nodes[j].x;
        let dy = nodes[i].y - nodes[j].y;
        let dist = Math.hypot(dx, dy) || 0.1;
        const force = 120 / (dist * dist);
        dx = dx / dist * force;
        dy = dy / dist * force;
        nodes[i].vx = (nodes[i].vx ?? 0) + dx;
        nodes[i].vy = (nodes[i].vy ?? 0) + dy;
        nodes[j].vx = (nodes[j].vx ?? 0) - dx;
        nodes[j].vy = (nodes[j].vy ?? 0) - dy;
      }
    }
    for (const e of edges) {
      const a = nodes.find((n) => n.id === e.from);
      const b = nodes.find((n) => n.id === e.to);
      if (!a || !b) continue;
      let dx = b.x - a.x;
      let dy = b.y - a.y;
      const dist = Math.hypot(dx, dy) || 0.1;
      const force = (dist - 25) * 0.05;
      dx = dx / dist * force;
      dy = dy / dist * force;
      a.vx = (a.vx ?? 0) + dx;
      a.vy = (a.vy ?? 0) + dy;
      b.vx = (b.vx ?? 0) - dx;
      b.vy = (b.vy ?? 0) - dy;
    }
    for (const n of nodes) {
      n.x = Math.min(W - 5, Math.max(5, n.x + (n.vx ?? 0) * 0.6));
      n.y = Math.min(H - 5, Math.max(5, n.y + (n.vy ?? 0) * 0.6));
      n.vx = (n.vx ?? 0) * 0.6;
      n.vy = (n.vy ?? 0) * 0.6;
    }
  }
  return { nodes, edges };
}
const _hoisted_1$2z = ["data-layout", "data-zoom-mode", "data-nodes-arcs", "data-arcs", "data-main-stat-unit", "data-nodes-main-stat-unit", "data-nodes-secondary-stat-unit", "data-edges-main-stat-unit", "data-edges-secondary-stat-unit", "data-secondary-stat-unit", "data-show-nodes", "data-show-edges", "data-node-count", "data-edge-count", "data-selected", "data-arc-count", "data-edge-main-stat-unit"];
const _hoisted_2$21 = {
  key: 0,
  viewBox: "0 0 100 90",
  class: "svg",
  role: "img",
  "aria-label": "节点图"
};
const _hoisted_3$1N = ["x1", "y1", "x2", "y2", "stroke-width"];
const _hoisted_4$1u = ["data-id", "onClick"];
const _hoisted_5$1l = ["cx", "cy", "r", "fill", "stroke-width"];
const _hoisted_6$19 = ["x", "y"];
const _hoisted_7$11 = ["x", "y"];
const _hoisted_8$U = { class: "ctx__title" };
const _hoisted_9$R = {
  key: 0,
  class: "ctx__meta"
};
const _hoisted_10$J = {
  key: 2,
  class: "detail",
  "data-testid": "nodegraph-detail"
};
const _hoisted_11$C = { key: 0 };
const _hoisted_12$v = { key: 1 };
const _hoisted_13$v = {
  key: 3,
  class: "panel-empty",
  "data-testid": "nodegraph-empty"
};
const _hoisted_14$u = {
  key: 4,
  class: "no-data-msg",
  "data-testid": "nodegraph-empty"
};
const _sfc_main$3f = /* @__PURE__ */ defineComponent({
  __name: "NodeGraphRenderer",
  props: {
    data: {},
    options: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const layoutMode = computed(
      () => String(
        opts.value.layoutAlgorithm ?? opts.value.layout?.mode ?? opts.value.layout ?? opts.value.nodes?.layout ?? "force"
      )
    );
    const zoomMode = computed(() => String(opts.value.zoomMode ?? "cooperative"));
    const mainStatUnit = computed(
      () => String(
        opts.value.mainStatUnit ?? opts.value.nodes?.mainStatUnit ?? opts.value.edges?.mainStatUnit ?? ""
      )
    );
    const secondaryStatUnit = computed(
      () => String(
        opts.value.secondaryStatUnit ?? opts.value.nodes?.secondaryStatUnit ?? opts.value.edges?.secondaryStatUnit ?? ""
      )
    );
    const showNodes = computed(
      () => opts.value.nodes !== false && opts.value.nodes !== 0
    );
    const showEdges = computed(
      () => opts.value.edges !== false && opts.value.edges !== 0
    );
    const edgeMainStatUnit = computed(
      () => String(opts.value.edges?.mainStatUnit ?? opts.value.mainStatUnit ?? "")
    );
    const arcCount = computed(() => {
      const arcs = opts.value.nodes?.arcs ?? opts.value.arcs;
      if (Array.isArray(arcs)) return arcs.length;
      if (typeof arcs === "string" && arcs.trim()) {
        try {
          const p = JSON.parse(arcs);
          return Array.isArray(p) ? p.length : 0;
        } catch {
          return 0;
        }
      }
      return 0;
    });
    const baseGraph = computed(() => framesToGraph(props.data?.series));
    const graph = computed(() => layoutGraph(baseGraph.value, layoutMode.value));
    const hasSeries = computed(() => (props.data?.series?.length ?? 0) > 0);
    const nodeRadius = computed(() => Number(opts.value.nodeRadius ?? 7));
    const showUnits = computed(
      () => Boolean(mainStatUnit.value || secondaryStatUnit.value)
    );
    const arcColors = computed(() => {
      const arcs = opts.value.nodes?.arcs;
      if (Array.isArray(arcs) && arcs.length)
        return arcs.map((a) => String(a.color ?? "var(--grafana-primary)"));
      return ["var(--grafana-primary)", "#73bf69", "#f2cc0c"];
    });
    const selected = ref(null);
    const menu = ref(null);
    function onNodeClick(n, evt) {
      selected.value = n;
      menu.value = { x: evt.offsetX, y: evt.offsetY, node: n };
    }
    function closeMenu() {
      menu.value = null;
    }
    const byId2 = computed(() => new Map(graph.value.nodes.map((n) => [n.id, n])));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "nodegraph",
        "data-testid": "panel-nodegraph",
        "data-layout": String(layoutMode.value),
        "data-zoom-mode": zoomMode.value,
        "data-nodes-arcs": String((opts.value.nodes?.arcs ?? opts.value.arcs ?? []).length || (opts.value.nodes?.arcs || opts.value.arcs ? 1 : 0)),
        "data-arcs": String((opts.value.arcs ?? opts.value.nodes?.arcs ?? []).length || (opts.value.arcs || opts.value.nodes?.arcs ? 1 : 0)),
        "data-main-stat-unit": mainStatUnit.value,
        "data-nodes-main-stat-unit": String(opts.value.nodes?.mainStatUnit ?? mainStatUnit.value),
        "data-nodes-secondary-stat-unit": String(opts.value.nodes?.secondaryStatUnit ?? secondaryStatUnit.value),
        "data-edges-main-stat-unit": String(opts.value.edges?.mainStatUnit ?? edgeMainStatUnit.value),
        "data-edges-secondary-stat-unit": String(opts.value.edges?.secondaryStatUnit ?? ""),
        "data-secondary-stat-unit": secondaryStatUnit.value,
        "data-show-nodes": String(showNodes.value),
        "data-show-edges": String(showEdges.value),
        "data-node-count": String(graph.value.nodes.length),
        "data-edge-count": String(graph.value.edges.length),
        "data-selected": selected.value?.id ?? "",
        "data-arc-count": String(arcCount.value),
        "data-edge-main-stat-unit": edgeMainStatUnit.value,
        onClick: closeMenu
      }, [
        graph.value.nodes.length ? (openBlock(), createElementBlock("svg", _hoisted_2$21, [
          showEdges.value ? (openBlock(true), createElementBlock(
            Fragment,
            { key: 0 },
            renderList(graph.value.edges, (e, i) => {
              return openBlock(), createElementBlock("line", {
                key: "e" + i,
                x1: byId2.value.get(e.from)?.x ?? 0,
                y1: byId2.value.get(e.from)?.y ?? 0,
                x2: byId2.value.get(e.to)?.x ?? 0,
                y2: byId2.value.get(e.to)?.y ?? 0,
                class: "edge",
                "stroke-width": e.mainStat != null ? Math.min(3, 0.5 + e.mainStat / 80) : 1
              }, null, 8, _hoisted_3$1N);
            }),
            128
            /* KEYED_FRAGMENT */
          )) : createCommentVNode("v-if", true),
          showNodes.value ? (openBlock(true), createElementBlock(
            Fragment,
            { key: 1 },
            renderList(graph.value.nodes, (n) => {
              return openBlock(), createElementBlock("g", {
                key: n.id,
                class: normalizeClass(["node", { selected: selected.value?.id === n.id }]),
                "data-testid": "nodegraph-node",
                "data-id": n.id,
                onClick: withModifiers(($event) => onNodeClick(n, $event), ["stop"])
              }, [
                createElementVNode("circle", {
                  cx: n.x,
                  cy: n.y,
                  r: nodeRadius.value,
                  fill: n.color ?? arcColors.value[0],
                  stroke: "#fff",
                  "stroke-width": selected.value?.id === n.id ? 0.8 : 0.3
                }, null, 8, _hoisted_5$1l),
                createElementVNode("text", {
                  x: n.x,
                  y: n.y + nodeRadius.value + 4,
                  "text-anchor": "middle",
                  class: "label"
                }, toDisplayString(n.label), 9, _hoisted_6$19),
                n.mainStat != null ? (openBlock(), createElementBlock("text", {
                  key: 0,
                  x: n.x,
                  y: n.y + 1.5,
                  "text-anchor": "middle",
                  class: "stat"
                }, toDisplayString(n.mainStat) + toDisplayString(showUnits.value && mainStatUnit.value ? mainStatUnit.value : ""), 9, _hoisted_7$11)) : createCommentVNode("v-if", true)
              ], 10, _hoisted_4$1u);
            }),
            128
            /* KEYED_FRAGMENT */
          )) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true),
        menu.value ? (openBlock(), createElementBlock(
          "div",
          {
            key: 1,
            class: "ctx",
            "data-testid": "nodegraph-context-menu",
            style: normalizeStyle({ left: menu.value.x + "px", top: menu.value.y + "px" }),
            onClick: _cache[2] || (_cache[2] = withModifiers(() => {
            }, ["stop"]))
          },
          [
            createElementVNode(
              "div",
              _hoisted_8$U,
              toDisplayString(menu.value.node.label),
              1
              /* TEXT */
            ),
            createElementVNode("button", {
              type: "button",
              "data-testid": "nodegraph-focus",
              onClick: _cache[0] || (_cache[0] = ($event) => menu.value = null)
            }, " 聚焦节点 "),
            createElementVNode("button", {
              type: "button",
              onClick: _cache[1] || (_cache[1] = ($event) => {
                selected.value = menu.value.node;
                menu.value = null;
              })
            }, " 查看详情 "),
            menu.value.node.mainStat != null ? (openBlock(), createElementBlock(
              "div",
              _hoisted_9$R,
              " 主指标: " + toDisplayString(menu.value.node.mainStat),
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true)
          ],
          4
          /* STYLE */
        )) : createCommentVNode("v-if", true),
        selected.value ? (openBlock(), createElementBlock("aside", _hoisted_10$J, [
          createElementVNode(
            "strong",
            null,
            toDisplayString(selected.value.label),
            1
            /* TEXT */
          ),
          createElementVNode(
            "div",
            null,
            "ID: " + toDisplayString(selected.value.id),
            1
            /* TEXT */
          ),
          selected.value.mainStat != null ? (openBlock(), createElementBlock(
            "div",
            _hoisted_11$C,
            " 主指标: " + toDisplayString(selected.value.mainStat) + toDisplayString(mainStatUnit.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          selected.value.secondaryStat != null ? (openBlock(), createElementBlock(
            "div",
            _hoisted_12$v,
            " 次指标: " + toDisplayString(selected.value.secondaryStat) + toDisplayString(secondaryStatUnit.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          createElementVNode("button", {
            type: "button",
            onClick: _cache[3] || (_cache[3] = ($event) => selected.value = null)
          }, "关闭")
        ])) : createCommentVNode("v-if", true),
        createCommentVNode(" series empty → panel-empty; series present but not topology → noDataMsg + zoom chrome "),
        !graph.value.nodes.length && !hasSeries.value ? (openBlock(), createElementBlock("div", _hoisted_13$v, [..._cache[4] || (_cache[4] = [
          createElementVNode(
            "p",
            { class: "panel-empty__msg" },
            "回复中未找到数据",
            -1
            /* CACHED */
          )
        ])])) : !graph.value.nodes.length ? (openBlock(), createElementBlock("div", _hoisted_14$u, " 没有数据 ")) : createCommentVNode("v-if", true),
        _cache[5] || (_cache[5] = createStaticVNode('<div class="view-controls" data-testid="nodegraph-view-controls" aria-hidden="true" data-v-64c6beb2><div class="view-controls__btns" data-v-64c6beb2><button type="button" class="vc-btn" tabindex="-1" aria-label="Zoom in" data-v-64c6beb2><svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" data-v-64c6beb2><circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" data-v-64c6beb2></circle><path d="M12 8v8M8 12h8" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" data-v-64c6beb2></path></svg></button><button type="button" class="vc-btn" tabindex="-1" aria-label="Zoom out" data-v-64c6beb2><svg viewBox="0 0 24 24" width="16" height="16" aria-hidden="true" data-v-64c6beb2><circle cx="12" cy="12" r="9" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" data-v-64c6beb2></circle><path d="M8 12h8" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" data-v-64c6beb2></path></svg></button></div></div>', 1))
      ], 8, _hoisted_1$2z);
    };
  }
});
const NodeGraphRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3f, [["__scopeId", "data-v-64c6beb2"]]);
const _sfc_main$3e = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(NodeGraphRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "nodeGraph",
    name: "节点图",
    description: "服务拓扑 / 节点关系图",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$3e
).setPanelOptions((builder) => {
  const cat = ["节点图"];
  builder.addSelect(
    {
      id: "zoomMode",
      path: "zoomMode",
      name: "缩放模式",
      category: cat,
      settings: {
        options: [
          {
            label: "协作",
            value: "cooperative",
            description: "允许页面正常滚动"
          },
          {
            label: "独占",
            value: "greedy",
            description: "响应全部缩放手势"
          }
        ]
      }
    },
    "cooperative"
  ).addSelect(
    {
      id: "layoutAlgorithm",
      path: "layoutAlgorithm",
      name: "布局算法",
      category: cat,
      settings: {
        options: [
          { label: "分层", value: "layered" },
          { label: "力导向", value: "force" },
          { label: "网格", value: "grid" },
          { label: "环形", value: "circular" }
        ]
      }
    },
    "layered"
  ).addUnit(
    {
      id: "nodes.mainStatUnit",
      path: "nodes.mainStatUnit",
      name: "节点主统计单位",
      category: ["节点"]
    },
    ""
  ).addUnit(
    {
      id: "nodes.secondaryStatUnit",
      path: "nodes.secondaryStatUnit",
      name: "节点次统计单位",
      category: ["节点"]
    },
    ""
  ).addTextArea(
    {
      id: "nodes.arcs",
      path: "nodes.arcs",
      name: "弧段",
      description: 'JSON 数组，如 [{"color":"#f00","field":"error"}]',
      category: ["节点"]
    },
    "[]"
  ).addUnit(
    {
      id: "edges.mainStatUnit",
      path: "edges.mainStatUnit",
      name: "边主统计单位",
      category: ["边"]
    },
    ""
  ).addUnit(
    {
      id: "edges.secondaryStatUnit",
      path: "edges.secondaryStatUnit",
      name: "边次统计单位",
      category: ["边"]
    },
    ""
  ).addCustom({
    id: "nodes",
    path: "nodes",
    name: "节点配置",
    category: cat,
    editor: "text"
  }).addCustom({
    id: "edges",
    path: "edges",
    name: "边配置",
    category: cat,
    editor: "text"
  }).addUnit(
    {
      id: "mainStatUnit",
      path: "mainStatUnit",
      name: "主统计单位（兼容）",
      category: cat
    },
    void 0
  ).addUnit(
    {
      id: "secondaryStatUnit",
      path: "secondaryStatUnit",
      name: "次统计单位（兼容）",
      category: cat
    },
    void 0
  ).addText(
    {
      id: "arcs",
      path: "arcs",
      name: "弧（兼容）",
      category: cat
    },
    void 0
  );
}).setRuntimeConsumedPaths([
  "zoomMode",
  "layoutAlgorithm",
  "nodes.mainStatUnit",
  "nodes.secondaryStatUnit",
  "nodes.arcs",
  "edges.mainStatUnit",
  "edges.secondaryStatUnit",
  "mainStatUnit",
  "secondaryStatUnit",
  "arcs",
  "nodes",
  "edges"
]).register();
const _hoisted_1$2y = {
  class: "panel-content-only",
  "data-testid": "panel-content-only",
  "data-panel-type": "xychart"
};
const _hoisted_2$20 = ["data-x-field", "data-dims-x", "data-dims-frame", "data-dims-y", "data-fill-opacity", "data-point-size-fixed", "data-point-size", "data-point-size-min", "data-point-size-max", "data-point-shape", "data-point-symbol", "data-exclude-series", "data-show-lines", "data-line-width", "data-show", "data-legend", "data-legend-display-mode", "data-legend-placement", "data-tooltip-mode", "data-tooltip-sort", "data-line-style", "data-point-stroke-width", "data-mapping", "data-series-count"];
const _hoisted_3$1M = { class: "chart-box" };
const _hoisted_4$1t = {
  key: 0,
  class: "legend",
  "data-testid": "xychart-legend",
  "data-shared-legend": "viz-legend"
};
const _hoisted_5$1k = { class: "name" };
const _sfc_main$3d = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    useCssVars((_ctx) => ({
      "v1d562e2a": chartHeightCss.value
    }));
    const props = __props;
    const el = ref(null);
    const opts = computed(() => props.options ?? {});
    const custom = computed(
      () => props.fieldConfig?.defaults?.custom ?? {}
    );
    function merged(key, fallback) {
      const o = opts.value[key];
      if (o !== void 0 && o !== null && o !== "") return o;
      const c = custom.value[key];
      if (c !== void 0 && c !== null && c !== "") return c;
      return fallback;
    }
    function resolveFieldName(spec) {
      if (spec == null) return "";
      if (typeof spec === "string") return spec;
      const s = spec;
      if (s.fixed != null) return String(s.fixed);
      if (s.matcher?.options != null) return String(s.matcher.options);
      if (s.options != null) return String(s.options);
      return "";
    }
    const prep = computed(() => {
      const frames = props.data?.series ?? [];
      if (!frames.length) {
        return {
          warn: "无数据",
          series: []
        };
      }
      const mapping = String(opts.value.mapping ?? "auto");
      const mappedSeries = Array.isArray(opts.value.series) && opts.value.series.length ? opts.value.series : [{}];
      const dims = opts.value.dims ?? {};
      const legacyX = opts.value.xField ? String(opts.value.xField) : dims.x ? String(dims.x) : "";
      const out = [];
      let seriesIndex = 0;
      const fillOpacity = Number(merged("fillOpacity", 50));
      const pointSizeRaw = merged("pointSize", 5);
      const pointSizeObj = typeof pointSizeRaw === "object" && pointSizeRaw ? pointSizeRaw : null;
      const pointSize = Number(
        pointSizeObj ? pointSizeObj.fixed ?? pointSizeObj.min ?? 5 : pointSizeRaw ?? 5
      );
      const pointSizeMin = pointSizeObj?.min != null ? Number(pointSizeObj.min) : void 0;
      const pointSizeMax = pointSizeObj?.max != null ? Number(pointSizeObj.max) : void 0;
      const pointSymbol = String(
        merged("pointSymbol", opts.value.pointSymbol ?? "circle")
      );
      const excludeSeries = new Set(
        (Array.isArray(opts.value.excludeSeries) ? opts.value.excludeSeries : String(opts.value.excludeSeries || "").split(/[,\s]+/).filter(Boolean)).map(String)
      );
      const showMode = String(merged("show", "points"));
      const showLines = showMode === "lines" || showMode === "points+lines" || opts.value.showLines === true;
      const lineWidth = showLines ? Number(merged("lineWidth", 1)) : 0;
      const dimsFrame = dims.frame != null && dims.frame !== "" ? Number(dims.frame) : null;
      for (const seriesCfg of mappedSeries) {
        if (mapping === "manual") {
          const hasX = resolveFieldName(seriesCfg?.x) || seriesCfg?.x?.matcher;
          const hasY = resolveFieldName(seriesCfg?.y) || seriesCfg?.y?.matcher;
          if (!hasX || !hasY) continue;
        }
        for (let frameIndex = 0; frameIndex < frames.length; frameIndex++) {
          const frame = frames[frameIndex];
          if (dimsFrame != null && Number.isFinite(dimsFrame) && frameIndex !== dimsFrame) continue;
          const onlyNum = frame.fields.filter((f) => f.type === "number");
          if (!onlyNum.length) continue;
          const xName = resolveFieldName(seriesCfg?.x) || legacyX;
          let xField = xName ? onlyNum.find((f) => f.name === xName) : onlyNum[0];
          if (!xField) xField = onlyNum[0];
          if (!xField) continue;
          const yWanted = resolveFieldName(seriesCfg?.y);
          for (const yField of onlyNum) {
            if (yField === xField) continue;
            if (yWanted && yField.name !== yWanted) continue;
            if (mapping === "manual" && !yWanted) continue;
            const seriesLabel = getFieldDisplayName(yField, frame, frames);
            if (excludeSeries.has(yField.name) || excludeSeries.has(seriesLabel) || excludeSeries.has(String(seriesIndex))) {
              continue;
            }
            const cfg = {
              ...yField.config ?? {},
              ...props.fieldConfig?.defaults ?? {}
            };
            const color = seriesCfg?.pointColor && String(seriesCfg.pointColor) || getFieldSeriesColor(String(yField.name || "series"), seriesIndex, {
              ...cfg,
              color: cfg.color ?? { mode: "palette-classic" }
            }) || getFieldColor(
              Number(yField.values[yField.values.length - 1] ?? 0),
              cfg
            ) || "#73BF69";
            const label = seriesCfg?.name && String(seriesCfg.name) ? String(seriesCfg.name) : getFieldDisplayName(yField, frame, frames);
            let size = pointSize;
            if (pointSizeMin != null && pointSizeMax != null) {
              const vals = yField.values.map((v) => Math.abs(Number(v))).filter((n) => Number.isFinite(n));
              const vmin = vals.length ? Math.min(...vals) : 0;
              const vmax = vals.length ? Math.max(...vals) : 1;
              const span = vmax - vmin || 1;
              const last = Math.abs(
                Number(yField.values[yField.values.length - 1] ?? 0)
              );
              const t2 = (last - vmin) / span;
              size = pointSizeMin + t2 * (pointSizeMax - pointSizeMin);
            }
            out.push({
              label,
              color: String(color),
              points: yField.values.map((y, row) => ({
                x: Number(xField.values[row] ?? row),
                y: y == null ? null : Number(y)
              })),
              fillOpacity: showLines ? fillOpacity : 0,
              lineWidth,
              pointSize: size,
              pointStrokeWidth: Number(merged("pointStrokeWidth", opts.value.pointStrokeWidth ?? 1)),
              lineStyle: merged("lineStyle", opts.value.lineStyle),
              pointShape: String(
                merged("pointShape", pointSymbol === "square" ? "square" : "circle")
              ),
              showPoints: "always",
              lineInterpolation: String(merged("lineInterpolation", "linear"))
            });
            seriesIndex++;
            if (mapping === "manual") break;
          }
        }
      }
      if (!out.length) {
        return {
          warn: "无数据",
          series: []
        };
      }
      return { warn: void 0, series: out };
    });
    const showError = computed(() => {
      if (props.data?.state === "Loading") return false;
      return Boolean(prep.value.warn) || !prep.value.series.length;
    });
    const series = computed(() => showError.value ? [] : prep.value.series);
    const width2 = computed(() => props.width || 400);
    const height2 = computed(() => {
      const place = String(opts.value?.legend?.placement ?? "bottom");
      const show = opts.value?.legend?.showLegend !== false && series.value.length > 0;
      const reserve = show && place === "bottom" ? 32 : 0;
      return Math.max((props.height || 200) - reserve, 40);
    });
    const chartHeightCss = computed(() => `${height2.value}px`);
    const xFieldAttr = computed(() => {
      if (opts.value.xField) return String(opts.value.xField);
      const series0 = opts.value.series?.[0];
      const n = resolveFieldName(series0?.x);
      if (n) return n;
      const frames = props.data?.series ?? [];
      const nums = frames[0]?.fields?.filter((f) => f.type === "number") ?? [];
      return nums[0]?.name ?? "";
    });
    const pointSizeAttr = computed(() => {
      const raw = merged("pointSize", 5);
      if (typeof raw === "object" && raw) return String(raw.fixed ?? 5);
      return String(raw ?? 5);
    });
    const pointShapeAttr = computed(
      () => String(
        merged(
          "pointShape",
          opts.value.pointSymbol === "square" || merged("pointSymbol") === "square" ? "square" : "circle"
        )
      )
    );
    const pointSymbolAttr = computed(
      () => String(merged("pointSymbol", opts.value.pointSymbol ?? pointShapeAttr.value))
    );
    const excludeSeriesAttr = computed(() => {
      const ex = opts.value.excludeSeries;
      if (Array.isArray(ex)) return ex.join(",");
      return String(ex ?? "");
    });
    const pointSizeMinAttr = computed(() => {
      const raw = merged("pointSize", 5);
      if (typeof raw === "object" && raw && raw.min != null)
        return String(raw.min);
      return "";
    });
    const pointSizeMaxAttr = computed(() => {
      const raw = merged("pointSize", 5);
      if (typeof raw === "object" && raw && raw.max != null)
        return String(raw.max);
      return "";
    });
    const showLinesAttr = computed(() => {
      const show = String(merged("show", "points"));
      return String(
        show === "lines" || show === "points+lines" || opts.value.showLines === true
      );
    });
    const lineWidthAttr = computed(
      () => String(merged("lineWidth", showLinesAttr.value === "true" ? 1 : 0))
    );
    const showModeAttr = computed(() => String(merged("show", "points")));
    const legendAttr = computed(
      () => String(opts.value?.legend?.showLegend !== false)
    );
    const mappingAttr = computed(() => String(opts.value.mapping ?? "auto"));
    const seriesCountAttr = computed(() => String(series.value.length));
    const pointStrokeWidthAttr = computed(
      () => String(merged("pointStrokeWidth", opts.value.pointStrokeWidth ?? 1))
    );
    const lineStyleAttr = computed(() => {
      const ls = merged("lineStyle", opts.value.lineStyle);
      if (ls == null) return "";
      if (typeof ls === "string") return ls;
      if (typeof ls === "object") {
        const o = ls;
        return String(o.fill ?? o.dash?.join?.(",") ?? JSON.stringify(ls));
      }
      return String(ls);
    });
    const legendDisplayModeAttr = computed(
      () => String(opts.value?.legend?.displayMode ?? "list")
    );
    const legendPlacementAttr = computed(
      () => String(opts.value?.legend?.placement ?? "bottom")
    );
    const tooltipModeAttr = computed(
      () => String(opts.value?.tooltip?.mode ?? "single")
    );
    const tooltipSortAttr = computed(
      () => String(opts.value?.tooltip?.sort ?? "none")
    );
    useUPlot(el, series, {
      width: width2,
      height: height2,
      mode: computed(() => {
        const show = String(merged("show", "points"));
        if (show === "lines" || show === "points+lines" || opts.value.showLines === true) {
          return Number(merged("fillOpacity", 0)) > 0 ? "area" : "line";
        }
        return "points";
      }),
      timeX: false,
      showLegend: false,
      lineInterpolation: computed(
        () => String(merged("lineInterpolation", "linear"))
      )
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2y, [
        showError.value ? (openBlock(), createBlock(PanelDataErrorView, {
          key: 0,
          data: __props.data,
          "field-config": __props.fieldConfig,
          message: prep.value.warn || "无数据"
        }, null, 8, ["data", "field-config", "message"])) : (openBlock(), createElementBlock("div", {
          key: 1,
          class: "chart-wrap",
          "data-testid": "xychart-panel",
          "data-x-field": xFieldAttr.value,
          "data-dims-x": String(opts.value.dims?.x ?? opts.value.xField ?? xFieldAttr.value),
          "data-dims-frame": String(opts.value.dims?.frame ?? ""),
          "data-dims-y": String(opts.value.dims?.y ?? ""),
          "data-fill-opacity": String(merged("fillOpacity", 50)),
          "data-point-size-fixed": pointSizeAttr.value,
          "data-point-size": pointSizeAttr.value,
          "data-point-size-min": pointSizeMinAttr.value,
          "data-point-size-max": pointSizeMaxAttr.value,
          "data-point-shape": pointShapeAttr.value,
          "data-point-symbol": pointSymbolAttr.value,
          "data-exclude-series": excludeSeriesAttr.value,
          "data-show-lines": showLinesAttr.value,
          "data-line-width": lineWidthAttr.value,
          "data-show": showModeAttr.value,
          "data-legend": legendAttr.value,
          "data-legend-display-mode": legendDisplayModeAttr.value,
          "data-legend-placement": legendPlacementAttr.value,
          "data-tooltip-mode": tooltipModeAttr.value,
          "data-tooltip-sort": tooltipSortAttr.value,
          "data-line-style": lineStyleAttr.value,
          "data-point-stroke-width": pointStrokeWidthAttr.value,
          "data-mapping": mappingAttr.value,
          "data-series-count": seriesCountAttr.value
        }, [
          createElementVNode("div", _hoisted_3$1M, [
            createElementVNode(
              "div",
              {
                ref_key: "el",
                ref: el,
                class: "chart",
                "data-testid": "panel-uplot",
                role: "img",
                "aria-label": "XY 图"
              },
              null,
              512
              /* NEED_PATCH */
            )
          ]),
          legendAttr.value === "true" && series.value.length ? (openBlock(), createElementBlock("ul", _hoisted_4$1t, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(series.value, (s) => {
                return openBlock(), createElementBlock("li", {
                  key: s.label
                }, [
                  createElementVNode(
                    "i",
                    {
                      class: "legend-swatch",
                      style: normalizeStyle({ background: s.color })
                    },
                    null,
                    4
                    /* STYLE */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_5$1k,
                    toDisplayString(s.label),
                    1
                    /* TEXT */
                  )
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : createCommentVNode("v-if", true)
        ], 8, _hoisted_2$20))
      ]);
    };
  }
});
const Panel$c = /* @__PURE__ */ _export_sfc(_sfc_main$3d, [["__scopeId", "data-v-78d7b6b0"]]);
const _hoisted_1$2x = ["data-mapping"];
const _hoisted_2$1$ = ["value"];
const _hoisted_3$1L = {
  key: 0,
  value: "0"
};
const _hoisted_4$1s = ["value"];
const _hoisted_5$1j = ["value"];
const _hoisted_6$18 = ["value"];
const _hoisted_7$10 = ["value"];
const _hoisted_8$T = ["value"];
const _hoisted_9$Q = {
  class: "series-list",
  "data-testid": "xy-series-list"
};
const _hoisted_10$I = ["data-testid", "onClick"];
const _hoisted_11$B = ["onClick"];
const _hoisted_12$u = {
  key: 0,
  class: "editor",
  "data-testid": "xy-series-form"
};
const _hoisted_13$u = ["value"];
const _hoisted_14$t = ["value"];
const _hoisted_15$o = {
  key: 0,
  value: "0"
};
const _hoisted_16$m = ["value"];
const _hoisted_17$j = ["value"];
const _hoisted_18$j = ["value"];
const _hoisted_19$h = ["value"];
const _hoisted_20$f = ["value"];
const _hoisted_21$b = ["value"];
const _hoisted_22$b = ["value"];
const _hoisted_23$7 = ["value"];
const _hoisted_24$7 = ["value"];
const _hoisted_25$7 = ["value"];
const _sfc_main$3c = /* @__PURE__ */ defineComponent({
  __name: "XYSeriesEditor",
  props: {
    mapping: {},
    series: {},
    dims: {},
    frames: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const selectedIdx = ref(0);
    function parseSeries(raw) {
      if (Array.isArray(raw)) return raw;
      if (typeof raw === "string" && raw.trim()) {
        try {
          const p = JSON.parse(raw);
          return Array.isArray(p) ? p : [];
        } catch {
          return [];
        }
      }
      return [];
    }
    const list = computed(() => {
      const s = parseSeries(props.series);
      if (props.mapping === "manual" && !s.length) {
        return [{ frame: { matcher: { id: "byIndex", options: 0 } } }];
      }
      return s;
    });
    watch(
      () => props.mapping,
      (m, prev) => {
        if (prev != null && m !== prev && m === "manual" && !parseSeries(props.series).length) {
          emit("change", {
            series: [{ frame: { matcher: { id: "byIndex", options: 0 } } }]
          });
          selectedIdx.value = 0;
        }
      }
    );
    const frames = computed(() => props.frames ?? []);
    const current = computed(() => list.value[selectedIdx.value] ?? null);
    function frameIndexOf(s) {
      const o = s.frame?.matcher?.options;
      const n = Number(o ?? 0);
      return Number.isFinite(n) ? n : 0;
    }
    function fieldName(spec) {
      if (spec == null) return "";
      if (typeof spec === "string") return spec;
      if (spec.fixed != null) return String(spec.fixed);
      if (spec.matcher?.options != null) return String(spec.matcher.options);
      return "";
    }
    function fieldsOf(frameIdx, types) {
      const f = frames.value[frameIdx] ?? frames.value[0];
      if (!f) return [];
      return f.fields.filter((fld) => !types || types.includes(fld.type)).map((fld) => fld.name);
    }
    function seriesLabel(s, i) {
      if (typeof s.name === "string" && s.name) return s.name;
      if (s.name && typeof s.name === "object" && s.name.fixed) return s.name.fixed;
      const y = fieldName(s.y);
      return y || `序列 ${i + 1}`;
    }
    function commit(next) {
      emit("change", { series: next });
    }
    function addSeries() {
      const next = [
        ...list.value,
        { frame: { matcher: { id: "byIndex", options: 0 } } }
      ];
      commit(next);
      selectedIdx.value = next.length - 1;
    }
    function deleteSeries(i) {
      const next = list.value.filter((_, idx) => idx !== i);
      commit(
        next.length ? next : [{ frame: { matcher: { id: "byIndex", options: 0 } } }]
      );
      selectedIdx.value = 0;
    }
    function patchCurrent(partial) {
      const next = list.value.map(
        (s, i) => i === selectedIdx.value ? { ...s, ...partial } : s
      );
      commit(next);
    }
    function setName(fixed) {
      patchCurrent({ name: fixed ? { fixed } : void 0 });
    }
    function setFrame(idx) {
      patchCurrent({ frame: { matcher: { id: "byIndex", options: idx } } });
    }
    function setField(key, name) {
      if (!name) {
        patchCurrent({ [key]: void 0 });
        return;
      }
      patchCurrent({ [key]: { matcher: { id: "byName", options: name } } });
    }
    function setColorField(name) {
      if (!name) {
        patchCurrent({ color: void 0 });
        return;
      }
      patchCurrent({ color: { matcher: { id: "byName", options: name } } });
    }
    function setPointColor(hex) {
      patchCurrent({
        pointColor: hex || void 0,
        color: hex ? { fixed: hex } : void 0
      });
    }
    function setDims(partial) {
      emit("change", { dims: { ...props.dims ?? {}, ...partial } });
    }
    const curFrameIdx = computed(
      () => current.value ? frameIndexOf(current.value) : Number(props.dims?.frame ?? 0)
    );
    const numberFields = computed(() => fieldsOf(curFrameIdx.value, ["number"]));
    const allFields = computed(() => fieldsOf(curFrameIdx.value));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "xy-series-editor",
        "data-testid": "xy-series-editor",
        "data-mapping": String(__props.mapping ?? "auto")
      }, [
        createCommentVNode(" Auto: dims "),
        __props.mapping !== "manual" ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            _cache[15] || (_cache[15] = createElementVNode(
              "header",
              { class: "head" },
              "自动映射 · 维度",
              -1
              /* CACHED */
            )),
            createElementVNode("label", null, [
              _cache[10] || (_cache[10] = createTextVNode(
                " 数据帧 ",
                -1
                /* CACHED */
              )),
              createElementVNode("select", {
                "data-testid": "xy-dims-frame",
                value: String(__props.dims?.frame ?? 0),
                onChange: _cache[0] || (_cache[0] = ($event) => setDims({
                  frame: Number($event.target.value)
                }))
              }, [
                !frames.value.length ? (openBlock(), createElementBlock("option", _hoisted_3$1L, "帧 0")) : createCommentVNode("v-if", true),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(frames.value, (f, i) => {
                    return openBlock(), createElementBlock("option", {
                      key: i,
                      value: String(i)
                    }, toDisplayString(f.name || `帧 ${i}`) + " (" + toDisplayString(f.length) + " 行) ", 9, _hoisted_4$1s);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ], 40, _hoisted_2$1$)
            ]),
            createElementVNode("label", null, [
              _cache[12] || (_cache[12] = createTextVNode(
                " X 字段 ",
                -1
                /* CACHED */
              )),
              createElementVNode("select", {
                "data-testid": "xy-dims-x",
                value: __props.dims?.x ?? "",
                onChange: _cache[1] || (_cache[1] = ($event) => setDims({ x: $event.target.value }))
              }, [
                _cache[11] || (_cache[11] = createElementVNode(
                  "option",
                  { value: "" },
                  "自动",
                  -1
                  /* CACHED */
                )),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(fieldsOf(Number(__props.dims?.frame ?? 0), ["number"]), (n) => {
                    return openBlock(), createElementBlock("option", {
                      key: n,
                      value: n
                    }, toDisplayString(n), 9, _hoisted_6$18);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ], 40, _hoisted_5$1j)
            ]),
            createElementVNode("label", null, [
              _cache[14] || (_cache[14] = createTextVNode(
                " Y 字段 ",
                -1
                /* CACHED */
              )),
              createElementVNode("select", {
                "data-testid": "xy-dims-y",
                value: __props.dims?.y ?? "",
                onChange: _cache[2] || (_cache[2] = ($event) => setDims({ y: $event.target.value }))
              }, [
                _cache[13] || (_cache[13] = createElementVNode(
                  "option",
                  { value: "" },
                  "全部数值字段",
                  -1
                  /* CACHED */
                )),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(fieldsOf(Number(__props.dims?.frame ?? 0), ["number"]), (n) => {
                    return openBlock(), createElementBlock("option", {
                      key: n,
                      value: n
                    }, toDisplayString(n), 9, _hoisted_8$T);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ], 40, _hoisted_7$10)
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createCommentVNode(" Manual: series list + field pickers "),
            createElementVNode("header", { class: "head" }, [
              _cache[16] || (_cache[16] = createTextVNode(
                " 手动序列 ",
                -1
                /* CACHED */
              )),
              createElementVNode("button", {
                type: "button",
                "data-testid": "xy-add-series",
                class: "btn",
                onClick: addSeries
              }, " + 添加序列 ")
            ]),
            createElementVNode("ul", _hoisted_9$Q, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(list.value, (s, i) => {
                  return openBlock(), createElementBlock("li", {
                    key: i,
                    class: normalizeClass(["series-row", { sel: i === selectedIdx.value }]),
                    "data-testid": `xy-series-${i}`,
                    onClick: ($event) => selectedIdx.value = i
                  }, [
                    createElementVNode(
                      "span",
                      null,
                      toDisplayString(seriesLabel(s, i)),
                      1
                      /* TEXT */
                    ),
                    createElementVNode("button", {
                      type: "button",
                      "data-testid": "xy-del-series",
                      class: "icon",
                      title: "删除",
                      onClick: withModifiers(($event) => deleteSeries(i), ["stop"])
                    }, " × ", 8, _hoisted_11$B)
                  ], 10, _hoisted_10$I);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            current.value ? (openBlock(), createElementBlock("div", _hoisted_12$u, [
              createElementVNode("label", null, [
                _cache[17] || (_cache[17] = createTextVNode(
                  " 名称 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("input", {
                  "data-testid": "xy-series-name",
                  value: seriesLabel(current.value, selectedIdx.value).startsWith("序列 ") ? "" : seriesLabel(current.value, selectedIdx.value),
                  placeholder: "序列名称",
                  onChange: _cache[3] || (_cache[3] = ($event) => setName($event.target.value))
                }, null, 40, _hoisted_13$u)
              ]),
              createElementVNode("label", null, [
                _cache[18] || (_cache[18] = createTextVNode(
                  " 数据帧 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("select", {
                  "data-testid": "xy-series-frame",
                  value: String(frameIndexOf(current.value)),
                  onChange: _cache[4] || (_cache[4] = ($event) => setFrame(Number($event.target.value)))
                }, [
                  !frames.value.length ? (openBlock(), createElementBlock("option", _hoisted_15$o, "帧 0")) : createCommentVNode("v-if", true),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(frames.value, (f, i) => {
                      return openBlock(), createElementBlock("option", {
                        key: i,
                        value: String(i)
                      }, toDisplayString(f.name || `帧 ${i}`), 9, _hoisted_16$m);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ], 40, _hoisted_14$t)
              ]),
              createElementVNode("label", null, [
                _cache[20] || (_cache[20] = createTextVNode(
                  " X 字段 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("select", {
                  "data-testid": "xy-series-x",
                  value: fieldName(current.value.x),
                  onChange: _cache[5] || (_cache[5] = ($event) => setField("x", $event.target.value))
                }, [
                  _cache[19] || (_cache[19] = createElementVNode(
                    "option",
                    { value: "" },
                    "选择字段",
                    -1
                    /* CACHED */
                  )),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(numberFields.value, (n) => {
                      return openBlock(), createElementBlock("option", {
                        key: "x" + n,
                        value: n
                      }, toDisplayString(n), 9, _hoisted_18$j);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ], 40, _hoisted_17$j)
              ]),
              createElementVNode("label", null, [
                _cache[22] || (_cache[22] = createTextVNode(
                  " Y 字段 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("select", {
                  "data-testid": "xy-series-y",
                  value: fieldName(current.value.y),
                  onChange: _cache[6] || (_cache[6] = ($event) => setField("y", $event.target.value))
                }, [
                  _cache[21] || (_cache[21] = createElementVNode(
                    "option",
                    { value: "" },
                    "选择字段",
                    -1
                    /* CACHED */
                  )),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(numberFields.value, (n) => {
                      return openBlock(), createElementBlock("option", {
                        key: "y" + n,
                        value: n
                      }, toDisplayString(n), 9, _hoisted_20$f);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ], 40, _hoisted_19$h)
              ]),
              createElementVNode("label", null, [
                _cache[24] || (_cache[24] = createTextVNode(
                  " 颜色字段 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("select", {
                  "data-testid": "xy-series-color-field",
                  value: fieldName(current.value.color),
                  onChange: _cache[7] || (_cache[7] = ($event) => setColorField($event.target.value))
                }, [
                  _cache[23] || (_cache[23] = createElementVNode(
                    "option",
                    { value: "" },
                    "固定色 / 无",
                    -1
                    /* CACHED */
                  )),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(allFields.value, (n) => {
                      return openBlock(), createElementBlock("option", {
                        key: "c" + n,
                        value: n
                      }, toDisplayString(n), 9, _hoisted_22$b);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ], 40, _hoisted_21$b)
              ]),
              createElementVNode("label", null, [
                _cache[25] || (_cache[25] = createTextVNode(
                  " 固定点颜色 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("input", {
                  "data-testid": "xy-series-point-color",
                  type: "color",
                  value: current.value.pointColor || current.value.color?.fixed || "var(--grafana-primary)",
                  onInput: _cache[8] || (_cache[8] = ($event) => setPointColor($event.target.value))
                }, null, 40, _hoisted_23$7)
              ]),
              createElementVNode("label", null, [
                _cache[27] || (_cache[27] = createTextVNode(
                  " 大小字段 ",
                  -1
                  /* CACHED */
                )),
                createElementVNode("select", {
                  "data-testid": "xy-series-size",
                  value: fieldName(current.value.size),
                  onChange: _cache[9] || (_cache[9] = ($event) => setField("size", $event.target.value))
                }, [
                  _cache[26] || (_cache[26] = createElementVNode(
                    "option",
                    { value: "" },
                    "固定大小",
                    -1
                    /* CACHED */
                  )),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(numberFields.value, (n) => {
                      return openBlock(), createElementBlock("option", {
                        key: "s" + n,
                        value: n
                      }, toDisplayString(n), 9, _hoisted_25$7);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ], 40, _hoisted_24$7)
              ])
            ])) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ], 8, _hoisted_1$2x);
    };
  }
});
const XYSeriesEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3c, [["__scopeId", "data-v-c4854eda"]]);
new VuePanelPlugin(
  {
    id: "xychart",
    name: "XY 图",
    description: "XY / 散点图",
    state: "stable",
    skipDataQuery: false
  },
  Panel$c
).useFieldConfig({
  useCustomConfig: (builder) => {
    const category = ["XY 图"];
    builder.addRadio(
      {
        id: "show",
        path: "show",
        name: "显示",
        category,
        settings: {
          options: [
            { label: "点", value: "points" },
            { label: "线", value: "lines" },
            { label: "点+线", value: "points+lines" }
          ]
        }
      },
      "points"
    ).addSlider(
      {
        id: "pointSize.fixed",
        path: "pointSize.fixed",
        name: "点大小",
        category,
        settings: { min: 1, max: 100, step: 1 },
        showIf: (c) => (c.show ?? c.custom?.show) !== "lines"
      },
      5
    ).addNumber({
      id: "pointSize.min",
      path: "pointSize.min",
      name: "最小",
      category,
      showIf: (c) => (c.show ?? c.custom?.show) !== "lines"
    }).addNumber({
      id: "pointSize.max",
      path: "pointSize.max",
      name: "最大",
      category,
      showIf: (c) => (c.show ?? c.custom?.show) !== "lines"
    }).addRadio(
      {
        id: "pointShape",
        path: "pointShape",
        name: "点形状",
        category,
        settings: {
          options: [
            { label: "圆形", value: "circle" },
            { label: "方形", value: "square" }
          ]
        },
        showIf: (c) => (c.show ?? c.custom?.show) !== "lines"
      },
      "circle"
    ).addSlider(
      {
        id: "pointStrokeWidth",
        path: "pointStrokeWidth",
        name: "点描边宽度",
        category,
        settings: { min: 0, max: 10, step: 1 },
        showIf: (c) => (c.show ?? c.custom?.show) !== "lines"
      },
      1
    ).addSlider(
      {
        id: "fillOpacity",
        path: "fillOpacity",
        name: "填充透明度",
        category,
        settings: { min: 0, max: 100, step: 1 },
        showIf: (c) => (c.show ?? c.custom?.show) !== "lines"
      },
      50
    ).addText({
      id: "lineStyle",
      path: "lineStyle",
      name: "线样式",
      category,
      showIf: (c) => (c.show ?? c.custom?.show) !== "points"
    }).addSlider(
      {
        id: "lineWidth",
        path: "lineWidth",
        name: "线宽",
        category,
        settings: { min: 0, max: 10, step: 1 },
        showIf: (c) => (c.show ?? c.custom?.show) !== "points"
      },
      1
    ).addText({
      id: "pointSymbol",
      path: "pointSymbol",
      name: "点符号（兼容）",
      category,
      showIf: () => false
    });
  }
}).setPanelOptions((builder) => {
  const category = ["XY 图"];
  builder.addRadio(
    {
      id: "mapping",
      path: "mapping",
      name: "序列映射",
      category,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "手动", value: "manual" }
        ]
      }
    },
    "auto"
  ).addNumber(
    {
      id: "dims.frame",
      path: "dims.frame",
      name: "数据帧索引",
      category,
      settings: { min: 0, step: 1 },
      showIf: () => false
      // SeriesEditor,
    },
    0
  ).addText({
    id: "dims.x",
    path: "dims.x",
    name: "X 字段",
    category,
    showIf: () => false
    // SeriesEditor,
  }).addText({
    id: "dims.y",
    path: "dims.y",
    name: "Y 字段",
    category,
    showIf: () => false
    // SeriesEditor,
  }).addCustom(
    {
      id: "series",
      path: "series",
      name: "序列（SeriesEditor）",
      description: "由下方 SeriesEditor 编辑；兼容 JSON round-trip",
      category,
      editor: "textarea",
      showIf: () => false
      // UI via XYSeriesEditor in PanelEditor
    },
    []
  ).addText({
    id: "excludeSeries",
    path: "excludeSeries",
    name: "排除序列（逗号分隔）",
    category
  }).addRadio(
    {
      id: "show",
      path: "show",
      name: "显示（options 兼容）",
      category: ["XY 图 · 兼容"],
      settings: {
        options: [
          { label: "点", value: "points" },
          { label: "线", value: "lines" },
          { label: "点+线", value: "points+lines" }
        ]
      }
    },
    "points"
  ).addSlider(
    {
      id: "pointSize.fixed",
      path: "pointSize.fixed",
      name: "点大小（兼容）",
      category: ["XY 图 · 兼容"],
      settings: { min: 1, max: 100, step: 1 }
    },
    5
  ).addNumber({
    id: "pointSize.min",
    path: "pointSize.min",
    name: "最小点（兼容）",
    category: ["XY 图 · 兼容"]
  }).addNumber({
    id: "pointSize.max",
    path: "pointSize.max",
    name: "最大点（兼容）",
    category: ["XY 图 · 兼容"]
  }).addRadio(
    {
      id: "pointShape",
      path: "pointShape",
      name: "点形状（兼容）",
      category: ["XY 图 · 兼容"],
      settings: {
        options: [
          { label: "圆形", value: "circle" },
          { label: "方形", value: "square" }
        ]
      }
    },
    "circle"
  ).addSlider(
    {
      id: "pointStrokeWidth",
      path: "pointStrokeWidth",
      name: "点描边（兼容）",
      category: ["XY 图 · 兼容"],
      settings: { min: 0, max: 10 }
    },
    1
  ).addSlider(
    {
      id: "fillOpacity",
      path: "fillOpacity",
      name: "填充（兼容）",
      category: ["XY 图 · 兼容"],
      settings: { min: 0, max: 100 }
    },
    50
  ).addText({
    id: "lineStyle",
    path: "lineStyle",
    name: "线样式（兼容）",
    category: ["XY 图 · 兼容"]
  }).addSlider(
    {
      id: "lineWidth",
      path: "lineWidth",
      name: "线宽（兼容）",
      category: ["XY 图 · 兼容"],
      settings: { min: 0, max: 10 }
    },
    1
  ).addText({
    id: "pointSymbol",
    path: "pointSymbol",
    name: "点符号（兼容）",
    category: ["XY 图 · 兼容"]
  });
  addTooltipOptions(builder, true);
  addLegendOptions(builder, true, true);
}).setRuntimeConsumedPaths([
  "mapping",
  "series",
  "dims.frame",
  "dims.x",
  "dims.y",
  "excludeSeries",
  "show",
  "pointSize.fixed",
  "pointSize.min",
  "pointSize.max",
  "pointShape",
  "pointStrokeWidth",
  "fillOpacity",
  "lineStyle",
  "lineWidth",
  "pointSymbol",
  "legend.showLegend",
  "legend.displayMode",
  "legend.placement",
  "tooltip.mode",
  "tooltip.sort"
]).setOptionsEditor(XYSeriesEditor).register();
function resolveLineDash(lineStyle) {
  if (lineStyle == null) return void 0;
  const s = typeof lineStyle === "string" ? lineStyle : String(lineStyle?.fill ?? lineStyle?.style ?? "");
  const v = s.toLowerCase();
  if (v === "dashed" || v === "dash") return "6 4";
  if (v === "dotted" || v === "dot") return "2 3";
  return void 0;
}
function pickElementChrome(el) {
  const links = Array.isArray(el.links) ? el.links : el.links != null ? [el.links] : void 0;
  const actions = Array.isArray(el.actions) ? el.actions : el.actions != null && String(el.actions).trim() !== "" ? [el.actions] : void 0;
  const lineStyle = el.lineStyle ?? el.config?.lineStyle ?? void 0;
  return { links, actions, lineStyle };
}
function normalizeCanvasOptions(options = {}) {
  const root = options.root && typeof options.root === "object" ? options.root : void 0;
  const rawElements = (Array.isArray(options.elements) && options.elements.length ? options.elements : void 0) ?? (Array.isArray(root?.elements) ? root.elements : void 0);
  const elements = rawElements?.map((el, i) => {
    const n = normalizeElement(el, i);
    if (!n || !el || typeof el !== "object") return n;
    const chrome = pickElementChrome(el);
    return { ...n, ...chrome };
  }).filter((el) => el != null);
  const connections = collectConnections(options, elements ?? []);
  const selectedIds = Array.isArray(options.selectedIds) ? options.selectedIds.map(String) : typeof options.selectedId === "string" ? [options.selectedId] : void 0;
  const bgNested = options.background && typeof options.background === "object" ? options.background : null;
  const backgroundColor = typeof options.background === "string" ? options.background : typeof bgNested?.color === "string" ? bgNested.color : typeof options["background.color"] === "string" ? String(options["background.color"]) : "transparent";
  const backgroundImage = typeof bgNested?.image === "string" ? bgNested.image : typeof options["background.image"] === "string" ? String(options["background.image"]) : void 0;
  const backgroundSize = typeof bgNested?.size === "string" ? bgNested.size : typeof options["background.size"] === "string" ? String(options["background.size"]) : "cover";
  const borderNested = options.border && typeof options.border === "object" ? options.border : null;
  const borderColor = typeof borderNested?.color === "string" ? borderNested.color : typeof options["border.color"] === "string" ? String(options["border.color"]) : "";
  const borderWidth = borderNested?.width != null ? Number(borderNested.width) : options["border.width"] != null ? Number(options["border.width"]) : void 0;
  const panelColor = typeof options.color === "string" ? options.color : typeof options.color === "object" && options.color?.fixed ? String(options.color.fixed) : "";
  const normalizedElements = applyConstraints(elements ?? [], 100, 100);
  return {
    elements: normalizedElements,
    connections,
    background: backgroundColor,
    backgroundColor,
    backgroundImage,
    backgroundSize,
    borderColor,
    borderWidth,
    color: panelColor,
    inlineEditing: options.inlineEditing !== false,
    panZoom: Boolean(
      options.panZoom === true || String(options.panZoom) === "true" || Number(options.panZoom) === 1
    ),
    panZoomHelp: options.panZoomHelp !== false,
    zoomToContent: Boolean(options.zoomToContent),
    showAdvancedTypes: Boolean(options.showAdvancedTypes),
    tooltipMode: String(
      options.tooltip?.mode ?? options["tooltip.mode"] ?? "auto"
    ),
    tooltipDisableForOneClick: Boolean(
      options.tooltip?.disableForOneClick ?? options["tooltip.disableForOneClick"]
    ),
    root: root ?? { elements: normalizedElements },
    selectedId: selectedIds?.[selectedIds.length - 1],
    selectedIds
  };
}
function normalizeElement(raw, index2) {
  if (!raw || typeof raw !== "object") return null;
  const el = raw;
  const type = String(el.type ?? "");
  const id = typeof el.id === "string" ? el.id : `el-${index2}`;
  const x = num(el.x, 0);
  const y = num(el.y, 0);
  const fill = typeof el.fill === "string" ? el.fill : void 0;
  const name = typeof el.name === "string" ? el.name : void 0;
  const constraint = normalizeConstraint(el.constraint ?? el.placement);
  const connections = Array.isArray(el.connections) ? el.connections.map((c, ci) => normalizeConnection(c, id, ci)).filter((c) => !!c) : void 0;
  switch (type) {
    case "rect":
      return {
        type: "rect",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 10),
        h: num(el.h ?? el.height, 10),
        fill,
        text: typeof el.text === "string" ? el.text : void 0,
        constraint,
        connections
      };
    case "circle":
      return {
        type: "circle",
        id,
        name,
        x,
        y,
        r: num(el.r ?? el.radius, 5),
        fill,
        constraint,
        connections
      };
    case "text":
      return {
        type: "text",
        id,
        name,
        x,
        y,
        text: String(el.text ?? ""),
        fill,
        fontSize: num(el.fontSize, 5),
        constraint,
        connections
      };
    case "metricValue":
    case "metric":
      return {
        type: "metric",
        id,
        name,
        x,
        y,
        field: typeof el.field === "string" ? el.field : void 0,
        fill,
        text: typeof el.text === "string" ? el.text : void 0,
        constraint,
        connections
      };
    case "line":
      return {
        type: "line",
        id,
        name,
        x,
        y,
        x2: num(el.x2, x + 10),
        y2: num(el.y2, y + 10),
        stroke: typeof el.stroke === "string" ? el.stroke : "#8ab8ff",
        strokeWidth: num(el.strokeWidth, 0.8),
        constraint,
        connections
      };
    case "ellipse":
      return {
        type: "ellipse",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 14),
        h: num(el.h ?? el.height, 10),
        fill,
        constraint,
        connections
      };
    case "icon":
      return {
        type: "icon",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 8),
        h: num(el.h ?? el.height, 8),
        fill: fill ?? "#8ab8ff",
        icon: typeof el.icon === "string" ? el.icon : "cube",
        constraint,
        connections
      };
    case "server":
      return {
        type: "server",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 12),
        h: num(el.h ?? el.height, 16),
        fill: fill ?? "#3d71d9",
        text: typeof el.text === "string" ? el.text : "Server",
        constraint,
        connections
      };
    case "button":
      return {
        type: "button",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 16),
        h: num(el.h ?? el.height, 8),
        fill: fill ?? "#3274d9",
        text: typeof el.text === "string" ? el.text : "Button",
        constraint,
        connections
      };
    case "drone":
      return {
        type: "drone",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 14),
        h: num(el.h ?? el.height, 10),
        fill: fill ?? "#6ed0e0",
        text: typeof el.text === "string" ? el.text : "Drone",
        constraint,
        connections
      };
    case "droneTop":
    case "droneFront":
    case "droneSide": {
      const view = type;
      return {
        type: view,
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 14),
        h: num(el.h ?? el.height, 10),
        fill: fill ?? "#6ed0e0",
        text: typeof el.text === "string" ? el.text : view,
        constraint,
        connections
      };
    }
    case "windTurbine":
    case "wind-turbine":
      return {
        type: "windTurbine",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 12),
        h: num(el.h ?? el.height, 18),
        fill: fill ?? "#8ab8ff",
        text: typeof el.text === "string" ? el.text : "Turbine",
        constraint,
        connections
      };
    case "cloud":
    case "triangle":
    case "parallelogram":
      return {
        type,
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 16),
        h: num(el.h ?? el.height, 12),
        fill: fill ?? (type === "cloud" ? "#8ab8ff" : type === "triangle" ? "#f2cc0c" : "#b877d9"),
        text: typeof el.text === "string" ? el.text : type,
        constraint,
        connections
      };
    // Grafana aliases
    case "rectangle":
      return {
        type: "rect",
        id,
        name,
        x,
        y,
        w: num(el.w ?? el.width, 10),
        h: num(el.h ?? el.height, 10),
        fill,
        text: typeof el.text === "string" ? el.text : void 0,
        constraint,
        connections
      };
    default:
      return null;
  }
}
function normalizeConstraint(raw) {
  if (!raw || typeof raw !== "object") return void 0;
  const c = raw;
  return {
    horizontal: c.horizontal != null ? String(c.horizontal) : void 0,
    vertical: c.vertical != null ? String(c.vertical) : void 0
  };
}
function normalizeConnection(raw, fallbackSource, index2) {
  if (!raw || typeof raw !== "object") return null;
  const c = raw;
  const source = String(c.source ?? c.sourceName ?? fallbackSource ?? "");
  const target = String(c.target ?? c.targetName ?? "");
  if (!source || !target) return null;
  return {
    id: typeof c.id === "string" ? c.id : `conn-${source}-${target}-${index2}`,
    source,
    target,
    color: typeof c.color === "string" ? c.color : "#8ab8ff",
    pathType: typeof c.pathType === "string" ? c.pathType : "straight",
    strokeWidth: c.strokeWidth != null ? Number(c.strokeWidth) : 0.8,
    sourceOriginal: c.sourceOriginal && typeof c.sourceOriginal === "object" ? {
      x: num(c.sourceOriginal.x, 0.5),
      y: num(c.sourceOriginal.y, 0.5)
    } : { x: 0.5, y: 0.5 },
    targetOriginal: c.targetOriginal && typeof c.targetOriginal === "object" ? {
      x: num(c.targetOriginal.x, 0.5),
      y: num(c.targetOriginal.y, 0.5)
    } : { x: 0.5, y: 0.5 },
    vertices: Array.isArray(c.vertices) ? c.vertices.map((v) => ({ x: num(v?.x, 0), y: num(v?.y, 0) })) : void 0
  };
}
function collectConnections(options, elements) {
  const out = [];
  const seen = /* @__PURE__ */ new Set();
  const push = (c) => {
    if (!c) return;
    const key = c.id || `${c.source}->${c.target}`;
    if (seen.has(key)) return;
    seen.add(key);
    out.push(c);
  };
  if (Array.isArray(options.connections)) {
    options.connections.forEach((c, i) => push(normalizeConnection(c, "", i)));
  }
  for (const el of elements) {
    if (Array.isArray(el.connections)) {
      el.connections.forEach(
        (c, i) => push(normalizeConnection(c, el.id ?? "", i))
      );
    }
  }
  return out;
}
function applyConstraints(elements, canvasW = 100, canvasH = 100) {
  return elements.map((el) => {
    const c = el.constraint;
    if (!c) return el;
    const b = elementBounds(el);
    let x = el.x;
    let y = el.y;
    const h2 = String(c.horizontal ?? "");
    const v = String(c.vertical ?? "");
    if (h2 === "left") x = el.type === "circle" ? b.w / 2 : 0;
    else if (h2 === "right")
      x = el.type === "circle" ? canvasW - b.w / 2 : canvasW - b.w;
    else if (h2 === "center")
      x = el.type === "circle" ? canvasW / 2 : (canvasW - b.w) / 2;
    else if (h2 === "scale") {
      const ratio = el.x / 100;
      x = el.type === "circle" ? ratio * canvasW : ratio * canvasW;
    }
    if (v === "top") y = el.type === "circle" ? b.h / 2 : 0;
    else if (v === "bottom")
      y = el.type === "circle" ? canvasH - b.h / 2 : canvasH - b.h;
    else if (v === "center")
      y = el.type === "circle" ? canvasH / 2 : (canvasH - b.h) / 2;
    else if (v === "scale") {
      const ratio = el.y / 100;
      y = el.type === "circle" ? ratio * canvasH : ratio * canvasH;
    }
    if ((h2 === "scale" || v === "scale") && el.type !== "line" && el.type !== "circle" && el.type !== "text" && el.type !== "metric") {
      const scaleX = canvasW / 100;
      const scaleY = canvasH / 100;
      const w = Math.max(
        1,
        Number(el.w ?? 10) * (h2 === "scale" ? scaleX : 1)
      );
      const hh = Math.max(
        1,
        Number(el.h ?? 10) * (v === "scale" ? scaleY : 1)
      );
      return { ...el, x, y, w, h: hh };
    }
    if (el.type === "line") {
      const dx = x - el.x;
      const dy = y - el.y;
      return {
        ...el,
        x: el.x + dx,
        y: el.y + dy,
        x2: el.x2 + dx,
        y2: el.y2 + dy
      };
    }
    return { ...el, x, y };
  });
}
function anchorPoint(el, anchor = { x: 0.5, y: 0.5 }) {
  const b = elementBounds(el);
  return { x: b.x + b.w * anchor.x, y: b.y + b.h * anchor.y };
}
function connectionPath(elements, conn) {
  const src = elements.find((e) => e.id === conn.source);
  const tgt = elements.find((e) => e.id === conn.target);
  if (!src || !tgt) return null;
  const a = anchorPoint(src, conn.sourceOriginal ?? { x: 0.5, y: 0.5 });
  const b = anchorPoint(tgt, conn.targetOriginal ?? { x: 0.5, y: 0.5 });
  if (conn.pathType === "bezier") {
    const mx = (a.x + b.x) / 2;
    const d = `M ${a.x} ${a.y} C ${mx} ${a.y}, ${mx} ${b.y}, ${b.x} ${b.y}`;
    return { d, x1: a.x, y1: a.y, x2: b.x, y2: b.y };
  }
  if (conn.vertices?.length) {
    const parts = [
      `M ${a.x} ${a.y}`,
      ...conn.vertices.map((v) => `L ${v.x} ${v.y}`),
      `L ${b.x} ${b.y}`
    ];
    return { d: parts.join(" "), x1: a.x, y1: a.y, x2: b.x, y2: b.y };
  }
  return {
    d: `M ${a.x} ${a.y} L ${b.x} ${b.y}`,
    x1: a.x,
    y1: a.y,
    x2: b.x,
    y2: b.y
  };
}
function setConnectionVertices(options, connectionId, vertices) {
  const connections = (options.connections ?? []).map(
    (c) => c.id === connectionId ? {
      ...c,
      vertices: vertices.map((v) => ({
        x: Number(v.x) || 0,
        y: Number(v.y) || 0
      }))
    } : c
  );
  return { ...options, connections };
}
function addConnectionVertex(options, connectionId, vertex) {
  const connections = (options.connections ?? []).map((c) => {
    if (c.id !== connectionId) return c;
    return {
      ...c,
      vertices: [
        ...c.vertices ?? [],
        { x: Number(vertex.x) || 0, y: Number(vertex.y) || 0 }
      ]
    };
  });
  return { ...options, connections };
}
function addConnection(options, sourceId, targetId, patch = {}) {
  if (!sourceId || !targetId || sourceId === targetId) return options;
  const connections = [...options.connections ?? []];
  const id = `conn-${sourceId}-${targetId}-${connections.length}`;
  connections.push({
    id,
    source: sourceId,
    target: targetId,
    color: patch.color ?? "#8ab8ff",
    pathType: patch.pathType ?? "straight",
    strokeWidth: patch.strokeWidth ?? 0.8,
    sourceOriginal: patch.sourceOriginal ?? { x: 0.5, y: 0.5 },
    targetOriginal: patch.targetOriginal ?? { x: 0.5, y: 0.5 }
  });
  return { ...options, elements: options.elements ?? [], connections };
}
function removeConnection(options, id) {
  return {
    ...options,
    elements: options.elements ?? [],
    connections: (options.connections ?? []).filter((c) => c.id !== id)
  };
}
function setConnectionPathType(options, connectionId, pathType) {
  const connections = (options.connections ?? []).map(
    (c) => c.id === connectionId ? { ...c, pathType } : c
  );
  return { ...options, connections };
}
function toggleConnectionPathType(options, connectionId) {
  const conn = (options.connections ?? []).find((c) => c.id === connectionId);
  if (!conn) return options;
  const next = conn.pathType === "bezier" ? "straight" : "bezier";
  return setConnectionPathType(options, connectionId, next);
}
function updateCanvasElement(elements, id, patch) {
  return elements.map((el) => {
    if (el.id !== id) return el;
    return { ...el, ...patch };
  });
}
function setElementConstraint(elements, id, constraint) {
  return elements.map((el) => el.id === id ? { ...el, constraint } : el);
}
function num(v, fallback) {
  const n = Number(v);
  return Number.isFinite(n) ? n : fallback;
}
function defaultCanvasElements(_value) {
  return [
    {
      type: "metric",
      id: "element-1",
      name: "Element 1",
      x: 100,
      y: 100,
      w: 260,
      h: 50,
      fill: "#D9D9D9",
      text: "Double click to set field",
      fontSize: 20,
      textColor: "#000000"
    }
  ];
}
function ensureElementIds(elements) {
  return elements.map((el, i) => ({ ...el, id: el.id ?? `el-${i}` }));
}
function addCanvasElement(elements, type) {
  const id = `el-${Date.now().toString(36)}-${elements.length}`;
  const base = { id, x: 40, y: 40 };
  let next;
  switch (type) {
    case "rect":
      next = { type: "rect", ...base, w: 20, h: 14, fill: "#3d71d9" };
      break;
    case "circle":
      next = { type: "circle", ...base, r: 8, fill: "#73bf69" };
      break;
    case "text":
      next = {
        type: "text",
        ...base,
        text: "Text",
        fill: "#d8d9da",
        fontSize: 5
      };
      break;
    case "metric":
      next = {
        type: "metric",
        ...base,
        field: "Value",
        fill: "#f2cc0c",
        text: "—"
      };
      break;
    case "line":
      next = {
        type: "line",
        ...base,
        x2: 60,
        y2: 60,
        stroke: "#8ab8ff",
        strokeWidth: 1
      };
      break;
    case "ellipse":
      next = { type: "ellipse", ...base, w: 18, h: 12, fill: "#b877d9" };
      break;
    case "icon":
      next = {
        type: "icon",
        ...base,
        w: 10,
        h: 10,
        fill: "#8ab8ff",
        icon: "cube"
      };
      break;
    case "server":
      next = {
        type: "server",
        ...base,
        w: 14,
        h: 18,
        fill: "#3d71d9",
        text: "Server"
      };
      break;
    case "button":
      next = {
        type: "button",
        ...base,
        w: 18,
        h: 8,
        fill: "#3274d9",
        text: "Button"
      };
      break;
    case "drone":
      next = {
        type: "drone",
        ...base,
        w: 14,
        h: 10,
        fill: "#6ed0e0",
        text: "Drone"
      };
      break;
    case "droneTop":
      next = {
        type: "droneTop",
        ...base,
        w: 14,
        h: 10,
        fill: "#6ed0e0",
        text: "DroneTop"
      };
      break;
    case "droneFront":
      next = {
        type: "droneFront",
        ...base,
        w: 14,
        h: 10,
        fill: "#6ed0e0",
        text: "DroneFront"
      };
      break;
    case "droneSide":
      next = {
        type: "droneSide",
        ...base,
        w: 14,
        h: 10,
        fill: "#6ed0e0",
        text: "DroneSide"
      };
      break;
    case "windTurbine":
      next = {
        type: "windTurbine",
        ...base,
        w: 12,
        h: 18,
        fill: "#8ab8ff",
        text: "Turbine"
      };
      break;
    case "cloud":
      next = {
        type: "cloud",
        ...base,
        w: 18,
        h: 12,
        fill: "#8ab8ff",
        text: "Cloud"
      };
      break;
    case "triangle":
      next = {
        type: "triangle",
        ...base,
        w: 16,
        h: 14,
        fill: "#f2cc0c",
        text: "△"
      };
      break;
    case "parallelogram":
      next = {
        type: "parallelogram",
        ...base,
        w: 20,
        h: 12,
        fill: "#b877d9",
        text: "◇"
      };
      break;
    case "metricValue":
      next = {
        type: "metric",
        ...base,
        field: "Value",
        fill: "#f2cc0c",
        text: "—"
      };
      break;
    case "rectangle":
      next = { type: "rect", ...base, w: 20, h: 14, fill: "#3d71d9" };
      break;
    default:
      next = { type: "rect", ...base, w: 16, h: 12, fill: "#3d71d9" };
      break;
  }
  return [...ensureElementIds(elements), next];
}
function removeCanvasElements(elements, ids) {
  const set = new Set(ids);
  return elements.filter((el) => !el.id || !set.has(el.id));
}
function moveCanvasElement(elements, id, dx, dy) {
  return elements.map((el) => {
    if (el.id !== id) return el;
    if (el.type === "line") {
      return {
        ...el,
        x: el.x + dx,
        y: el.y + dy,
        x2: el.x2 + dx,
        y2: el.y2 + dy
      };
    }
    return { ...el, x: el.x + dx, y: el.y + dy };
  });
}
function moveCanvasElements(elements, ids, dx, dy) {
  let next = elements;
  for (const id of ids) next = moveCanvasElement(next, id, dx, dy);
  return next;
}
function resizeCanvasElement(elements, id, patch) {
  return elements.map((el) => {
    if (el.id !== id) return el;
    if (el.type === "rect" || el.type === "ellipse" || el.type === "icon" || el.type === "server" || el.type === "button" || el.type === "drone" || el.type === "windTurbine") {
      return {
        ...el,
        x: patch.x != null ? patch.x : el.x,
        y: patch.y != null ? patch.y : el.y,
        w: patch.w != null ? Math.max(1, patch.w) : el.w,
        h: patch.h != null ? Math.max(1, patch.h) : el.h
      };
    }
    if (el.type === "circle") {
      return {
        ...el,
        x: patch.x != null ? patch.x : el.x,
        y: patch.y != null ? patch.y : el.y,
        r: patch.r != null ? Math.max(1, patch.r) : el.r
      };
    }
    if (el.type === "line") {
      return {
        ...el,
        x2: patch.x2 != null ? patch.x2 : el.x2,
        y2: patch.y2 != null ? patch.y2 : el.y2
      };
    }
    if (el.type === "text" || el.type === "metric") {
      return {
        ...el,
        x: patch.x != null ? patch.x : el.x,
        y: patch.y != null ? patch.y : el.y
      };
    }
    return el;
  });
}
function selectCanvasElement(options, id, additive = false) {
  if (!id) return { ...options, selectedId: void 0, selectedIds: [] };
  let selectedIds = options.selectedIds ?? (options.selectedId ? [options.selectedId] : []);
  if (additive) {
    selectedIds = selectedIds.includes(id) ? selectedIds.filter((x) => x !== id) : [...selectedIds, id];
  } else {
    selectedIds = [id];
  }
  return {
    ...options,
    selectedId: selectedIds[selectedIds.length - 1],
    selectedIds
  };
}
function bindMetricText(elements, metricValue) {
  return elements.map((el) => {
    if (el.type !== "metric") return el;
    if (!el.field) return el;
    return { ...el, text: metricValue != null ? String(metricValue) : "—" };
  });
}
function serializeCanvasOptions(options) {
  const bgColor = options.backgroundColor ?? options.background ?? "#111418";
  const elements = ensureElementIds(options.elements ?? []);
  const connections = options.connections ?? collectConnections({}, elements);
  return {
    background: {
      color: bgColor,
      ...options.backgroundImage ? { image: options.backgroundImage } : {},
      size: options.backgroundSize ?? "cover"
    },
    // flat alias for simpler consumers
    "background.color": bgColor,
    ...options.backgroundImage ? { "background.image": options.backgroundImage } : {},
    "background.size": options.backgroundSize ?? "cover",
    elements,
    connections,
    root: {
      elements,
      ...typeof options.root === "object" && options.root ? options.root : {}
    },
    inlineEditing: options.inlineEditing !== false,
    panZoom: Boolean(
      options.panZoom === true || String(options.panZoom) === "true" || Number(options.panZoom) === 1
    ),
    panZoomHelp: options.panZoomHelp !== false,
    zoomToContent: Boolean(options.zoomToContent),
    showAdvancedTypes: Boolean(options.showAdvancedTypes),
    tooltip: {
      mode: options.tooltipMode ?? "auto",
      disableForOneClick: Boolean(options.tooltipDisableForOneClick)
    },
    "tooltip.mode": options.tooltipMode ?? "auto",
    "tooltip.disableForOneClick": Boolean(options.tooltipDisableForOneClick),
    ...options.selectedId ? { selectedId: options.selectedId } : {},
    ...options.selectedIds?.length ? { selectedIds: options.selectedIds } : {}
  };
}
function elementBounds(el) {
  if (el.type === "rect" || el.type === "ellipse")
    return { x: el.x, y: el.y, w: el.w, h: el.h };
  if (el.type === "circle")
    return { x: el.x - el.r, y: el.y - el.r, w: el.r * 2, h: el.r * 2 };
  if (el.type === "icon" || el.type === "server" || el.type === "button" || el.type === "drone" || el.type === "droneTop" || el.type === "droneFront" || el.type === "droneSide" || el.type === "windTurbine" || el.type === "cloud" || el.type === "triangle" || el.type === "parallelogram") {
    return { x: el.x, y: el.y, w: el.w ?? 10, h: el.h ?? 10 };
  }
  if (el.type === "line") {
    const x = Math.min(el.x, el.x2);
    const y = Math.min(el.y, el.y2);
    return {
      x,
      y,
      w: Math.max(1, Math.abs(el.x2 - el.x)),
      h: Math.max(1, Math.abs(el.y2 - el.y))
    };
  }
  return { x: el.x, y: el.y - 4, w: 20, h: 8 };
}
function cloneOptions(snapshot) {
  return JSON.parse(JSON.stringify(snapshot));
}
class CanvasHistory {
  past = [];
  future = [];
  limit;
  constructor(limit = 50) {
    this.limit = limit;
  }
  push(snapshot) {
    this.past.push(cloneOptions(snapshot));
    if (this.past.length > this.limit) this.past.shift();
    this.future = [];
  }
  undo(current) {
    const prev = this.past.pop();
    if (!prev) return null;
    this.future.push(cloneOptions(current));
    return prev;
  }
  redo(current) {
    const next = this.future.pop();
    if (!next) return null;
    this.past.push(cloneOptions(current));
    return next;
  }
  get canUndo() {
    return this.past.length > 0;
  }
  get canRedo() {
    return this.future.length > 0;
  }
}
const _hoisted_1$2w = ["data-inline-editing", "data-pan-zoom", "data-zoom-to-content", "data-show-advanced", "data-tooltip-mode", "data-bg-color", "data-bg-image", "data-bg-size", "data-border-color", "data-border-width", "data-color", "data-element-count", "data-connection-count", "data-has-root", "data-has-drone", "data-has-wind-turbine", "data-vertex-total", "data-view-scale", "data-pan-zoom-help"];
const _hoisted_2$1_ = {
  key: 0,
  class: "pan-zoom-help",
  "data-testid": "canvas-pan-zoom-help",
  role: "note"
};
const _hoisted_3$1K = {
  key: 1,
  class: "toolbar",
  "data-testid": "canvas-toolbar"
};
const _hoisted_4$1r = ["disabled"];
const _hoisted_5$1i = ["disabled"];
const _hoisted_6$17 = ["disabled"];
const _hoisted_7$$ = ["disabled"];
const _hoisted_8$S = ["disabled"];
const _hoisted_9$P = ["disabled"];
const _hoisted_10$H = ["disabled"];
const _hoisted_11$A = {
  key: 5,
  class: "constraint"
};
const _hoisted_12$t = ["value"];
const _hoisted_13$t = {
  key: 6,
  class: "constraint"
};
const _hoisted_14$s = ["value"];
const _hoisted_15$n = {
  key: 2,
  class: "element-props",
  "data-testid": "canvas-element-props"
};
const _hoisted_16$l = ["value"];
const _hoisted_17$i = ["value"];
const _hoisted_18$i = { key: 0 };
const _hoisted_19$g = ["value"];
const _hoisted_20$e = { key: 1 };
const _hoisted_21$a = ["value"];
const _hoisted_22$a = { key: 2 };
const _hoisted_23$6 = ["value"];
const _hoisted_24$6 = { key: 3 };
const _hoisted_25$6 = ["value"];
const _hoisted_26$6 = { key: 4 };
const _hoisted_27$5 = ["value"];
const _hoisted_28$5 = { key: 5 };
const _hoisted_29$5 = ["value"];
const _hoisted_30$5 = { key: 6 };
const _hoisted_31$5 = ["value"];
const _hoisted_32$5 = ["value"];
const _hoisted_33$5 = ["value"];
const _hoisted_34$5 = ["data-inline-editing", "data-pan-zoom", "data-bg-color"];
const _hoisted_35$4 = ["data-el-type", "data-el-id", "onPointerdown"];
const _hoisted_36$3 = {
  key: 0,
  class: "metric-text"
};
const _hoisted_37$3 = {
  key: 2,
  class: "fallback-label"
};
const _hoisted_38$3 = ["viewBox", "data-inline-editing", "data-pan-zoom", "data-bg-color"];
const _hoisted_39$3 = { key: 0 };
const _hoisted_40$2 = ["width", "height"];
const _hoisted_41$2 = ["href", "width", "height", "preserveAspectRatio"];
const _hoisted_42$2 = ["width", "height", "fill"];
const _hoisted_43$2 = ["data-source", "data-target", "data-vertex-count", "data-path-type"];
const _hoisted_44$2 = ["d", "stroke", "stroke-width"];
const _hoisted_45$2 = ["cx", "cy", "onPointerdown"];
const _hoisted_46$2 = ["data-el-type", "data-el-animation", "transform", "onPointerdown"];
const _hoisted_47$2 = ["x", "y", "width", "height", "rx", "fill", "stroke", "data-el-id"];
const _hoisted_48$1 = ["x", "y"];
const _hoisted_49$1 = ["x1", "y1", "x2", "y2"];
const _hoisted_50$1 = ["cx", "cy", "r", "fill", "stroke"];
const _hoisted_51$1 = ["cx", "cy", "rx", "ry", "fill", "stroke"];
const _hoisted_52$1 = ["d", "fill", "stroke"];
const _hoisted_53 = ["points", "fill", "stroke"];
const _hoisted_54 = ["points", "fill", "stroke"];
const _hoisted_55 = ["x", "y"];
const _hoisted_56 = ["x", "y", "width", "height", "fill", "stroke"];
const _hoisted_57 = ["x", "y"];
const _hoisted_58 = ["x1", "y1", "x2", "y2", "stroke", "stroke-width", "stroke-dasharray", "data-line-style", "data-has-links", "data-has-actions", "title", "onClick"];
const _hoisted_59 = ["x", "y", "width", "height", "fill", "stroke", "data-el-id"];
const _hoisted_60 = ["x", "y", "fill", "font-size"];
const _hoisted_61 = ["x", "y", "fill", "font-size"];
const _hoisted_62 = ["x", "y", "onPointerdown"];
const _sfc_main$3b = /* @__PURE__ */ defineComponent({
  __name: "CanvasEditor",
  props: {
    options: {},
    metricValue: {},
    editable: { type: Boolean },
    width: {},
    height: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const viewBox = computed(() => {
      const w = Number(props.width);
      const h2 = Number(props.height);
      if (Number.isFinite(w) && w > 0 && Number.isFinite(h2) && h2 > 0) {
        return `0 0 ${Math.round(w)} ${Math.round(h2)}`;
      }
      return "0 0 100 100";
    });
    const viewBoxW = computed(() => {
      const w = Number(props.width);
      return Number.isFinite(w) && w > 0 ? Math.round(w) : 100;
    });
    const viewBoxH = computed(() => {
      const h2 = Number(props.height);
      return Number.isFinite(h2) && h2 > 0 ? Math.round(h2) : 100;
    });
    const usePixelLayout = computed(() => {
      const w = Number(props.width);
      const h2 = Number(props.height);
      return Number.isFinite(w) && w > 40 && Number.isFinite(h2) && h2 > 40;
    });
    const emit = __emit;
    const local = ref(normalizeCanvasOptions(props.options ?? {}));
    const viewScale = ref(1);
    const viewPan = ref({ x: 0, y: 0 });
    const history = new CanvasHistory();
    const canUndo = ref(false);
    const canRedo = ref(false);
    function refreshHistoryFlags() {
      canUndo.value = history.canUndo;
      canRedo.value = history.canRedo;
    }
    watch(
      () => props.options,
      (o) => {
        if (o) local.value = normalizeCanvasOptions(o);
      }
    );
    const elements = computed(() => {
      const base = local.value.elements?.length ? local.value.elements : defaultCanvasElements(props.metricValue);
      return bindMetricText(base, props.metricValue);
    });
    const selectedIds = computed(
      () => local.value.selectedIds ?? (local.value.selectedId ? [local.value.selectedId] : [])
    );
    const connections = computed(() => local.value.connections ?? []);
    const connectionPaths = computed(
      () => connections.value.map((c) => {
        const path = connectionPath(elements.value, c);
        return path ? { conn: c, ...path } : null;
      }).filter(Boolean)
    );
    function htmlElStyle(el) {
      const any = el;
      const w = Number(any.w ?? (el.type === "circle" ? (any.r ?? 8) * 2 : 100));
      const h2 = Number(any.h ?? (el.type === "circle" ? (any.r ?? 8) * 2 : 100));
      const base = {
        position: "absolute",
        left: `${el.x}px`,
        top: `${el.y}px`,
        width: `${w}px`,
        height: `${h2}px`,
        boxSizing: "border-box"
      };
      if (el.type === "metric") {
        base.background = String(any.fill ?? "#D9D9D9");
        base.display = "table";
        base.color = String(any.textColor ?? "#000000");
        base.fontSize = `${Number(any.fontSize ?? 20)}px`;
        base.fontFamily = "Inter, Helvetica, Arial, sans-serif";
        base.fontWeight = "400";
        base.lineHeight = "normal";
      } else if (el.type === "rect" || el.type === "button" || el.type === "server") {
        base.background = String(any.fill ?? "var(--grafana-primary)");
      } else if (el.type === "circle" || el.type === "ellipse") {
        base.background = String(any.fill ?? "#73bf69");
        base.borderRadius = el.type === "circle" ? "50%" : "50%";
      }
      if (isSelected(el.id)) {
        base.outline = "1px solid #fff";
      }
      return base;
    }
    function isSelected(id) {
      return !!id && selectedIds.value.includes(id);
    }
    function connectSelected() {
      if (selectedIds.value.length < 2) return;
      const [source, target] = selectedIds.value.slice(-2);
      const base = {
        ...local.value,
        elements: elements.value,
        connections: local.value.connections ?? []
      };
      commit(addConnection(base, source, target));
    }
    function removeSelectedConnections() {
      let next = {
        ...local.value,
        elements: elements.value,
        connections: [...local.value.connections ?? []]
      };
      for (const c of connections.value) {
        if (selectedIds.value.includes(c.source) || selectedIds.value.includes(c.target)) {
          next = removeConnection(next, c.id ?? "");
        }
      }
      commit(next);
    }
    function toggleLastPathType() {
      const last = connections.value[connections.value.length - 1];
      if (!last?.id) return;
      commit(
        toggleConnectionPathType(
          {
            ...local.value,
            elements: elements.value,
            connections: local.value.connections ?? []
          },
          last.id
        )
      );
    }
    function setConstraint(axis, value) {
      const id = selectedIds.value[selectedIds.value.length - 1];
      if (!id) return;
      const el = elements.value.find((e) => e.id === id);
      const constraint = { ...el?.constraint ?? {}, [axis]: value };
      let els = setElementConstraint(elements.value, id, constraint);
      els = applyConstraints(els, 100, 100);
      commit({ ...local.value, elements: els });
    }
    function hasTextProp(el) {
      if (!el) return false;
      return "text" in el || [
        "text",
        "metric",
        "button",
        "server",
        "drone",
        "droneTop",
        "droneFront",
        "droneSide",
        "windTurbine",
        "cloud",
        "triangle",
        "parallelogram",
        "rect"
      ].includes(el.type);
    }
    function patchSelectedElement(partial) {
      const id = selectedIds.value[selectedIds.value.length - 1];
      if (!id) return;
      const els = updateCanvasElement(elements.value, id, partial);
      commit({ ...local.value, elements: els });
    }
    const selectedElement = computed(() => {
      const id = selectedIds.value[selectedIds.value.length - 1];
      return elements.value.find((e) => e.id === id);
    });
    function commit(next, record = true) {
      if (record) history.push(local.value);
      local.value = next;
      emit("change", serializeCanvasOptions(next));
      refreshHistoryFlags();
    }
    function add(type) {
      const els = addCanvasElement(elements.value, type);
      const selectedId = els[els.length - 1]?.id;
      commit({
        ...local.value,
        elements: els,
        selectedId,
        selectedIds: selectedId ? [selectedId] : []
      });
    }
    function removeSelected() {
      if (!selectedIds.value.length) return;
      commit({
        ...local.value,
        elements: removeCanvasElements(elements.value, selectedIds.value),
        selectedId: void 0,
        selectedIds: []
      });
    }
    function select(id, additive = false) {
      commit(
        selectCanvasElement(
          { ...local.value, elements: elements.value },
          id,
          additive
        ),
        false
      );
    }
    function undo() {
      const prev = history.undo(local.value);
      if (!prev) return;
      local.value = prev;
      emit("change", serializeCanvasOptions(prev));
      refreshHistoryFlags();
    }
    function redo() {
      const next = history.redo(local.value);
      if (!next) return;
      local.value = next;
      emit("change", serializeCanvasOptions(next));
      refreshHistoryFlags();
    }
    const dragging = ref(null);
    function svgPoint(evt, svg) {
      const pt = svg.createSVGPoint();
      pt.x = evt.clientX;
      pt.y = evt.clientY;
      const ctm = svg.getScreenCTM();
      if (!ctm) return { x: 0, y: 0 };
      const p = pt.matrixTransform(ctm.inverse());
      return { x: p.x, y: p.y };
    }
    function ownerSvg(evt) {
      const el = evt.currentTarget;
      if (el instanceof SVGSVGElement) return el;
      return el.ownerSVGElement;
    }
    function onPointerDown(evt, id) {
      if (!props.editable) return;
      const svg = ownerSvg(evt);
      if (!svg) return;
      evt.currentTarget.setPointerCapture?.(evt.pointerId);
      const p = svgPoint(evt, svg);
      const additive = evt.shiftKey || evt.metaKey || evt.ctrlKey;
      const nextSel = selectCanvasElement(
        { ...local.value, elements: elements.value },
        id,
        additive
      );
      local.value = nextSel;
      const ids = nextSel.selectedIds?.length ? nextSel.selectedIds : [id];
      dragging.value = { kind: "move", ids, lastX: p.x, lastY: p.y };
    }
    function onResizeDown(evt, id) {
      if (!props.editable) return;
      evt.stopPropagation();
      const svg = ownerSvg(evt);
      if (!svg) return;
      evt.currentTarget.setPointerCapture?.(evt.pointerId);
      const p = svgPoint(evt, svg);
      const origin = elements.value.find((e) => e.id === id);
      if (!origin) return;
      history.push(local.value);
      dragging.value = {
        kind: "resize",
        id,
        startX: p.x,
        startY: p.y,
        origin: JSON.parse(JSON.stringify(origin))
      };
      local.value = { ...local.value, selectedId: id, selectedIds: [id] };
    }
    function onPointerMove(evt) {
      if (!dragging.value || !props.editable) return;
      if (dragging.value.kind === "vertex") {
        const svg2 = ownerSvg(evt);
        if (!svg2) return;
        const p2 = svgPoint(evt, svg2);
        const d = dragging.value;
        const conn = (local.value.connections ?? []).find((c) => c.id === d.connId);
        if (!conn) return;
        const verts = [...conn.vertices ?? []];
        verts[d.vertexIndex] = { x: p2.x, y: p2.y };
        local.value = setConnectionVertices(local.value, d.connId, verts);
        return;
      }
      const svg = ownerSvg(evt);
      if (!svg) return;
      const p = svgPoint(evt, svg);
      if (dragging.value.kind === "move") {
        const dx = p.x - dragging.value.lastX;
        const dy = p.y - dragging.value.lastY;
        if (Math.abs(dx) < 0.01 && Math.abs(dy) < 0.01) return;
        const els = moveCanvasElements(elements.value, dragging.value.ids, dx, dy);
        dragging.value = {
          kind: "move",
          ids: dragging.value.ids,
          lastX: p.x,
          lastY: p.y
        };
        local.value = { ...local.value, elements: els };
        return;
      }
      const { id, origin } = dragging.value;
      if (origin.type === "rect" || origin.type === "ellipse" || origin.type === "icon" || origin.type === "server" || origin.type === "button" || origin.type === "drone" || origin.type === "droneTop" || origin.type === "droneFront" || origin.type === "droneSide" || origin.type === "windTurbine" || origin.type === "cloud" || origin.type === "triangle" || origin.type === "parallelogram") {
        const w = Math.max(
          1,
          Number(origin.w ?? 12) + (p.x - dragging.value.startX)
        );
        const h2 = Math.max(
          1,
          Number(origin.h ?? 10) + (p.y - dragging.value.startY)
        );
        local.value = {
          ...local.value,
          elements: resizeCanvasElement(elements.value, id, { w, h: h2 })
        };
      } else if (origin.type === "circle") {
        const r = Math.max(
          1,
          origin.r + (p.x - dragging.value.startX + p.y - dragging.value.startY) / 2
        );
        local.value = {
          ...local.value,
          elements: resizeCanvasElement(elements.value, id, { r })
        };
      } else if (origin.type === "line") {
        local.value = {
          ...local.value,
          elements: resizeCanvasElement(elements.value, id, { x2: p.x, y2: p.y })
        };
      }
    }
    function onPointerUp() {
      if (!dragging.value) return;
      const wasResize = dragging.value.kind === "resize";
      dragging.value = null;
      commit({ ...local.value, elements: elements.value }, !wasResize);
    }
    function onVertexDown(evt, connId, vertexIndex) {
      if (!props.editable) return;
      evt.stopPropagation();
      const svg = ownerSvg(evt);
      if (!svg) return;
      evt.currentTarget.setPointerCapture?.(evt.pointerId);
      history.push(local.value);
      dragging.value = { kind: "vertex", connId, vertexIndex };
    }
    function addVertexToLast() {
      const last = connections.value[connections.value.length - 1];
      if (!last?.id) return;
      history.push(local.value);
      const mid = { x: 50, y: 50 };
      if (last.source && last.target) {
        const path = connectionPath(elements.value, last);
        if (path) {
          mid.x = (path.x1 + path.x2) / 2;
          mid.y = (path.y1 + path.y2) / 2;
        }
      }
      const next = addConnectionVertex(local.value, last.id, mid);
      commit(next, false);
    }
    function onWheel(evt) {
      if (!local.value.panZoom) return;
      evt.preventDefault();
      const dir = evt.deltaY > 0 ? 0.9 : 1.1;
      viewScale.value = Math.max(0.4, Math.min(3, viewScale.value * dir));
    }
    function onBgClick(evt) {
      if (!props.editable) return;
      if (evt.target === evt.currentTarget) select(void 0);
    }
    function hit(el) {
      return el.id ?? "";
    }
    function cloudPath(el) {
      const x = Number(el.x), y = Number(el.y), w = Number(el.w ?? 16), h2 = Number(el.h ?? 12);
      const cy = y + h2 / 2;
      return `M ${x + w * 0.2} ${cy + h2 * 0.15}
    a ${w * 0.18} ${h2 * 0.22} 0 1 1 ${w * 0.15} ${-h2 * 0.2}
    a ${w * 0.22} ${h2 * 0.25} 0 1 1 ${w * 0.35} 0
    a ${w * 0.16} ${h2 * 0.2} 0 1 1 ${w * 0.12} ${h2 * 0.18}
    z`;
    }
    function trianglePoints(el) {
      const x = Number(el.x), y = Number(el.y), w = Number(el.w ?? 16), h2 = Number(el.h ?? 14);
      return `${x + w / 2},${y} ${x + w},${y + h2} ${x},${y + h2}`;
    }
    function parallelogramPoints(el) {
      const x = Number(el.x), y = Number(el.y), w = Number(el.w ?? 20), h2 = Number(el.h ?? 12);
      const skew = w * 0.25;
      return `${x + skew},${y} ${x + w},${y} ${x + w - skew},${y + h2} ${x},${y + h2}`;
    }
    function handlePos(el) {
      const b = elementBounds(el);
      return { x: b.x + b.w, y: b.y + b.h };
    }
    function linkTitle(el) {
      const links = el?.links;
      if (!Array.isArray(links) || !links.length) return String(el?.name || el?.id || "");
      return links.map((l) => l?.title || l?.url || String(l)).filter(Boolean).join(" · ");
    }
    function onElementActivate(el) {
      const links = el?.links;
      if (Array.isArray(links) && links[0]) {
        const url = links[0].url || links[0].href || (typeof links[0] === "string" ? links[0] : "");
        if (url && typeof window !== "undefined") {
          try {
            window.open(String(url), "_blank", "noopener,noreferrer");
          } catch {
          }
        }
      }
      if (el?.actions?.length) {
        el.__lastAction = el.actions[0];
      }
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "canvas-editor",
        "data-testid": "canvas-editor",
        "data-inline-editing": String(local.value.inlineEditing !== false),
        "data-pan-zoom": String(!!local.value.panZoom),
        "data-zoom-to-content": String(!!local.value.zoomToContent),
        "data-show-advanced": String(!!local.value.showAdvancedTypes),
        "data-tooltip-mode": String(local.value.tooltipMode ?? "auto"),
        "data-bg-color": String(local.value.backgroundColor || local.value.background || "#111418"),
        "data-bg-image": String(local.value.backgroundImage || ""),
        "data-bg-size": String(local.value.backgroundSize || "cover"),
        "data-border-color": String(local.value.borderColor || ""),
        "data-border-width": String(local.value.borderWidth ?? ""),
        "data-color": String(local.value.color || ""),
        "data-element-count": String(elements.value.length),
        "data-connection-count": String(connections.value.length),
        "data-has-root": String(!!local.value.root),
        "data-has-drone": String(elements.value.some((e) => String(e.type).startsWith("drone"))),
        "data-has-wind-turbine": String(elements.value.some((e) => e.type === "windTurbine")),
        "data-vertex-total": String(connections.value.reduce((n, c) => n + (c.vertices?.length ?? 0), 0)),
        "data-view-scale": String(viewScale.value),
        "data-pan-zoom-help": String(!!local.value.panZoom && local.value.panZoomHelp !== false)
      }, [
        createCommentVNode(" Grafana PanZoomHelp: options-pane info; surface when panZoom enabled "),
        local.value.panZoom ? (openBlock(), createElementBlock("div", _hoisted_2$1_, [..._cache[30] || (_cache[30] = [
          createElementVNode(
            "div",
            { class: "pan-zoom-help__title" },
            "平移与缩放控制",
            -1
            /* CACHED */
          ),
          createElementVNode(
            "ul",
            { class: "pan-zoom-help__list" },
            [
              createElementVNode("li", null, "平移：中键 或 Ctrl + 右键拖动"),
              createElementVNode("li", null, "缩放：滚轮"),
              createElementVNode("li", null, "重置：双击")
            ],
            -1
            /* CACHED */
          )
        ])])) : createCommentVNode("v-if", true),
        __props.editable && local.value.inlineEditing !== false ? (openBlock(), createElementBlock("div", _hoisted_3$1K, [
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-rect",
            onClick: _cache[0] || (_cache[0] = ($event) => add("rect"))
          }, " 矩形 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-circle",
            onClick: _cache[1] || (_cache[1] = ($event) => add("circle"))
          }, " 圆形 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-text",
            onClick: _cache[2] || (_cache[2] = ($event) => add("text"))
          }, " 文本 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-metric",
            onClick: _cache[3] || (_cache[3] = ($event) => add("metric"))
          }, " 指标 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-line",
            onClick: _cache[4] || (_cache[4] = ($event) => add("line"))
          }, " 直线 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-ellipse",
            onClick: _cache[5] || (_cache[5] = ($event) => add("ellipse"))
          }, " 椭圆 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-cloud",
            onClick: _cache[6] || (_cache[6] = ($event) => add("cloud"))
          }, " 云 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-triangle",
            onClick: _cache[7] || (_cache[7] = ($event) => add("triangle"))
          }, " 三角 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-parallelogram",
            onClick: _cache[8] || (_cache[8] = ($event) => add("parallelogram"))
          }, " 平行四边形 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-icon",
            onClick: _cache[9] || (_cache[9] = ($event) => add("icon"))
          }, " 图标 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-server",
            onClick: _cache[10] || (_cache[10] = ($event) => add("server"))
          }, " 服务器 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-button",
            onClick: _cache[11] || (_cache[11] = ($event) => add("button"))
          }, " 按钮 "),
          local.value.showAdvancedTypes ? (openBlock(), createElementBlock("button", {
            key: 0,
            type: "button",
            "data-testid": "canvas-add-drone",
            onClick: _cache[12] || (_cache[12] = ($event) => add("drone"))
          }, " 无人机 ")) : createCommentVNode("v-if", true),
          local.value.showAdvancedTypes ? (openBlock(), createElementBlock("button", {
            key: 1,
            type: "button",
            "data-testid": "canvas-add-drone-top",
            onClick: _cache[13] || (_cache[13] = ($event) => add("droneTop"))
          }, " 无人机顶视 ")) : createCommentVNode("v-if", true),
          local.value.showAdvancedTypes ? (openBlock(), createElementBlock("button", {
            key: 2,
            type: "button",
            "data-testid": "canvas-add-drone-front",
            onClick: _cache[14] || (_cache[14] = ($event) => add("droneFront"))
          }, " 无人机前视 ")) : createCommentVNode("v-if", true),
          local.value.showAdvancedTypes ? (openBlock(), createElementBlock("button", {
            key: 3,
            type: "button",
            "data-testid": "canvas-add-drone-side",
            onClick: _cache[15] || (_cache[15] = ($event) => add("droneSide"))
          }, " 无人机侧视 ")) : createCommentVNode("v-if", true),
          local.value.showAdvancedTypes ? (openBlock(), createElementBlock("button", {
            key: 4,
            type: "button",
            "data-testid": "canvas-add-wind-turbine",
            onClick: _cache[16] || (_cache[16] = ($event) => add("windTurbine"))
          }, " 风机 ")) : createCommentVNode("v-if", true),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-connect",
            disabled: selectedIds.value.length < 2,
            onClick: connectSelected
          }, " 连接 ", 8, _hoisted_4$1r),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-add-vertex",
            disabled: !connections.value.length,
            onClick: addVertexToLast
          }, " 加顶点 ", 8, _hoisted_5$1i),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-path-type",
            disabled: !connections.value.length,
            onClick: toggleLastPathType
          }, " 路径类型 ", 8, _hoisted_6$17),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-disconnect",
            disabled: !connections.value.length,
            onClick: removeSelectedConnections
          }, " 断连 ", 8, _hoisted_7$$),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-remove",
            disabled: !selectedIds.value.length,
            onClick: removeSelected
          }, " 删除 ", 8, _hoisted_8$S),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-undo",
            disabled: !canUndo.value,
            onClick: undo
          }, " 撤销 ", 8, _hoisted_9$P),
          createElementVNode("button", {
            type: "button",
            "data-testid": "canvas-redo",
            disabled: !canRedo.value,
            onClick: redo
          }, " 重做 ", 8, _hoisted_10$H),
          selectedElement.value ? (openBlock(), createElementBlock("label", _hoisted_11$A, [
            _cache[32] || (_cache[32] = createTextVNode(
              " 水平 ",
              -1
              /* CACHED */
            )),
            createElementVNode("select", {
              "data-testid": "canvas-constraint-h",
              value: selectedElement.value.constraint?.horizontal ?? "",
              onChange: _cache[17] || (_cache[17] = ($event) => setConstraint(
                "horizontal",
                $event.target.value
              ))
            }, [..._cache[31] || (_cache[31] = [
              createElementVNode(
                "option",
                { value: "" },
                "自由",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "left" },
                "左",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "center" },
                "中",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "right" },
                "右",
                -1
                /* CACHED */
              )
            ])], 40, _hoisted_12$t)
          ])) : createCommentVNode("v-if", true),
          selectedElement.value ? (openBlock(), createElementBlock("label", _hoisted_13$t, [
            _cache[34] || (_cache[34] = createTextVNode(
              " 垂直 ",
              -1
              /* CACHED */
            )),
            createElementVNode("select", {
              "data-testid": "canvas-constraint-v",
              value: selectedElement.value.constraint?.vertical ?? "",
              onChange: _cache[18] || (_cache[18] = ($event) => setConstraint(
                "vertical",
                $event.target.value
              ))
            }, [..._cache[33] || (_cache[33] = [
              createElementVNode(
                "option",
                { value: "" },
                "自由",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "top" },
                "上",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "center" },
                "中",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "bottom" },
                "下",
                -1
                /* CACHED */
              )
            ])], 40, _hoisted_14$s)
          ])) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true),
        __props.editable && selectedElement.value ? (openBlock(), createElementBlock("div", _hoisted_15$n, [
          _cache[47] || (_cache[47] = createElementVNode(
            "strong",
            null,
            "元素属性",
            -1
            /* CACHED */
          )),
          createElementVNode("label", null, [
            _cache[35] || (_cache[35] = createTextVNode(
              "名称 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-name",
              value: String(selectedElement.value.name ?? selectedElement.value.id ?? ""),
              onChange: _cache[19] || (_cache[19] = ($event) => patchSelectedElement({
                name: $event.target.value
              }))
            }, null, 40, _hoisted_16$l)
          ]),
          createElementVNode("label", null, [
            _cache[36] || (_cache[36] = createTextVNode(
              "填充色 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-fill",
              type: "color",
              value: String(selectedElement.value.fill ?? "var(--grafana-primary)"),
              onInput: _cache[20] || (_cache[20] = ($event) => patchSelectedElement({
                fill: $event.target.value
              }))
            }, null, 40, _hoisted_17$i)
          ]),
          hasTextProp(selectedElement.value) ? (openBlock(), createElementBlock("label", _hoisted_18$i, [
            _cache[37] || (_cache[37] = createTextVNode(
              "文本 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-text",
              value: String(selectedElement.value.text ?? ""),
              onChange: _cache[21] || (_cache[21] = ($event) => patchSelectedElement({
                text: $event.target.value
              }))
            }, null, 40, _hoisted_19$g)
          ])) : createCommentVNode("v-if", true),
          selectedElement.value.type === "metric" ? (openBlock(), createElementBlock("label", _hoisted_20$e, [
            _cache[38] || (_cache[38] = createTextVNode(
              "字段 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-field",
              value: String(selectedElement.value.field ?? ""),
              onChange: _cache[22] || (_cache[22] = ($event) => patchSelectedElement({
                field: $event.target.value
              }))
            }, null, 40, _hoisted_21$a)
          ])) : createCommentVNode("v-if", true),
          selectedElement.value.type === "line" ? (openBlock(), createElementBlock("label", _hoisted_22$a, [
            _cache[39] || (_cache[39] = createTextVNode(
              "描边色 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-stroke",
              type: "color",
              value: String(selectedElement.value.stroke ?? "#8ab8ff"),
              onInput: _cache[23] || (_cache[23] = ($event) => patchSelectedElement({
                stroke: $event.target.value
              }))
            }, null, 40, _hoisted_23$6)
          ])) : createCommentVNode("v-if", true),
          selectedElement.value.type === "line" ? (openBlock(), createElementBlock("label", _hoisted_24$6, [
            _cache[40] || (_cache[40] = createTextVNode(
              "线宽 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-stroke-width",
              type: "number",
              min: "0.2",
              step: "0.2",
              value: Number(selectedElement.value.strokeWidth ?? 1),
              onChange: _cache[24] || (_cache[24] = ($event) => patchSelectedElement({
                strokeWidth: Number($event.target.value)
              }))
            }, null, 40, _hoisted_25$6)
          ])) : createCommentVNode("v-if", true),
          "w" in selectedElement.value ? (openBlock(), createElementBlock("label", _hoisted_26$6, [
            _cache[41] || (_cache[41] = createTextVNode(
              "宽 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-w",
              type: "number",
              value: Number(selectedElement.value.w ?? 12),
              onChange: _cache[25] || (_cache[25] = ($event) => patchSelectedElement({
                w: Number($event.target.value)
              }))
            }, null, 40, _hoisted_27$5)
          ])) : createCommentVNode("v-if", true),
          "h" in selectedElement.value ? (openBlock(), createElementBlock("label", _hoisted_28$5, [
            _cache[42] || (_cache[42] = createTextVNode(
              "高 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-h",
              type: "number",
              value: Number(selectedElement.value.h ?? 10),
              onChange: _cache[26] || (_cache[26] = ($event) => patchSelectedElement({
                h: Number($event.target.value)
              }))
            }, null, 40, _hoisted_29$5)
          ])) : createCommentVNode("v-if", true),
          selectedElement.value.type === "circle" ? (openBlock(), createElementBlock("label", _hoisted_30$5, [
            _cache[43] || (_cache[43] = createTextVNode(
              "半径 ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-r",
              type: "number",
              value: Number(selectedElement.value.r ?? 8),
              onChange: _cache[27] || (_cache[27] = ($event) => patchSelectedElement({
                r: Number($event.target.value)
              }))
            }, null, 40, _hoisted_31$5)
          ])) : createCommentVNode("v-if", true),
          createElementVNode("label", null, [
            _cache[44] || (_cache[44] = createTextVNode(
              "旋转° ",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              "data-testid": "canvas-el-rotation",
              type: "number",
              value: Number(selectedElement.value.rotation ?? 0),
              onChange: _cache[28] || (_cache[28] = ($event) => patchSelectedElement({
                rotation: Number($event.target.value)
              }))
            }, null, 40, _hoisted_32$5)
          ]),
          createElementVNode("label", null, [
            _cache[46] || (_cache[46] = createTextVNode(
              "动画 ",
              -1
              /* CACHED */
            )),
            createElementVNode("select", {
              "data-testid": "canvas-el-animation",
              value: String(selectedElement.value.animation ?? "none"),
              onChange: _cache[29] || (_cache[29] = ($event) => patchSelectedElement({
                animation: $event.target.value
              }))
            }, [..._cache[45] || (_cache[45] = [
              createElementVNode(
                "option",
                { value: "none" },
                "无",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "pulse" },
                "脉冲",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "spin" },
                "旋转",
                -1
                /* CACHED */
              ),
              createElementVNode(
                "option",
                { value: "blink" },
                "闪烁",
                -1
                /* CACHED */
              )
            ])], 40, _hoisted_33$5)
          ])
        ])) : createCommentVNode("v-if", true),
        createCommentVNode(" Grafana Scene uses absolute HTML elements (not SVG text) — dual-run path "),
        usePixelLayout.value ? (openBlock(), createElementBlock("div", {
          key: 3,
          class: "canvas-html",
          "data-testid": "panel-canvas",
          "data-inline-editing": String(local.value.inlineEditing !== false),
          "data-pan-zoom": String(!!local.value.panZoom),
          "data-bg-color": String(local.value.backgroundColor || local.value.background || "transparent"),
          "data-pixel-layout": true,
          role: "img",
          "aria-label": "画布面板",
          style: normalizeStyle({
            width: viewBoxW.value + "px",
            height: viewBoxH.value + "px",
            background: local.value.backgroundImage ? `url(${local.value.backgroundImage}) ${local.value.backgroundSize || "cover"} center/cover no-repeat` : local.value.backgroundColor || local.value.background || "transparent",
            transform: `translate(${viewPan.value.x}px,${viewPan.value.y}px) scale(${viewScale.value})`,
            transformOrigin: "center center"
          }),
          onClick: onBgClick
        }, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(elements.value, (el, i) => {
              return openBlock(), createElementBlock("div", {
                key: el.id ?? i,
                class: normalizeClass(["canvas-el", ["type-" + el.type, { selected: isSelected(el.id) }]]),
                "data-el-type": el.type,
                "data-el-id": hit(el),
                style: normalizeStyle(htmlElStyle(el)),
                onPointerdown: withModifiers(($event) => props.editable ? onPointerDown($event, hit(el)) : void 0, ["stop"])
              }, [
                el.type === "metric" ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_36$3,
                  toDisplayString(el.text || "Double click to set field"),
                  1
                  /* TEXT */
                )) : el.type === "text" ? (openBlock(), createElementBlock(
                  "span",
                  {
                    key: 1,
                    class: "plain-text",
                    style: normalizeStyle({
                      color: el.fill || "var(--grafana-text)",
                      fontSize: (el.fontSize || 12) + "px"
                    })
                  },
                  toDisplayString(el.text),
                  5
                  /* TEXT, STYLE */
                )) : (openBlock(), createElementBlock(
                  "span",
                  _hoisted_37$3,
                  toDisplayString(el.type),
                  1
                  /* TEXT */
                ))
              ], 46, _hoisted_35$4);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ], 12, _hoisted_34$5)) : (openBlock(), createElementBlock("svg", {
          key: 4,
          class: "canvas",
          viewBox: viewBox.value,
          preserveAspectRatio: "none",
          onWheel: withModifiers(onWheel, ["prevent"]),
          style: normalizeStyle({
            transform: `translate(${viewPan.value.x}px,${viewPan.value.y}px) scale(${viewScale.value})`,
            transformOrigin: "center center"
          }),
          "data-testid": "panel-canvas",
          "data-inline-editing": String(local.value.inlineEditing !== false),
          "data-pan-zoom": String(!!local.value.panZoom),
          "data-bg-color": String(local.value.backgroundColor || local.value.background || "#111418"),
          role: "img",
          "aria-label": "画布面板",
          onPointermove: onPointerMove,
          onPointerup: onPointerUp,
          onPointerleave: onPointerUp,
          onClick: onBgClick
        }, [
          local.value.backgroundImage ? (openBlock(), createElementBlock("defs", _hoisted_39$3, [
            createElementVNode("pattern", {
              id: "canvas-bg-img",
              patternUnits: "userSpaceOnUse",
              width: viewBoxW.value,
              height: viewBoxH.value
            }, [
              createElementVNode("image", {
                href: local.value.backgroundImage,
                x: "0",
                y: "0",
                width: viewBoxW.value,
                height: viewBoxH.value,
                preserveAspectRatio: local.value.backgroundSize === "contain" ? "xMidYMid meet" : "xMidYMid slice"
              }, null, 8, _hoisted_41$2)
            ], 8, _hoisted_40$2)
          ])) : createCommentVNode("v-if", true),
          createElementVNode("rect", {
            x: "0",
            y: "0",
            width: viewBoxW.value,
            height: viewBoxH.value,
            fill: local.value.backgroundImage ? "url(#canvas-bg-img)" : local.value.backgroundColor || local.value.background || "transparent"
          }, null, 8, _hoisted_42$2),
          _cache[48] || (_cache[48] = createElementVNode(
            "defs",
            null,
            [
              createElementVNode("marker", {
                id: "canvas-arrow",
                markerWidth: "4",
                markerHeight: "4",
                refX: "3",
                refY: "2",
                orient: "auto"
              }, [
                createElementVNode("path", {
                  d: "M0,0 L4,2 L0,4 Z",
                  fill: "#8ab8ff"
                })
              ])
            ],
            -1
            /* CACHED */
          )),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(connectionPaths.value, (cp, ci) => {
              return openBlock(), createElementBlock("g", {
                key: cp.conn.id ?? ci,
                "data-testid": "canvas-connection",
                "data-source": cp.conn.source,
                "data-target": cp.conn.target,
                "data-vertex-count": String(cp.conn.vertices?.length ?? 0),
                "data-path-type": String(cp.conn.pathType ?? "straight")
              }, [
                createElementVNode("path", {
                  d: cp.d,
                  fill: "none",
                  stroke: cp.conn.color ?? "#8ab8ff",
                  "stroke-width": cp.conn.strokeWidth ?? 0.8,
                  "marker-end": "url(#canvas-arrow)"
                }, null, 8, _hoisted_44$2),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(cp.conn.vertices ?? [], (v, vi) => {
                    return openBlock(), createElementBlock("circle", {
                      key: vi,
                      cx: v.x,
                      cy: v.y,
                      r: "1.6",
                      fill: "#f2cc0c",
                      stroke: "#0b0c0e",
                      "stroke-width": "0.3",
                      "data-testid": "canvas-connection-vertex",
                      style: { "cursor": "move" },
                      onPointerdown: withModifiers(($event) => onVertexDown($event, String(cp.conn.id ?? ""), vi), ["stop"])
                    }, null, 40, _hoisted_45$2);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ], 8, _hoisted_43$2);
            }),
            128
            /* KEYED_FRAGMENT */
          )),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(elements.value, (el, i) => {
              return openBlock(), createElementBlock("g", {
                key: el.id ?? i,
                "data-el-type": el.type,
                "data-el-animation": String(el.animation ?? "none"),
                transform: el.rotation ? `rotate(${el.rotation} ${el.x + (el.w ?? el.r ?? 0) / 2} ${el.y + (el.h ?? el.r ?? 0) / 2})` : void 0,
                style: { "cursor": "move" },
                onPointerdown: withModifiers(($event) => onPointerDown($event, hit(el)), ["stop"])
              }, [
                el.type === "rect" || el.type === "button" || el.type === "server" || el.type === "drone" || el.type === "droneTop" || el.type === "droneFront" || el.type === "droneSide" || el.type === "windTurbine" ? (openBlock(), createElementBlock("rect", {
                  key: 0,
                  x: el.x,
                  y: el.y,
                  width: el.w ?? 12,
                  height: el.h ?? 10,
                  rx: el.type === "button" ? 1.5 : el.type === "drone" ? 3 : el.type === "windTurbine" ? 1 : el.type === "server" ? 0.5 : 0,
                  fill: el.fill ?? (el.type === "server" ? "var(--grafana-primary)" : el.type === "button" ? "#3274d9" : el.type === "drone" ? "#6ed0e0" : el.type === "windTurbine" ? "#8ab8ff" : "var(--grafana-primary)"),
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "0.8",
                  "data-el-id": hit(el)
                }, null, 8, _hoisted_47$2)) : createCommentVNode("v-if", true),
                el.type === "button" || el.type === "server" || el.type === "drone" || el.type === "droneTop" || el.type === "droneFront" || el.type === "droneSide" || el.type === "windTurbine" ? (openBlock(), createElementBlock("text", {
                  key: 1,
                  x: el.x + (el.w ?? 12) / 2,
                  y: el.y + (el.h ?? 10) / 2 + 1.2,
                  "text-anchor": "middle",
                  fill: "#0b0c0e",
                  "font-size": "3.2",
                  style: { "pointer-events": "none" }
                }, toDisplayString(el.text || (el.type === "server" ? "Server" : el.type === "drone" ? "Drone" : el.type === "windTurbine" ? "Turbine" : "Button")), 9, _hoisted_48$1)) : createCommentVNode("v-if", true),
                createCommentVNode(" windTurbine pole visual "),
                el.type === "windTurbine" ? (openBlock(), createElementBlock("line", {
                  key: 2,
                  x1: el.x + (el.w ?? 12) / 2,
                  y1: el.y + (el.h ?? 18),
                  x2: el.x + (el.w ?? 12) / 2,
                  y2: el.y + (el.h ?? 18) + 6,
                  stroke: "#8ab8ff",
                  "stroke-width": "0.8",
                  style: { "pointer-events": "none" }
                }, null, 8, _hoisted_49$1)) : createCommentVNode("v-if", true),
                el.type === "circle" ? (openBlock(), createElementBlock("circle", {
                  key: 3,
                  cx: el.x,
                  cy: el.y,
                  r: el.r,
                  fill: el.fill ?? "#73bf69",
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "0.8"
                }, null, 8, _hoisted_50$1)) : createCommentVNode("v-if", true),
                el.type === "ellipse" ? (openBlock(), createElementBlock("ellipse", {
                  key: 4,
                  cx: el.x + el.w / 2,
                  cy: el.y + el.h / 2,
                  rx: el.w / 2,
                  ry: el.h / 2,
                  fill: el.fill ?? "#b877d9",
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "0.8"
                }, null, 8, _hoisted_51$1)) : createCommentVNode("v-if", true),
                el.type === "cloud" ? (openBlock(), createElementBlock("path", {
                  key: 5,
                  d: cloudPath(el),
                  fill: el.fill ?? "#8ab8ff",
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "0.8"
                }, null, 8, _hoisted_52$1)) : createCommentVNode("v-if", true),
                el.type === "triangle" ? (openBlock(), createElementBlock("polygon", {
                  key: 6,
                  points: trianglePoints(el),
                  fill: el.fill ?? "#f2cc0c",
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "0.8"
                }, null, 8, _hoisted_53)) : createCommentVNode("v-if", true),
                el.type === "parallelogram" ? (openBlock(), createElementBlock("polygon", {
                  key: 7,
                  points: parallelogramPoints(el),
                  fill: el.fill ?? "#b877d9",
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "0.8"
                }, null, 8, _hoisted_54)) : createCommentVNode("v-if", true),
                el.type === "cloud" || el.type === "triangle" || el.type === "parallelogram" ? (openBlock(), createElementBlock("text", {
                  key: 8,
                  x: el.x + (el.w ?? 16) / 2,
                  y: el.y + (el.h ?? 12) / 2 + 1.2,
                  "text-anchor": "middle",
                  fill: "#0b0c0e",
                  "font-size": "3",
                  style: { "pointer-events": "none" }
                }, toDisplayString(el.text || el.type), 9, _hoisted_55)) : createCommentVNode("v-if", true),
                el.type === "icon" ? (openBlock(), createElementBlock(
                  Fragment,
                  { key: 9 },
                  [
                    createElementVNode("rect", {
                      x: el.x,
                      y: el.y,
                      width: el.w ?? 8,
                      height: el.h ?? 8,
                      fill: el.fill ?? "#8ab8ff",
                      stroke: isSelected(el.id) ? "#fff" : "transparent",
                      "stroke-width": "0.6",
                      rx: "1"
                    }, null, 8, _hoisted_56),
                    createElementVNode("text", {
                      x: el.x + (el.w ?? 8) / 2,
                      y: el.y + (el.h ?? 8) / 2 + 1.5,
                      "text-anchor": "middle",
                      fill: "#0b0c0e",
                      "font-size": "4",
                      style: { "pointer-events": "none" }
                    }, " ◆ ", 8, _hoisted_57)
                  ],
                  64
                  /* STABLE_FRAGMENT */
                )) : createCommentVNode("v-if", true),
                el.type === "line" ? (openBlock(), createElementBlock("line", {
                  key: 10,
                  x1: el.x,
                  y1: el.y,
                  x2: el.x2,
                  y2: el.y2,
                  stroke: el.stroke ?? "#8ab8ff",
                  "stroke-width": el.strokeWidth ?? 0.8,
                  "stroke-dasharray": unref(resolveLineDash)(el.lineStyle),
                  "data-line-style": String(el.lineStyle ?? "solid"),
                  "data-has-links": String(!!(el.links && el.links.length)),
                  "data-has-actions": String(!!(el.actions && el.actions.length)),
                  title: linkTitle(el),
                  onClick: withModifiers(($event) => onElementActivate(el), ["stop"])
                }, null, 8, _hoisted_58)) : createCommentVNode("v-if", true),
                createCommentVNode(" metric-value: Grafana defaultBgColor box + centered text "),
                el.type === "metric" ? (openBlock(), createElementBlock("rect", {
                  key: 11,
                  x: el.x,
                  y: el.y,
                  width: el.w ?? 260,
                  height: el.h ?? 50,
                  fill: el.fill ?? "#D9D9D9",
                  stroke: isSelected(el.id) ? "#fff" : "transparent",
                  "stroke-width": "1",
                  "data-el-id": hit(el)
                }, null, 8, _hoisted_59)) : createCommentVNode("v-if", true),
                el.type === "metric" ? (openBlock(), createElementBlock("text", {
                  key: 12,
                  x: el.x + (el.w ?? 260) / 2,
                  y: el.y + (el.h ?? 50) / 2,
                  "text-anchor": "middle",
                  "dominant-baseline": "middle",
                  fill: el.textColor ?? "#000000",
                  "font-size": el.fontSize ?? 20,
                  "font-family": "Inter, Helvetica, Arial, sans-serif",
                  style: { "pointer-events": "none" }
                }, toDisplayString(el.text || "Double click to set field"), 9, _hoisted_60)) : createCommentVNode("v-if", true),
                el.type === "text" ? (openBlock(), createElementBlock("text", {
                  key: 13,
                  x: el.x,
                  y: el.y,
                  fill: el.fill ?? "var(--grafana-text)",
                  "font-size": el.fontSize ?? 5
                }, toDisplayString(el.text), 9, _hoisted_61)) : createCommentVNode("v-if", true),
                __props.editable && isSelected(el.id) && el.type !== "text" && el.type !== "metric" ? (openBlock(), createElementBlock("rect", {
                  key: 14,
                  x: handlePos(el).x - 1.5,
                  y: handlePos(el).y - 1.5,
                  width: "3",
                  height: "3",
                  fill: "#fff",
                  stroke: "var(--grafana-primary)",
                  "stroke-width": "0.4",
                  "data-testid": "canvas-resize-handle",
                  style: { "cursor": "nwse-resize" },
                  onPointerdown: withModifiers(($event) => onResizeDown($event, hit(el)), ["stop"])
                }, null, 40, _hoisted_62)) : createCommentVNode("v-if", true)
              ], 40, _hoisted_46$2);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ], 44, _hoisted_38$3))
      ], 8, _hoisted_1$2w);
    };
  }
});
const CanvasEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3b, [["__scopeId", "data-v-19330f6b"]]);
const _hoisted_1$2v = ["data-show-advanced-types", "data-tooltip-disable-one-click", "data-direction", "data-radius", "data-border-radius"];
const _sfc_main$3a = /* @__PURE__ */ defineComponent({
  __name: "CanvasRenderer",
  props: {
    data: {},
    options: {},
    width: {},
    height: {},
    editable: { type: Boolean }
  },
  emits: ["options-change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const metricValue = computed(() => {
      const frame = props.data?.series?.[0];
      const field = frame?.fields.find((f) => f.type === "number");
      return field?.values?.slice(-1)[0];
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-canvas",
        "data-testid": "panel-canvas",
        "data-show-advanced-types": String(!!__props.options?.showAdvancedTypes),
        "data-tooltip-disable-one-click": String(!!(__props.options?.tooltip?.disableForOneClick ?? __props.options?.["tooltip.disableForOneClick"])),
        "data-direction": String(__props.options?.direction ?? ""),
        "data-radius": String(__props.options?.radius ?? __props.options?.border?.radius ?? ""),
        "data-border-radius": String(__props.options?.border?.radius ?? "")
      }, [
        createVNode(CanvasEditor, {
          options: __props.options,
          "metric-value": metricValue.value,
          editable: __props.editable,
          width: __props.width,
          height: __props.height,
          onChange: _cache[0] || (_cache[0] = ($event) => emit("options-change", $event))
        }, null, 8, ["options", "metric-value", "editable", "width", "height"])
      ], 8, _hoisted_1$2v);
    };
  }
});
const CanvasRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$3a, [["__scopeId", "data-v-1895d590"]]);
const _sfc_main$39 = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  emits: ["options-change"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const props = __props;
    const editable = computed(
      () => props.editable !== false && props.options?.inlineEditing !== false
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(CanvasRenderer, {
        data: __props.data,
        options: __props.options,
        width: __props.width,
        height: __props.height,
        editable: editable.value,
        onOptionsChange: _cache[0] || (_cache[0] = ($event) => emit("options-change", $event))
      }, null, 8, ["data", "options", "width", "height", "editable"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "canvas",
    name: "画布",
    description: "自由布局可视化画布",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$39
).useFieldConfig().setNoPadding().setPanelOptions((builder) => {
  const cat = ["画布"];
  const tip = ["提示"];
  const el = ["元素"];
  builder.addBoolean(
    {
      id: "inlineEditing",
      path: "inlineEditing",
      name: "内联编辑",
      description: "直接在面板中编辑",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showAdvancedTypes",
      path: "showAdvancedTypes",
      name: "实验性元素类型",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "panZoom",
      path: "panZoom",
      name: "平移与缩放",
      category: cat
    },
    false
  ).addCustom({
    id: "panZoomHelp",
    path: "panZoomHelp",
    name: "平移缩放帮助",
    category: cat,
    editor: "text",
    showIf: (c) => !!c.panZoom
  }).addBoolean(
    {
      id: "zoomToContent",
      path: "zoomToContent",
      name: "缩放至内容",
      category: cat,
      showIf: (c) => !!c.panZoom
    },
    false
  ).addRadio(
    {
      id: "tooltip.mode",
      path: "tooltip.mode",
      name: "提示模式",
      category: tip,
      settings: {
        options: [
          { label: "启用", value: "single" },
          { label: "禁用", value: "none" }
        ]
      }
    },
    "single"
  ).addBoolean(
    {
      id: "tooltip.disableForOneClick",
      path: "tooltip.disableForOneClick",
      name: "单击元素禁用提示",
      category: tip,
      showIf: (c) => c.tooltip?.mode !== "none"
    },
    false
  ).addCustom({
    id: "root",
    path: "root",
    name: "根场景",
    category: el,
    editor: "text"
  }).addCustom({
    id: "type",
    path: "type",
    name: "元素类型",
    category: el,
    editor: "select",
    settings: {
      options: [
        { label: "矩形", value: "rectangle" },
        { label: "文本", value: "text" },
        { label: "指标", value: "metric-value" },
        { label: "图标", value: "icon" },
        { label: "椭圆", value: "ellipse" },
        { label: "服务器", value: "server" }
      ]
    }
  }).addText(
    { id: "color", path: "color", name: "颜色", category: el },
    void 0
  ).addNumber(
    { id: "size", path: "size", name: "尺寸", category: el },
    void 0
  ).addNumber(
    { id: "radius", path: "radius", name: "半径", category: el },
    void 0
  ).addSelect(
    {
      id: "direction",
      path: "direction",
      name: "方向",
      category: el,
      settings: {
        options: [
          { label: "水平", value: "horizontal" },
          { label: "垂直", value: "vertical" }
        ]
      }
    },
    void 0
  ).addSelect(
    {
      id: "lineStyle",
      path: "lineStyle",
      name: "线型",
      category: el,
      settings: {
        options: [
          { label: "实线", value: "solid" },
          { label: "虚线", value: "dashed" },
          { label: "点线", value: "dotted" }
        ]
      }
    },
    void 0
  ).addCustom({
    id: "links",
    path: "links",
    name: "链接",
    category: el,
    editor: "links"
  }).addCustom({
    id: "actions",
    path: "actions",
    name: "动作",
    category: el,
    editor: "text"
  }).addColor(
    {
      id: "background.color",
      path: "background.color",
      name: "背景色",
      category: el
    },
    void 0
  ).addText(
    {
      id: "background.image",
      path: "background.image",
      name: "背景图",
      category: el
    },
    void 0
  ).addSelect(
    {
      id: "background.size",
      path: "background.size",
      name: "背景尺寸",
      category: el,
      settings: {
        options: [
          { label: "覆盖", value: "cover" },
          { label: "包含", value: "contain" },
          { label: "原始", value: "original" },
          { label: "平铺", value: "tile" }
        ]
      }
    },
    void 0
  ).addColor(
    {
      id: "border.color",
      path: "border.color",
      name: "边框色",
      category: el
    },
    void 0
  ).addNumber(
    {
      id: "border.width",
      path: "border.width",
      name: "边框宽",
      category: el
    },
    void 0
  ).addNumber(
    {
      id: "border.radius",
      path: "border.radius",
      name: "边框圆角",
      category: el
    },
    void 0
  );
}).setRuntimeConsumedPaths([
  "inlineEditing",
  "showAdvancedTypes",
  "panZoom",
  "panZoomHelp",
  "zoomToContent",
  "tooltip.mode",
  "tooltip.disableForOneClick",
  "root",
  "type",
  "color",
  "size",
  "radius",
  "direction",
  "lineStyle",
  "links",
  "actions",
  "background.color",
  "background.image",
  "background.size",
  "border.color",
  "border.width",
  "border.radius"
]).setOptionsEditor(CanvasEditor).register();
function validateTraceFields(fields) {
  const names = fields.map((f) => f.name);
  const has = (re) => names.some((n) => re.test(n));
  const missing = [];
  if (!has(/spanID|spanId|span_id/i)) missing.push("spanId");
  if (!has(/startTime|startTimeUnixNano|start_time|start/i) && !fields.some((f) => f.type === "time")) {
    missing.push("startTime");
  }
  if (!has(/duration|durationNano|duration_ms|dur/i)) missing.push("duration");
  if (missing.length) {
    return {
      code: "INVALID_TRACE_SCHEMA",
      message: `链路数据缺少必要字段: ${missing.join(", ")}`,
      missing
    };
  }
  return null;
}
function framesToTraceSpans(fields) {
  if (!fields.length) return [];
  const n = fields[0]?.values.length ?? 0;
  if (!n) return [];
  const by = (re) => fields.find((f) => re.test(f.name));
  const spanIdF = by(/spanID|spanId|span_id/i);
  if (!spanIdF) return [];
  const schemaErr = validateTraceFields(fields);
  if (schemaErr) return [];
  const nameF = by(/operation|name|spanName/i) ?? fields.find((f) => f.type === "string");
  const serviceF = by(/service/i);
  const startF = by(/startTimeUnixNano|startTime|start/i) ?? fields.find((f) => f.type === "time" || f.type === "number");
  const durF = by(/duration|dur/i) ?? fields.find((f) => f.type === "number" && f !== startF);
  const parentF = by(/parentSpanID|parentSpanId|parent/i);
  const statusF = by(/status|statusCode/i);
  const tagsF = by(/tags|attributes|process\.tags/i);
  const processF = by(/^process$|process\./i);
  const logsF = by(/logs|events/i);
  const spans = [];
  for (let i = 0; i < n; i++) {
    let start = Number(startF?.values[i] ?? i * 10);
    if (start > 1e15) start = start / 1e6;
    else if (start > 1e14) start = start / 1e3;
    let duration = Number(durF?.values[i] ?? 20);
    if (duration > 1e9) duration = duration / 1e6;
    let tags;
    const rawTags = tagsF?.values[i];
    if (rawTags && typeof rawTags === "object" && !Array.isArray(rawTags)) {
      tags = Object.fromEntries(
        Object.entries(rawTags).map(([k, v]) => [k, String(v)])
      );
    } else if (typeof rawTags === "string" && rawTags.trim().startsWith("{")) {
      try {
        tags = Object.fromEntries(
          Object.entries(JSON.parse(rawTags)).map(([k, v]) => [k, String(v)])
        );
      } catch {
        tags = { raw: rawTags };
      }
    }
    let process2;
    const rawProc = processF?.values[i];
    if (rawProc && typeof rawProc === "object" && !Array.isArray(rawProc)) {
      process2 = Object.fromEntries(
        Object.entries(rawProc).map(([k, v]) => [k, String(v)])
      );
    }
    let logs;
    const rawLogs = logsF?.values[i];
    if (Array.isArray(rawLogs)) {
      logs = rawLogs.map((l, li) => ({
        timestamp: Number(l?.timestamp ?? l?.ts ?? li),
        fields: l?.fields && typeof l.fields === "object" ? Object.fromEntries(
          Object.entries(l.fields).map(([k, v]) => [k, String(v)])
        ) : { event: String(l?.event ?? l ?? "") }
      }));
    }
    spans.push({
      spanId: String(spanIdF?.values[i] ?? i),
      parentSpanId: parentF?.values[i] != null ? String(parentF.values[i]) : void 0,
      name: String(nameF?.values[i] ?? `span-${i}`),
      service: String(serviceF?.values[i] ?? "service"),
      start,
      duration,
      depth: 0,
      status: statusF ? String(statusF.values[i]) : void 0,
      tags,
      process: process2,
      logs,
      logsCount: logs?.length
    });
  }
  const byId2 = new Map(spans.map((s) => [s.spanId, s]));
  for (const s of spans) {
    let d = 0;
    let p = s.parentSpanId;
    const seen = /* @__PURE__ */ new Set();
    while (p && byId2.has(p) && !seen.has(p)) {
      seen.add(p);
      d += 1;
      p = byId2.get(p).parentSpanId;
    }
    s.depth = d;
  }
  if (spans.every((s) => s.depth === 0)) {
    spans.forEach((s, i) => {
      s.depth = i === 0 ? 0 : 1 + i % 3;
    });
  }
  return spans;
}
function normalizeTracePanelFrames(frames) {
  const diagnostics = [];
  const allSpans = [];
  for (const frame of frames || []) {
    const fields = (frame.fields || []).map((f) => ({
      name: f.name,
      type: f.type,
      values: f.values
    }));
    const err = validateTraceFields(fields);
    if (err) {
      diagnostics.push({ code: err.code, message: err.message });
      continue;
    }
    const spans2 = framesToTraceSpans(fields);
    if (!spans2.length && fields.length) {
      diagnostics.push({
        code: "INVALID_RESPONSE",
        message: "trace frame produced zero spans after strict parse"
      });
      continue;
    }
    for (const s of spans2) {
      if (!s.spanId) {
        throw new Error("INVALID_RESPONSE: span missing spanId");
      }
      if (!Number.isFinite(s.start) || !Number.isFinite(s.duration)) {
        throw new Error("INVALID_RESPONSE: span missing start or duration");
      }
      allSpans.push(s);
    }
  }
  if (!allSpans.length) {
    if (diagnostics.length) {
      const e = new Error(
        `INVALID_RESPONSE: ${diagnostics.map((d) => d.message).join("; ")}`
      );
      e.code = "INVALID_RESPONSE";
      throw e;
    }
    return { spans: [], rootStart: 0, duration: 0, diagnostics };
  }
  const rootStart = Math.min(...allSpans.map((s) => s.start));
  const end = Math.max(...allSpans.map((s) => s.start + s.duration));
  const spans = allSpans.map((s) => ({
    ...s,
    // trace-relative offset
    offsetMs: Math.round(s.start - rootStart)
  }));
  return {
    spans,
    rootStart,
    duration: Math.max(0, end - rootStart),
    diagnostics
  };
}
const _hoisted_1$2u = {
  key: 0,
  class: "panel-empty",
  "data-testid": "traces-panel-empty"
};
const _hoisted_2$1Z = ["data-filters", "data-critical-path", "data-matches-only", "data-span-count", "data-show-service", "data-detail-open", "data-selected-span", "data-view-mode", "data-has-service-graph", "data-service-graph-nodes"];
const _hoisted_3$1J = {
  key: 0,
  class: "view-tabs",
  "data-testid": "traces-view-tabs"
};
const _hoisted_4$1q = {
  key: 1,
  class: "svc-graph",
  "data-testid": "traces-service-graph"
};
const _hoisted_5$1h = {
  viewBox: "0 0 100 90",
  class: "svc-svg",
  role: "img",
  "aria-label": "服务拓扑图"
};
const _hoisted_6$16 = ["x1", "y1", "x2", "y2"];
const _hoisted_7$_ = ["onClick"];
const _hoisted_8$R = ["cx", "cy", "fill"];
const _hoisted_9$O = ["x", "y"];
const _hoisted_10$G = {
  key: 0,
  class: "svc-detail",
  "data-testid": "traces-service-detail"
};
const _hoisted_11$z = { key: 0 };
const _hoisted_12$s = {
  key: 0,
  class: "legend",
  "data-testid": "traces-legend"
};
const _hoisted_13$s = { class: "TimelineHeaderRow" };
const _hoisted_14$r = { class: "header-view" };
const _hoisted_15$m = { class: "Ticks" };
const _hoisted_16$k = { class: "VirtualizedTraceView" };
const _hoisted_17$h = ["data-selected", "onClick"];
const _hoisted_18$h = { class: "nameColumn" };
const _hoisted_19$f = { class: "SpanTreeOffset" };
const _hoisted_20$d = { class: "endpointName" };
const _hoisted_21$9 = { class: "view" };
const _hoisted_22$9 = { class: "Ticks ticks-abs" };
const _hoisted_23$5 = { class: "spanBarWrapper" };
const _hoisted_24$5 = {
  key: 3,
  class: "empty",
  "data-testid": "traces-empty"
};
const _hoisted_25$5 = {
  key: 4,
  class: "empty",
  "data-testid": "traces-empty-fallback"
};
const _hoisted_26$5 = {
  key: 0,
  class: "detail",
  "data-testid": "traces-detail"
};
const _hoisted_27$4 = { class: "detail-head" };
const _hoisted_28$4 = { class: "endpointName" };
const _hoisted_29$4 = { class: "detail-meta" };
const _hoisted_30$4 = { key: 0 };
const _hoisted_31$4 = {
  class: "tabs",
  "data-testid": "traces-detail-tabs"
};
const _hoisted_32$4 = {
  key: 0,
  class: "kv",
  "data-testid": "traces-tags"
};
const _hoisted_33$4 = {
  key: 0,
  class: "empty-cell"
};
const _hoisted_34$4 = {
  key: 1,
  class: "proc",
  "data-testid": "traces-process"
};
const _hoisted_35$3 = { key: 0 };
const _hoisted_36$2 = {
  key: 2,
  class: "logs-tl",
  "data-testid": "traces-logs"
};
const _hoisted_37$2 = { class: "log-ts" };
const _hoisted_38$2 = { class: "log-fields" };
const _hoisted_39$2 = {
  key: 0,
  class: "empty-cell"
};
const _sfc_main$38 = /* @__PURE__ */ defineComponent({
  __name: "TracesRenderer",
  props: {
    data: {},
    options: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const filtersOpt = computed(() => opts.value.filters ?? opts.value.spanFilters ?? null);
    const selected = ref(null);
    function isNodeGraphFrame(f) {
      const name = String(f?.name ?? "");
      if (/^(nodes?|edges?)$/i.test(name)) return true;
      if (f?.meta?.preferredVisualisationType === "nodeGraph") return true;
      const names = (Array.isArray(f?.fields) ? f.fields : []).map(
        (fld) => String(fld?.name ?? "").toLowerCase()
      );
      const hasFromTo = names.some((n) => n === "source" || n === "from") && names.some((n) => n === "target" || n === "to");
      const hasIdTitle = names.includes("id") && names.some((n) => n === "title" || n === "mainstat");
      return hasFromTo || hasIdTitle;
    }
    function isTraceFrame(f) {
      if (!f || isNodeGraphFrame(f)) return false;
      const names = (Array.isArray(f?.fields) ? f.fields : []).map(
        (fld) => String(fld?.name ?? "").toLowerCase()
      );
      return names.some(
        (n) => /spanid|span_id|duration|starttime|operationname|servicename/.test(n)
      );
    }
    const allSpans = computed(() => {
      const series = props.data?.series ?? [];
      if (series.length && series.every(isNodeGraphFrame)) {
        return [];
      }
      const frames = series.filter((f) => isTraceFrame(f) || !isNodeGraphFrame(f));
      if (!frames.length) return [];
      try {
        const norm = normalizeTracePanelFrames(frames);
        return norm.spans.map((s) => ({
          ...s,
          start: Number.isFinite(s.offsetMs) ? s.offsetMs : s.start - norm.rootStart
        }));
      } catch {
        return [];
      }
    });
    const spans = computed(() => {
      let list = allSpans.value;
      const f = opts.value.spanFilters ?? {};
      if (f.criticalPathOnly) {
        let walk = function(parent) {
          const kids = byParent.get(parent) ?? [];
          if (!kids.length) return;
          const best = [...kids].sort((a, b) => b.duration - a.duration)[0];
          keep.add(best.spanId);
          walk(best.spanId);
        };
        const byParent = /* @__PURE__ */ new Map();
        for (const s of list) {
          const k = s.parentSpanId;
          if (!byParent.has(k)) byParent.set(k, []);
          byParent.get(k).push(s);
        }
        const keep = /* @__PURE__ */ new Set();
        walk(void 0);
        for (const s of list) {
          if (!s.parentSpanId) keep.add(s.spanId);
        }
        list = list.filter((s) => keep.has(s.spanId));
      }
      if (f.matchesOnly && f.serviceName) {
        const svc = String(f.serviceName).toLowerCase();
        list = list.filter((s) => s.service.toLowerCase().includes(svc));
      }
      if (f.matchesOnly && f.spanName) {
        const n = String(f.spanName).toLowerCase();
        list = list.filter((s) => s.name.toLowerCase().includes(n));
      }
      if (f.minDuration != null && f.minDuration !== "") {
        const min = Number(f.minDuration);
        if (Number.isFinite(min)) list = list.filter((s) => s.duration >= min);
      }
      return list;
    });
    const maxEnd = computed(
      () => Math.max(...spans.value.map((s) => s.start + s.duration), 1)
    );
    const services = computed(() => [
      ...new Set(spans.value.map((s) => s.service))
    ]);
    function hasNodeGraphFrames(series) {
      if (!series?.length) return false;
      return series.some((f) => {
        const name = String(f?.name ?? "");
        if (/node|edge/i.test(name)) return true;
        if (f?.meta?.preferredVisualisationType === "nodeGraph") return true;
        const fields = Array.isArray(f?.fields) ? f.fields : [];
        const names = fields.map(
          (fld) => String(fld?.name ?? "").toLowerCase()
        );
        const hasId = names.some((n) => n === "id" || n.endsWith(" id"));
        const hasFromTo = names.some(
          (n) => n === "source" || n === "from" || n.endsWith("source")
        ) && names.some(
          (n) => n === "target" || n === "to" || n.endsWith("target")
        );
        return hasId || hasFromTo;
      });
    }
    const hasServiceGraph = computed(
      () => hasNodeGraphFrames(props.data?.series)
    );
    const serviceGraph = computed(() => {
      if (!hasServiceGraph.value)
        return { nodes: [], edges: [] };
      return layoutGraph(framesToGraph(props.data?.series), "force");
    });
    const graphById = computed(
      () => new Map(serviceGraph.value.nodes.map((n) => [n.id, n]))
    );
    const selectedNode = ref(null);
    const viewMode = ref("waterfall");
    watch(
      () => ({ spans: allSpans.value.length, graph: hasServiceGraph.value }),
      ({ spans: spans2, graph }) => {
        if (!spans2 && graph) viewMode.value = "serviceGraph";
        if (spans2 && !graph) viewMode.value = "waterfall";
      },
      { immediate: true }
    );
    function selectNode(n) {
      selectedNode.value = selectedNode.value?.id === n.id ? null : n;
    }
    const noTraceData = computed(
      () => !allSpans.value.length && !hasServiceGraph.value
    );
    const showServiceName = computed(() => opts.value.showServiceName !== false);
    const showDuration = computed(() => opts.value.showDuration !== false);
    const selectedSpan = computed(() => {
      if (!selected.value) return null;
      return allSpans.value.find((s) => s.spanId === selected.value) ?? spans.value.find((s) => s.spanId === selected.value) ?? null;
    });
    const selectedTags = computed(() => {
      const s = selectedSpan.value;
      if (!s) return [];
      const base = {
        spanID: s.spanId,
        ...s.parentSpanId ? { parentSpanID: s.parentSpanId } : {},
        service: s.service,
        operation: s.name,
        duration: `${Math.round(s.duration)}ms`,
        start: `${Math.round(s.start)}ms`,
        ...s.status ? { status: s.status } : {},
        ...s.tags ?? {}
      };
      return Object.entries(base);
    });
    const processEntries = computed(() => {
      const s = selectedSpan.value;
      if (!s?.process) return [];
      return Object.entries(s.process);
    });
    const logEntries = computed(() => {
      const s = selectedSpan.value;
      return s?.logs ?? [];
    });
    const detailTab = ref("tags");
    watch(selected, () => {
      detailTab.value = "tags";
    });
    const SERVICE_PALETTE = [
      "#3d71d9",
      "#6ed0e0",
      "#ef843c",
      "#e24d42",
      "#1f78c1",
      "#ba43a9",
      "#705da0",
      "#508642",
      "#cca300",
      "#447ebc"
    ];
    function serviceColor(name) {
      let h2 = 0;
      for (let i = 0; i < name.length; i++) h2 = h2 * 31 + name.charCodeAt(i) >>> 0;
      return SERVICE_PALETTE[h2 % SERVICE_PALETTE.length];
    }
    const timeTicks = computed(() => {
      const end = maxEnd.value || 1;
      const steps = 5;
      return Array.from({ length: steps + 1 }, (_, i) => {
        const t2 = end * i / steps;
        return {
          pct: i / steps * 100,
          label: t2 >= 1e3 ? `${(t2 / 1e3).toFixed(t2 >= 1e4 ? 0 : 1)}s` : `${Math.round(t2)}ms`
        };
      });
    });
    function formatDur(ms) {
      if (!Number.isFinite(ms)) return "—";
      if (ms >= 1e3) return `${(ms / 1e3).toFixed(ms >= 1e4 ? 1 : 2)}s`;
      if (ms < 1) return `${ms.toFixed(2)}ms`;
      return `${Math.round(ms)}ms`;
    }
    function onTraceKeydown(e) {
      if (!spans.value.length) return;
      const ids = spans.value.map((s) => s.spanId);
      const idx = selected.value ? ids.indexOf(selected.value) : -1;
      if (e.key === "Escape") {
        selected.value = null;
        e.preventDefault();
        return;
      }
      if (e.key === "ArrowDown") {
        const next = idx < 0 ? 0 : Math.min(ids.length - 1, idx + 1);
        selected.value = ids[next] ?? null;
        e.preventDefault();
      } else if (e.key === "ArrowUp") {
        const next = idx < 0 ? 0 : Math.max(0, idx - 1);
        selected.value = ids[next] ?? null;
        e.preventDefault();
      } else if (e.key === "Enter" && idx >= 0) {
        e.preventDefault();
      }
    }
    function selectSpan(id) {
      selected.value = selected.value === id ? null : id;
    }
    return (_ctx, _cache) => {
      return noTraceData.value ? (openBlock(), createElementBlock("div", _hoisted_1$2u, [..._cache[6] || (_cache[6] = [
        createElementVNode(
          "p",
          { class: "panel-empty__msg" },
          "回复中未找到数据",
          -1
          /* CACHED */
        )
      ])])) : (openBlock(), createElementBlock("div", {
        key: 1,
        class: "traces",
        "data-testid": "panel-traces",
        "data-filters": String(
          filtersOpt.value == null || filtersOpt.value === "" ? "" : typeof filtersOpt.value === "string" ? filtersOpt.value : JSON.stringify(filtersOpt.value)
        ),
        tabindex: "0",
        role: "region",
        "data-critical-path": String(!!opts.value.spanFilters?.criticalPathOnly),
        "data-matches-only": String(!!opts.value.spanFilters?.matchesOnly),
        "data-span-count": String(spans.value.length),
        "data-show-service": String(showServiceName.value),
        "data-detail-open": String(!!selectedSpan.value),
        "data-selected-span": selected.value ?? "",
        "data-view-mode": viewMode.value,
        "data-has-service-graph": String(hasServiceGraph.value),
        "data-service-graph-nodes": String(serviceGraph.value.nodes.length),
        onKeydown: onTraceKeydown
      }, [
        createElementVNode(
          "div",
          {
            class: normalizeClass(["wrapper", { "is-empty": !spans.value.length && viewMode.value === "waterfall" }])
          },
          [
            hasServiceGraph.value && spans.value.length ? (openBlock(), createElementBlock("div", _hoisted_3$1J, [
              createElementVNode(
                "button",
                {
                  type: "button",
                  class: normalizeClass({ on: viewMode.value === "waterfall" }),
                  "data-testid": "traces-view-waterfall",
                  onClick: _cache[0] || (_cache[0] = ($event) => viewMode.value = "waterfall")
                },
                " 瀑布图 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  class: normalizeClass({ on: viewMode.value === "serviceGraph" }),
                  "data-testid": "traces-view-service-graph",
                  onClick: _cache[1] || (_cache[1] = ($event) => viewMode.value = "serviceGraph")
                },
                " 服务图 ",
                2
                /* CLASS */
              )
            ])) : createCommentVNode("v-if", true),
            viewMode.value === "serviceGraph" && hasServiceGraph.value ? (openBlock(), createElementBlock("div", _hoisted_4$1q, [
              (openBlock(), createElementBlock("svg", _hoisted_5$1h, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(serviceGraph.value.edges, (e, i) => {
                    return openBlock(), createElementBlock("line", {
                      key: "e" + i,
                      x1: graphById.value.get(e.from)?.x ?? 0,
                      y1: graphById.value.get(e.from)?.y ?? 0,
                      x2: graphById.value.get(e.to)?.x ?? 0,
                      y2: graphById.value.get(e.to)?.y ?? 0,
                      class: "svc-edge"
                    }, null, 8, _hoisted_6$16);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                )),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(serviceGraph.value.nodes, (n) => {
                    return openBlock(), createElementBlock("g", {
                      key: n.id,
                      class: normalizeClass(["svc-node", { on: selectedNode.value?.id === n.id }]),
                      "data-testid": "traces-service-node",
                      onClick: ($event) => selectNode(n)
                    }, [
                      createElementVNode("circle", {
                        cx: n.x,
                        cy: n.y,
                        r: "5",
                        fill: serviceColor(n.label || n.id)
                      }, null, 8, _hoisted_8$R),
                      createElementVNode("text", {
                        x: n.x,
                        y: (n.y ?? 0) + 9,
                        "text-anchor": "middle",
                        class: "svc-label"
                      }, toDisplayString(n.label || n.id), 9, _hoisted_9$O)
                    ], 10, _hoisted_7$_);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])),
              selectedNode.value ? (openBlock(), createElementBlock("div", _hoisted_10$G, [
                createElementVNode(
                  "strong",
                  null,
                  toDisplayString(selectedNode.value.label || selectedNode.value.id),
                  1
                  /* TEXT */
                ),
                selectedNode.value.mainStat != null ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_11$z,
                  " · " + toDisplayString(selectedNode.value.mainStat),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ])) : createCommentVNode("v-if", true)
            ])) : spans.value.length ? (openBlock(), createElementBlock(
              Fragment,
              { key: 2 },
              [
                showServiceName.value ? (openBlock(), createElementBlock("div", _hoisted_12$s, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(services.value, (s) => {
                      return openBlock(), createElementBlock("span", {
                        key: s,
                        class: "chip"
                      }, [
                        createElementVNode(
                          "i",
                          {
                            class: "dot",
                            style: normalizeStyle({ background: serviceColor(s) })
                          },
                          null,
                          4
                          /* STYLE */
                        ),
                        createTextVNode(
                          toDisplayString(s),
                          1
                          /* TEXT */
                        )
                      ]);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true),
                createCommentVNode(" TimelineHeaderRow "),
                createElementVNode("div", _hoisted_13$s, [
                  _cache[7] || (_cache[7] = createElementVNode(
                    "div",
                    { class: "header-name" },
                    "Service & Operation",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode("div", _hoisted_14$r, [
                    createElementVNode("div", _hoisted_15$m, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(timeTicks.value, (tk, i) => {
                          return openBlock(), createElementBlock(
                            "div",
                            {
                              key: i,
                              class: "TicksTick",
                              style: normalizeStyle({ left: tk.pct + "%" })
                            },
                            [
                              createElementVNode(
                                "span",
                                {
                                  class: normalizeClass(["TicksTickLabel", { end: i === timeTicks.value.length - 1 }])
                                },
                                toDisplayString(tk.label),
                                3
                                /* TEXT, CLASS */
                              )
                            ],
                            4
                            /* STYLE */
                          );
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ])
                  ])
                ]),
                createCommentVNode(" SpanBarRows "),
                createElementVNode("div", _hoisted_16$k, [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(spans.value, (s, i) => {
                      return openBlock(), createElementBlock("div", {
                        key: s.spanId + i,
                        class: normalizeClass(["span-row", {
                          selected: selected.value === s.spanId,
                          isDetailExpanded: selected.value === s.spanId,
                          error: s.status === "ERROR" || s.status === "2"
                        }]),
                        "data-testid": "trace-span",
                        "data-selected": selected.value === s.spanId ? "true" : "false",
                        onClick: ($event) => selectSpan(s.spanId)
                      }, [
                        createElementVNode(
                          "div",
                          {
                            class: "nameWrapper",
                            style: normalizeStyle({ borderBottomColor: serviceColor(s.service || "unknown") })
                          },
                          [
                            createElementVNode("div", _hoisted_18$h, [
                              createElementVNode("span", _hoisted_19$f, [
                                (openBlock(true), createElementBlock(
                                  Fragment,
                                  null,
                                  renderList(s.depth, (d) => {
                                    return openBlock(), createElementBlock("span", {
                                      key: d,
                                      class: "SpanTreeOffset--indentGuide"
                                    });
                                  }),
                                  128
                                  /* KEYED_FRAGMENT */
                                ))
                              ]),
                              createElementVNode(
                                "button",
                                {
                                  type: "button",
                                  class: "name",
                                  style: normalizeStyle({ borderBottomColor: serviceColor(s.service || "unknown") + "CF" })
                                },
                                [
                                  showServiceName.value ? (openBlock(), createElementBlock(
                                    "span",
                                    {
                                      key: 0,
                                      class: "svcName",
                                      style: normalizeStyle({ color: serviceColor(s.service || "unknown") })
                                    },
                                    toDisplayString(s.service),
                                    5
                                    /* TEXT, STYLE */
                                  )) : createCommentVNode("v-if", true),
                                  createElementVNode(
                                    "span",
                                    _hoisted_20$d,
                                    toDisplayString(s.name),
                                    1
                                    /* TEXT */
                                  )
                                ],
                                4
                                /* STYLE */
                              )
                            ])
                          ],
                          4
                          /* STYLE */
                        ),
                        createElementVNode("div", _hoisted_21$9, [
                          createElementVNode("div", _hoisted_22$9, [
                            (openBlock(true), createElementBlock(
                              Fragment,
                              null,
                              renderList(timeTicks.value, (tk, ti) => {
                                return openBlock(), createElementBlock(
                                  "div",
                                  {
                                    key: "t" + ti,
                                    class: "TicksTick",
                                    style: normalizeStyle({ left: tk.pct + "%" })
                                  },
                                  null,
                                  4
                                  /* STYLE */
                                );
                              }),
                              128
                              /* KEYED_FRAGMENT */
                            ))
                          ]),
                          createCommentVNode(" SpanBar: height 40%, top 30% "),
                          createElementVNode("div", _hoisted_23$5, [
                            createElementVNode(
                              "div",
                              {
                                class: normalizeClass(["spanBar", { error: s.status === "ERROR" || s.status === "2" }]),
                                style: normalizeStyle({
                                  left: s.start / maxEnd.value * 100 + "%",
                                  width: Math.max(0.25, s.duration / maxEnd.value * 100) + "%",
                                  background: s.status === "ERROR" || s.status === "2" ? "var(--grafana-error)" : serviceColor(s.service || "unknown")
                                })
                              },
                              null,
                              6
                              /* CLASS, STYLE */
                            ),
                            showDuration.value ? (openBlock(), createElementBlock(
                              "div",
                              {
                                key: 0,
                                class: normalizeClass(["spanBarLabel", s.start / maxEnd.value > 0.5 ? "labelLeft" : "labelRight"]),
                                style: normalizeStyle({
                                  left: s.start / maxEnd.value > 0.5 ? s.start / maxEnd.value * 100 + "%" : s.start / maxEnd.value * 100 + Math.max(0.25, s.duration / maxEnd.value * 100) + "%"
                                })
                              },
                              toDisplayString(formatDur(s.duration)),
                              7
                              /* TEXT, CLASS, STYLE */
                            )) : createCommentVNode("v-if", true)
                          ])
                        ])
                      ], 10, _hoisted_17$h);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])
              ],
              64
              /* STABLE_FRAGMENT */
            )) : !hasServiceGraph.value ? (openBlock(), createElementBlock("div", _hoisted_24$5, " 暂无链路数据 ")) : (openBlock(), createElementBlock("div", _hoisted_25$5, " 无瀑布图 span，已切换服务图 "))
          ],
          2
          /* CLASS */
        ),
        createCommentVNode(" Span detail (simplified SpanDetailRow) "),
        selectedSpan.value ? (openBlock(), createElementBlock("aside", _hoisted_26$5, [
          createElementVNode("header", _hoisted_27$4, [
            createElementVNode("div", null, [
              createElementVNode(
                "div",
                {
                  class: "svcName",
                  style: normalizeStyle({ color: serviceColor(selectedSpan.value.service || "unknown") })
                },
                toDisplayString(selectedSpan.value.service),
                5
                /* TEXT, STYLE */
              ),
              createElementVNode(
                "div",
                _hoisted_28$4,
                toDisplayString(selectedSpan.value.name),
                1
                /* TEXT */
              )
            ]),
            createElementVNode("button", {
              type: "button",
              "data-testid": "traces-detail-close",
              class: "close",
              onClick: _cache[2] || (_cache[2] = ($event) => selected.value = null)
            }, " × ")
          ]),
          createElementVNode("div", _hoisted_29$4, [
            createElementVNode(
              "span",
              null,
              toDisplayString(formatDur(selectedSpan.value.duration)),
              1
              /* TEXT */
            ),
            selectedSpan.value.status ? (openBlock(), createElementBlock(
              "span",
              _hoisted_30$4,
              toDisplayString(selectedSpan.value.status),
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true)
          ]),
          createElementVNode("div", _hoisted_31$4, [
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ on: detailTab.value === "tags" }),
                "data-testid": "traces-tab-tags",
                onClick: _cache[3] || (_cache[3] = ($event) => detailTab.value = "tags")
              },
              " Tags ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ on: detailTab.value === "process" }),
                "data-testid": "traces-tab-process",
                onClick: _cache[4] || (_cache[4] = ($event) => detailTab.value = "process")
              },
              " Process ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ on: detailTab.value === "logs" }),
                "data-testid": "traces-tab-logs",
                onClick: _cache[5] || (_cache[5] = ($event) => detailTab.value = "logs")
              },
              " Logs" + toDisplayString(logEntries.value.length ? ` (${logEntries.value.length})` : ""),
              3
              /* TEXT, CLASS */
            )
          ]),
          detailTab.value === "tags" ? (openBlock(), createElementBlock("dl", _hoisted_32$4, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(selectedTags.value, ([k, v]) => {
                return openBlock(), createElementBlock(
                  Fragment,
                  { key: k },
                  [
                    createElementVNode(
                      "dt",
                      null,
                      toDisplayString(k),
                      1
                      /* TEXT */
                    ),
                    createElementVNode(
                      "dd",
                      null,
                      toDisplayString(v),
                      1
                      /* TEXT */
                    )
                  ],
                  64
                  /* STABLE_FRAGMENT */
                );
              }),
              128
              /* KEYED_FRAGMENT */
            )),
            !selectedTags.value.length ? (openBlock(), createElementBlock("div", _hoisted_33$4, "无标签")) : createCommentVNode("v-if", true)
          ])) : detailTab.value === "process" ? (openBlock(), createElementBlock("table", _hoisted_34$4, [
            createElementVNode("tbody", null, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(processEntries.value, ([k, v]) => {
                  return openBlock(), createElementBlock("tr", { key: k }, [
                    createElementVNode(
                      "th",
                      null,
                      toDisplayString(k),
                      1
                      /* TEXT */
                    ),
                    createElementVNode(
                      "td",
                      null,
                      toDisplayString(v),
                      1
                      /* TEXT */
                    )
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              !processEntries.value.length ? (openBlock(), createElementBlock("tr", _hoisted_35$3, [..._cache[8] || (_cache[8] = [
                createElementVNode(
                  "td",
                  {
                    colspan: "2",
                    class: "empty-cell"
                  },
                  "无进程标签",
                  -1
                  /* CACHED */
                )
              ])])) : createCommentVNode("v-if", true)
            ])
          ])) : (openBlock(), createElementBlock("div", _hoisted_36$2, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(logEntries.value, (lg, i) => {
                return openBlock(), createElementBlock("div", {
                  key: i,
                  class: "log-item",
                  "data-testid": "traces-log-item"
                }, [
                  createElementVNode(
                    "div",
                    _hoisted_37$2,
                    "+" + toDisplayString(formatDur(lg.timestamp)),
                    1
                    /* TEXT */
                  ),
                  createElementVNode("div", _hoisted_38$2, [
                    (openBlock(true), createElementBlock(
                      Fragment,
                      null,
                      renderList(lg.fields, (v, k) => {
                        return openBlock(), createElementBlock(
                          "span",
                          {
                            key: k,
                            class: "lf"
                          },
                          toDisplayString(k) + "=" + toDisplayString(v),
                          1
                          /* TEXT */
                        );
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    ))
                  ])
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            )),
            !logEntries.value.length ? (openBlock(), createElementBlock("div", _hoisted_39$2, "无 Span 日志")) : createCommentVNode("v-if", true)
          ]))
        ])) : createCommentVNode("v-if", true)
      ], 40, _hoisted_2$1Z));
    };
  }
});
const TracesRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$38, [["__scopeId", "data-v-732a3529"]]);
const _sfc_main$37 = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(TracesRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "traces",
    name: "链路追踪",
    description: "分布式追踪瀑布图",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$37
).setPanelOptions((builder) => {
  const cat = ["链路"];
  builder.addCustom({
    id: "filters",
    path: "filters",
    name: "过滤器",
    category: cat,
    editor: "text",
    description: "Span filters（Grafana 兼容 id）"
  }).addCustom({
    id: "spanFilters",
    path: "spanFilters",
    name: "过滤器对象",
    category: cat,
    editor: "text",
    description: "Span 过滤配置对象"
  }).addBoolean(
    {
      id: "spanFilters.matchesOnly",
      path: "spanFilters.matchesOnly",
      name: "仅显示匹配项",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "spanFilters.criticalPathOnly",
      path: "spanFilters.criticalPathOnly",
      name: "仅关键路径",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "showServiceName",
      path: "showServiceName",
      name: "显示服务名",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showDuration",
      path: "showDuration",
      name: "显示耗时",
      category: cat
    },
    true
  );
}).setRuntimeConsumedPaths([
  "filters",
  "spanFilters",
  "spanFilters.criticalPathOnly",
  "spanFilters.matchesOnly",
  "showServiceName",
  "showDuration"
]).register();
const COLORS = [
  "#3d71d9",
  "#73bf69",
  "#f2cc0c",
  "#ff780a",
  "#e02f44",
  "#b877d9",
  "#5794f2",
  "#fa6400"
];
function normalizeFlameTree(node) {
  const kids = (node.children ?? []).map(normalizeFlameTree);
  const childSum = kids.reduce((a, b) => a + b.value, 0);
  const self = node.self ?? Math.max(0, node.value - childSum);
  const value = Math.max(node.value, childSum + self, 1);
  return {
    name: node.name,
    value,
    self,
    children: kids.length ? kids : void 0
  };
}
function checkFields(fields) {
  const list = fields ?? [];
  const required = [
    ["label", ["string", "enum"]],
    ["level", ["number"]],
    ["value", ["number"]],
    ["self", ["number"]]
  ];
  const missingFields = [];
  const wrongTypeFields = [];
  for (const [name, types] of required) {
    const frameField = list.find((f) => f.name === name);
    if (!frameField) {
      missingFields.push(name);
      continue;
    }
    const t2 = String(frameField.type || "other");
    if (!types.includes(t2)) {
      wrongTypeFields.push({ name, expectedTypes: types, type: t2 });
    }
  }
  if (missingFields.length || wrongTypeFields.length) {
    return { missingFields, wrongTypeFields };
  }
  return void 0;
}
function getMessageCheckFieldsResult(wrongFields) {
  if (wrongFields.missingFields.length) {
    return `Data is missing fields: ${wrongFields.missingFields.join(", ")}`;
  }
  if (wrongFields.wrongTypeFields.length) {
    return `Data has fields of wrong type: ${wrongFields.wrongTypeFields.map(
      (f) => `${f.name} has type ${f.type} but should be ${f.expectedTypes.join(" or ")}`
    ).join(", ")}`;
  }
  return "";
}
function framesToFlameRoot(fields) {
  if (!fields.length || !(fields[0]?.values?.length ?? 0)) {
    return null;
  }
  const by = (re) => fields.find((f) => re.test(f.name));
  const n = fields[0].values.length;
  const stackF = by(/stack|stacktrace|callstack/i);
  if (stackF) {
    return normalizeFlameTree(
      stacksToTree(stackF.values.map(String), valueColumn(fields, n))
    );
  }
  const nameF = by(/name|label|function|symbol|location/i) ?? fields.find((f) => f.type === "string") ?? fields[0];
  const valueF = valueField(fields, nameF);
  const parentF = by(/parent|caller|parentName|parentId/i);
  const levelF = by(/level|depth/i);
  const selfF = by(/self|exclusive/i);
  if (parentF || levelF) {
    return normalizeFlameTree(
      hierarchyToTree(
        Array.from({ length: n }, (_, i) => ({
          name: String(nameF.values[i] ?? `fn-${i}`),
          value: Math.abs(Number(valueF?.values[i] ?? 1)),
          self: selfF ? Math.abs(Number(selfF.values[i] ?? 0)) : void 0,
          parent: parentF?.values[i] != null ? String(parentF.values[i]) : void 0,
          level: levelF ? Number(levelF.values[i] ?? 0) : void 0
        }))
      )
    );
  }
  const children = [];
  for (let i = 0; i < Math.min(n, 64); i++) {
    children.push({
      name: String(nameF.values[i] ?? `fn-${i}`),
      value: Math.abs(Number(valueF?.values[i] ?? 1)),
      self: selfF ? Math.abs(Number(selfF.values[i] ?? 0)) : void 0
    });
  }
  const total = children.reduce((a, b) => a + b.value, 0) || 1;
  return normalizeFlameTree({ name: "total", value: total, self: 0, children });
}
function valueField(fields, exclude) {
  return fields.find(
    (f) => /value|total|samples|count|weight/i.test(f.name) && f !== exclude
  ) ?? fields.find((f) => f.type === "number" && f !== exclude);
}
function valueColumn(fields, n) {
  const vf = valueField(fields);
  return Array.from(
    { length: n },
    (_, i) => Math.abs(Number(vf?.values[i] ?? 1))
  );
}
function stacksToTree(stacks, values) {
  const root = { name: "total", value: 0, self: 0, children: [] };
  for (let i = 0; i < stacks.length; i++) {
    const parts = String(stacks[i]).split(/[;\n]+/).map((s) => s.trim()).filter(Boolean);
    const v = values[i] ?? 1;
    root.value += v;
    let cur = root;
    for (let d = 0; d < parts.length; d++) {
      const name = parts[d];
      if (!cur.children) cur.children = [];
      let next = cur.children.find((c) => c.name === name);
      if (!next) {
        next = { name, value: 0, self: 0, children: [] };
        cur.children.push(next);
      }
      next.value += v;
      if (d === parts.length - 1) {
        next.self = (next.self ?? 0) + v;
      }
      cur = next;
    }
  }
  if (!root.value) root.value = 1;
  return root;
}
function hierarchyToTree(rows) {
  if (rows.some((r) => r.parent != null && r.parent !== "")) {
    const byName = /* @__PURE__ */ new Map();
    for (const r of rows) {
      byName.set(r.name, {
        name: r.name,
        value: r.value,
        self: r.self,
        children: []
      });
    }
    const roots = [];
    for (const r of rows) {
      const node = byName.get(r.name);
      if (r.parent && byName.has(r.parent) && r.parent !== r.name) {
        const p = byName.get(r.parent);
        if (!p.children) p.children = [];
        p.children.push(node);
      } else {
        roots.push(node);
      }
    }
    if (roots.length === 1) return roots[0];
    const total = roots.reduce((a, b) => a + b.value, 0) || 1;
    return { name: "total", value: total, self: 0, children: roots };
  }
  const sorted = [...rows].sort((a, b) => (a.level ?? 0) - (b.level ?? 0));
  const root = { name: "total", value: 0, self: 0, children: [] };
  const stack = [root];
  for (const r of sorted) {
    const level = Math.max(0, Math.floor(r.level ?? 0));
    while (stack.length > level + 1) stack.pop();
    const parent = stack[stack.length - 1] ?? root;
    const node = {
      name: r.name,
      value: r.value,
      self: r.self ?? r.value,
      children: []
    };
    if (!parent.children) parent.children = [];
    parent.children.push(node);
    parent.value += r.value;
    stack.push(node);
  }
  if (!root.value) root.value = rows.reduce((a, r) => a + r.value, 0) || 1;
  return root;
}
function layoutFlame(root) {
  const out = [];
  function walk(node, depth, x, width2) {
    if (!out[depth]) out[depth] = [];
    const kids = node.children ?? [];
    const childSum = kids.reduce((a, b) => a + b.value, 0);
    const self = node.self ?? Math.max(0, node.value - childSum);
    out[depth].push({
      name: node.name,
      value: node.value,
      self,
      x,
      w: width2,
      depth,
      color: COLORS[depth % COLORS.length]
    });
    if (!kids.length) return;
    const sum = kids.reduce((a, b) => a + b.value, 0) || 1;
    let cx = x;
    for (const k of kids) {
      const w = width2 * (k.value / sum);
      walk(k, depth + 1, cx, w);
      cx += w;
    }
  }
  walk(normalizeFlameTree(root), 0, 0, 100);
  return out;
}
function focusFlameNode(root, name) {
  function find(n) {
    if (n.name === name) return n;
    for (const c of n.children ?? []) {
      const hit = find(c);
      if (hit) return hit;
    }
    return null;
  }
  return normalizeFlameTree(find(root) ?? root);
}
const FULL_VIEWPORT = { start: 0, end: 100 };
const MIN_VISIBLE_PCT = 0.5;
const SCROLL_ZOOM_INTENSITY = 15e-4;
function clamp(value, min, max) {
  return Math.max(min, Math.min(max, value));
}
function clampViewport(view) {
  const span = clamp(view.end - view.start, MIN_VISIBLE_PCT, 100);
  let start = clamp(view.start, 0, 100 - span);
  return { start, end: start + span };
}
function zoomViewport(view, factor, anchorRatio) {
  const oldSpan = Math.max(view.end - view.start, MIN_VISIBLE_PCT);
  const nextSpan = clamp(oldSpan * factor, MIN_VISIBLE_PCT, 100);
  const anchorPct = view.start + clamp(anchorRatio, 0, 1) * oldSpan;
  const start = clamp(anchorPct - clamp(anchorRatio, 0, 1) * nextSpan, 0, 100 - nextSpan);
  return clampViewport({ start, end: start + nextSpan });
}
function panViewport(view, deltaPct) {
  const span = Math.max(view.end - view.start, MIN_VISIBLE_PCT);
  const start = clamp(view.start - deltaPct, 0, 100 - span);
  return { start, end: start + span };
}
function blockScreenRect(xPct, wPct, view, cssWidth) {
  const span = Math.max(view.end - view.start, MIN_VISIBLE_PCT);
  const start = xPct;
  const end = xPct + wPct;
  if (end < view.start || start > view.end) {
    return { x: 0, width: 0, visible: false };
  }
  const visibleStart = clamp(start, view.start, view.end);
  const visibleEnd = clamp(end, view.start, view.end);
  const x = (visibleStart - view.start) / span * cssWidth;
  const width2 = Math.max(1, (visibleEnd - visibleStart) / span * cssWidth);
  return { x, width: width2, visible: true };
}
const DEFAULT_ROW_HEIGHT = 22;
const MIN_SPAN_BAR_HEIGHT = 8;
const LABEL_FONT = "500 11px Inter, sans-serif";
const LABEL_PADDING_X = 6;
const MIN_WIDTH_FOR_NAME = 28;
const MIN_WIDTH_FOR_VALUE = 72;
const OVERSCAN_ROWS = 2;
function getRowMetrics(rowHeight) {
  const bar = Math.max(
    MIN_SPAN_BAR_HEIGHT,
    Math.min(DEFAULT_ROW_HEIGHT - 2, Math.round(rowHeight * 0.85))
  );
  return {
    ROW_HEIGHT: rowHeight,
    BAR_HEIGHT: bar,
    BAR_Y_OFFSET: Math.floor((rowHeight - bar) / 2)
  };
}
function darkenHex(hex, amount = 0.18) {
  if (!/^#[0-9a-fA-F]{6}$/.test(hex)) return hex;
  const r = Number.parseInt(hex.slice(1, 3), 16);
  const g = Number.parseInt(hex.slice(3, 5), 16);
  const b = Number.parseInt(hex.slice(5, 7), 16);
  const f = 1 - amount;
  const to = (n) => Math.max(0, Math.min(255, Math.round(n * f))).toString(16).padStart(2, "0");
  return `#${to(r)}${to(g)}${to(b)}`;
}
function roundedRectPath(ctx, x, y, width2, height2, radius) {
  const r = Math.min(radius, width2 / 2, height2 / 2);
  ctx.beginPath();
  ctx.moveTo(x + r, y);
  ctx.arcTo(x + width2, y, x + width2, y + height2, r);
  ctx.arcTo(x + width2, y + height2, x, y + height2, r);
  ctx.arcTo(x, y + height2, x, y, r);
  ctx.arcTo(x, y, x + width2, y, r);
  ctx.closePath();
}
function truncateText(ctx, text, maxWidth) {
  const ellipsis = "…";
  if (ctx.measureText(text).width <= maxWidth) return text;
  const ellipsisWidth = ctx.measureText(ellipsis).width;
  let lo = 0;
  let hi = text.length;
  while (lo < hi) {
    const mid = Math.ceil((lo + hi) / 2);
    if (ctx.measureText(text.slice(0, mid)).width + ellipsisWidth <= maxWidth) {
      lo = mid;
    } else {
      hi = mid - 1;
    }
  }
  return lo > 0 ? `${text.slice(0, lo)}${ellipsis}` : ellipsis;
}
function updateCanvasSize(canvas, width2, height2) {
  if (!canvas) return;
  const safeW = Math.max(width2, 1);
  const safeH = Math.max(height2, 1);
  const dpr = Math.min(typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1, 2);
  const nextW = Math.round(safeW * dpr);
  const nextH = Math.round(safeH * dpr);
  if (canvas.width !== nextW) canvas.width = nextW;
  if (canvas.height !== nextH) canvas.height = nextH;
  canvas.style.width = `${safeW}px`;
  canvas.style.height = `${safeH}px`;
}
function getCanvasCssSize(canvas) {
  const dpr = Math.min(typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1, 2);
  return {
    dpr,
    cssWidth: Math.max(canvas.width / dpr, 1),
    cssHeight: Math.max(canvas.height / dpr, 1)
  };
}
function drawFlamegraph(args) {
  const {
    ctx,
    levels,
    view,
    scrollTop,
    cssWidth,
    cssHeight,
    rowHeight,
    search,
    focusName,
    hoveredName,
    sandwich,
    showDiffLabels,
    hitRects
  } = args;
  hitRects.length = 0;
  const metrics = getRowMetrics(rowHeight);
  const totalRows = levels.length;
  const first = Math.max(0, Math.floor(scrollTop / rowHeight) - OVERSCAN_ROWS);
  const last = Math.min(
    totalRows,
    Math.ceil((scrollTop + cssHeight) / rowHeight) + OVERSCAN_ROWS
  );
  const q = search.trim().toLowerCase();
  let drawn = 0;
  for (let depth = first; depth < last; depth++) {
    const rowY = depth * rowHeight - scrollTop;
    for (const block of levels[depth] ?? []) {
      const rect = blockScreenRect(block.x, block.w, view, cssWidth);
      if (!rect.visible) continue;
      const barY = rowY + metrics.BAR_Y_OFFSET;
      const isFocus = focusName === block.name;
      const isHover = hoveredName === block.name;
      const match = !q || block.name.toLowerCase().includes(q);
      const dim = q && !match && !isFocus && !isHover;
      const color = block.color || "#3d71d9";
      const colorDark = darkenHex(color, 0.16);
      if (dim) ctx.globalAlpha = 0.15;
      roundedRectPath(ctx, rect.x, barY, rect.width, metrics.BAR_HEIGHT, 2);
      if (isFocus || isHover) {
        ctx.fillStyle = "rgba(249, 249, 251, 0.92)";
        ctx.fill();
        if (isFocus) ctx.setLineDash([4, 2]);
        ctx.strokeStyle = colorDark;
        ctx.lineWidth = isFocus ? 2 : 1;
        ctx.stroke();
        if (isFocus) ctx.setLineDash([]);
      } else {
        ctx.fillStyle = color;
        ctx.fill();
        ctx.strokeStyle = sandwich ? colorDark : "rgba(0, 0, 0, 0.28)";
        ctx.lineWidth = 1;
        if (sandwich) ctx.setLineDash([3, 2]);
        ctx.stroke();
        if (sandwich) ctx.setLineDash([]);
      }
      hitRects.push({
        block,
        x: rect.x,
        y: barY,
        width: rect.width,
        height: metrics.BAR_HEIGHT
      });
      drawn++;
      if (rect.width >= MIN_WIDTH_FOR_NAME) {
        ctx.save();
        ctx.beginPath();
        ctx.rect(rect.x, barY, rect.width, metrics.BAR_HEIGHT);
        ctx.clip();
        ctx.font = LABEL_FONT;
        ctx.textBaseline = "middle";
        ctx.fillStyle = isFocus || isHover ? colorDark : "rgba(255, 255, 255, 0.95)";
        const textY = barY + metrics.BAR_HEIGHT / 2;
        const leftX = rect.x + LABEL_PADDING_X;
        const available = rect.width - LABEL_PADDING_X * 2;
        const label = showDiffLabels ? `${block.name} Δ` : block.name;
        if (rect.width >= MIN_WIDTH_FOR_VALUE) {
          const valueText = String(block.value);
          const vw = ctx.measureText(valueText).width;
          const nameSpace = available - vw - 6;
          ctx.textAlign = "right";
          ctx.fillText(valueText, rect.x + rect.width - LABEL_PADDING_X, textY);
          if (nameSpace > 16) {
            ctx.textAlign = "left";
            ctx.fillText(truncateText(ctx, label, nameSpace), leftX, textY);
          }
        } else {
          ctx.textAlign = "left";
          ctx.fillText(truncateText(ctx, label, available), leftX, textY);
        }
        ctx.restore();
      }
      if (dim) ctx.globalAlpha = 1;
    }
  }
  return drawn;
}
function hitFlameBlock(hitRects, x, y) {
  for (let i = hitRects.length - 1; i >= 0; i--) {
    const r = hitRects[i];
    if (x >= r.x && x <= r.x + r.width && y >= r.y && y <= r.y + r.height) {
      return r;
    }
  }
  return null;
}
const _hoisted_1$2t = ["data-show-table", "data-collapsing", "data-sticky-header", "data-show-diff", "data-focus", "data-level-count", "data-block-count", "data-sandwich", "data-show-extra", "data-search"];
const _hoisted_2$1Y = {
  key: 0,
  class: "empty",
  "data-testid": "flame-empty"
};
const _hoisted_3$1I = {
  class: "sr-blocks",
  "aria-hidden": "true"
};
const _hoisted_4$1p = ["data-match", "aria-label", "onClick"];
const _hoisted_5$1g = { class: "tooltip__title" };
const _hoisted_6$15 = { class: "tooltip__row" };
const _hoisted_7$Z = { class: "tooltip__row" };
const _hoisted_8$Q = { class: "tooltip__row" };
const _hoisted_9$N = { class: "is-accent" };
const _hoisted_10$F = {
  key: 2,
  class: "table",
  "data-testid": "flame-table"
};
const _hoisted_11$y = ["onClick"];
const _sfc_main$36 = /* @__PURE__ */ defineComponent({
  __name: "FlamegraphRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const focusName = ref(null);
    const search = ref("");
    const hoveredName = ref(null);
    const view = ref({ ...FULL_VIEWPORT });
    const scrollTop = ref(0);
    const rowHeight = ref(DEFAULT_ROW_HEIGHT);
    const cursorXPercent = ref(null);
    const tip = ref(null);
    const blockCount = ref(0);
    const wrapRef = ref(null);
    const canvasRef = ref(null);
    const overlayRef = ref(null);
    const hitRects = [];
    let ro = null;
    let dragging = false;
    let dragMoved = false;
    let suppressClick = false;
    let dragStartX = 0;
    let dragStartY = 0;
    let dragStartView = { ...FULL_VIEWPORT };
    let dragStartScroll = 0;
    const fieldError = computed(() => {
      const frame = props.data?.series?.[0];
      const wrong = checkFields(frame?.fields);
      return wrong ? getMessageCheckFieldsResult(wrong) : "";
    });
    const root = computed(() => {
      if (fieldError.value) return null;
      const frame = props.data?.series?.[0];
      const tree = framesToFlameRoot(frame?.fields ?? []);
      if (!tree) return null;
      return focusName.value ? focusFlameNode(tree, focusName.value) : tree;
    });
    const sandwich = computed(
      () => Boolean(opts.value.sandwich ?? opts.value.view === "sandwich")
    );
    const showExtra = computed(() => Boolean(opts.value.showExtra));
    const levels = computed(() => root.value ? layoutFlame(root.value) : []);
    const flatBlocks = computed(() => levels.value.flat());
    const showTable = computed(
      () => opts.value.showTable !== false && opts.value.getTable !== false
    );
    const collapsible = computed(() => opts.value.collapsing !== false);
    const stickyHeader = computed(() => opts.value.stickyHeader !== false);
    const showDiffLabels = computed(() => Boolean(opts.value.showDiffLabels));
    const totalHeight = computed(() => levels.value.length * rowHeight.value);
    const tableRows = computed(() => {
      if (!showTable.value || !root.value)
        return [];
      const rows = [];
      function walk(n) {
        rows.push({ name: n.name, total: n.value, self: n.self ?? 0 });
        for (const c of n.children ?? []) walk(c);
      }
      walk(root.value);
      return rows.sort((a, b) => b.total - a.total);
    });
    function onBlockClick(name) {
      if (!collapsible.value) return;
      focusName.value = focusName.value === name ? null : name;
      view.value = { ...FULL_VIEWPORT };
      scrollTop.value = 0;
    }
    function resetFocus() {
      focusName.value = null;
      view.value = { ...FULL_VIEWPORT };
      scrollTop.value = 0;
    }
    function sizeCanvases() {
      const el = wrapRef.value;
      if (!el) return;
      updateCanvasSize(canvasRef.value, el.clientWidth, el.clientHeight);
      updateCanvasSize(overlayRef.value, el.clientWidth, el.clientHeight);
    }
    function clearCanvas(canvas) {
      const ctx = canvas?.getContext("2d");
      if (!ctx || !canvas) return;
      ctx.setTransform(1, 0, 0, 1, 0, 0);
      ctx.clearRect(0, 0, canvas.width, canvas.height);
    }
    function drawMain() {
      const canvas = canvasRef.value;
      const wrap = wrapRef.value;
      if (!canvas || !wrap || !levels.value.length) {
        clearCanvas(canvas);
        blockCount.value = 0;
        return;
      }
      const ctx = canvas.getContext("2d");
      if (!ctx) return;
      sizeCanvases();
      const { dpr, cssWidth, cssHeight } = getCanvasCssSize(canvas);
      ctx.setTransform(1, 0, 0, 1, 0, 0);
      ctx.clearRect(0, 0, canvas.width, canvas.height);
      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
      const maxScroll = Math.max(0, totalHeight.value - cssHeight);
      if (scrollTop.value > maxScroll) scrollTop.value = maxScroll;
      blockCount.value = drawFlamegraph({
        ctx,
        levels: levels.value,
        view: view.value,
        scrollTop: scrollTop.value,
        cssWidth,
        cssHeight,
        rowHeight: rowHeight.value,
        search: search.value,
        focusName: focusName.value,
        hoveredName: hoveredName.value,
        sandwich: sandwich.value,
        showDiffLabels: showDiffLabels.value,
        hitRects
      });
    }
    function drawOverlay() {
      const canvas = overlayRef.value;
      if (!canvas) return;
      const ctx = canvas.getContext("2d");
      if (!ctx) return;
      const { dpr, cssWidth, cssHeight } = getCanvasCssSize(canvas);
      ctx.setTransform(1, 0, 0, 1, 0, 0);
      ctx.clearRect(0, 0, canvas.width, canvas.height);
      if (cursorXPercent.value == null) return;
      const x = clamp(cursorXPercent.value, 0, 1) * cssWidth;
      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
      ctx.beginPath();
      ctx.strokeStyle = "rgba(22, 100, 255, 0.22)";
      ctx.lineWidth = 1;
      ctx.moveTo(x, 0);
      ctx.lineTo(x, cssHeight);
      ctx.stroke();
    }
    function redraw() {
      drawMain();
      drawOverlay();
    }
    function setupRO() {
      ro?.disconnect();
      if (typeof ResizeObserver === "undefined") return;
      ro = new ResizeObserver(() => {
        sizeCanvases();
        redraw();
      });
      if (wrapRef.value) ro.observe(wrapRef.value);
    }
    function pointer(event) {
      const canvas = canvasRef.value;
      if (!canvas) return null;
      const rect = canvas.getBoundingClientRect();
      if (!rect.width || !rect.height) return null;
      const { cssWidth, cssHeight } = getCanvasCssSize(canvas);
      return {
        x: (event.clientX - rect.left) * (cssWidth / rect.width),
        y: (event.clientY - rect.top) * (cssHeight / rect.height),
        cssWidth
      };
    }
    function makeTip(block, x, y) {
      const total = root.value?.value || 1;
      const pct = (block.value / total * 100).toFixed(1);
      const wrap = wrapRef.value;
      const w = wrap?.clientWidth ?? 320;
      const h2 = wrap?.clientHeight ?? 200;
      return {
        cx: clamp(x + 12, 8, Math.max(8, w - 200)),
        cy: clamp(y + 12, 8, Math.max(8, h2 - 100)),
        name: block.name,
        total: block.value,
        self: block.self,
        pct: `${pct}%`
      };
    }
    function onMouseMove(event) {
      if (dragging) return;
      const p = pointer(event);
      if (!p) return;
      cursorXPercent.value = clamp(p.x / Math.max(p.cssWidth, 1), 0, 1);
      const hit = hitFlameBlock(hitRects, p.x, p.y);
      if (hit) {
        hoveredName.value = hit.block.name;
        tip.value = makeTip(hit.block, p.x, p.y);
        if (canvasRef.value) canvasRef.value.style.cursor = "pointer";
      } else {
        hoveredName.value = null;
        tip.value = null;
        if (canvasRef.value) canvasRef.value.style.cursor = "grab";
      }
      redraw();
    }
    function onLeave() {
      cursorXPercent.value = null;
      hoveredName.value = null;
      tip.value = null;
      if (canvasRef.value && !dragging) canvasRef.value.style.cursor = "grab";
      redraw();
    }
    function detachDrag() {
      document.removeEventListener("mousemove", onDocMove);
      document.removeEventListener("mouseup", onDocUp);
    }
    function onMouseDown(event) {
      if (event.button !== 0 || !canvasRef.value || !wrapRef.value) return;
      dragging = true;
      dragMoved = false;
      suppressClick = false;
      dragStartX = event.clientX;
      dragStartY = event.clientY;
      dragStartView = { ...view.value };
      dragStartScroll = scrollTop.value;
      canvasRef.value.style.cursor = "grabbing";
      document.addEventListener("mousemove", onDocMove);
      document.addEventListener("mouseup", onDocUp);
    }
    function onDocMove(event) {
      if (!dragging || !canvasRef.value || !wrapRef.value) return;
      const dx = event.clientX - dragStartX;
      const dy = event.clientY - dragStartY;
      dragMoved = Math.hypot(dx, dy) > 3;
      const span = Math.max(dragStartView.end - dragStartView.start, MIN_VISIBLE_PCT);
      const cssWidth = Math.max(canvasRef.value.clientWidth, 1);
      const deltaPct = dx / cssWidth * span;
      view.value = panViewport(dragStartView, deltaPct);
      const maxScroll = Math.max(0, totalHeight.value - wrapRef.value.clientHeight);
      scrollTop.value = clamp(dragStartScroll - dy, 0, maxScroll);
      redraw();
    }
    function onDocUp() {
      dragging = false;
      suppressClick = dragMoved;
      dragMoved = false;
      if (canvasRef.value) canvasRef.value.style.cursor = "grab";
      detachDrag();
    }
    function onClick(event) {
      if (suppressClick) {
        suppressClick = false;
        return;
      }
      const p = pointer(event);
      if (!p) return;
      const hit = hitFlameBlock(hitRects, p.x, p.y);
      if (hit) onBlockClick(hit.block.name);
    }
    function onWheel(event) {
      const p = pointer(event);
      if (!p) return;
      const factor = Math.exp(event.deltaY * SCROLL_ZOOM_INTENSITY);
      const ratio = clamp(p.x / Math.max(p.cssWidth, 1), 0, 1);
      view.value = zoomViewport(view.value, factor, ratio);
      redraw();
    }
    watch(
      () => props.data?.series,
      () => {
        focusName.value = null;
        view.value = { ...FULL_VIEWPORT };
        scrollTop.value = 0;
      }
    );
    watch(
      [
        levels,
        search,
        focusName,
        hoveredName,
        sandwich,
        showDiffLabels,
        view,
        scrollTop,
        rowHeight
      ],
      () => nextTick(redraw),
      { deep: true }
    );
    watch(
      () => [props.width, props.height],
      () => nextTick(() => {
        sizeCanvases();
        redraw();
      })
    );
    onMounted(() => {
      nextTick(() => {
        setupRO();
        sizeCanvases();
        redraw();
      });
    });
    onUnmounted(() => {
      ro?.disconnect();
      detachDrag();
    });
    return (_ctx, _cache) => {
      return fieldError.value ? (openBlock(), createBlock(PanelDataErrorView, {
        key: 0,
        data: __props.data,
        "field-config": __props.fieldConfig,
        message: fieldError.value
      }, null, 8, ["data", "field-config", "message"])) : (openBlock(), createElementBlock("div", {
        key: 1,
        class: "flame",
        "data-testid": "panel-flamegraph",
        role: "group",
        "aria-label": "火焰图",
        "data-show-table": String(showTable.value),
        "data-collapsing": String(collapsible.value),
        "data-sticky-header": String(stickyHeader.value),
        "data-show-diff": String(showDiffLabels.value),
        "data-focus": String(focusName.value || ""),
        "data-level-count": String(levels.value.length),
        "data-block-count": String(blockCount.value || flatBlocks.value.length),
        "data-sandwich": String(sandwich.value),
        "data-show-extra": String(showExtra.value),
        "data-search": search.value
      }, [
        createElementVNode(
          "div",
          {
            class: normalizeClass(["toolbar", { "is-sticky": stickyHeader.value }]),
            "data-testid": "flame-toolbar"
          },
          [
            focusName.value ? (openBlock(), createElementBlock(
              "button",
              {
                key: 0,
                type: "button",
                class: "reset",
                "data-testid": "flame-reset",
                onClick: resetFocus
              },
              " 重置缩放（" + toDisplayString(focusName.value) + "） ",
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true)
          ],
          2
          /* CLASS */
        ),
        !levels.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$1Y, " 暂无火焰图数据 ")) : (openBlock(), createElementBlock(
          "div",
          {
            key: 1,
            ref_key: "wrapRef",
            ref: wrapRef,
            class: "graph",
            "data-testid": "flame-graph"
          },
          [
            createCommentVNode(" Stable test hooks mirroring former DOM blocks "),
            createElementVNode("div", _hoisted_3$1I, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(flatBlocks.value, (b, i) => {
                  return openBlock(), createElementBlock("button", {
                    key: `${b.depth}-${b.name}-${i}`,
                    type: "button",
                    class: "sr-block",
                    "data-testid": "flame-block",
                    "data-match": search.value ? String(
                      b.name.toLowerCase().includes(search.value.toLowerCase().trim())
                    ) : "true",
                    "aria-label": `${b.name} ${b.value}`,
                    onClick: ($event) => onBlockClick(b.name)
                  }, null, 8, _hoisted_4$1p);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            createElementVNode(
              "canvas",
              {
                ref_key: "canvasRef",
                ref: canvasRef,
                class: "canvas",
                onMousemove: onMouseMove,
                onMouseleave: onLeave,
                onMousedown: onMouseDown,
                onClick,
                onWheel: withModifiers(onWheel, ["prevent"])
              },
              null,
              544
              /* NEED_HYDRATION, NEED_PATCH */
            ),
            createElementVNode(
              "canvas",
              {
                ref_key: "overlayRef",
                ref: overlayRef,
                class: "overlay"
              },
              null,
              512
              /* NEED_PATCH */
            ),
            tip.value ? (openBlock(), createElementBlock(
              "div",
              {
                key: 0,
                class: "tooltip",
                "data-testid": "flame-tooltip",
                style: normalizeStyle({ left: `${tip.value.cx}px`, top: `${tip.value.cy}px` })
              },
              [
                createElementVNode(
                  "div",
                  _hoisted_5$1g,
                  toDisplayString(tip.value.name),
                  1
                  /* TEXT */
                ),
                createElementVNode("div", _hoisted_6$15, [
                  _cache[0] || (_cache[0] = createElementVNode(
                    "span",
                    null,
                    "总计",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode(
                    "strong",
                    null,
                    toDisplayString(tip.value.total),
                    1
                    /* TEXT */
                  )
                ]),
                createElementVNode("div", _hoisted_7$Z, [
                  _cache[1] || (_cache[1] = createElementVNode(
                    "span",
                    null,
                    "自身",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode(
                    "strong",
                    null,
                    toDisplayString(tip.value.self),
                    1
                    /* TEXT */
                  )
                ]),
                createElementVNode("div", _hoisted_8$Q, [
                  _cache[2] || (_cache[2] = createElementVNode(
                    "span",
                    null,
                    "占比",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode(
                    "strong",
                    _hoisted_9$N,
                    toDisplayString(tip.value.pct),
                    1
                    /* TEXT */
                  )
                ])
              ],
              4
              /* STYLE */
            )) : createCommentVNode("v-if", true)
          ],
          512
          /* NEED_PATCH */
        )),
        showTable.value && tableRows.value.length ? (openBlock(), createElementBlock("table", _hoisted_10$F, [
          _cache[3] || (_cache[3] = createElementVNode(
            "thead",
            null,
            [
              createElementVNode("tr", null, [
                createElementVNode("th", null, "符号"),
                createElementVNode("th", null, "总计"),
                createElementVNode("th", null, "自身")
              ])
            ],
            -1
            /* CACHED */
          )),
          createElementVNode("tbody", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(tableRows.value, (r) => {
                return openBlock(), createElementBlock("tr", {
                  key: r.name,
                  "data-testid": "flame-table-row",
                  onClick: ($event) => onBlockClick(r.name)
                }, [
                  createElementVNode(
                    "td",
                    null,
                    toDisplayString(r.name),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "td",
                    null,
                    toDisplayString(r.total),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "td",
                    null,
                    toDisplayString(r.self),
                    1
                    /* TEXT */
                  )
                ], 8, _hoisted_11$y);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2t));
    };
  }
});
const FlamegraphRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$36, [["__scopeId", "data-v-8a0f6ddb"]]);
const _sfc_main$35 = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(FlamegraphRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "flamegraph",
    name: "火焰图",
    description: "CPU / 内存分析火焰图",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$35
).setPanelOptions((builder) => {
  const cat = ["火焰图"];
  builder.addBoolean(
    {
      id: "showTable",
      path: "showTable",
      name: "显示表格",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "collapsing",
      path: "collapsing",
      name: "允许折叠/缩放",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "stickyHeader",
      path: "stickyHeader",
      name: "固定顶栏",
      category: cat
    },
    true
  ).addBoolean(
    {
      id: "showDiffLabels",
      path: "showDiffLabels",
      name: "显示差异标签",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "sandwich",
      path: "sandwich",
      name: "三明治视图",
      category: cat
    },
    false
  ).addBoolean(
    {
      id: "showExtra",
      path: "showExtra",
      name: "显示附加信息",
      category: cat
    },
    false
  );
}).setRuntimeConsumedPaths([
  "showTable",
  "collapsing",
  "stickyHeader",
  "showDiffLabels",
  "sandwich",
  "showExtra"
]).register();
const _hoisted_1$2s = ["data-channel", "data-display", "data-paused", "data-line-count", "data-auto-scroll", "data-message-size-limit", "data-publish", "data-publish-visible"];
const _hoisted_2$1X = ["data-publish-mode"];
const _hoisted_3$1H = { class: "publish__label" };
const _hoisted_4$1o = ["placeholder"];
const _hoisted_5$1f = {
  key: 1,
  class: "live-alert-wrap",
  role: "status",
  "aria-label": "Grafana Live"
};
const _hoisted_6$14 = {
  class: "live-alert",
  "data-testid": "data-testid Alert info"
};
const _hoisted_7$Y = { class: "live-alert__icon" };
const _hoisted_8$P = {
  class: "waiting",
  "data-testid": "live-waiting"
};
const _hoisted_9$M = { class: "waiting__channel" };
const _hoisted_10$E = ["data-auto-scroll"];
const _hoisted_11$x = ["data-truncated"];
const _sfc_main$34 = /* @__PURE__ */ defineComponent({
  __name: "LiveRenderer",
  props: {
    data: {},
    options: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const channelParts = computed(() => {
      const ch = opts.value.channel;
      if (ch && typeof ch === "object") {
        const scope = String(ch.scope ?? "").trim();
        const stream = String(ch.stream ?? ch.namespace ?? "").trim();
        const path = String(ch.path ?? "").trim();
        const valid = Boolean(scope && stream);
        return {
          scope,
          stream,
          path,
          label: [scope, stream, path].filter(Boolean).join("/") || "—",
          valid
        };
      }
      const s = String(ch || "").trim();
      if (!s) return { scope: "", stream: "", path: "", label: "—", valid: false };
      const bits = s.split("/").filter(Boolean);
      return {
        scope: bits[0] || "",
        stream: bits[1] || "",
        path: bits.slice(2).join("/") || "",
        label: s,
        valid: bits.length >= 2
      };
    });
    const display = computed(
      () => String(opts.value.display ?? opts.value.message ?? "json")
    );
    const publishMode = computed(
      () => String(opts.value.publish ?? "none").toLowerCase()
    );
    const showPublish = computed(
      () => publishMode.value === "json" || publishMode.value === "influx"
    );
    const publishDraft = ref("");
    function onPublish() {
      if (!showPublish.value || !hasChannel.value) return;
      publishDraft.value = "";
    }
    const messageSizeLimit = computed(() => {
      const n = Number(opts.value.messageSizeLimit ?? 0);
      return Number.isFinite(n) && n > 0 ? Math.floor(n) : 0;
    });
    const autoScroll = computed(() => opts.value.autoScroll !== false);
    function truncateMessage(raw) {
      const limit = messageSizeLimit.value;
      if (!limit || raw.length <= limit) return raw;
      return raw.slice(0, limit) + "…";
    }
    function formatMessage(raw) {
      const mode2 = display.value.toLowerCase();
      if (mode2 === "none") return "";
      if (mode2 === "json") {
        try {
          const parsed = JSON.parse(raw);
          return truncateMessage(JSON.stringify(parsed, null, 2));
        } catch {
          return truncateMessage(raw);
        }
      }
      return truncateMessage(raw);
    }
    const messages = computed(() => {
      if (display.value.toLowerCase() === "none") return [];
      const frame = props.data?.series?.[0];
      if (!frame?.fields?.length) return [];
      const strField = frame.fields.find((f) => f.type === "string");
      if (!strField) return [];
      const n = Math.min(frame.length ?? strField.values.length, 200);
      const out = [];
      for (let i = 0; i < n; i++) {
        const v = strField.values[i];
        if (v != null && String(v).length) out.push(formatMessage(String(v)));
      }
      return out;
    });
    const hasMessage = computed(() => messages.value.length > 0);
    const hasChannel = computed(() => channelParts.value.valid);
    const paused = ref(false);
    const streamEl = ref(null);
    watch(
      () => [messages.value.length, autoScroll.value, messages.value[messages.value.length - 1]],
      async () => {
        if (!autoScroll.value || paused.value) return;
        await nextTick();
        const el = streamEl.value;
        if (!el) return;
        el.scrollTop = el.scrollHeight;
      },
      { flush: "post" }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "live",
        "data-testid": "panel-live",
        "data-channel": channelParts.value.label,
        "data-display": display.value,
        "data-paused": String(paused.value),
        "data-line-count": String(messages.value.length),
        "data-auto-scroll": String(autoScroll.value),
        "data-message-size-limit": String(messageSizeLimit.value),
        "data-publish": publishMode.value,
        "data-publish-visible": String(showPublish.value)
      }, [
        showPublish.value && hasChannel.value ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: "publish",
          "data-testid": "live-publish",
          "data-publish-mode": publishMode.value
        }, [
          createElementVNode(
            "div",
            _hoisted_3$1H,
            toDisplayString(publishMode.value === "influx" ? "Influx 发布" : "JSON 发布"),
            1
            /* TEXT */
          ),
          withDirectives(createElementVNode("textarea", {
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => publishDraft.value = $event),
            class: "publish__input",
            "data-testid": "live-publish-input",
            rows: "3",
            placeholder: publishMode.value === "influx" ? "measurement,tag=value field=1" : "{ }"
          }, null, 8, _hoisted_4$1o), [
            [vModelText, publishDraft.value]
          ]),
          createElementVNode("button", {
            type: "button",
            class: "publish__btn",
            "data-testid": "live-publish-btn",
            onClick: onPublish
          }, " 发布 ")
        ], 8, _hoisted_2$1X)) : createCommentVNode("v-if", true),
        createCommentVNode(" Grafana LivePanel: !addr → Alert severity=info "),
        !hasChannel.value ? (openBlock(), createElementBlock("div", _hoisted_5$1f, [
          createElementVNode("div", _hoisted_6$14, [
            createElementVNode("div", _hoisted_7$Y, [
              createVNode(unref(GIcon), {
                name: "info-circle",
                size: 24,
                color: "var(--grafana-primary)"
              })
            ]),
            _cache[1] || (_cache[1] = createElementVNode(
              "div",
              { class: "live-alert__body" },
              [
                createElementVNode("div", { class: "live-alert__title" }, "Grafana Live"),
                createElementVNode("div", { class: "live-alert__content" }, "使用面板编辑器选择频道")
              ],
              -1
              /* CACHED */
            ))
          ])
        ])) : !hasMessage.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createCommentVNode(" Grafana LivePanel.renderMessage empty branch (zh-Hans) "),
            createElementVNode("div", _hoisted_8$P, [
              _cache[2] || (_cache[2] = createElementVNode(
                "h4",
                { class: "waiting__title" },
                "正在等待数据：",
                -1
                /* CACHED */
              )),
              createElementVNode(
                "div",
                _hoisted_9$M,
                toDisplayString(channelParts.value.label),
                1
                /* TEXT */
              )
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        )) : (openBlock(), createElementBlock("div", {
          key: 3,
          ref_key: "streamEl",
          ref: streamEl,
          class: "stream",
          "data-testid": "live-stream",
          "data-auto-scroll": String(autoScroll.value)
        }, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(messages.value, (l, i) => {
              return openBlock(), createElementBlock("div", {
                key: i,
                class: "line",
                "data-testid": "live-line",
                "data-truncated": messageSizeLimit.value > 0 && l.endsWith("…") ? "true" : "false"
              }, toDisplayString(l), 9, _hoisted_11$x);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ], 8, _hoisted_10$E))
      ], 8, _hoisted_1$2s);
    };
  }
});
const LiveRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$34, [["__scopeId", "data-v-f091a7a0"]]);
const _sfc_main$33 = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(LiveRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "live",
    name: "实时",
    description: "Grafana Live 频道",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$33
).setPanelOptions((builder) => {
  const category = ["实时"];
  builder.addText(
    {
      id: "channel",
      path: "channel",
      name: "频道",
      description: "如 grafana/dashboard/uid/panel-1",
      category
    },
    ""
  ).addRadio(
    {
      id: "display",
      path: "display",
      name: "消息显示",
      category,
      settings: {
        options: [
          { label: "JSON", value: "json" },
          { label: "原始", value: "raw" },
          { label: "自动", value: "auto" },
          { label: "不显示", value: "none" }
        ]
      }
    },
    "json"
  ).addRadio(
    {
      id: "publish",
      path: "publish",
      name: "发布",
      category,
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "JSON", value: "json" },
          { label: "Influx", value: "influx" }
        ]
      }
    },
    "none"
  ).addNumber(
    {
      id: "messageSizeLimit",
      path: "messageSizeLimit",
      name: "消息大小限制",
      category,
      description: "单条消息最大字节（0=不限制）"
    },
    0
  ).addBoolean(
    {
      id: "autoScroll",
      path: "autoScroll",
      name: "自动滚动",
      category
    },
    true
  );
}).setRuntimeConsumedPaths([
  "channel",
  "display",
  "publish",
  "messageSizeLimit",
  "autoScroll"
]).register();
const _hoisted_1$2r = ["data-mode", "data-state-view", "data-instance-name", "data-counter-render", "data-counter-data", "data-counter-schema", "data-elapsed", "data-dashboard-uid"];
const _hoisted_2$1W = {
  key: 0,
  class: "state-view",
  "data-testid": "debug-state-view"
};
const _hoisted_3$1G = { class: "state-field" };
const _hoisted_4$1n = {
  class: "state-current",
  "data-testid": "debug-state-current"
};
const _hoisted_5$1e = {
  key: 0,
  class: "state-view-meta"
};
const _hoisted_6$13 = {
  class: "events-view",
  "data-testid": "debug-events"
};
const _hoisted_7$X = {
  class: "toolbar",
  "data-testid": "debug-counters"
};
const _hoisted_8$O = { class: "counts" };
const _hoisted_9$L = {
  class: "event-list",
  "data-testid": "debug-payload"
};
const _hoisted_10$D = { class: "event-type" };
const _hoisted_11$w = { class: "event-detail" };
const _hoisted_12$r = {
  key: 0,
  class: "event-empty"
};
const _hoisted_13$r = {
  class: "cursor-view",
  "data-testid": "debug-cursor"
};
const _hoisted_14$q = { "data-testid": "debug-cursor-pos" };
const _hoisted_15$l = {
  class: "toolbar",
  "data-testid": "debug-counters"
};
const _hoisted_16$j = { class: "counts" };
const _hoisted_17$g = {
  key: 0,
  "data-testid": "counter-render"
};
const _hoisted_18$g = {
  key: 1,
  "data-testid": "counter-data"
};
const _hoisted_19$e = {
  key: 2,
  "data-testid": "counter-schema"
};
const _hoisted_20$c = { "data-testid": "counter-elapsed" };
const _hoisted_21$8 = { class: "frame-title" };
const _hoisted_22$8 = {
  class: "filter-table",
  "data-testid": "debug-field-table"
};
const _sfc_main$32 = /* @__PURE__ */ defineComponent({
  __name: "DebugRenderer",
  props: {
    data: {},
    options: {},
    fieldConfig: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const mode2 = computed(() => String(opts.value.mode ?? "render"));
    const modeKey = computed(() => mode2.value.toLowerCase());
    const counters = ref({ render: 1, dataChanged: 0, schemaChanged: 0 });
    const elapsed = ref(0);
    const sawData = ref(false);
    const instanceName = ref("");
    const stateViewLabel = computed(() => String(opts.value.stateView ?? ""));
    const showRender = computed(() => opts.value.counters?.render !== false);
    const showData = computed(() => opts.value.counters?.dataChanged !== false);
    const showSchema = computed(() => opts.value.counters?.schemaChanged !== false);
    const eventLog = ref([]);
    const cursorInfo = ref({ x: 0, y: 0, active: false });
    function frameStructure(series) {
      return (series ?? []).map((f) => (f.fields ?? []).map((x) => `${x.name}:${x.type}`).join(",")).join("|");
    }
    watch(
      () => props.data,
      (n, o) => {
        if (!sawData.value) {
          sawData.value = true;
          return;
        }
        if (n !== o) {
          counters.value = {
            ...counters.value,
            dataChanged: counters.value.dataChanged + 1,
            schemaChanged: frameStructure(n?.series) !== frameStructure(o?.series) ? counters.value.schemaChanged + 1 : counters.value.schemaChanged,
            render: counters.value.render + 1
          };
          if (modeKey.value === "events") {
            eventLog.value = [
              ...eventLog.value.slice(-49),
              {
                t: Date.now(),
                type: "data",
                detail: `series=${n?.series?.length ?? 0}`
              }
            ];
          }
        }
      }
    );
    function resetCounters() {
      counters.value = { render: 1, dataChanged: 0, schemaChanged: 0 };
      elapsed.value = 0;
      eventLog.value = [];
    }
    function lastNotNull(values) {
      for (let i = values.length - 1; i >= 0; i--) {
        const v = values[i];
        if (v != null && !(typeof v === "number" && Number.isNaN(v)))
          return String(v);
      }
      return "null";
    }
    const frames = computed(
      () => (props.data?.series ?? []).map((frame, idx) => {
        const name = frame.name || frame.refId || `Frame ${idx}`;
        const length = frame.length ?? frame.fields?.[0]?.values?.length ?? 0;
        const fields = (frame.fields ?? []).map((field) => ({
          name: field.name,
          type: field.type,
          last: lastNotNull(field.values ?? [])
        }));
        return { name, length, fields, key: `${idx}/${frame.refId ?? name}` };
      })
    );
    function onCursorMove(e) {
      if (modeKey.value !== "cursor") return;
      const t2 = e.currentTarget;
      const r = t2.getBoundingClientRect();
      cursorInfo.value = {
        x: Math.round(e.clientX - r.left),
        y: Math.round(e.clientY - r.top),
        active: true
      };
    }
    function onCursorLeave() {
      cursorInfo.value = { ...cursorInfo.value, active: false };
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "debug",
        "data-testid": "panel-debug",
        "data-mode": mode2.value,
        "data-state-view": stateViewLabel.value,
        "data-instance-name": instanceName.value,
        "data-counter-render": String(counters.value.render),
        "data-counter-data": String(counters.value.dataChanged),
        "data-counter-schema": String(counters.value.schemaChanged),
        "data-elapsed": String(elapsed.value),
        "data-dashboard-uid": String(opts.value.dashboardUID ?? ""),
        onMousemove: onCursorMove,
        onMouseleave: onCursorLeave
      }, [
        createCommentVNode(" Grafana DebugMode.State → StateView "),
        modeKey.value === "state" ? (openBlock(), createElementBlock("div", _hoisted_2$1W, [
          createElementVNode("label", _hoisted_3$1G, [
            _cache[1] || (_cache[1] = createElementVNode(
              "span",
              { class: "state-label" },
              "状态名称",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "data-testid": "debug-state-name",
              value: instanceName.value,
              placeholder: "instance state name",
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => instanceName.value = String($event ?? ""))
            }, null, 8, ["value"])
          ]),
          createElementVNode("div", _hoisted_4$1n, [
            createTextVNode(
              " 当前值: " + toDisplayString(instanceName.value || "—") + " ",
              1
              /* TEXT */
            ),
            stateViewLabel.value ? (openBlock(), createElementBlock(
              "span",
              _hoisted_5$1e,
              " (" + toDisplayString(stateViewLabel.value) + ") ",
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true)
          ])
        ])) : modeKey.value === "events" ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createCommentVNode(" Grafana DebugMode.Events → EventBusLogger "),
            createElementVNode("div", _hoisted_6$13, [
              createElementVNode("div", _hoisted_7$X, [
                createElementVNode("button", {
                  type: "button",
                  class: "reset-btn",
                  title: "复位计数器",
                  "aria-label": "后退",
                  "data-testid": "debug-reset",
                  onClick: resetCounters
                }, [
                  createVNode(unref(GIcon), {
                    name: "step-backward",
                    size: 16
                  })
                ]),
                createElementVNode(
                  "span",
                  _hoisted_8$O,
                  "事件：" + toDisplayString(eventLog.value.length),
                  1
                  /* TEXT */
                )
              ]),
              createElementVNode("ul", _hoisted_9$L, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(eventLog.value, (e, i) => {
                    return openBlock(), createElementBlock("li", {
                      key: i,
                      class: "event-row"
                    }, [
                      createElementVNode(
                        "span",
                        _hoisted_10$D,
                        toDisplayString(e.type),
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "span",
                        _hoisted_11$w,
                        toDisplayString(e.detail),
                        1
                        /* TEXT */
                      )
                    ]);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                )),
                !eventLog.value.length ? (openBlock(), createElementBlock("li", _hoisted_12$r, "暂无事件")) : createCommentVNode("v-if", true)
              ])
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        )) : modeKey.value === "cursor" ? (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createCommentVNode(" Grafana DebugMode.Cursor → CursorView "),
            createElementVNode("div", _hoisted_13$r, [
              createElementVNode(
                "div",
                _hoisted_14$q,
                " 光标：" + toDisplayString(cursorInfo.value.active ? `${cursorInfo.value.x}, ${cursorInfo.value.y}` : "—"),
                1
                /* TEXT */
              )
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        )) : (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            createCommentVNode(" Default: RenderInfoViewer "),
            createElementVNode("div", _hoisted_15$l, [
              createElementVNode("button", {
                type: "button",
                class: "reset-btn",
                title: "复位计数器",
                "aria-label": "后退",
                "data-testid": "debug-reset",
                onClick: resetCounters
              }, [
                createVNode(unref(GIcon), {
                  name: "step-backward",
                  size: 16
                })
              ]),
              createElementVNode("span", _hoisted_16$j, [
                showRender.value ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_17$g,
                  "渲染：" + toDisplayString(counters.value.render),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                showData.value ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_18$g,
                  "数据：" + toDisplayString(counters.value.dataChanged),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                showSchema.value ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_19$e,
                  "架构：" + toDisplayString(counters.value.schemaChanged),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                createElementVNode(
                  "span",
                  _hoisted_20$c,
                  "时间：" + toDisplayString(elapsed.value) + " 毫秒",
                  1
                  /* TEXT */
                )
              ])
            ]),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(frames.value, (frame) => {
                return openBlock(), createElementBlock("div", {
                  key: frame.key,
                  class: "frame",
                  "data-testid": "debug-frame"
                }, [
                  createElementVNode(
                    "h4",
                    _hoisted_21$8,
                    toDisplayString(frame.name) + " (" + toDisplayString(frame.length) + ")",
                    1
                    /* TEXT */
                  ),
                  createElementVNode("table", _hoisted_22$8, [
                    _cache[2] || (_cache[2] = createElementVNode(
                      "thead",
                      null,
                      [
                        createElementVNode("tr", null, [
                          createElementVNode("td", null, "字段"),
                          createElementVNode("td", null, "类型"),
                          createElementVNode("td", null, "最后一个")
                        ])
                      ],
                      -1
                      /* CACHED */
                    )),
                    createElementVNode("tbody", null, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(frame.fields, (field, fi) => {
                          return openBlock(), createElementBlock("tr", {
                            key: `${fi}/${field.name}`
                          }, [
                            createElementVNode(
                              "td",
                              null,
                              toDisplayString(field.name),
                              1
                              /* TEXT */
                            ),
                            createElementVNode(
                              "td",
                              null,
                              toDisplayString(field.type),
                              1
                              /* TEXT */
                            ),
                            createElementVNode(
                              "td",
                              null,
                              toDisplayString(field.last),
                              1
                              /* TEXT */
                            )
                          ]);
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ])
                  ])
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ], 40, _hoisted_1$2r);
    };
  }
});
const DebugRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$32, [["__scopeId", "data-v-0626e35b"]]);
const _sfc_main$31 = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(DebugRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "debug",
    name: "调试",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$31
).setPanelOptions((builder) => {
  const category = ["调试"];
  builder.addSelect(
    {
      id: "mode",
      path: "mode",
      name: "模式",
      category,
      settings: {
        options: [
          { label: "渲染", value: "render" },
          { label: "事件", value: "Events" },
          { label: "光标", value: "Cursor" },
          { label: "状态", value: "State" }
        ]
      }
    },
    "render"
  ).addText({
    id: "stateView",
    path: "stateView",
    name: "状态视图",
    category,
    showIf: (c) => String(c.mode).toLowerCase() === "state"
  }).addBoolean(
    {
      id: "counters.render",
      path: "counters.render",
      name: "渲染计数",
      category
    },
    true
  ).addBoolean(
    {
      id: "counters.dataChanged",
      path: "counters.dataChanged",
      name: "数据变更计数",
      category
    },
    true
  ).addBoolean(
    {
      id: "counters.schemaChanged",
      path: "counters.schemaChanged",
      name: "Schema 变更计数",
      category
    },
    true
  ).addText({
    id: "dashboardUID",
    path: "dashboardUID",
    name: "仪表盘 UID",
    category
  });
}).setRuntimeConsumedPaths([
  "mode",
  "stateView",
  "counters.render",
  "counters.dataChanged",
  "counters.schemaChanged",
  "dashboardUID"
]).register();
const _hoisted_1$2q = ["data-folder", "data-datasource", "data-group-by", "data-view-mode", "data-group-mode", "data-max-items", "data-sort", "data-show-inactive", "data-dashboard-alerts", "data-alert-name", "data-alert-instance-label-filter", "data-row-count", "data-stat-color-mode", "data-stat-color", "data-state-filter-size", "data-state-firing", "data-state-pending", "data-state-normal", "data-stat-thresholds", "data-stat-value-mappings"];
const _hoisted_2$1V = ["data-color-mode"];
const _hoisted_3$1F = { class: "stat-label" };
const _hoisted_4$1m = {
  key: 0,
  class: "group-title"
};
const _hoisted_5$1d = ["data-state"];
const _hoisted_6$12 = { class: "badge" };
const _hoisted_7$W = { class: "info" };
const _hoisted_8$N = { class: "name" };
const _hoisted_9$K = {
  key: 0,
  class: "labels"
};
const _hoisted_10$C = {
  key: 0,
  class: "empty",
  "data-testid": "alertlist-empty"
};
const _sfc_main$30 = /* @__PURE__ */ defineComponent({
  __name: "AlertListRenderer",
  props: {
    data: {},
    options: {},
    width: {},
    height: {}
  },
  setup(__props) {
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const viewMode = computed(() => String(opts.value.viewMode ?? "list"));
    const groupMode = computed(() => String(opts.value.groupMode ?? "default"));
    const maxItems = computed(() => Number(opts.value.maxItems ?? 10) || 10);
    const sortOrder = computed(() => opts.value.sortOrder ?? "alphaAsc");
    const showInactive = computed(() => opts.value.showInactiveAlerts !== false);
    const dashboardAlerts = computed(
      () => opts.value.dashboardAlerts === true || opts.value.dashboardAlerts === "true"
    );
    const groupByField = computed(() => String(opts.value.groupBy ?? ""));
    const STAT_THRESHOLDS_DEFAULT = {
      mode: "absolute",
      steps: [
        { value: -Infinity, color: "green" },
        { value: 80, color: "red" }
      ]
    };
    function fromData() {
      const frame = props.data?.series?.[0];
      if (!frame?.fields?.length) return [];
      const nameF = frame.fields.find((f) => /name|alertname|title/i.test(f.name)) ?? frame.fields[0];
      const stateF = frame.fields.find((f) => /state|status/i.test(f.name));
      const labelsF = frame.fields.find((f) => /label/i.test(f.name));
      const n = nameF.values.length;
      if (!n) return [];
      const rows2 = [];
      for (let i = 0; i < n; i++) {
        rows2.push({
          name: String(nameF.values[i]),
          state: String(stateF?.values[i] ?? "alerting").toLowerCase(),
          labels: labelsF ? String(labelsF.values[i]) : void 0
        });
      }
      return rows2;
    }
    const STATE_FILTER_OPTION_KEYS = [
      "firing",
      "pending",
      "recovering",
      "noData",
      "normal",
      "error",
      "inactive"
    ];
    const stateFilter = computed(() => {
      const f = opts.value.stateFilter;
      if (f == null) return null;
      if (Array.isArray(f)) {
        if (!f.length) return null;
        return new Set(f.map((s) => String(s).toLowerCase()));
      }
      if (typeof f !== "object") return null;
      const rec = f;
      const set = /* @__PURE__ */ new Set();
      for (const k of STATE_FILTER_OPTION_KEYS) {
        if (rec[k]) set.add(String(k).toLowerCase());
      }
      for (const [k, v] of Object.entries(rec)) {
        if (v) set.add(String(k).toLowerCase());
      }
      return set;
    });
    function matchesStateFilter(state2, filter2) {
      const st = state2.toLowerCase().replace(/[\s-]/g, "_");
      if (filter2.has(st)) return true;
      const groups2 = [
        ["firing", "alerting", "alert"],
        ["pending"],
        ["recovering", "recover"],
        ["normal", "ok", "inactive"],
        ["nodata", "no_data", "no-data"],
        ["error", "err"]
      ];
      for (const g of groups2) {
        const dataHit = g.some((a) => a === st || st.includes(a));
        const filterHit = g.some((a) => filter2.has(a));
        if (dataHit && filterHit) return true;
      }
      return false;
    }
    const rows = computed(() => {
      let list = fromData();
      const nameFilter = String(
        opts.value.alertName ?? opts.value.alertInstanceLabelFilter ?? ""
      ).toLowerCase();
      const folderFilter = String(opts.value.folder ?? "").toLowerCase();
      const dsFilter = String(opts.value.datasource ?? "").toLowerCase();
      if (nameFilter) {
        list = list.filter(
          (r) => r.name.toLowerCase().includes(nameFilter) || (r.labels ?? "").toLowerCase().includes(nameFilter)
        );
      }
      if (folderFilter) {
        list = list.filter(
          (r) => String(r.folder ?? "").toLowerCase().includes(folderFilter)
        );
      }
      if (dsFilter) {
        list = list.filter(
          (r) => String(r.datasource ?? r.ds ?? "").toLowerCase().includes(dsFilter)
        );
      }
      const filter2 = stateFilter.value;
      list = list.filter((r) => {
        const st = r.state.toLowerCase();
        if (st === "inactive" && !showInactive.value && !filter2) return false;
        if (!filter2) return true;
        return matchesStateFilter(st, filter2);
      });
      if (dashboardAlerts.value) {
        list = list.filter((r) => !r.folder || r.folder === "Infra");
      }
      const sort = sortOrder.value;
      list = [...list].sort((a, b) => {
        if (sort === 3 || sort === "importance")
          return (a.importance ?? 0) - (b.importance ?? 0);
        if (sort === 2 || sort === "alphaDesc") return b.name.localeCompare(a.name);
        if (sort === 4 || sort === "timeAsc" || sort === 5 || sort === "timeDesc")
          return a.name.localeCompare(b.name);
        return a.name.localeCompare(b.name);
      });
      return list.slice(0, maxItems.value);
    });
    const groups = computed(() => {
      if (groupMode.value === "default" || viewMode.value !== "list") {
        return [{ key: "all", rows: rows.value }];
      }
      const map = /* @__PURE__ */ new Map();
      for (const r of rows.value) {
        const key = groupMode.value === "custom" ? groupByField.value ? String(r[groupByField.value] ?? r.folder ?? "默认") : r.folder || "默认" : r.state;
        if (!map.has(key)) map.set(key, []);
        map.get(key).push(r);
      }
      return [...map.entries()].map(([key, rows2]) => ({ key, rows: rows2 }));
    });
    function stateClass(s) {
      const st = s.toLowerCase();
      if (st === "alerting" || st === "firing" || st === "error") return "alerting";
      if (st === "pending") return "pending";
      if (st === "recovering") return "pending";
      if (st === "ok" || st === "normal") return "ok";
      if (st === "no_data" || st === "nodata") return "nodata";
      return "inactive";
    }
    const statColorMode = computed(
      () => String(opts.value.statColorMode ?? "none").toLowerCase()
    );
    const statDisplay = computed(() => {
      const count = rows.value.length;
      const thresholds = opts.value.statThresholds ?? STAT_THRESHOLDS_DEFAULT;
      const mappings = opts.value.statValueMappings ?? [];
      const processor = getDisplayProcessor({
        field: {
          name: "count",
          type: "number",
          config: {
            thresholds,
            mappings
          },
          values: [count]
        }
      });
      const displayValue = processor(count);
      let color = displayValue.color;
      if (statColorMode.value === "none") {
        color = void 0;
      } else if (!color) {
        const active = getActiveThreshold(count, thresholds);
        color = active?.color ? resolveVizColor(active.color) : void 0;
      } else {
        color = resolveVizColor(color) ?? color;
      }
      return {
        text: displayValue.text ?? String(count),
        numeric: count,
        color,
        title: "告警"
      };
    });
    const bigValueColorMode = computed(() => {
      const m = statColorMode.value;
      if (m === "background" || m === "background_solid") return m;
      if (m === "value") return BigValueColorMode.Value;
      return BigValueColorMode.None;
    });
    const statShellStyle = computed(() => {
      const mode2 = statColorMode.value;
      const color = statDisplay.value.color;
      if (!color) return {};
      if (mode2 === "background_solid") return { background: color };
      if (mode2 === "background")
        return { background: `linear-gradient(120deg, ${color}, ${color})` };
      return {};
    });
    const statValueStyle = computed(() => {
      if (statColorMode.value === "value" && statDisplay.value.color) {
        return { color: statDisplay.value.color };
      }
      return {};
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "alertlist",
        "data-testid": "panel-alertlist",
        "data-folder": String(opts.value.folder ?? ""),
        "data-datasource": String(opts.value.datasource ?? ""),
        "data-group-by": String(opts.value.groupBy ?? ""),
        "data-view-mode": viewMode.value,
        "data-group-mode": groupMode.value,
        "data-max-items": String(maxItems.value),
        "data-sort": String(sortOrder.value),
        "data-show-inactive": String(showInactive.value),
        "data-dashboard-alerts": String(dashboardAlerts.value),
        "data-alert-name": String(opts.value.alertName ?? ""),
        "data-alert-instance-label-filter": String(opts.value.alertInstanceLabelFilter ?? ""),
        "data-row-count": String(rows.value.length),
        "data-stat-color-mode": statColorMode.value,
        "data-stat-color": String(statDisplay.value.color ?? ""),
        "data-state-filter-size": String(stateFilter.value == null ? -1 : stateFilter.value.size),
        "data-state-firing": String(!!(opts.value.stateFilter?.firing ?? opts.value.stateFilter?.alerting)),
        "data-state-pending": String(!!opts.value.stateFilter?.pending),
        "data-state-normal": String(!!(opts.value.stateFilter?.normal ?? opts.value.stateFilter?.inactive)),
        "data-stat-thresholds": String(
          Array.isArray(opts.value.statThresholds?.steps) ? opts.value.statThresholds.steps.length : opts.value.statThresholds ? "set" : ""
        ),
        "data-stat-value-mappings": String(
          Array.isArray(opts.value.statValueMappings) ? opts.value.statValueMappings.length : opts.value.statValueMappings ? "set" : ""
        )
      }, [
        viewMode.value === "stat" ? (openBlock(), createElementBlock("div", {
          key: 0,
          class: "stat-wrap",
          "data-testid": "alertlist-stat",
          "data-color-mode": statColorMode.value,
          style: normalizeStyle(statShellStyle.value)
        }, [
          __props.width && __props.height ? (openBlock(), createBlock(unref(BigValue), {
            key: 0,
            width: __props.width,
            height: __props.height,
            value: {
              text: statDisplay.value.text,
              title: statDisplay.value.title,
              color: statDisplay.value.color
            },
            "color-mode": bigValueColorMode.value,
            "graph-mode": unref(BigValueGraphMode).None,
            "justify-mode": unref(BigValueJustifyMode).Auto,
            "text-mode": unref(BigValueTextMode).Auto
          }, null, 8, ["width", "height", "value", "color-mode", "graph-mode", "justify-mode", "text-mode"])) : (openBlock(), createElementBlock(
            Fragment,
            { key: 1 },
            [
              createElementVNode(
                "div",
                {
                  class: "stat",
                  style: normalizeStyle(statValueStyle.value)
                },
                toDisplayString(statDisplay.value.text),
                5
                /* TEXT, STYLE */
              ),
              createElementVNode(
                "div",
                _hoisted_3$1F,
                toDisplayString(statDisplay.value.title),
                1
                /* TEXT */
              )
            ],
            64
            /* STABLE_FRAGMENT */
          ))
        ], 12, _hoisted_2$1V)) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(groups.value, (g) => {
                return openBlock(), createElementBlock("section", {
                  key: g.key,
                  class: "group"
                }, [
                  groupMode.value !== "default" ? (openBlock(), createElementBlock(
                    "header",
                    _hoisted_4$1m,
                    toDisplayString(g.key),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(g.rows, (r, i) => {
                      return openBlock(), createElementBlock("div", {
                        key: i,
                        class: normalizeClass(["row", stateClass(r.state)]),
                        "data-testid": "alertlist-row",
                        "data-state": r.state
                      }, [
                        createElementVNode(
                          "span",
                          _hoisted_6$12,
                          toDisplayString(r.state),
                          1
                          /* TEXT */
                        ),
                        createElementVNode("div", _hoisted_7$W, [
                          createElementVNode(
                            "div",
                            _hoisted_8$N,
                            toDisplayString(r.name),
                            1
                            /* TEXT */
                          ),
                          r.labels ? (openBlock(), createElementBlock(
                            "div",
                            _hoisted_9$K,
                            toDisplayString(r.labels),
                            1
                            /* TEXT */
                          )) : createCommentVNode("v-if", true)
                        ])
                      ], 10, _hoisted_5$1d);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            )),
            createCommentVNode(" Grafana UnifiedAlertList hardcodes English empty copy "),
            !rows.value.length ? (openBlock(), createElementBlock("div", _hoisted_10$C, " No alerts matching filters ")) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ], 8, _hoisted_1$2q);
    };
  }
});
const AlertListRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$30, [["__scopeId", "data-v-9e0be702"]]);
const _sfc_main$2$ = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(AlertListRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
new VuePanelPlugin(
  {
    id: "alertlist",
    name: "告警列表",
    description: "统一告警列表 / 统计",
    state: "stable",
    skipDataQuery: true
  },
  _sfc_main$2$
).setPanelOptions((builder) => {
  const optionsCategory = ["选项"];
  const filterCategory = ["过滤"];
  const alertStateCategory = ["告警状态过滤"];
  const statCategory = ["统计样式"];
  builder.addRadio(
    {
      id: "viewMode",
      path: "viewMode",
      name: "视图模式",
      description: "列表视图与统计视图切换",
      category: optionsCategory,
      settings: {
        options: [
          { label: "列表", value: "list" },
          { label: "统计", value: "stat" }
        ]
      }
    },
    "list"
  ).addRadio(
    {
      id: "groupMode",
      path: "groupMode",
      name: "分组模式",
      category: optionsCategory,
      settings: {
        options: [
          { label: "默认分组", value: "default" },
          { label: "自定义分组", value: "custom" }
        ]
      }
    },
    "default"
  ).addText(
    {
      id: "groupBy",
      path: "groupBy",
      name: "分组字段",
      description: "标签查询，逗号分隔",
      category: optionsCategory,
      showIf: (c) => c.groupMode === "custom"
    },
    void 0
  ).addNumber(
    {
      id: "maxItems",
      path: "maxItems",
      name: "最大条目",
      category: optionsCategory,
      settings: { min: 1 },
      showIf: (c) => c.groupMode !== "custom"
    },
    20
  ).addSelect(
    {
      id: "sortOrder",
      path: "sortOrder",
      name: "排序",
      category: optionsCategory,
      settings: {
        options: [
          { label: "字母升序", value: 1 },
          { label: "字母降序", value: 2 },
          { label: "重要性", value: 3 },
          { label: "时间升序", value: 4 },
          { label: "时间降序", value: 5 }
        ]
      }
    },
    3
  ).addBoolean(
    {
      id: "dashboardAlerts",
      path: "dashboardAlerts",
      name: "仅本仪表盘关联告警",
      category: filterCategory
    },
    false
  ).addText(
    {
      id: "alertName",
      path: "alertName",
      name: "告警名称",
      category: filterCategory
    },
    ""
  ).addText(
    {
      id: "alertInstanceLabelFilter",
      path: "alertInstanceLabelFilter",
      name: "实例标签过滤",
      category: filterCategory
    },
    ""
  ).addText(
    {
      id: "datasource",
      path: "datasource",
      name: "数据源",
      category: filterCategory
    },
    void 0
  ).addText(
    {
      id: "folder",
      path: "folder",
      name: "文件夹",
      category: filterCategory
    },
    void 0
  ).addBoolean(
    {
      id: "showInactiveAlerts",
      path: "showInactiveAlerts",
      name: "显示 0 实例告警",
      category: filterCategory
    },
    false
  ).addBoolean(
    {
      id: "stateFilter.firing",
      path: "stateFilter.firing",
      name: "Alerting / Firing",
      category: alertStateCategory
    },
    true
  ).addBoolean(
    {
      id: "stateFilter.pending",
      path: "stateFilter.pending",
      name: "Pending",
      category: alertStateCategory
    },
    true
  ).addBoolean(
    {
      id: "stateFilter.recovering",
      path: "stateFilter.recovering",
      name: "Recovering",
      category: alertStateCategory
    },
    true
  ).addBoolean(
    {
      id: "stateFilter.noData",
      path: "stateFilter.noData",
      name: "No Data",
      category: alertStateCategory
    },
    false
  ).addBoolean(
    {
      id: "stateFilter.normal",
      path: "stateFilter.normal",
      name: "Normal",
      category: alertStateCategory
    },
    false
  ).addBoolean(
    {
      id: "stateFilter.error",
      path: "stateFilter.error",
      name: "Error",
      category: alertStateCategory
    },
    true
  ).addSelect(
    {
      id: "statColorMode",
      path: "statColorMode",
      name: "颜色模式",
      category: statCategory,
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "值", value: "value" },
          { label: "背景渐变", value: "background" },
          { label: "背景纯色", value: "background_solid" }
        ]
      },
      showIf: (c) => c.viewMode === "stat"
    },
    "none"
  ).addCustom({
    id: "statThresholds",
    path: "statThresholds",
    name: "阈值",
    category: statCategory,
    editor: "thresholds",
    showIf: (c) => c.viewMode === "stat" && c.statColorMode && c.statColorMode !== "none"
  }).addCustom({
    id: "statValueMappings",
    path: "statValueMappings",
    name: "值映射",
    category: statCategory,
    editor: "mappings",
    showIf: (c) => c.viewMode === "stat"
  });
}).setRuntimeConsumedPaths([
  "viewMode",
  "groupMode",
  "groupBy",
  "maxItems",
  "sortOrder",
  "dashboardAlerts",
  "alertName",
  "alertInstanceLabelFilter",
  "datasource",
  "folder",
  "showInactiveAlerts",
  "stateFilter.firing",
  "stateFilter.pending",
  "stateFilter.recovering",
  "stateFilter.noData",
  "stateFilter.normal",
  "stateFilter.error",
  "statColorMode",
  "statThresholds",
  "statValueMappings"
]).register();
const _hoisted_1$2p = ["data-mode", "data-clock-type", "data-date-show", "data-timezone"];
const _hoisted_2$1U = { class: "panel-clock__time" };
const _hoisted_3$1E = {
  key: 0,
  class: "panel-clock__date"
};
const _sfc_main$2_ = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const now = ref(Date.now());
    let timer;
    onMounted(() => {
      timer = setInterval(() => {
        now.value = Date.now();
      }, 250);
    });
    onBeforeUnmount(() => {
      if (timer) clearInterval(timer);
    });
    function pad(n) {
      return String(n).padStart(2, "0");
    }
    function formatInTz(ts, tz, clockType, dateFormat) {
      try {
        const d = new Date(ts);
        const hour12 = String(clockType || "").toLowerCase().includes("12");
        if (tz) {
          const parts = new Intl.DateTimeFormat(hour12 ? "en-US" : "en-GB", {
            timeZone: tz,
            year: "numeric",
            month: "2-digit",
            day: "2-digit",
            hour: "2-digit",
            minute: "2-digit",
            second: "2-digit",
            hour12
          }).formatToParts(d);
          const get = (t2) => parts.find((p) => p.type === t2)?.value || "";
          const dayPeriod = get("dayPeriod");
          const time2 = hour12 ? `${get("hour")}:${get("minute")}:${get("second")}${dayPeriod ? " " + dayPeriod : ""}` : `${get("hour")}:${get("minute")}:${get("second")}`;
          const y2 = get("year");
          const m2 = get("month");
          const day2 = get("day");
          const date = applyDateFormat(dateFormat, y2, m2, day2);
          return { date, time: time2 };
        }
        const y = String(d.getFullYear());
        const m = pad(d.getMonth() + 1);
        const day = pad(d.getDate());
        let h2 = d.getHours();
        const min = pad(d.getMinutes());
        const sec = pad(d.getSeconds());
        let time;
        if (hour12) {
          const ap = h2 >= 12 ? "PM" : "AM";
          h2 = h2 % 12 || 12;
          time = `${pad(h2)}:${min}:${sec} ${ap}`;
        } else {
          time = `${pad(h2)}:${min}:${sec}`;
        }
        return { date: applyDateFormat(dateFormat, y, m, day), time };
      } catch {
        const d = new Date(ts);
        return {
          date: d.toISOString().slice(0, 10),
          time: d.toISOString().slice(11, 19)
        };
      }
    }
    function applyDateFormat(fmt, y, m, d) {
      const f = fmt || "YYYY-MM-DD";
      return f.replace(/YYYY/g, y).replace(/MM/g, m).replace(/DD/g, d).replace(/YY/g, y.slice(-2));
    }
    function formatDuration(ms) {
      const sign = ms < 0 ? "-" : "";
      ms = Math.abs(ms);
      const s = Math.floor(ms / 1e3);
      const h2 = Math.floor(s / 3600);
      const m = Math.floor(s % 3600 / 60);
      const sec = s % 60;
      return `${sign}${pad(h2)}:${pad(m)}:${pad(sec)}`;
    }
    const display = computed(() => {
      const opts = props.options || {};
      const mode2 = opts.mode || "time";
      const tz = opts.timezone || void 0;
      if (mode2 === "countdown" && opts.countdownEnd) {
        const end = Date.parse(opts.countdownEnd);
        if (Number.isFinite(end))
          return {
            primary: formatDuration(end - now.value),
            secondary: opts.dateShow ? formatInTz(now.value, tz, opts.clockType, opts.dateFormat).date : ""
          };
      }
      if (mode2 === "countup" && opts.countdownEnd) {
        const start = Date.parse(opts.countdownEnd);
        if (Number.isFinite(start))
          return {
            primary: formatDuration(now.value - start),
            secondary: opts.dateShow ? formatInTz(now.value, tz, opts.clockType, opts.dateFormat).date : ""
          };
      }
      const f = formatInTz(now.value, tz, opts.clockType, opts.dateFormat);
      return { primary: f.time, secondary: opts.dateShow !== false ? f.date : "" };
    });
    const style = computed(() => {
      const opts = props.options || {};
      return {
        fontSize: opts.fontSize || "3em",
        background: opts.bgColor || "transparent"
      };
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-clock",
        "data-testid": "panel-clock",
        "data-mode": String(__props.options?.mode || "time"),
        "data-clock-type": String(__props.options?.clockType || "24 hour"),
        "data-date-show": String(__props.options?.dateShow !== false),
        "data-timezone": String(__props.options?.timezone || ""),
        style: normalizeStyle(style.value)
      }, [
        createElementVNode(
          "div",
          _hoisted_2$1U,
          toDisplayString(display.value.primary),
          1
          /* TEXT */
        ),
        display.value.secondary ? (openBlock(), createElementBlock(
          "div",
          _hoisted_3$1E,
          toDisplayString(display.value.secondary),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ], 12, _hoisted_1$2p);
    };
  }
});
const Panel$b = /* @__PURE__ */ _export_sfc(_sfc_main$2_, [["__scopeId", "data-v-65daf2c1"]]);
new VuePanelPlugin(
  { id: "clock", name: "时钟", state: "stable", skipDataQuery: true },
  Panel$b
).setPanelOptions((builder) => {
  builder.addRadio(
    {
      id: "mode",
      path: "mode",
      name: "模式",
      category: ["时钟"],
      editor: "radio",
      settings: {
        options: [
          { label: "时间", value: "time" },
          { label: "倒计时", value: "countdown" },
          { label: "正计时", value: "countup" }
        ]
      }
    },
    "time"
  ).addText(
    {
      id: "clockType",
      path: "clockType",
      name: "时钟类型",
      category: ["时钟"],
      editor: "text",
      settings: { placeholder: "24 hour" }
    },
    "24 hour"
  ).addText(
    {
      id: "timezone",
      path: "timezone",
      name: "时区",
      category: ["时钟"],
      editor: "text",
      description: "IANA 时区，如 Asia/Shanghai；空为本地"
    },
    ""
  ).addText(
    {
      id: "dateFormat",
      path: "dateFormat",
      name: "日期格式",
      category: ["日期"],
      editor: "text"
    },
    "YYYY-MM-DD"
  ).addBoolean(
    {
      id: "dateShow",
      path: "dateShow",
      name: "显示日期",
      category: ["日期"],
      editor: "boolean"
    },
    true
  ).addText(
    {
      id: "countdownEnd",
      path: "countdownEnd",
      name: "倒计时终点",
      category: ["倒计时"],
      editor: "text",
      description: "ISO 时间或可解析日期字符串",
      showIf: (c) => c.mode === "countdown"
    },
    ""
  ).addText(
    {
      id: "bgColor",
      path: "bgColor",
      name: "背景色",
      category: ["外观"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "fontSize",
      path: "fontSize",
      name: "字号",
      category: ["外观"],
      editor: "text"
    },
    "3em"
  );
}).useFieldConfig().setRuntimeConsumedPaths([
  "mode",
  "clockType",
  "timezone",
  "dateFormat",
  "dateShow",
  "countdownEnd",
  "bgColor",
  "fontSize"
]).register();
const _hoisted_1$2o = ["data-color-mode", "data-show-legend"];
const _hoisted_2$1T = {
  key: 0,
  class: "panel-statusmap__empty"
};
const _hoisted_3$1D = { class: "row-h" };
const _hoisted_4$1l = ["title"];
const _hoisted_5$1c = {
  key: 2,
  class: "panel-statusmap__legend",
  "data-testid": "statusmap-legend"
};
const _sfc_main$2Z = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const colorMode = computed(
      () => String(props.options?.colorMode || "threshold")
    );
    const showLegend = computed(
      () => props.options?.showLegend !== false
    );
    const cells = computed(() => {
      const series = props.data?.series || [];
      const out = [];
      const palette2 = getClassicPalette$1();
      const max = Number(props.options?.cellsMax) || 500;
      const mode2 = colorMode.value;
      const raw = [];
      for (const frame of series) {
        const fields = frame.fields || [];
        const time = fields.find((f) => f.type === "time");
        const nums = fields.filter((f) => f.type === "number");
        for (const f of nums) {
          const vals2 = f.values || [];
          const times = time?.values || [];
          for (let i = 0; i < vals2.length && raw.length < max; i++) {
            const v = Number(vals2[i]);
            if (!Number.isFinite(v)) continue;
            const t2 = times[i] != null ? new Date(Number(times[i])).toISOString().slice(11, 16) : String(i);
            raw.push({ row: f.name || "series", col: t2, value: v, field: f });
          }
        }
      }
      const vals = raw.map((r) => r.value);
      const minV = vals.length ? Math.min(...vals) : 0;
      const maxV = vals.length ? Math.max(...vals) : 1;
      const span = maxV - minV || 1;
      for (const r of raw) {
        let color;
        if (mode2 === "spectrum" || mode2 === "opacity") {
          const t2 = (r.value - minV) / span;
          const idx = Math.min(palette2.length - 1, Math.floor(t2 * (palette2.length - 1)));
          color = palette2[idx];
          if (mode2 === "opacity") {
            color = `color-mix(in srgb, var(--grafana-primary) ${Math.round(15 + t2 * 85)}%, transparent)`;
          }
        } else {
          color = getThresholdColor(r.value, r.field.config || {}) || palette2[Math.abs(Math.floor(r.value)) % palette2.length];
        }
        out.push({ row: r.row, col: r.col, value: r.value, color });
      }
      return out;
    });
    const rows = computed(() => [...new Set(cells.value.map((c) => c.row))]);
    const cols = computed(() => [...new Set(cells.value.map((c) => c.col))]);
    const grid = computed(() => {
      const map = new Map(cells.value.map((c) => [`${c.row}|${c.col}`, c]));
      return rows.value.map((r) => cols.value.map((c) => map.get(`${r}|${c}`)));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-statusmap",
        "data-testid": "panel-statusmap",
        "data-color-mode": colorMode.value,
        "data-show-legend": String(showLegend.value)
      }, [
        !cells.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$1T, "无数据")) : (openBlock(), createElementBlock(
          "div",
          {
            key: 1,
            class: "panel-statusmap__grid",
            style: normalizeStyle({
              gridTemplateColumns: `80px repeat(${cols.value.length}, minmax(10px, 1fr))`
            })
          },
          [
            _cache[0] || (_cache[0] = createElementVNode(
              "div",
              { class: "corner" },
              null,
              -1
              /* CACHED */
            )),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(cols.value, (c) => {
                return openBlock(), createElementBlock(
                  "div",
                  {
                    key: c,
                    class: "col-h"
                  },
                  toDisplayString(c),
                  1
                  /* TEXT */
                );
              }),
              128
              /* KEYED_FRAGMENT */
            )),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(grid.value, (row, ri) => {
                return openBlock(), createElementBlock(
                  Fragment,
                  {
                    key: rows.value[ri]
                  },
                  [
                    createElementVNode(
                      "div",
                      _hoisted_3$1D,
                      toDisplayString(rows.value[ri]),
                      1
                      /* TEXT */
                    ),
                    (openBlock(true), createElementBlock(
                      Fragment,
                      null,
                      renderList(row, (cell, ci) => {
                        return openBlock(), createElementBlock("div", {
                          key: ci,
                          class: "cell",
                          style: normalizeStyle({ background: cell?.color || "var(--grafana-hover)" }),
                          title: cell ? `${rows.value[ri]} @ ${cols.value[ci]} = ${cell.value}` : ""
                        }, null, 12, _hoisted_4$1l);
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    ))
                  ],
                  64
                  /* STABLE_FRAGMENT */
                );
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ],
          4
          /* STYLE */
        )),
        showLegend.value && cells.value.length ? (openBlock(), createElementBlock("div", _hoisted_5$1c, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(rows.value, (r, i) => {
              return openBlock(), createElementBlock("span", {
                key: i,
                class: "panel-statusmap__legend-item"
              }, [
                createElementVNode(
                  "i",
                  {
                    style: normalizeStyle({
                      background: cells.value.find((c) => c.row === r)?.color || "var(--grafana-primary)"
                    })
                  },
                  null,
                  4
                  /* STYLE */
                ),
                createTextVNode(
                  toDisplayString(r),
                  1
                  /* TEXT */
                )
              ]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2o);
    };
  }
});
const Panel$a = /* @__PURE__ */ _export_sfc(_sfc_main$2Z, [["__scopeId", "data-v-e7735fef"]]);
new VuePanelPlugin(
  { id: "statusmap", name: "状态地图", state: "stable" },
  Panel$a
).setPanelOptions((builder) => {
  builder.addNumber(
    {
      id: "colorMode",
      path: "colorMode",
      name: "着色模式",
      category: ["状态地图"],
      editor: "number"
    },
    0
  ).addBoolean(
    {
      id: "showLegend",
      path: "showLegend",
      name: "图例",
      category: ["状态地图"],
      editor: "boolean"
    },
    true
  ).addNumber(
    {
      id: "cellsMax",
      path: "cellsMax",
      name: "最大单元",
      category: ["状态地图"],
      editor: "number"
    },
    500
  );
}).useFieldConfig().setRuntimeConsumedPaths(["colorMode", "showLegend", "cellsMax"]).register();
const _hoisted_1$2n = ["data-shape", "data-show-value", "data-limit"];
const _hoisted_2$1S = {
  key: 0,
  class: "empty"
};
const _hoisted_3$1C = ["title"];
const _hoisted_4$1k = { class: "name" };
const _hoisted_5$1b = {
  key: 0,
  class: "val"
};
const _sfc_main$2Y = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const items = computed(() => {
      const series = props.data?.series || [];
      const limit = Number(props.options?.limit) || 100;
      const palette2 = getClassicPalette$1();
      const out = [];
      let i = 0;
      for (const frame of series) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          const color = getThresholdColor(v, field.config || {}) || palette2[i % palette2.length];
          out.push({
            name: field.name || `s${i}`,
            value: v,
            color,
            text: formatValue(v, field.config || {})
          });
          i++;
          if (out.length >= limit) return out;
        }
      }
      return out;
    });
    const shape = computed(
      () => props.options?.shape || "hexagon_pointed_top"
    );
    const showValue = computed(() => props.options?.showValue !== false);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-polystat",
        "data-testid": "panel-polystat",
        "data-shape": shape.value,
        "data-show-value": String(showValue.value),
        "data-limit": String(Number(__props.options?.limit) || 100)
      }, [
        !items.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$1S, "无数据")) : createCommentVNode("v-if", true),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(items.value, (it) => {
            return openBlock(), createElementBlock("div", {
              key: it.name,
              class: normalizeClass(["poly", "shape-" + shape.value]),
              style: normalizeStyle({ background: it.color }),
              title: it.name + ": " + it.text
            }, [
              createElementVNode(
                "span",
                _hoisted_4$1k,
                toDisplayString(it.name),
                1
                /* TEXT */
              ),
              showValue.value ? (openBlock(), createElementBlock(
                "span",
                _hoisted_5$1b,
                toDisplayString(it.text),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true)
            ], 14, _hoisted_3$1C);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ], 8, _hoisted_1$2n);
    };
  }
});
const Panel$9 = /* @__PURE__ */ _export_sfc(_sfc_main$2Y, [["__scopeId", "data-v-45d6a8d0"]]);
new VuePanelPlugin(
  { id: "polystat", name: "蜂窝多维", state: "stable" },
  Panel$9
).setPanelOptions((builder) => {
  builder.addSelect(
    {
      id: "shape",
      path: "shape",
      name: "形状",
      category: ["蜂窝"],
      editor: "select",
      settings: {
        options: [
          { label: "六边形", value: "hexagon_pointed_top" },
          { label: "圆形", value: "circle" },
          { label: "方形", value: "square" }
        ]
      }
    },
    "hexagon_pointed_top"
  ).addNumber(
    {
      id: "limit",
      path: "limit",
      name: "数量上限",
      category: ["蜂窝"],
      editor: "number"
    },
    100
  ).addBoolean(
    {
      id: "showValue",
      path: "showValue",
      name: "显示数值",
      category: ["蜂窝"],
      editor: "boolean"
    },
    true
  );
}).useFieldConfig().setRuntimeConsumedPaths(["shape", "limit", "showValue"]).register();
const _hoisted_1$2m = ["data-text", "data-url", "data-method", "data-confirm", "data-variant", "data-has-body"];
const _hoisted_2$1R = ["disabled"];
const _hoisted_3$1B = {
  key: 0,
  class: "panel-button__status",
  "data-testid": "panel-button-status"
};
const _sfc_main$2X = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const status = ref("");
    const loading = ref(false);
    const label = computed(() => props.options?.text || "执行");
    const variant = computed(() => props.options?.variant || "primary");
    async function onClick() {
      const opts = props.options || {};
      if (opts.confirm && typeof window !== "undefined") {
        if (!window.confirm(`确认执行：${label.value}？`)) return;
      }
      const url = props.replaceVariables ? props.replaceVariables(opts.url || "") : opts.url || "";
      if (!url) {
        status.value = "未配置 URL";
        return;
      }
      loading.value = true;
      status.value = "";
      const client = createHttpClient({ kind: "app", timeoutMs: 3e4 });
      try {
        const method = String(opts.method || "POST").toUpperCase();
        const res = await client.request({
          url,
          method,
          headers: { "Content-Type": "application/json" },
          data: method === "GET" || method === "HEAD" ? void 0 : opts.body || void 0,
          // absolute URL: no baseURL
          transformResponse: [(d) => d]
        });
        status.value = `${res.status} ${res.statusText || ""}`.trim();
      } catch (e) {
        status.value = e?.message || "请求失败";
      } finally {
        client.dispose();
        loading.value = false;
      }
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-button",
        "data-testid": "panel-button",
        "data-text": String(label.value),
        "data-url": String(__props.options?.url ?? ""),
        "data-method": String(__props.options?.method ?? "POST"),
        "data-confirm": String(!!__props.options?.confirm),
        "data-variant": String(variant.value),
        "data-has-body": String(!!__props.options?.body)
      }, [
        createElementVNode("button", {
          type: "button",
          class: normalizeClass(["panel-button__btn", "is-" + variant.value]),
          disabled: loading.value,
          "data-testid": "panel-button-trigger",
          onClick
        }, toDisplayString(loading.value ? "…" : label.value), 11, _hoisted_2$1R),
        status.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_3$1B,
          toDisplayString(status.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$2m);
    };
  }
});
const Panel$8 = /* @__PURE__ */ _export_sfc(_sfc_main$2X, [["__scopeId", "data-v-ca6ea997"]]);
new VuePanelPlugin(
  { id: "button", name: "按钮", state: "stable", skipDataQuery: true },
  Panel$8
).setPanelOptions((builder) => {
  builder.addText(
    {
      id: "text",
      path: "text",
      name: "按钮文案",
      category: ["按钮"],
      editor: "text"
    },
    "执行"
  ).addText(
    {
      id: "url",
      path: "url",
      name: "请求 URL",
      category: ["动作"],
      editor: "text"
    },
    ""
  ).addSelect(
    {
      id: "method",
      path: "method",
      name: "方法",
      category: ["动作"],
      editor: "select",
      settings: {
        options: [
          { label: "GET", value: "GET" },
          { label: "POST", value: "POST" },
          { label: "PUT", value: "PUT" },
          { label: "DELETE", value: "DELETE" }
        ]
      }
    },
    "POST"
  ).addTextArea(
    {
      id: "body",
      path: "body",
      name: "请求体",
      category: ["动作"],
      editor: "textarea"
    },
    ""
  ).addBoolean(
    {
      id: "confirm",
      path: "confirm",
      name: "点击前确认",
      category: ["按钮"],
      editor: "boolean"
    },
    false
  ).addText(
    {
      id: "variant",
      path: "variant",
      name: "样式",
      category: ["外观"],
      editor: "text",
      description: "primary | default | danger"
    },
    "primary"
  );
}).useFieldConfig().setRuntimeConsumedPaths([
  "text",
  "url",
  "method",
  "body",
  "confirm",
  "variant"
]).register();
const ALLOWED_TAGS$1 = /* @__PURE__ */ new Set([
  "b",
  "i",
  "em",
  "strong",
  "br",
  "p",
  "span",
  "code",
  "pre",
  "ul",
  "ol",
  "li"
]);
function sanitizeProblemHtml$1(input, allowDangerousHTML = false) {
  const raw = String(input || "");
  if (!raw) return "";
  let s = raw.replace(/<\s*(script|style)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi, "").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/javascript:/gi, "");
  if (allowDangerousHTML) return s;
  s = s.replace(/<\/?([a-zA-Z0-9]+)(\s[^>]*)?>/g, (full, tag) => {
    const t2 = String(tag).toLowerCase();
    if (!ALLOWED_TAGS$1.has(t2)) return "";
    if (full.startsWith("</")) return `</${t2}>`;
    if (t2 === "br") return "<br/>";
    return `<${t2}>`;
  });
  return s;
}
const sanitizeHtml = sanitizeProblemHtml$1;
const _hoisted_1$2l = ["data-content-type", "data-every-row", "innerHTML"];
const _sfc_main$2W = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function rowMap(series) {
      const map = {};
      for (const frame of series || []) {
        for (const field of frame.fields || []) {
          const name = field.name || field.config?.displayName || "value";
          const vals = field.values;
          const v = Array.isArray(vals) ? vals[vals.length - 1] : vals;
          map[name] = v;
          if (field.type === "number" && map.value === void 0) map.value = v;
        }
      }
      return map;
    }
    function applyTemplate(tpl, data) {
      return String(tpl || "").replace(/\{\{\s*([\w.-]+)\s*\}\}/g, (_, key) => {
        const v = data[key];
        return v == null ? "" : String(v);
      });
    }
    function simpleMd(s) {
      return s.replace(/^### (.*)$/gm, "<h3>$1</h3>").replace(/^## (.*)$/gm, "<h2>$1</h2>").replace(/^# (.*)$/gm, "<h1>$1</h1>").replace(/\*\*(.+?)\*\*/g, "<strong>$1</strong>").replace(/\*(.+?)\*/g, "<em>$1</em>").replace(/`([^`]+)`/g, "<code>$1</code>").replace(/\n/g, "<br/>");
    }
    function rowMaps(series) {
      let len = 0;
      for (const frame of series || []) {
        for (const field of frame.fields || []) {
          const n = Array.isArray(field.values) ? field.values.length : 0;
          if (n > len) len = n;
        }
      }
      if (len <= 0) return [rowMap(series)];
      const rows = [];
      for (let i = 0; i < len; i++) {
        const map = {};
        for (const frame of series || []) {
          for (const field of frame.fields || []) {
            const name = field.name || field.config?.displayName || "value";
            const vals = field.values;
            const v = Array.isArray(vals) ? vals[i] : vals;
            map[name] = v;
            if (field.type === "number" && map.value === void 0) map.value = v;
          }
        }
        rows.push(map);
      }
      return rows;
    }
    const html = computed(() => {
      const opts = props.options || {};
      const series = props.data?.series || [];
      let tpl = opts.content || "";
      if (props.replaceVariables) tpl = props.replaceVariables(tpl);
      const maps = opts.everyRow ? rowMaps(series) : [rowMap(series)];
      const parts = [];
      for (const map0 of maps) {
        const map = { ...map0 };
        if (props.replaceVariables) {
          for (const k of Object.keys(map))
            map[k] = props.replaceVariables(String(map[k] ?? ""));
        }
        const rendered = applyTemplate(tpl, map);
        parts.push(opts.contentType === "html" ? rendered : simpleMd(rendered));
      }
      return sanitizeHtml(parts.join(opts.everyRow ? "<hr/>" : ""));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-dynamictext",
        "data-testid": "panel-dynamictext",
        "data-content-type": String(__props.options?.contentType || "markdown"),
        "data-every-row": String(!!__props.options?.everyRow),
        innerHTML: html.value
      }, null, 8, _hoisted_1$2l);
    };
  }
});
const Panel$7 = /* @__PURE__ */ _export_sfc(_sfc_main$2W, [["__scopeId", "data-v-72ab5df8"]]);
new VuePanelPlugin(
  { id: "dynamictext", name: "动态文本", state: "stable" },
  Panel$7
).setPanelOptions((builder) => {
  builder.addRadio(
    {
      id: "contentType",
      path: "contentType",
      name: "类型",
      category: ["内容"],
      editor: "radio",
      settings: {
        options: [
          { label: "Markdown", value: "markdown" },
          { label: "HTML", value: "html" }
        ]
      }
    },
    "markdown"
  ).addTextArea(
    {
      id: "content",
      path: "content",
      name: "模板",
      category: ["内容"],
      editor: "textarea",
      description: "支持 {{field_name}} 占位；无数据时显示原文"
    },
    "# {{title}}\n\n值: {{value}}"
  ).addBoolean(
    {
      id: "everyRow",
      path: "everyRow",
      name: "逐行渲染",
      category: ["内容"],
      editor: "boolean"
    },
    false
  );
}).useFieldConfig().setRuntimeConsumedPaths(["contentType", "content", "everyRow"]).register();
const _hoisted_1$2k = ["data-show-label", "data-text-field", "data-start-field", "data-end-field"];
const _hoisted_2$1Q = {
  key: 0,
  class: "empty"
};
const _hoisted_3$1A = {
  key: 0,
  class: "label"
};
const _hoisted_4$1j = { class: "track" };
const _hoisted_5$1a = ["title"];
const _sfc_main$2V = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const showLabel = computed(() => props.options?.showLabel !== false);
    const bars = computed(() => {
      const series = props.data?.series || [];
      const opts = props.options || {};
      const palette2 = getClassicPalette$1();
      const out = [];
      for (const frame of series) {
        const fields = frame.fields || [];
        const byName = (n) => fields.find((f) => f.name === n);
        const textF = byName(opts.textField) || fields.find((f) => f.type === "string");
        const timeFields = fields.filter(
          (f) => f.type === "time" || /start|end|time/i.test(f.name || "")
        );
        const startF = byName(opts.startField) || timeFields[0];
        const endF = byName(opts.endField) || timeFields[1] || timeFields[0];
        if (!startF) continue;
        const len = (startF.values || []).length;
        for (let i = 0; i < len; i++) {
          const start = Number(startF.values[i]);
          const end = endF ? Number(endF.values[i]) : start + 1;
          if (!Number.isFinite(start)) continue;
          const label = textF ? String(textF.values[i] ?? i) : String(i);
          out.push({
            label,
            start,
            end: Number.isFinite(end) ? end : start + 1,
            color: palette2[i % palette2.length]
          });
        }
      }
      return out;
    });
    const domain = computed(() => {
      if (!bars.value.length) return { min: 0, max: 1 };
      let min = Math.min(...bars.value.map((b) => b.start));
      let max = Math.max(...bars.value.map((b) => b.end));
      if (max <= min) max = min + 1;
      return { min, max };
    });
    function left(b) {
      const { min, max } = domain.value;
      return (b.start - min) / (max - min) * 100;
    }
    function width2(b) {
      const { min, max } = domain.value;
      return Math.max(0.5, (b.end - b.start) / (max - min) * 100);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-gantt",
        "data-testid": "panel-gantt",
        "data-show-label": String(showLabel.value),
        "data-text-field": String(__props.options?.textField || ""),
        "data-start-field": String(__props.options?.startField || ""),
        "data-end-field": String(__props.options?.endField || "")
      }, [
        !bars.value.length ? (openBlock(), createElementBlock("div", _hoisted_2$1Q, "无数据（需要时间字段）")) : createCommentVNode("v-if", true),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(bars.value, (b, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row"
            }, [
              showLabel.value ? (openBlock(), createElementBlock(
                "div",
                _hoisted_3$1A,
                toDisplayString(b.label),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              createElementVNode("div", _hoisted_4$1j, [
                createElementVNode("div", {
                  class: "bar",
                  style: normalizeStyle({
                    left: left(b) + "%",
                    width: width2(b) + "%",
                    background: b.color
                  }),
                  title: b.label
                }, null, 12, _hoisted_5$1a)
              ])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ], 8, _hoisted_1$2k);
    };
  }
});
const Panel$6 = /* @__PURE__ */ _export_sfc(_sfc_main$2V, [["__scopeId", "data-v-2fdf44c4"]]);
new VuePanelPlugin(
  { id: "gantt", name: "甘特图", state: "stable" },
  Panel$6
).setPanelOptions((builder) => {
  builder.addText(
    {
      id: "textField",
      path: "textField",
      name: "标签字段",
      category: ["甘特"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "startField",
      path: "startField",
      name: "开始字段",
      category: ["甘特"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "endField",
      path: "endField",
      name: "结束字段",
      category: ["甘特"],
      editor: "text"
    },
    ""
  ).addBoolean(
    {
      id: "showLabel",
      path: "showLabel",
      name: "显示标签",
      category: ["甘特"],
      editor: "boolean"
    },
    true
  );
}).useFieldConfig().setRuntimeConsumedPaths(["textField", "startField", "endField", "showLabel"]).register();
const _hoisted_1$2j = ["data-source-field", "data-target-field", "data-value-field"];
const _hoisted_2$1P = {
  key: 0,
  class: "empty"
};
const _hoisted_13$q = {
  viewBox: "0 0 100 100",
  preserveAspectRatio: "none",
  class: "sankey"
};
const _hoisted_14$p = ["d", "stroke", "stroke-width"];
const _hoisted_15$k = ["y"];
const kind$5 = "sankey";
const _sfc_main$2U = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function fieldByName(fields, name, type) {
      if (name) {
        const hit = fields.find(
          (f) => f.name === name || f.config?.displayName === name || f.config?.displayNameFromDS === name
        );
        if (hit) return hit;
      }
      if (type) return fields.find((f) => f.type === type);
      return void 0;
    }
    const seriesItems = computed(() => {
      const palette2 = getClassicPalette$1();
      const opts = props.options || {};
      const out = [];
      let i = 0;
      for (const frame of props.data?.series || []) {
        const fields = frame.fields || [];
        {
          const srcF = fieldByName(fields, opts.sourceField, "string");
          const tgtF = fieldByName(fields, opts.targetField, "string");
          const valF = fieldByName(fields, opts.valueField, "number");
          const strings = fields.filter((f) => f.type === "string");
          const source = srcF || strings[0];
          const target = tgtF || strings[1] || strings[0];
          const value = valF || fields.find((f) => f.type === "number");
          if (source && target && value) {
            const n = Math.min(
              (source.values || []).length,
              (target.values || []).length,
              (value.values || []).length
            );
            for (let r = 0; r < n; r++) {
              const v = Number(value.values[r]);
              if (!Number.isFinite(v)) continue;
              out.push({
                name: `${source.values[r]} → ${target.values[r]}`,
                source: String(source.values[r]),
                target: String(target.values[r]),
                value: Math.abs(v),
                color: palette2[r % palette2.length]
              });
            }
            if (out.length) return out;
          }
        }
        const labelName = opts.labelField || opts.nameField || opts.categoryField || void 0;
        const valueName = opts.valueField || void 0;
        const strF = fieldByName(fields, labelName, "string");
        const numF = fieldByName(fields, valueName, "number");
        if (strF && numF) {
          for (let r = 0; r < (strF.values || []).length; r++) {
            const v = Number(numF.values[r]);
            if (!Number.isFinite(v)) continue;
            out.push({
              name: String(strF.values[r]),
              value: Math.abs(v),
              color: palette2[r % palette2.length]
            });
          }
          if (out.length) {
            if (opts.sortDescending !== false && kind$5 === "treemap") ;
            return out;
          }
        }
      }
      for (const frame of props.data?.series || []) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          if (opts.valueField && field.name !== opts.valueField && field.config?.displayName !== opts.valueField) {
            continue;
          }
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          out.push({
            name: field.name || `s${i}`,
            value: Math.abs(v),
            color: palette2[i % palette2.length]
          });
          i++;
        }
      }
      if (opts.sortDescending === false) return out;
      return out;
    });
    const maxV = computed(
      () => Math.max(
        1,
        ...seriesItems.value.map((s) => s.value),
        Number(props.options?.maxValue) || 0
      )
    );
    computed(() => {
      const items = [...seriesItems.value].sort((a, b) => b.value - a.value);
      const total = items.reduce((s, i) => s + i.value, 0) || 1;
      let x = 0;
      return items.map((it) => {
        const w = it.value / total * 100;
        const cell = { ...it, x, w };
        x += w;
        return cell;
      });
    });
    const radarPoints = computed(() => {
      const items = seriesItems.value;
      const n = items.length || 1;
      const cx = 50, cy = 50, r = 40;
      return items.map((it, i) => {
        const ang = -Math.PI / 2 + i * 2 * Math.PI / n;
        const rr = r * (it.value / maxV.value);
        return {
          ...it,
          x: cx + rr * Math.cos(ang),
          y: cy + rr * Math.sin(ang),
          lx: cx + r * Math.cos(ang),
          ly: cy + r * Math.sin(ang)
        };
      });
    });
    computed(
      () => radarPoints.value.map((p) => `${p.x},${p.y}`).join(" ")
    );
    const hourly = computed(() => {
      const grid = Array.from({ length: 7 }, () => Array(24).fill(0));
      for (const frame of props.data?.series || []) {
        const time = (frame.fields || []).find((f) => f.type === "time");
        const num2 = (frame.fields || []).find((f) => f.type === "number");
        if (!time || !num2) continue;
        for (let i = 0; i < (time.values || []).length; i++) {
          const d = new Date(Number(time.values[i]));
          if (Number.isNaN(d.getTime())) continue;
          const day = d.getDay();
          const hour = d.getHours();
          const v = Number(num2.values[i]) || 0;
          grid[day][hour] = (grid[day][hour] || 0) + v;
        }
      }
      return grid;
    });
    computed(() => Math.max(1, ...hourly.value.flat()));
    const sankeyLinks = computed(() => {
      const items = seriesItems.value;
      return items.map((it, i) => ({
        ...it,
        y: i / Math.max(1, items.length) * 100,
        h: Math.max(4, it.value / maxV.value * 20)
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-viz",
        "data-testid": "panel-sankey",
        "data-kind": kind$5,
        "data-source-field": String(__props.options?.sourceField ?? ""),
        "data-target-field": String(__props.options?.targetField ?? ""),
        "data-value-field": String(__props.options?.valueField ?? "")
      }, [
        !seriesItems.value.length && kind$5 !== "hourly-heatmap" ? (openBlock(), createElementBlock("div", _hoisted_2$1P, " 无数据 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 5 },
          [
            createCommentVNode(" sankey simplified "),
            (openBlock(), createElementBlock("svg", _hoisted_13$q, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(sankeyLinks.value, (l, i) => {
                  return openBlock(), createElementBlock("path", {
                    key: i,
                    d: `M 5 ${l.y + 5} C 40 ${l.y + 5}, 60 ${l.y + 5}, 95 ${l.y + 5}`,
                    fill: "none",
                    stroke: l.color,
                    "stroke-width": Math.max(1, l.h / 3),
                    opacity: "0.7"
                  }, null, 8, _hoisted_14$p);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(sankeyLinks.value, (l, i) => {
                  return openBlock(), createElementBlock("text", {
                    key: "t" + i,
                    x: "2",
                    y: l.y + 6,
                    "font-size": "3",
                    fill: "var(--grafana-text)"
                  }, toDisplayString(l.name), 9, _hoisted_15$k);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]))
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 8, _hoisted_1$2j);
    };
  }
});
const Panel$5 = /* @__PURE__ */ _export_sfc(_sfc_main$2U, [["__scopeId", "data-v-359ad180"]]);
new VuePanelPlugin(
  { id: "sankey", name: "桑基图", state: "stable" },
  Panel$5
).setPanelOptions((builder) => {
  builder.addText(
    {
      id: "sourceField",
      path: "sourceField",
      name: "源字段",
      category: ["桑基"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "targetField",
      path: "targetField",
      name: "目标字段",
      category: ["桑基"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "valueField",
      path: "valueField",
      name: "值字段",
      category: ["桑基"],
      editor: "text"
    },
    ""
  );
}).useFieldConfig().setRuntimeConsumedPaths(["sourceField", "targetField", "valueField"]).register();
const _hoisted_1$2i = ["data-show-legend", "data-max-value"];
const _hoisted_2$1O = {
  key: 0,
  class: "empty"
};
const _hoisted_9$J = { class: "radar-wrap" };
const _hoisted_10$B = {
  viewBox: "0 0 100 100",
  class: "radar"
};
const _hoisted_11$v = ["x2", "y2"];
const _hoisted_12$q = ["points"];
const _hoisted_13$p = ["x", "y"];
const _hoisted_14$o = {
  key: 0,
  class: "radar-legend",
  "data-testid": "radar-legend"
};
const kind$4 = "radar";
const _sfc_main$2T = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function fieldByName(fields, name, type) {
      if (name) {
        const hit = fields.find(
          (f) => f.name === name || f.config?.displayName === name || f.config?.displayNameFromDS === name
        );
        if (hit) return hit;
      }
      if (type) return fields.find((f) => f.type === type);
      return void 0;
    }
    const seriesItems = computed(() => {
      const palette2 = getClassicPalette$1();
      const opts = props.options || {};
      const out = [];
      let i = 0;
      for (const frame of props.data?.series || []) {
        const fields = frame.fields || [];
        const labelName = opts.labelField || opts.nameField || opts.categoryField || void 0;
        const valueName = opts.valueField || void 0;
        const strF = fieldByName(fields, labelName, "string");
        const numF = fieldByName(fields, valueName, "number");
        if (strF && numF) {
          for (let r = 0; r < (strF.values || []).length; r++) {
            const v = Number(numF.values[r]);
            if (!Number.isFinite(v)) continue;
            out.push({
              name: String(strF.values[r]),
              value: Math.abs(v),
              color: palette2[r % palette2.length]
            });
          }
          if (out.length) {
            if (opts.sortDescending !== false && kind$4 === "treemap") ;
            return out;
          }
        }
      }
      for (const frame of props.data?.series || []) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          if (opts.valueField && field.name !== opts.valueField && field.config?.displayName !== opts.valueField) {
            continue;
          }
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          out.push({
            name: field.name || `s${i}`,
            value: Math.abs(v),
            color: palette2[i % palette2.length]
          });
          i++;
        }
      }
      if (opts.sortDescending === false) return out;
      return out;
    });
    const maxV = computed(
      () => Math.max(
        1,
        ...seriesItems.value.map((s) => s.value),
        Number(props.options?.maxValue) || 0
      )
    );
    computed(() => {
      const items = [...seriesItems.value].sort((a, b) => b.value - a.value);
      const total = items.reduce((s, i) => s + i.value, 0) || 1;
      let x = 0;
      return items.map((it) => {
        const w = it.value / total * 100;
        const cell = { ...it, x, w };
        x += w;
        return cell;
      });
    });
    const radarPoints = computed(() => {
      const items = seriesItems.value;
      const n = items.length || 1;
      const cx = 50, cy = 50, r = 40;
      return items.map((it, i) => {
        const ang = -Math.PI / 2 + i * 2 * Math.PI / n;
        const rr = r * (it.value / maxV.value);
        return {
          ...it,
          x: cx + rr * Math.cos(ang),
          y: cy + rr * Math.sin(ang),
          lx: cx + r * Math.cos(ang),
          ly: cy + r * Math.sin(ang)
        };
      });
    });
    const radarPoly = computed(
      () => radarPoints.value.map((p) => `${p.x},${p.y}`).join(" ")
    );
    const hourly = computed(() => {
      const grid = Array.from({ length: 7 }, () => Array(24).fill(0));
      for (const frame of props.data?.series || []) {
        const time = (frame.fields || []).find((f) => f.type === "time");
        const num2 = (frame.fields || []).find((f) => f.type === "number");
        if (!time || !num2) continue;
        for (let i = 0; i < (time.values || []).length; i++) {
          const d = new Date(Number(time.values[i]));
          if (Number.isNaN(d.getTime())) continue;
          const day = d.getDay();
          const hour = d.getHours();
          const v = Number(num2.values[i]) || 0;
          grid[day][hour] = (grid[day][hour] || 0) + v;
        }
      }
      return grid;
    });
    computed(() => Math.max(1, ...hourly.value.flat()));
    computed(() => {
      const items = seriesItems.value;
      return items.map((it, i) => ({
        ...it,
        y: i / Math.max(1, items.length) * 100,
        h: Math.max(4, it.value / maxV.value * 20)
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["panel-viz", { "has-legend": __props.options?.showLegend !== false }]),
        "data-show-legend": String(__props.options?.showLegend !== false),
        "data-max-value": String(__props.options?.maxValue ?? ""),
        "data-testid": "panel-radar",
        "data-kind": kind$4
      }, [
        !seriesItems.value.length && kind$4 !== "hourly-heatmap" ? (openBlock(), createElementBlock("div", _hoisted_2$1O, " 无数据 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 4 },
          [
            createCommentVNode(" radar "),
            createElementVNode("div", _hoisted_9$J, [
              (openBlock(), createElementBlock("svg", _hoisted_10$B, [
                _cache[0] || (_cache[0] = createElementVNode(
                  "circle",
                  {
                    cx: "50",
                    cy: "50",
                    r: "40",
                    fill: "none",
                    stroke: "var(--grafana-border)",
                    "stroke-width": "0.5"
                  },
                  null,
                  -1
                  /* CACHED */
                )),
                _cache[1] || (_cache[1] = createElementVNode(
                  "circle",
                  {
                    cx: "50",
                    cy: "50",
                    r: "20",
                    fill: "none",
                    stroke: "var(--grafana-border)",
                    "stroke-width": "0.3"
                  },
                  null,
                  -1
                  /* CACHED */
                )),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(radarPoints.value, (p, i) => {
                    return openBlock(), createElementBlock("line", {
                      key: "a" + i,
                      x1: "50",
                      y1: "50",
                      x2: p.lx,
                      y2: p.ly,
                      stroke: "var(--grafana-border)",
                      "stroke-width": "0.3"
                    }, null, 8, _hoisted_11$v);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                )),
                createElementVNode("polygon", {
                  points: radarPoly.value,
                  fill: "var(--grafana-primary-transparent, rgba(61,113,217,0.25))",
                  stroke: "var(--grafana-primary)",
                  "stroke-width": "0.8"
                }, null, 8, _hoisted_12$q),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(radarPoints.value, (p, i) => {
                    return openBlock(), createElementBlock("text", {
                      key: "t" + i,
                      x: p.lx,
                      y: p.ly,
                      "font-size": "3",
                      fill: "var(--grafana-text)",
                      "text-anchor": "middle"
                    }, toDisplayString(p.name), 9, _hoisted_13$p);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])),
              __props.options?.showLegend !== false ? (openBlock(), createElementBlock("div", _hoisted_14$o, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(seriesItems.value, (it, i) => {
                    return openBlock(), createElementBlock("span", {
                      key: i,
                      class: "radar-legend__item"
                    }, [
                      createElementVNode(
                        "i",
                        {
                          style: normalizeStyle({ background: it.color })
                        },
                        null,
                        4
                        /* STYLE */
                      ),
                      createTextVNode(
                        toDisplayString(it.name),
                        1
                        /* TEXT */
                      )
                    ]);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])) : createCommentVNode("v-if", true)
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 10, _hoisted_1$2i);
    };
  }
});
const Panel$4 = /* @__PURE__ */ _export_sfc(_sfc_main$2T, [["__scopeId", "data-v-4a7f83c3"]]);
new VuePanelPlugin(
  { id: "radar", name: "雷达图", state: "stable" },
  Panel$4
).setPanelOptions((builder) => {
  builder.addBoolean(
    {
      id: "showLegend",
      path: "showLegend",
      name: "图例",
      category: ["雷达"],
      editor: "boolean"
    },
    true
  ).addNumber(
    {
      id: "maxValue",
      path: "maxValue",
      name: "最大值",
      category: ["雷达"],
      editor: "number"
    },
    0
  );
}).useFieldConfig().setRuntimeConsumedPaths(["showLegend", "maxValue"]).register();
const _hoisted_1$2h = ["data-show-percent", "data-sort-desc"];
const _hoisted_2$1N = {
  key: 0,
  class: "empty"
};
const _hoisted_3$1z = { class: "funnel" };
const _hoisted_4$1i = { key: 0 };
const kind$3 = "funnel";
const _sfc_main$2S = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function fieldByName(fields, name, type) {
      if (name) {
        const hit = fields.find(
          (f) => f.name === name || f.config?.displayName === name || f.config?.displayNameFromDS === name
        );
        if (hit) return hit;
      }
      if (type) return fields.find((f) => f.type === type);
      return void 0;
    }
    const seriesItems = computed(() => {
      const palette2 = getClassicPalette$1();
      const opts = props.options || {};
      const out = [];
      let i = 0;
      for (const frame of props.data?.series || []) {
        const fields = frame.fields || [];
        const labelName = opts.labelField || opts.nameField || opts.categoryField || void 0;
        const valueName = opts.valueField || void 0;
        const strF = fieldByName(fields, labelName, "string");
        const numF = fieldByName(fields, valueName, "number");
        if (strF && numF) {
          for (let r = 0; r < (strF.values || []).length; r++) {
            const v = Number(numF.values[r]);
            if (!Number.isFinite(v)) continue;
            out.push({
              name: String(strF.values[r]),
              value: Math.abs(v),
              color: palette2[r % palette2.length]
            });
          }
          if (out.length) {
            if (opts.sortDescending !== false && kind$3 === "funnel") {
              out.sort((a, b) => b.value - a.value);
            }
            return out;
          }
        }
      }
      for (const frame of props.data?.series || []) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          if (opts.valueField && field.name !== opts.valueField && field.config?.displayName !== opts.valueField) {
            continue;
          }
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          out.push({
            name: field.name || `s${i}`,
            value: Math.abs(v),
            color: palette2[i % palette2.length]
          });
          i++;
        }
      }
      if (opts.sortDescending === false) return out;
      return [...out].sort((a, b) => b.value - a.value);
    });
    const maxV = computed(
      () => Math.max(
        1,
        ...seriesItems.value.map((s) => s.value),
        Number(props.options?.maxValue) || 0
      )
    );
    computed(() => {
      const items = [...seriesItems.value].sort((a, b) => b.value - a.value);
      const total = items.reduce((s, i) => s + i.value, 0) || 1;
      let x = 0;
      return items.map((it) => {
        const w = it.value / total * 100;
        const cell = { ...it, x, w };
        x += w;
        return cell;
      });
    });
    const radarPoints = computed(() => {
      const items = seriesItems.value;
      const n = items.length || 1;
      const cx = 50, cy = 50, r = 40;
      return items.map((it, i) => {
        const ang = -Math.PI / 2 + i * 2 * Math.PI / n;
        const rr = r * (it.value / maxV.value);
        return {
          ...it,
          x: cx + rr * Math.cos(ang),
          y: cy + rr * Math.sin(ang),
          lx: cx + r * Math.cos(ang),
          ly: cy + r * Math.sin(ang)
        };
      });
    });
    computed(
      () => radarPoints.value.map((p) => `${p.x},${p.y}`).join(" ")
    );
    const hourly = computed(() => {
      const grid = Array.from({ length: 7 }, () => Array(24).fill(0));
      for (const frame of props.data?.series || []) {
        const time = (frame.fields || []).find((f) => f.type === "time");
        const num2 = (frame.fields || []).find((f) => f.type === "number");
        if (!time || !num2) continue;
        for (let i = 0; i < (time.values || []).length; i++) {
          const d = new Date(Number(time.values[i]));
          if (Number.isNaN(d.getTime())) continue;
          const day = d.getDay();
          const hour = d.getHours();
          const v = Number(num2.values[i]) || 0;
          grid[day][hour] = (grid[day][hour] || 0) + v;
        }
      }
      return grid;
    });
    computed(() => Math.max(1, ...hourly.value.flat()));
    computed(() => {
      const items = seriesItems.value;
      return items.map((it, i) => ({
        ...it,
        y: i / Math.max(1, items.length) * 100,
        h: Math.max(4, it.value / maxV.value * 20)
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-viz",
        "data-testid": "panel-funnel",
        "data-kind": kind$3,
        "data-show-percent": String(__props.options?.showPercent !== false),
        "data-sort-desc": String(__props.options?.sortDescending !== false)
      }, [
        !seriesItems.value.length && kind$3 !== "hourly-heatmap" ? (openBlock(), createElementBlock("div", _hoisted_2$1N, " 无数据 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createCommentVNode(" funnel "),
            createElementVNode("div", _hoisted_3$1z, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(__props.options?.sortDescending === false ? seriesItems.value : [...seriesItems.value].sort((a, b) => b.value - a.value), (it, i) => {
                  return openBlock(), createElementBlock(
                    "div",
                    {
                      key: i,
                      class: "funnel-row",
                      style: normalizeStyle({ width: it.value / maxV.value * 100 + "%", background: it.color })
                    },
                    [
                      createElementVNode(
                        "span",
                        null,
                        toDisplayString(it.name) + ": " + toDisplayString(it.value),
                        1
                        /* TEXT */
                      ),
                      __props.options?.showPercent !== false ? (openBlock(), createElementBlock(
                        "span",
                        _hoisted_4$1i,
                        toDisplayString(Math.round(it.value / maxV.value * 100)) + "%",
                        1
                        /* TEXT */
                      )) : createCommentVNode("v-if", true)
                    ],
                    4
                    /* STYLE */
                  );
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 8, _hoisted_1$2h);
    };
  }
});
const Panel$3 = /* @__PURE__ */ _export_sfc(_sfc_main$2S, [["__scopeId", "data-v-8bde596e"]]);
new VuePanelPlugin(
  { id: "funnel", name: "漏斗图", state: "stable" },
  Panel$3
).setPanelOptions((builder) => {
  builder.addBoolean(
    {
      id: "showPercent",
      path: "showPercent",
      name: "显示占比",
      category: ["漏斗"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "sortDescending",
      path: "sortDescending",
      name: "降序",
      category: ["漏斗"],
      editor: "boolean"
    },
    true
  );
}).useFieldConfig().setRuntimeConsumedPaths(["showPercent", "sortDescending"]).register();
const _hoisted_1$2g = ["data-max-words", "data-min-font", "data-max-font"];
const _hoisted_2$1M = {
  key: 0,
  class: "empty"
};
const _hoisted_5$19 = { class: "wordcloud" };
const kind$2 = "wordcloud";
const _sfc_main$2R = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function fieldByName(fields, name, type) {
      if (name) {
        const hit = fields.find(
          (f) => f.name === name || f.config?.displayName === name || f.config?.displayNameFromDS === name
        );
        if (hit) return hit;
      }
      if (type) return fields.find((f) => f.type === type);
      return void 0;
    }
    const seriesItems = computed(() => {
      const palette2 = getClassicPalette$1();
      const opts = props.options || {};
      const out = [];
      let i = 0;
      for (const frame of props.data?.series || []) {
        const fields = frame.fields || [];
        const labelName = opts.labelField || opts.nameField || opts.categoryField || void 0;
        const valueName = opts.valueField || void 0;
        const strF = fieldByName(fields, labelName, "string");
        const numF = fieldByName(fields, valueName, "number");
        if (strF && numF) {
          for (let r = 0; r < (strF.values || []).length; r++) {
            const v = Number(numF.values[r]);
            if (!Number.isFinite(v)) continue;
            out.push({
              name: String(strF.values[r]),
              value: Math.abs(v),
              color: palette2[r % palette2.length]
            });
          }
          if (out.length) {
            if (opts.sortDescending !== false && kind$2 === "treemap") ;
            return out;
          }
        }
      }
      for (const frame of props.data?.series || []) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          if (opts.valueField && field.name !== opts.valueField && field.config?.displayName !== opts.valueField) {
            continue;
          }
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          out.push({
            name: field.name || `s${i}`,
            value: Math.abs(v),
            color: palette2[i % palette2.length]
          });
          i++;
        }
      }
      if (opts.sortDescending === false) return out;
      return out;
    });
    const maxV = computed(
      () => Math.max(
        1,
        ...seriesItems.value.map((s) => s.value),
        Number(props.options?.maxValue) || 0
      )
    );
    computed(() => {
      const items = [...seriesItems.value].sort((a, b) => b.value - a.value);
      const total = items.reduce((s, i) => s + i.value, 0) || 1;
      let x = 0;
      return items.map((it) => {
        const w = it.value / total * 100;
        const cell = { ...it, x, w };
        x += w;
        return cell;
      });
    });
    const radarPoints = computed(() => {
      const items = seriesItems.value;
      const n = items.length || 1;
      const cx = 50, cy = 50, r = 40;
      return items.map((it, i) => {
        const ang = -Math.PI / 2 + i * 2 * Math.PI / n;
        const rr = r * (it.value / maxV.value);
        return {
          ...it,
          x: cx + rr * Math.cos(ang),
          y: cy + rr * Math.sin(ang),
          lx: cx + r * Math.cos(ang),
          ly: cy + r * Math.sin(ang)
        };
      });
    });
    computed(
      () => radarPoints.value.map((p) => `${p.x},${p.y}`).join(" ")
    );
    const hourly = computed(() => {
      const grid = Array.from({ length: 7 }, () => Array(24).fill(0));
      for (const frame of props.data?.series || []) {
        const time = (frame.fields || []).find((f) => f.type === "time");
        const num2 = (frame.fields || []).find((f) => f.type === "number");
        if (!time || !num2) continue;
        for (let i = 0; i < (time.values || []).length; i++) {
          const d = new Date(Number(time.values[i]));
          if (Number.isNaN(d.getTime())) continue;
          const day = d.getDay();
          const hour = d.getHours();
          const v = Number(num2.values[i]) || 0;
          grid[day][hour] = (grid[day][hour] || 0) + v;
        }
      }
      return grid;
    });
    computed(() => Math.max(1, ...hourly.value.flat()));
    computed(() => {
      const items = seriesItems.value;
      return items.map((it, i) => ({
        ...it,
        y: i / Math.max(1, items.length) * 100,
        h: Math.max(4, it.value / maxV.value * 20)
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-viz",
        "data-testid": "panel-wordcloud",
        "data-kind": kind$2,
        "data-max-words": String(__props.options?.maxWords ?? 80),
        "data-min-font": String(__props.options?.minFontSize ?? 10),
        "data-max-font": String(__props.options?.maxFontSize ?? 48)
      }, [
        !seriesItems.value.length && kind$2 !== "hourly-heatmap" ? (openBlock(), createElementBlock("div", _hoisted_2$1M, " 无数据 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createCommentVNode(" wordcloud "),
            createElementVNode("div", _hoisted_5$19, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(seriesItems.value.slice(0, Number(__props.options?.maxWords) || 80), (it, i) => {
                  return openBlock(), createElementBlock(
                    "span",
                    {
                      key: i,
                      style: normalizeStyle({
                        fontSize: (Number(__props.options?.minFontSize) || 10) + it.value / maxV.value * ((Number(__props.options?.maxFontSize) || 48) - (Number(__props.options?.minFontSize) || 10)) + "px",
                        color: it.color
                      })
                    },
                    toDisplayString(it.name),
                    5
                    /* TEXT, STYLE */
                  );
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 8, _hoisted_1$2g);
    };
  }
});
const Panel$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2R, [["__scopeId", "data-v-02c4b458"]]);
new VuePanelPlugin(
  { id: "wordcloud", name: "词云", state: "stable" },
  Panel$2
).setPanelOptions((builder) => {
  builder.addNumber(
    {
      id: "maxWords",
      path: "maxWords",
      name: "最大词数",
      category: ["词云"],
      editor: "number"
    },
    80
  ).addNumber(
    {
      id: "minFontSize",
      path: "minFontSize",
      name: "最小字号",
      category: ["词云"],
      editor: "number"
    },
    10
  ).addNumber(
    {
      id: "maxFontSize",
      path: "maxFontSize",
      name: "最大字号",
      category: ["词云"],
      editor: "number"
    },
    48
  );
}).useFieldConfig().setRuntimeConsumedPaths(["maxWords", "minFontSize", "maxFontSize"]).register();
const _hoisted_1$2f = ["data-show-label", "data-label-field", "data-value-field"];
const _hoisted_2$1L = {
  key: 0,
  class: "empty"
};
const _hoisted_6$11 = { class: "treemap" };
const _hoisted_7$V = ["title"];
const _hoisted_8$M = { key: 0 };
const kind$1 = "treemap";
const _sfc_main$2Q = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function fieldByName(fields, name, type) {
      if (name) {
        const hit = fields.find(
          (f) => f.name === name || f.config?.displayName === name || f.config?.displayNameFromDS === name
        );
        if (hit) return hit;
      }
      if (type) return fields.find((f) => f.type === type);
      return void 0;
    }
    const seriesItems = computed(() => {
      const palette2 = getClassicPalette$1();
      const opts = props.options || {};
      const out = [];
      let i = 0;
      for (const frame of props.data?.series || []) {
        const fields = frame.fields || [];
        const labelName = opts.labelField || opts.nameField || opts.categoryField || void 0;
        const valueName = opts.valueField || void 0;
        const strF = fieldByName(fields, labelName, "string");
        const numF = fieldByName(fields, valueName, "number");
        if (strF && numF) {
          for (let r = 0; r < (strF.values || []).length; r++) {
            const v = Number(numF.values[r]);
            if (!Number.isFinite(v)) continue;
            out.push({
              name: String(strF.values[r]),
              value: Math.abs(v),
              color: palette2[r % palette2.length]
            });
          }
          if (out.length) {
            if (opts.sortDescending !== false && kind$1 === "treemap") {
              out.sort((a, b) => b.value - a.value);
            }
            return out;
          }
        }
      }
      for (const frame of props.data?.series || []) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          if (opts.valueField && field.name !== opts.valueField && field.config?.displayName !== opts.valueField) {
            continue;
          }
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          out.push({
            name: field.name || `s${i}`,
            value: Math.abs(v),
            color: palette2[i % palette2.length]
          });
          i++;
        }
      }
      if (opts.sortDescending === false) return out;
      return out;
    });
    const maxV = computed(
      () => Math.max(
        1,
        ...seriesItems.value.map((s) => s.value),
        Number(props.options?.maxValue) || 0
      )
    );
    const treemapLayout = computed(() => {
      const items = [...seriesItems.value].sort((a, b) => b.value - a.value);
      const total = items.reduce((s, i) => s + i.value, 0) || 1;
      let x = 0;
      return items.map((it) => {
        const w = it.value / total * 100;
        const cell = { ...it, x, w };
        x += w;
        return cell;
      });
    });
    const radarPoints = computed(() => {
      const items = seriesItems.value;
      const n = items.length || 1;
      const cx = 50, cy = 50, r = 40;
      return items.map((it, i) => {
        const ang = -Math.PI / 2 + i * 2 * Math.PI / n;
        const rr = r * (it.value / maxV.value);
        return {
          ...it,
          x: cx + rr * Math.cos(ang),
          y: cy + rr * Math.sin(ang),
          lx: cx + r * Math.cos(ang),
          ly: cy + r * Math.sin(ang)
        };
      });
    });
    computed(
      () => radarPoints.value.map((p) => `${p.x},${p.y}`).join(" ")
    );
    const hourly = computed(() => {
      const grid = Array.from({ length: 7 }, () => Array(24).fill(0));
      for (const frame of props.data?.series || []) {
        const time = (frame.fields || []).find((f) => f.type === "time");
        const num2 = (frame.fields || []).find((f) => f.type === "number");
        if (!time || !num2) continue;
        for (let i = 0; i < (time.values || []).length; i++) {
          const d = new Date(Number(time.values[i]));
          if (Number.isNaN(d.getTime())) continue;
          const day = d.getDay();
          const hour = d.getHours();
          const v = Number(num2.values[i]) || 0;
          grid[day][hour] = (grid[day][hour] || 0) + v;
        }
      }
      return grid;
    });
    computed(() => Math.max(1, ...hourly.value.flat()));
    computed(() => {
      const items = seriesItems.value;
      return items.map((it, i) => ({
        ...it,
        y: i / Math.max(1, items.length) * 100,
        h: Math.max(4, it.value / maxV.value * 20)
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-viz",
        "data-testid": "panel-treemap",
        "data-kind": kind$1,
        "data-show-label": String(__props.options?.showLabel !== false),
        "data-label-field": String(__props.options?.labelField ?? ""),
        "data-value-field": String(__props.options?.valueField ?? "")
      }, [
        !seriesItems.value.length && kind$1 !== "hourly-heatmap" ? (openBlock(), createElementBlock("div", _hoisted_2$1L, " 无数据 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            createCommentVNode(" treemap "),
            createElementVNode("div", _hoisted_6$11, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(treemapLayout.value, (it, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: i,
                    class: "tm-cell",
                    style: normalizeStyle({ width: it.w + "%", background: it.color }),
                    title: it.name + ": " + it.value
                  }, [
                    __props.options?.showLabel !== false ? (openBlock(), createElementBlock(
                      "span",
                      _hoisted_8$M,
                      toDisplayString(it.name),
                      1
                      /* TEXT */
                    )) : createCommentVNode("v-if", true)
                  ], 12, _hoisted_7$V);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 8, _hoisted_1$2f);
    };
  }
});
const Panel$1 = /* @__PURE__ */ _export_sfc(_sfc_main$2Q, [["__scopeId", "data-v-79b085b4"]]);
new VuePanelPlugin(
  { id: "treemap", name: "矩形树图", state: "stable" },
  Panel$1
).setPanelOptions((builder) => {
  builder.addText(
    {
      id: "labelField",
      path: "labelField",
      name: "标签字段",
      category: ["树图"],
      editor: "text"
    },
    ""
  ).addText(
    {
      id: "valueField",
      path: "valueField",
      name: "值字段",
      category: ["树图"],
      editor: "text"
    },
    ""
  ).addBoolean(
    {
      id: "showLabel",
      path: "showLabel",
      name: "显示标签",
      category: ["树图"],
      editor: "boolean"
    },
    true
  );
}).useFieldConfig().setRuntimeConsumedPaths(["labelField", "valueField", "showLabel"]).register();
const _hoisted_1$2e = ["data-show-values"];
const _hoisted_2$1K = {
  key: 0,
  class: "empty"
};
const _hoisted_16$i = { class: "hourly" };
const _hoisted_17$f = { class: "hourly-grid" };
const _hoisted_18$f = ["title"];
const _hoisted_19$d = { key: 0 };
const kind = "hourly-heatmap";
const _sfc_main$2P = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    function fieldByName(fields, name, type) {
      if (name) {
        const hit = fields.find(
          (f) => f.name === name || f.config?.displayName === name || f.config?.displayNameFromDS === name
        );
        if (hit) return hit;
      }
      if (type) return fields.find((f) => f.type === type);
      return void 0;
    }
    const seriesItems = computed(() => {
      const palette2 = getClassicPalette$1();
      const opts = props.options || {};
      const out = [];
      let i = 0;
      for (const frame of props.data?.series || []) {
        const fields = frame.fields || [];
        const labelName = opts.labelField || opts.nameField || opts.categoryField || void 0;
        const valueName = opts.valueField || void 0;
        const strF = fieldByName(fields, labelName, "string");
        const numF = fieldByName(fields, valueName, "number");
        if (strF && numF) {
          for (let r = 0; r < (strF.values || []).length; r++) {
            const v = Number(numF.values[r]);
            if (!Number.isFinite(v)) continue;
            out.push({
              name: String(strF.values[r]),
              value: Math.abs(v),
              color: palette2[r % palette2.length]
            });
          }
          if (out.length) {
            if (opts.sortDescending !== false && kind === "treemap") ;
            return out;
          }
        }
      }
      for (const frame of props.data?.series || []) {
        for (const field of frame.fields || []) {
          if (field.type !== "number") continue;
          if (opts.valueField && field.name !== opts.valueField && field.config?.displayName !== opts.valueField) {
            continue;
          }
          const vals = field.values || [];
          const v = Number(vals[vals.length - 1]);
          if (!Number.isFinite(v)) continue;
          out.push({
            name: field.name || `s${i}`,
            value: Math.abs(v),
            color: palette2[i % palette2.length]
          });
          i++;
        }
      }
      if (opts.sortDescending === false) return out;
      return out;
    });
    const maxV = computed(
      () => Math.max(
        1,
        ...seriesItems.value.map((s) => s.value),
        Number(props.options?.maxValue) || 0
      )
    );
    computed(() => {
      const items = [...seriesItems.value].sort((a, b) => b.value - a.value);
      const total = items.reduce((s, i) => s + i.value, 0) || 1;
      let x = 0;
      return items.map((it) => {
        const w = it.value / total * 100;
        const cell = { ...it, x, w };
        x += w;
        return cell;
      });
    });
    const radarPoints = computed(() => {
      const items = seriesItems.value;
      const n = items.length || 1;
      const cx = 50, cy = 50, r = 40;
      return items.map((it, i) => {
        const ang = -Math.PI / 2 + i * 2 * Math.PI / n;
        const rr = r * (it.value / maxV.value);
        return {
          ...it,
          x: cx + rr * Math.cos(ang),
          y: cy + rr * Math.sin(ang),
          lx: cx + r * Math.cos(ang),
          ly: cy + r * Math.sin(ang)
        };
      });
    });
    computed(
      () => radarPoints.value.map((p) => `${p.x},${p.y}`).join(" ")
    );
    const hourly = computed(() => {
      const grid = Array.from({ length: 7 }, () => Array(24).fill(0));
      for (const frame of props.data?.series || []) {
        const time = (frame.fields || []).find((f) => f.type === "time");
        const num2 = (frame.fields || []).find((f) => f.type === "number");
        if (!time || !num2) continue;
        for (let i = 0; i < (time.values || []).length; i++) {
          const d = new Date(Number(time.values[i]));
          if (Number.isNaN(d.getTime())) continue;
          const day = d.getDay();
          const hour = d.getHours();
          const v = Number(num2.values[i]) || 0;
          grid[day][hour] = (grid[day][hour] || 0) + v;
        }
      }
      return grid;
    });
    const hourlyMax = computed(() => Math.max(1, ...hourly.value.flat()));
    computed(() => {
      const items = seriesItems.value;
      return items.map((it, i) => ({
        ...it,
        y: i / Math.max(1, items.length) * 100,
        h: Math.max(4, it.value / maxV.value * 20)
      }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-viz",
        "data-testid": "panel-hourly-heatmap",
        "data-kind": kind,
        "data-show-values": String(!!__props.options?.showValues)
      }, [
        !seriesItems.value.length && kind !== "hourly-heatmap" ? (openBlock(), createElementBlock("div", _hoisted_2$1K, " 无数据 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 6 },
          [
            createCommentVNode(" hourly heatmap "),
            createElementVNode("div", _hoisted_16$i, [
              createElementVNode("div", _hoisted_17$f, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(hourly.value, (day, di) => {
                    return openBlock(), createElementBlock("div", {
                      key: di,
                      class: "hourly-row"
                    }, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(day, (v, hi) => {
                          return openBlock(), createElementBlock("div", {
                            key: hi,
                            class: "hourly-cell",
                            style: normalizeStyle({
                              opacity: 0.15 + 0.85 * (v / hourlyMax.value),
                              background: "var(--grafana-primary)"
                            }),
                            title: `D${{ di }} H${{ hi }}: ${{ v }}`
                          }, [
                            __props.options?.showValues && v ? (openBlock(), createElementBlock(
                              "span",
                              _hoisted_19$d,
                              toDisplayString(Math.round(v)),
                              1
                              /* TEXT */
                            )) : createCommentVNode("v-if", true)
                          ], 12, _hoisted_18$f);
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ]);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])
            ])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 8, _hoisted_1$2e);
    };
  }
});
const Panel = /* @__PURE__ */ _export_sfc(_sfc_main$2P, [["__scopeId", "data-v-92203f81"]]);
new VuePanelPlugin(
  { id: "hourly-heatmap", name: "小时热力", state: "stable" },
  Panel
).setPanelOptions((builder) => {
  builder.addSelect(
    {
      id: "from",
      path: "from",
      name: "周起始",
      category: ["小时热力"],
      editor: "select",
      settings: {
        options: [
          { label: "周一", value: "monday" },
          { label: "周日", value: "sunday" }
        ]
      }
    },
    "monday"
  ).addBoolean(
    {
      id: "showValues",
      path: "showValues",
      name: "显示数值",
      category: ["小时热力"],
      editor: "boolean"
    },
    false
  );
}).useFieldConfig().setRuntimeConsumedPaths(["from", "showValues"]).register();
let panelsRegistered = false;
function registerBuiltinPanels() {
  if (panelsRegistered) return;
  panelsRegistered = true;
  if (listPanelPlugins().length === 0) {
    throw new Error(
      "[grafana-vue-panels] registerBuiltinPanels produced zero panel plugins"
    );
  }
}
async function registerGeomapPanel() {
  const mod = await Promise.resolve().then(() => module$5);
  if (mod.plugin) {
    const { registerPanelPlugin: registerPanelPlugin2 } = await Promise.resolve().then(() => index$2);
    registerPanelPlugin2(mod.plugin);
  }
}
const register$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  registerBuiltinPanels,
  registerGeomapPanel
}, Symbol.toStringTag, { value: "Module" }));
function asQueryBag(query) {
  return query;
}
function useQueryEditorModel(props) {
  const type = computed(
    () => normalizeDsType(
      props.datasource?.type ?? asQueryBag(props.query).datasource?.type ?? ""
    )
  );
  const family = computed(() => queryFieldFamily(type.value));
  const editorMode = ref(
    asQueryBag(props.query).editorMode || "code"
  );
  function patch(partial) {
    props.onChange({ ...props.query, ...partial });
  }
  function setEditorMode(mode2) {
    editorMode.value = mode2;
    patch({ editorMode: mode2 });
  }
  const expr = computed({
    get: () => {
      const q = asQueryBag(props.query);
      return String(
        q.expr ?? q.query ?? q.rawSql ?? q.target ?? q.expression ?? ""
      );
    },
    set: (v) => {
      const f = family.value;
      if (f === "prometheus" || f === "loki") patch({ expr: v });
      else if (f === "sql") patch({ rawSql: v, rawQuery: true });
      else if (f === "graphite") patch({ target: v });
      else if (f === "influxdb") patch({ query: v, rawQuery: true });
      else if (f === "cloudwatch") patch({ expression: v });
      else if (f === "tempo" || f === "elasticsearch" || f === "azure" || f === "alertmanager")
        patch({ query: v });
      else if (f === "jaeger" || f === "pyroscope") patch({ query: v });
      else patch({ query: v, expr: v });
    }
  });
  const isSql = computed(() => family.value === "sql");
  const query = computed(() => asQueryBag(props.query));
  return {
    type,
    family,
    query,
    editorMode,
    expr,
    isSql,
    patch,
    setEditorMode,
    onRunQuery: () => props.onRunQuery(),
    onChange: props.onChange,
    label: computed(() => props.label)
  };
}
const promFormatOptions = [
  { label: "时序", value: "time_series" },
  { label: "表格", value: "table" },
  { label: "热图", value: "heatmap" }
];
const sqlFormatOptions = [
  { label: "时序", value: 0 },
  { label: "表格", value: 1 }
];
const cloudwatchQueryTypes = [
  { label: "指标", value: "Metrics" },
  { label: "日志", value: "Logs" },
  { label: "注解", value: "Annotations" }
];
const cwPlaceholder = `SEARCH('{AWS/EC2,InstanceId} MetricName="CPUUtilization"', 'Average', 300)`;
const _hoisted_1$2d = {
  class: "prom-builder",
  "data-testid": "prom-query-builder"
};
const _hoisted_2$1J = { class: "row" };
const _hoisted_3$1y = { class: "row" };
const _hoisted_4$1h = {
  key: 0,
  class: "row"
};
const _hoisted_5$18 = { class: "labels" };
const _hoisted_6$10 = { class: "labels-head" };
const _hoisted_7$U = {
  class: "preview",
  "data-testid": "prom-builder-preview"
};
const _sfc_main$2O = /* @__PURE__ */ defineComponent({
  __name: "PromQueryBuilder",
  props: {
    expr: {}
  },
  emits: ["update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const metric = ref("up");
    const labels = ref([
      { key: "job", op: "=", value: "api" }
    ]);
    const fn = ref("rate");
    const range = ref("5m");
    function parseExpr(expr) {
      const m = expr.match(
        /^(?:(\w+)\()?([a-zA-Z_:][a-zA-Z0-9_:]*)\s*(\{[^}]*\})?(?:\[([^\]]+)\])?\)?$/
      );
      if (!m) return;
      fn.value = m[1] || void 0;
      metric.value = m[2] || "up";
      range.value = m[4] || "5m";
      const body = m[3]?.slice(1, -1) || "";
      if (body) {
        labels.value = body.split(",").map((part) => {
          const mm = part.trim().match(/([a-zA-Z_][\w]*)\s*(=~|!~|=|!=)\s*"([^"]*)"/);
          return mm ? { key: mm[1], op: mm[2], value: mm[3] } : { key: "job", op: "=", value: "" };
        });
      }
    }
    watch(
      () => props.expr,
      (e) => {
        if (e) parseExpr(e);
      },
      { immediate: true }
    );
    const built = computed(() => {
      const sel = labels.value.filter((l) => l.key).map((l) => `${l.key}${l.op}"${l.value}"`).join(",");
      const selector = sel ? `${metric.value}{${sel}}` : metric.value;
      if (fn.value) return `${fn.value}(${selector}[${range.value || "5m"}])`;
      return selector;
    });
    watch(built, (v) => emit("update:expr", v));
    function addLabel() {
      labels.value = [...labels.value, { key: "", op: "=", value: "" }];
    }
    function removeLabel(i) {
      labels.value = labels.value.filter((_, idx) => idx !== i);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2d, [
        createElementVNode("div", _hoisted_2$1J, [
          _cache[3] || (_cache[3] = createElementVNode(
            "label",
            null,
            "指标",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: metric.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => metric.value = $event),
            "data-testid": "prom-builder-metric",
            placeholder: "up"
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1y, [
          _cache[4] || (_cache[4] = createElementVNode(
            "label",
            null,
            "函数",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            "allow-clear": "",
            style: { "width": "100%" },
            value: fn.value,
            options: [
              { label: "无", value: "" },
              { label: "rate", value: "rate" },
              { label: "irate", value: "irate" },
              { label: "increase", value: "increase" },
              { label: "sum", value: "sum" },
              { label: "avg", value: "avg" }
            ],
            "data-testid": "prom-builder-fn",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => fn.value = $event || void 0)
          }, null, 8, ["value"])
        ]),
        fn.value && ["rate", "irate", "increase"].includes(fn.value) ? (openBlock(), createElementBlock("div", _hoisted_4$1h, [
          _cache[5] || (_cache[5] = createElementVNode(
            "label",
            null,
            "范围",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: range.value,
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => range.value = $event),
            placeholder: "5m",
            "data-testid": "prom-builder-range"
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_5$18, [
          createElementVNode("div", _hoisted_6$10, [
            _cache[7] || (_cache[7] = createElementVNode(
              "span",
              null,
              "标签",
              -1
              /* CACHED */
            )),
            createVNode(unref(Button), {
              size: "small",
              onClick: addLabel
            }, {
              default: withCtx(() => [..._cache[6] || (_cache[6] = [
                createTextVNode(
                  "添加标签",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })
          ]),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(labels.value, (l, i) => {
              return openBlock(), createElementBlock("div", {
                key: i,
                class: "label-row"
              }, [
                createVNode(unref(Input), {
                  value: l.key,
                  "onUpdate:value": ($event) => l.key = $event,
                  placeholder: "标签名"
                }, null, 8, ["value", "onUpdate:value"]),
                createVNode(unref(Select), {
                  style: { "width": "80px" },
                  value: l.op,
                  "onUpdate:value": ($event) => l.op = $event,
                  options: [
                    { label: "=", value: "=" },
                    { label: "!=", value: "!=" },
                    { label: "=~", value: "=~" },
                    { label: "!~", value: "!~" }
                  ]
                }, null, 8, ["value", "onUpdate:value"]),
                createVNode(unref(Input), {
                  value: l.value,
                  "onUpdate:value": ($event) => l.value = $event,
                  placeholder: "值"
                }, null, 8, ["value", "onUpdate:value"]),
                createVNode(unref(Button), {
                  size: "small",
                  danger: "",
                  onClick: ($event) => removeLabel(i)
                }, {
                  default: withCtx(() => [..._cache[8] || (_cache[8] = [
                    createTextVNode(
                      "×",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["onClick"])
              ]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ]),
        createElementVNode(
          "div",
          _hoisted_7$U,
          toDisplayString(built.value),
          1
          /* TEXT */
        )
      ]);
    };
  }
});
const PromQueryBuilder = /* @__PURE__ */ _export_sfc(_sfc_main$2O, [["__scopeId", "data-v-d69597b0"]]);
const _hoisted_1$2c = { class: "qf" };
const _hoisted_2$1I = {
  class: "mode-tabs",
  "data-testid": "prom-editor-mode"
};
const _hoisted_3$1x = {
  class: "row metric-browser",
  "data-testid": "prom-metric-browser"
};
const _hoisted_4$1g = {
  key: 0,
  class: "meta-err",
  "data-testid": "prom-meta-error"
};
const _hoisted_5$17 = {
  key: 1,
  class: "row labels-hint"
};
const _hoisted_6$$ = {
  class: "label-chips",
  "data-testid": "prom-label-chips"
};
const _hoisted_7$T = ["onClick"];
const _hoisted_8$L = {
  key: 4,
  class: "promql-diag",
  "data-testid": "promql-diagnostics",
  role: "alert"
};
const _hoisted_9$I = {
  key: 0,
  class: "hint"
};
const _hoisted_10$A = { class: "row" };
const _hoisted_11$u = { class: "row" };
const _hoisted_12$p = { class: "row" };
const _hoisted_13$o = { class: "row" };
const _hoisted_14$n = { class: "row" };
const _hoisted_15$j = { class: "row" };
const _hoisted_16$h = { class: "row" };
const _sfc_main$2N = /* @__PURE__ */ defineComponent({
  __name: "PromQueryFields",
  props: {
    query: {},
    expr: {},
    editorMode: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr", "set-editor-mode"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    const editorMode = computed(() => props.editorMode);
    function setEditorMode(mode2) {
      emit("set-editor-mode", mode2);
    }
    function patch(partial) {
      emit("patch", partial);
    }
    const promqlDiagnostics = computed(
      () => parsePromqlToAst(expr.value).diagnostics
    );
    const promqlOk = computed(() => parsePromqlToAst(expr.value).ok);
    const metricOptions = ref([]);
    const labelOptions = ref([]);
    const metaError = ref("");
    const metaLoading = ref(false);
    const selectedMetric = ref();
    async function loadMetrics() {
      metaLoading.value = true;
      metaError.value = "";
      try {
        const api = props.datasourceApi;
        if (typeof api?.listMetricNames === "function") {
          const names = await api.listMetricNames();
          metricOptions.value = (names || []).map((n) => ({
            label: n,
            value: n
          }));
        } else if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery("metrics()");
          metricOptions.value = (rows || []).map((r) => ({
            label: String(r.text ?? r.value),
            value: String(r.value ?? r.text)
          }));
        } else {
          metricOptions.value = [
            { label: "up", value: "up" },
            {
              label: "process_cpu_seconds_total",
              value: "process_cpu_seconds_total"
            },
            { label: "http_requests_total", value: "http_requests_total" }
          ];
        }
        if (typeof api?.listLabelNames === "function") {
          const labels = await api.listLabelNames();
          labelOptions.value = (labels || []).map((n) => ({
            label: n,
            value: n
          }));
        }
      } catch (e) {
        metaError.value = e instanceof Error ? e.message : String(e);
        metricOptions.value = [
          { label: "up", value: "up" },
          { label: "http_requests_total", value: "http_requests_total" }
        ];
      } finally {
        metaLoading.value = false;
      }
    }
    function insertMetric(name) {
      const m = String(name ?? "").trim();
      if (!m) return;
      selectedMetric.value = m;
      const cur = expr.value.trim();
      if (!cur || /^[a-zA-Z_:][\w:]*$/.test(cur) || cur === "{}") {
        expr.value = m;
      } else if (!cur.includes(m)) {
        expr.value = m;
      }
    }
    function insertLabelChip(label) {
      const m = selectedMetric.value || "metric";
      if (expr.value.includes("{")) return;
      expr.value = m + "{" + label + '=""}';
    }
    onMounted(loadMetrics);
    watch(
      () => props.datasourceApi,
      () => {
        void loadMetrics();
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2c, [
        createElementVNode("div", _hoisted_2$1I, [
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: editorMode.value === "code" }),
              onClick: _cache[0] || (_cache[0] = ($event) => setEditorMode("code"))
            },
            " 代码 ",
            2
            /* CLASS */
          ),
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: editorMode.value === "builder" }),
              onClick: _cache[1] || (_cache[1] = ($event) => setEditorMode("builder"))
            },
            " 构建器 ",
            2
            /* CLASS */
          )
        ]),
        createElementVNode("div", _hoisted_3$1x, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "指标浏览器",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            loading: metaLoading.value,
            value: selectedMetric.value,
            options: metricOptions.value,
            "filter-option": (input, option) => String(option?.label ?? option?.value ?? "").toLowerCase().includes(String(input).toLowerCase()),
            placeholder: "预取指标名称（点击插入 PromQL）",
            "data-testid": "prom-metric-select",
            "onUpdate:value": insertMetric
          }, null, 8, ["loading", "value", "options", "filter-option"])
        ]),
        metaError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_4$1g,
          toDisplayString(metaError.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        labelOptions.value.length ? (openBlock(), createElementBlock("div", _hoisted_5$17, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "常用标签",
            -1
            /* CACHED */
          )),
          createElementVNode("div", _hoisted_6$$, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(labelOptions.value.slice(0, 12), (l) => {
                return openBlock(), createElementBlock("button", {
                  key: l.value,
                  type: "button",
                  class: "chip",
                  onClick: ($event) => insertLabelChip(l.value)
                }, toDisplayString(l.label), 9, _hoisted_7$T);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true),
        editorMode.value === "code" ? (openBlock(), createBlock(unref(GCodeEditor), {
          key: 2,
          value: expr.value,
          "onUpdate:value": _cache[2] || (_cache[2] = ($event) => expr.value = $event),
          language: "promql",
          height: 140,
          "test-id": "promql-input"
        }, null, 8, ["value"])) : (openBlock(), createBlock(PromQueryBuilder, {
          key: 3,
          expr: expr.value,
          "onUpdate:expr": _cache[3] || (_cache[3] = ($event) => expr.value = $event)
        }, null, 8, ["expr"])),
        expr.value.trim() && !promqlOk.value ? (openBlock(), createElementBlock("div", _hoisted_8$L, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(promqlDiagnostics.value, (d, i) => {
              return openBlock(), createElementBlock("div", {
                key: i,
                class: "promql-diag__item"
              }, [
                createTextVNode(
                  toDisplayString(d.message) + " ",
                  1
                  /* TEXT */
                ),
                d.range ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_9$I,
                  "@" + toDisplayString(d.range.from) + "-" + toDisplayString(d.range.to),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_10$A, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "图例",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.legendFormat ?? ""),
            placeholder: "{{instance}}",
            "data-testid": "prom-legend",
            "data-grafana-label": "Legend",
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ legendFormat: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_11$u, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "最小步长",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.interval ?? ""),
            placeholder: "15s",
            "data-testid": "prom-step",
            "data-grafana-label": "Min step",
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ interval: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_12$p, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "格式",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            value: String(query.value.format ?? "time_series"),
            options: unref(promFormatOptions),
            "data-testid": "prom-format",
            "data-grafana-label": "Format",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ format: $event }))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_13$o, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "瞬时",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            checked: !!query.value.instant,
            "data-testid": "prom-instant",
            "data-grafana-label": "Type",
            "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => patch({ instant: $event, range: !$event }))
          }, null, 8, ["checked"])
        ]),
        createElementVNode("div", _hoisted_14$n, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "样本",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            checked: !!query.value.exemplar,
            "data-testid": "prom-exemplar",
            "data-grafana-label": "Exemplars",
            "onUpdate:checked": _cache[8] || (_cache[8] = ($event) => patch({ exemplar: $event }))
          }, null, 8, ["checked"])
        ]),
        createElementVNode("div", _hoisted_15$j, [
          _cache[18] || (_cache[18] = createElementVNode(
            "label",
            null,
            "分辨率因子",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.intervalFactor ?? 1),
            "data-testid": "prom-interval-factor",
            "onUpdate:value": _cache[9] || (_cache[9] = ($event) => patch({ intervalFactor: Number($event) || 1 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_16$h, [
          _cache[19] || (_cache[19] = createElementVNode(
            "label",
            null,
            "UTC 偏移",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.utcOffsetSec ?? ""),
            placeholder: "0",
            "data-testid": "prom-utc-offset",
            "onUpdate:value": _cache[10] || (_cache[10] = ($event) => patch({ utcOffsetSec: Number($event) || 0 }))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const PromQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2N, [["__scopeId", "data-v-23babeac"]]);
const _hoisted_1$2b = {
  class: "logql-builder",
  "data-testid": "logql-query-builder"
};
const _hoisted_2$1H = { class: "row" };
const _hoisted_3$1w = { class: "row" };
const _hoisted_4$1f = { class: "row" };
const _hoisted_5$16 = {
  class: "preview",
  "data-testid": "logql-builder-preview"
};
const _sfc_main$2M = /* @__PURE__ */ defineComponent({
  __name: "LogqlQueryBuilder",
  props: {
    expr: {}
  },
  emits: ["update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const stream = ref("job");
    const streamValue = ref("varlogs");
    const lineFilter = ref("");
    const filterOp = ref("|=");
    const metric = ref(false);
    const metricFn = ref("rate");
    const range = ref("5m");
    const built = computed(() => {
      let e = `{${stream.value}="${streamValue.value}"}`;
      if (lineFilter.value) e += ` ${filterOp.value} \`${lineFilter.value}\``;
      if (metric.value) e = `${metricFn.value}(${e}[${range.value}])`;
      return e;
    });
    watch(built, (v) => emit("update:expr", v));
    watch(
      () => props.expr,
      (e) => {
        if (!e) return;
        const m = e.match(/\{([^=]+)="([^"]+)"\}/);
        if (m) {
          stream.value = m[1];
          streamValue.value = m[2];
        }
        metric.value = /\b(rate|count_over_time)\s*\(/.test(e);
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2b, [
        createElementVNode("div", _hoisted_2$1H, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "流选择器",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: stream.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => stream.value = $event),
            style: { "width": "100px" }
          }, null, 8, ["value"]),
          createVNode(unref(Input), {
            value: streamValue.value,
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => streamValue.value = $event),
            placeholder: "值",
            "data-testid": "logql-stream-value"
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1w, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "行过滤",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "80px" },
            value: filterOp.value,
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => filterOp.value = $event),
            options: [
              { label: "|=", value: "|=" },
              { label: "!=", value: "!=" },
              { label: "|~", value: "|~" }
            ]
          }, null, 8, ["value"]),
          createVNode(unref(Input), {
            value: lineFilter.value,
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => lineFilter.value = $event),
            placeholder: "错误关键词"
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$1f, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "指标",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            checked: metric.value,
            "onUpdate:checked": _cache[4] || (_cache[4] = ($event) => metric.value = $event),
            "data-testid": "logql-metric-toggle"
          }, null, 8, ["checked"]),
          metric.value ? (openBlock(), createBlock(unref(Select), {
            key: 0,
            style: { "width": "140px" },
            value: metricFn.value,
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => metricFn.value = $event),
            options: [
              { label: "rate", value: "rate" },
              { label: "count_over_time", value: "count_over_time" }
            ]
          }, null, 8, ["value"])) : createCommentVNode("v-if", true),
          metric.value ? (openBlock(), createBlock(unref(Input), {
            key: 1,
            value: range.value,
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => range.value = $event),
            style: { "width": "80px" },
            placeholder: "5m"
          }, null, 8, ["value"])) : createCommentVNode("v-if", true)
        ]),
        createElementVNode(
          "div",
          _hoisted_5$16,
          toDisplayString(built.value),
          1
          /* TEXT */
        )
      ]);
    };
  }
});
const LogqlQueryBuilder = /* @__PURE__ */ _export_sfc(_sfc_main$2M, [["__scopeId", "data-v-28a18009"]]);
const EMPTY_SELECTOR = "{}";
const MAX_AUTO_SELECT = 4;
const collator = new Intl.Collator("en", { sensitivity: "accent" });
function escapeLabelValueInExactSelector(value) {
  return String(value).replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n");
}
function escapeLabelValueInRegexSelector(value) {
  const escaped = String(value).replace(/\\/g, "\\\\").replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/"/g, '\\"').replace(/\n/g, "\\n");
  return escaped;
}
function buildSelector(labels) {
  const selectedLabels = [];
  for (const label of labels) {
    if (label.selected && label.values && label.values.length > 0) {
      const selectedValues = label.values.filter((value) => value.selected).map((value) => value.name).sort(collator.compare);
      if (selectedValues.length > 1) {
        selectedLabels.push(
          `${label.name}=~"${selectedValues.map(escapeLabelValueInRegexSelector).join("|")}"`
        );
      } else if (selectedValues.length === 1) {
        selectedLabels.push(
          `${label.name}="${escapeLabelValueInExactSelector(selectedValues[0])}"`
        );
      }
    }
  }
  return ["{", selectedLabels.join(","), "}"].join("");
}
function offlineDemoLabels() {
  const catalog = {
    job: ["varlogs", "nginx", "api"],
    filename: ["/var/log/nginx/json_access.log", "/var/log/app/app.log"],
    instance: ["localhost:3100", "localhost:9090"],
    level: ["info", "warn", "error", "debug"],
    host: ["web-1", "web-2", "api-1"]
  };
  return Object.entries(catalog).map(([name, values], i) => ({
    name,
    selected: i < MAX_AUTO_SELECT,
    values: values.map((v, vi) => ({ name: v, selected: i < 2 && vi === 0 }))
  }));
}
function buildRateQuery(selector) {
  const sel = selector && selector !== EMPTY_SELECTOR ? selector : "{}";
  return `rate(${sel}[$__auto])`;
}
function fuzzyFilter(items, term) {
  const t2 = term.trim().toLowerCase();
  if (!t2) return items;
  return items.filter((x) => x.toLowerCase().includes(t2));
}
const _hoisted_1$2a = {
  class: "loki-label-browser",
  "data-testid": "loki-label-browser",
  "data-grafana-label": "Label browser"
};
const _hoisted_2$1G = { class: "lb-head" };
const _hoisted_3$1v = { class: "lb-cols" };
const _hoisted_4$1e = {
  class: "lb-col",
  "data-testid": "loki-lb-labels"
};
const _hoisted_5$15 = ["data-testid", "onClick"];
const _hoisted_6$_ = {
  key: 0,
  class: "facet"
};
const _hoisted_7$S = {
  class: "lb-col",
  "data-testid": "loki-lb-values"
};
const _hoisted_8$K = ["aria-label"];
const _hoisted_9$H = ["data-testid", "onClick"];
const _hoisted_10$z = {
  key: 1,
  class: "lb-empty"
};
const _hoisted_11$t = {
  class: "lb-selector",
  "aria-label": "selector",
  "data-testid": "loki-lb-selector"
};
const _hoisted_12$o = { class: "lb-actions" };
const _hoisted_13$n = {
  key: 0,
  class: "lb-status",
  "data-testid": "loki-lb-validation"
};
const _hoisted_14$m = {
  key: 1,
  class: "lb-status"
};
const _sfc_main$2L = /* @__PURE__ */ defineComponent({
  __name: "LokiLabelBrowser",
  props: {
    labels: {}
  },
  emits: ["change", "apply-logs", "apply-metrics", "close"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const labels = ref([]);
    const searchTerm = ref("");
    const status = ref("");
    const validationStatus = ref("");
    function seed() {
      labels.value = (props.labels?.length ? structuredClone(props.labels) : offlineDemoLabels()).map((l) => ({
        ...l,
        values: l.values?.map((v) => ({ ...v }))
      }));
      status.value = "";
      validationStatus.value = "";
    }
    watch(
      () => props.labels,
      () => seed(),
      { immediate: true, deep: true }
    );
    const selector = computed(() => buildSelector(labels.value));
    const empty = computed(() => selector.value === EMPTY_SELECTOR);
    const activeLabel = computed(
      () => labels.value.find((l) => l.selected && l.values?.length) || labels.value.find((l) => l.selected)
    );
    const filteredLabelNames = computed(
      () => fuzzyFilter(
        labels.value.map((l) => l.name),
        searchTerm.value
      )
    );
    const filteredValues = computed(() => {
      const lab = activeLabel.value;
      if (!lab?.values) return [];
      const names = fuzzyFilter(
        lab.values.map((v) => v.name),
        searchTerm.value
      );
      return lab.values.filter((v) => names.includes(v.name));
    });
    function toggleLabel(name) {
      const lab = labels.value.find((l) => l.name === name);
      if (!lab) return;
      lab.selected = !lab.selected;
      if (lab.selected && (!lab.values || !lab.values.length)) {
        lab.values = [{ name: ".*", selected: false }];
      }
      emit("change", buildSelector(labels.value));
    }
    function toggleValue(labelName, valueName) {
      const lab = labels.value.find((l) => l.name === labelName);
      if (!lab?.values) return;
      const v = lab.values.find((x) => x.name === valueName);
      if (!v) return;
      v.selected = !v.selected;
      if (!lab.selected) lab.selected = true;
      emit("change", buildSelector(labels.value));
    }
    function onShowLogs() {
      const sel = buildSelector(labels.value);
      emit("apply-logs", sel);
      emit("change", sel);
    }
    function onShowMetrics() {
      const sel = buildSelector(labels.value);
      const q = buildRateQuery(sel);
      emit("apply-metrics", q);
    }
    function onClear() {
      labels.value = labels.value.map((label) => ({
        ...label,
        selected: false,
        values: label.values?.map((v) => ({ ...v, selected: false }))
      }));
      searchTerm.value = "";
      status.value = "";
      validationStatus.value = "";
      emit("change", EMPTY_SELECTOR);
    }
    function onValidate() {
      const sel = buildSelector(labels.value);
      if (sel === EMPTY_SELECTOR) {
        validationStatus.value = "选择器为空";
        return;
      }
      const ok2 = /^\{[^}]*\}$/.test(sel);
      validationStatus.value = ok2 ? `有效: ${sel}` : `无效选择器: ${sel}`;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$2a, [
        createElementVNode("div", _hoisted_2$1G, [
          _cache[3] || (_cache[3] = createElementVNode(
            "strong",
            null,
            "标签浏览器",
            -1
            /* CACHED */
          )),
          createVNode(unref(Button), {
            size: "small",
            type: "text",
            "data-testid": "loki-lb-close",
            onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
          }, {
            default: withCtx(() => [..._cache[2] || (_cache[2] = [
              createTextVNode(
                "关闭",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ]),
        createVNode(unref(Input), {
          value: searchTerm.value,
          "onUpdate:value": _cache[1] || (_cache[1] = ($event) => searchTerm.value = $event),
          size: "small",
          "allow-clear": "",
          placeholder: "过滤标签 / 值…",
          "data-testid": "loki-lb-search",
          "aria-label": "Filter expression for values"
        }, null, 8, ["value"]),
        createElementVNode("div", _hoisted_3$1v, [
          createElementVNode("div", _hoisted_4$1e, [
            _cache[4] || (_cache[4] = createElementVNode(
              "div",
              { class: "lb-title" },
              "标签",
              -1
              /* CACHED */
            )),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(filteredLabelNames.value, (name) => {
                return openBlock(), createElementBlock("button", {
                  key: name,
                  type: "button",
                  class: normalizeClass(["lb-chip", { active: labels.value.find((l) => l.name === name)?.selected }]),
                  "data-testid": `loki-lb-label-${name}`,
                  onClick: ($event) => toggleLabel(name)
                }, [
                  createTextVNode(
                    toDisplayString(name) + " ",
                    1
                    /* TEXT */
                  ),
                  labels.value.find((l) => l.name === name)?.values?.length ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_6$_,
                    toDisplayString(labels.value.find((l) => l.name === name)?.values?.filter((v) => v.selected).length || 0),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ], 10, _hoisted_5$15);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ]),
          createElementVNode("div", _hoisted_7$S, [
            createElementVNode("div", {
              class: "lb-title",
              "aria-label": activeLabel.value ? `Values for ${activeLabel.value.name}` : "Values"
            }, " 值 " + toDisplayString(activeLabel.value ? `(${activeLabel.value.name})` : ""), 9, _hoisted_8$K),
            activeLabel.value ? (openBlock(true), createElementBlock(
              Fragment,
              { key: 0 },
              renderList(filteredValues.value, (v) => {
                return openBlock(), createElementBlock("button", {
                  key: v.name,
                  type: "button",
                  class: normalizeClass(["lb-chip", { active: v.selected }]),
                  "data-testid": `loki-lb-value-${v.name}`,
                  onClick: ($event) => toggleValue(activeLabel.value.name, v.name)
                }, toDisplayString(v.name), 11, _hoisted_9$H);
              }),
              128
              /* KEYED_FRAGMENT */
            )) : (openBlock(), createElementBlock("div", _hoisted_10$z, "选择标签以查看值"))
          ])
        ]),
        createElementVNode(
          "pre",
          _hoisted_11$t,
          toDisplayString(selector.value),
          1
          /* TEXT */
        ),
        createElementVNode("div", _hoisted_12$o, [
          createVNode(unref(Button), {
            size: "small",
            type: "primary",
            disabled: empty.value,
            "data-testid": "loki-lb-show-logs",
            "aria-label": "Use selector as logs button",
            onClick: onShowLogs
          }, {
            default: withCtx(() => [..._cache[5] || (_cache[5] = [
              createTextVNode(
                " 显示日志 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          }, 8, ["disabled"]),
          createVNode(unref(Button), {
            size: "small",
            disabled: empty.value,
            "data-testid": "loki-lb-show-metrics",
            "aria-label": "Use selector as metrics button",
            onClick: onShowMetrics
          }, {
            default: withCtx(() => [..._cache[6] || (_cache[6] = [
              createTextVNode(
                " 显示指标 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          }, 8, ["disabled"]),
          createVNode(unref(Button), {
            size: "small",
            "data-testid": "loki-lb-validate",
            "aria-label": "Validate submit button",
            onClick: onValidate
          }, {
            default: withCtx(() => [..._cache[7] || (_cache[7] = [
              createTextVNode(
                " 校验 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          }),
          createVNode(unref(Button), {
            size: "small",
            "data-testid": "loki-lb-clear",
            "aria-label": "Selector clear button",
            onClick: onClear
          }, {
            default: withCtx(() => [..._cache[8] || (_cache[8] = [
              createTextVNode(
                " 清除 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ]),
        validationStatus.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_13$n,
          toDisplayString(validationStatus.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        status.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_14$m,
          toDisplayString(status.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const LokiLabelBrowser = /* @__PURE__ */ _export_sfc(_sfc_main$2L, [["__scopeId", "data-v-a5dedeab"]]);
const _hoisted_1$29 = { class: "qf" };
const _hoisted_2$1F = { class: "mode-tabs" };
const _hoisted_3$1u = { class: "row" };
const _hoisted_4$1d = { class: "row" };
const _hoisted_5$14 = {
  class: "row",
  "data-testid": "loki-direction",
  "data-grafana-label": "Direction"
};
const _hoisted_6$Z = { class: "row" };
const _hoisted_7$R = {
  class: "row",
  "data-testid": "loki-step-row"
};
const _hoisted_8$J = {
  class: "row",
  "data-testid": "loki-resolution-row"
};
const _hoisted_9$G = { class: "row" };
const _sfc_main$2K = /* @__PURE__ */ defineComponent({
  __name: "LokiQueryFields",
  props: {
    query: {},
    expr: {},
    editorMode: {}
  },
  emits: ["patch", "update:expr", "set-editor-mode"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    const editorMode = computed(() => props.editorMode);
    function setEditorMode(mode2) {
      emit("set-editor-mode", mode2);
    }
    function patch(partial) {
      emit("patch", partial);
    }
    const queryTypeOptions = [
      { label: "范围", value: "range" },
      { label: "瞬时", value: "instant" },
      { label: "流", value: "stream" }
    ];
    const directionOptions = [
      { label: "向后 (Backward)", value: "backward" },
      { label: "向前 (Forward)", value: "forward" },
      { label: "扫描 (Scan)", value: "scan" }
    ];
    const showLabelBrowser = ref(false);
    function applyLogsSelector(selector) {
      emit("update:expr", selector);
      showLabelBrowser.value = false;
    }
    function applyMetricsQuery(query2) {
      emit("update:expr", query2);
      showLabelBrowser.value = false;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$29, [
        createElementVNode("div", _hoisted_2$1F, [
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: editorMode.value === "code" }),
              onClick: _cache[0] || (_cache[0] = ($event) => setEditorMode("code"))
            },
            " 代码 ",
            2
            /* CLASS */
          ),
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: editorMode.value === "builder" }),
              onClick: _cache[1] || (_cache[1] = ($event) => setEditorMode("builder"))
            },
            " 构建器 ",
            2
            /* CLASS */
          ),
          createVNode(unref(Button), {
            size: "small",
            "data-testid": "loki-label-browser-toggle",
            "data-grafana-label": "Label browser",
            onClick: _cache[2] || (_cache[2] = ($event) => showLabelBrowser.value = !showLabelBrowser.value)
          }, {
            default: withCtx(() => [
              createTextVNode(
                toDisplayString(showLabelBrowser.value ? "隐藏标签浏览器" : "标签浏览器"),
                1
                /* TEXT */
              )
            ]),
            _: 1
            /* STABLE */
          })
        ]),
        showLabelBrowser.value ? (openBlock(), createBlock(LokiLabelBrowser, {
          key: 0,
          onApplyLogs: applyLogsSelector,
          onApplyMetrics: applyMetricsQuery,
          onClose: _cache[3] || (_cache[3] = ($event) => showLabelBrowser.value = false)
        })) : createCommentVNode("v-if", true),
        editorMode.value === "code" ? (openBlock(), createBlock(unref(GCodeEditor), {
          key: 1,
          value: expr.value,
          "onUpdate:value": _cache[4] || (_cache[4] = ($event) => expr.value = $event),
          language: "logql",
          height: 140,
          "test-id": "logql-input"
        }, null, 8, ["value"])) : (openBlock(), createBlock(LogqlQueryBuilder, {
          key: 2,
          expr: expr.value,
          "onUpdate:expr": _cache[5] || (_cache[5] = ($event) => expr.value = $event)
        }, null, 8, ["expr"])),
        createElementVNode("div", _hoisted_3$1u, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "图例",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.legendFormat ?? ""),
            placeholder: "{{filename}}",
            "data-testid": "loki-legend",
            "data-grafana-label": "Legend",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ legendFormat: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$1d, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            value: String(query.value.queryType ?? "range"),
            options: queryTypeOptions,
            "data-testid": "loki-query-type",
            "data-grafana-label": "Type",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({
              queryType: $event,
              instant: $event === "instant",
              range: $event !== "instant"
            }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$14, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "方向",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            value: String(query.value.direction ?? "backward"),
            options: directionOptions,
            "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patch({ direction: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_6$Z, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "最大行数",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            value: query.value.maxLines == null ? "" : String(query.value.maxLines),
            placeholder: "auto",
            "data-testid": "loki-max-lines",
            "data-grafana-label": "Line limit",
            "onUpdate:value": _cache[9] || (_cache[9] = ($event) => patch({
              maxLines: $event === "" || $event == null ? void 0 : Number($event)
            }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_7$R, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "步长",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: query.value.step == null ? "" : String(query.value.step),
            placeholder: "auto（如 1s / 5m）",
            "data-testid": "loki-step",
            "data-grafana-label": "Step",
            "onUpdate:value": _cache[10] || (_cache[10] = ($event) => patch({ step: $event === "" ? void 0 : $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_8$J, [
          _cache[18] || (_cache[18] = createElementVNode(
            "label",
            null,
            "分辨率",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            value: String(query.value.resolution ?? 1),
            min: "1",
            "data-testid": "loki-resolution",
            "onUpdate:value": _cache[11] || (_cache[11] = ($event) => patch({ resolution: $event === "" ? 1 : Number($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_9$G, [
          _cache[19] || (_cache[19] = createElementVNode(
            "label",
            null,
            "管道操作",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "loki-pipeline-ops",
            "data-grafana-label": "Include LogQL pipeline operations",
            checked: query.value.includePipelineOps !== false,
            "onUpdate:checked": _cache[12] || (_cache[12] = ($event) => patch({ includePipelineOps: $event }))
          }, null, 8, ["checked"])
        ])
      ]);
    };
  }
});
const LokiQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2K, [["__scopeId", "data-v-514453e5"]]);
const _hoisted_1$28 = {
  class: "qf",
  "data-testid": "sql-qe"
};
const _hoisted_2$1E = { class: "row" };
const _hoisted_3$1t = { class: "row" };
const _hoisted_4$1c = { class: "row" };
const _hoisted_5$13 = {
  key: 1,
  class: "builder",
  "data-testid": "sql-builder"
};
const _hoisted_6$Y = { class: "row" };
const _hoisted_7$Q = { class: "row" };
const _hoisted_8$I = { class: "row" };
const _hoisted_9$F = {
  class: "sql-preview",
  "data-testid": "sql-preview"
};
const _hoisted_10$y = { class: "row" };
const _hoisted_11$s = { class: "row" };
const _sfc_main$2J = /* @__PURE__ */ defineComponent({
  __name: "SqlQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const isRaw = computed({
      get: () => query.value.rawQuery !== false,
      set: (v) => patch({ rawQuery: v })
    });
    const DEMO_DATASETS = ["public", "metrics", "logs", "app"];
    const DEMO_TABLES = {
      public: ["metrics", "events", "users"],
      metrics: ["cpu", "memory", "disk"],
      logs: ["access", "error"],
      app: ["requests", "traces"]
    };
    const DEMO_COLUMNS = {
      metrics: ["time", "host", "job", "value", "cpu_user", "cpu_system"],
      events: ["time", "name", "severity", "payload"],
      users: ["id", "name", "email", "created_at"],
      cpu: ["time", "instance", "usage", "mode"],
      memory: ["time", "instance", "used", "total"],
      disk: ["time", "instance", "mount", "used_bytes"],
      access: ["time", "status", "path", "bytes"],
      error: ["time", "level", "message"],
      requests: ["time", "method", "route", "latency_ms"],
      traces: ["time", "trace_id", "span", "duration"]
    };
    const datasetOptions = ref(DEMO_DATASETS.map((d) => ({ label: d, value: d })));
    const tableOptions = computed(() => {
      const ds2 = String(query.value.dataset ?? query.value.schema ?? "public");
      const tables = DEMO_TABLES[ds2] ?? DEMO_TABLES.public;
      return tables.map((t2) => ({ label: t2, value: t2 }));
    });
    const columnOptions = computed(() => {
      const table = String(query.value.table ?? "metrics");
      const cols = DEMO_COLUMNS[table] ?? DEMO_COLUMNS.metrics;
      return cols.map((c) => ({ label: c, value: c }));
    });
    const selectedColumns = ref(
      Array.isArray(query.value.selectColumns) ? query.value.selectColumns : ["time", "value"]
    );
    const whereClause = ref(
      String(query.value.whereClause ?? query.value.where ?? "")
    );
    const groupBy = ref(
      Array.isArray(query.value.groupBy) ? query.value.groupBy : []
    );
    watch(
      () => [
        query.value.selectColumns,
        query.value.whereClause,
        query.value.groupBy
      ],
      () => {
        if (Array.isArray(query.value.selectColumns))
          selectedColumns.value = query.value.selectColumns;
        if (query.value.whereClause != null)
          whereClause.value = String(query.value.whereClause);
        if (Array.isArray(query.value.groupBy))
          groupBy.value = query.value.groupBy;
      }
    );
    function quoteIdent(name) {
      if (!/^[a-zA-Z_][\w]*$/.test(name)) return `"${name.replace(/"/g, '""')}"`;
      return name;
    }
    function rebuildSql() {
      const ds2 = String(query.value.dataset ?? query.value.schema ?? "public");
      const table = String(query.value.table ?? "metrics");
      const cols = selectedColumns.value.length ? selectedColumns.value.map(quoteIdent).join(", ") : "*";
      let sql = `SELECT ${cols}
FROM ${quoteIdent(ds2)}.${quoteIdent(table)}`;
      if (whereClause.value.trim()) {
        sql += `
WHERE ${whereClause.value.trim()}`;
      }
      if (groupBy.value.length) {
        sql += `
GROUP BY ${groupBy.value.map(quoteIdent).join(", ")}`;
      }
      const timeCol = String(
        query.value.timeColumn ?? query.value.timeField ?? "time"
      );
      sql += `
ORDER BY ${quoteIdent(timeCol)} ASC`;
      emit("update:expr", sql);
      patch({
        rawSql: sql,
        selectColumns: [...selectedColumns.value],
        whereClause: whereClause.value,
        groupBy: [...groupBy.value],
        rawQuery: false
      });
    }
    async function loadMeta() {
      const api = props.datasourceApi;
      if (!api?.metricFindQuery) return;
      try {
        const schemas = await api.metricFindQuery("SHOW schemas");
        if (schemas?.length) {
          datasetOptions.value = schemas.map((r) => ({
            label: r.text,
            value: String(r.value ?? r.text)
          }));
        }
      } catch {
      }
    }
    watch(
      () => props.datasourceApi,
      () => void loadMeta(),
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$28, [
        createElementVNode("div", _hoisted_2$1E, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "数据集 / Schema",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "sql-dataset",
            "data-grafana-label": "Dataset",
            "show-search": "",
            value: String(query.value.dataset ?? query.value.schema ?? "public"),
            options: datasetOptions.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ dataset: $event, schema: $event }))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_3$1t, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "表",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "sql-table",
            "data-grafana-label": "Table",
            "show-search": "",
            value: String(query.value.table ?? ""),
            options: tableOptions.value,
            placeholder: "选择表",
            "onUpdate:value": _cache[1] || (_cache[1] = (v) => {
              patch({ table: v });
              if (!isRaw.value) rebuildSql();
            })
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_4$1c, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "原始 SQL",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "sql-raw-query",
            "data-grafana-label": "SQL",
            checked: isRaw.value,
            "onUpdate:checked": _cache[2] || (_cache[2] = (v) => {
              isRaw.value = v;
              if (!v) rebuildSql();
            })
          }, null, 8, ["checked"])
        ]),
        isRaw.value ? (openBlock(), createBlock(unref(GCodeEditor), {
          key: 0,
          value: expr.value,
          "onUpdate:value": _cache[3] || (_cache[3] = ($event) => expr.value = $event),
          language: "sql",
          height: 160,
          "test-id": "sql-input"
        }, null, 8, ["value"])) : (openBlock(), createElementBlock("div", _hoisted_5$13, [
          createElementVNode("div", _hoisted_6$Y, [
            _cache[12] || (_cache[12] = createElementVNode(
              "label",
              null,
              "列",
              -1
              /* CACHED */
            )),
            createVNode(unref(Select), {
              style: { "width": "100%" },
              "data-testid": "sql-columns",
              "data-grafana-label": "Columns",
              mode: "multiple",
              "show-search": "",
              value: selectedColumns.value,
              options: columnOptions.value,
              placeholder: "选择列",
              "onUpdate:value": _cache[4] || (_cache[4] = (v) => {
                selectedColumns.value = v ?? [];
                rebuildSql();
              })
            }, null, 8, ["value", "options"])
          ]),
          createElementVNode("div", _hoisted_7$Q, [
            _cache[13] || (_cache[13] = createElementVNode(
              "label",
              null,
              "WHERE",
              -1
              /* CACHED */
            )),
            createVNode(unref(Input), {
              "data-testid": "sql-where",
              "data-grafana-label": "Filter",
              value: whereClause.value,
              placeholder: "host = 'web-1'",
              "onUpdate:value": _cache[5] || (_cache[5] = (v) => {
                whereClause.value = v;
                rebuildSql();
              })
            }, null, 8, ["value"])
          ]),
          createElementVNode("div", _hoisted_8$I, [
            _cache[14] || (_cache[14] = createElementVNode(
              "label",
              null,
              "GROUP BY",
              -1
              /* CACHED */
            )),
            createVNode(unref(Select), {
              style: { "width": "100%" },
              "data-testid": "sql-groupby",
              "data-grafana-label": "Group by",
              mode: "multiple",
              "show-search": "",
              value: groupBy.value,
              options: columnOptions.value,
              placeholder: "分组列",
              "onUpdate:value": _cache[6] || (_cache[6] = (v) => {
                groupBy.value = v ?? [];
                rebuildSql();
              })
            }, null, 8, ["value", "options"])
          ]),
          createVNode(unref(Button), {
            size: "small",
            "data-testid": "sql-rebuild",
            onClick: rebuildSql
          }, {
            default: withCtx(() => [..._cache[15] || (_cache[15] = [
              createTextVNode(
                "生成 SQL",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          }),
          createElementVNode(
            "pre",
            _hoisted_9$F,
            toDisplayString(expr.value),
            1
            /* TEXT */
          )
        ])),
        createElementVNode("div", _hoisted_10$y, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "格式",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            value: Number(query.value.format ?? 1),
            options: unref(sqlFormatOptions),
            "data-testid": "sql-format",
            "data-grafana-label": "Format",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ format: Number($event) }))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_11$s, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "时间列",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "sql-time-column",
            "data-grafana-label": "Time column",
            "show-search": "",
            "allow-clear": "",
            value: String(query.value.timeColumn ?? query.value.timeField ?? "time"),
            options: columnOptions.value,
            "onUpdate:value": _cache[8] || (_cache[8] = (v) => {
              patch({ timeColumn: v, timeField: v });
              if (!isRaw.value) rebuildSql();
            })
          }, null, 8, ["value", "options"])
        ])
      ]);
    };
  }
});
const SqlQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2J, [["__scopeId", "data-v-c457f485"]]);
const _hoisted_1$27 = {
  class: "qf",
  "data-testid": "influx-qe"
};
const _hoisted_2$1D = { class: "row" };
const _hoisted_3$1s = { class: "row" };
const _hoisted_4$1b = { class: "row" };
const _hoisted_5$12 = { class: "row" };
const _hoisted_6$X = { class: "row" };
const _hoisted_7$P = { class: "row" };
const _hoisted_8$H = { class: "row" };
const _hoisted_9$E = { class: "row" };
const _sfc_main$2I = /* @__PURE__ */ defineComponent({
  __name: "InfluxQueryFields",
  props: {
    query: {},
    expr: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const influxFormatOptions = [
      { label: "时间序列", value: "time_series" },
      { label: "表格", value: "table" },
      { label: "日志", value: "logs" }
    ];
    const tagsText = computed({
      get: () => {
        const tags = query.value.tags;
        if (!tags) return "";
        if (typeof tags === "string") return tags;
        try {
          return JSON.stringify(tags);
        } catch {
          return "";
        }
      },
      set: (v) => {
        try {
          patch({ tags: v.trim() ? JSON.parse(v) : [] });
        } catch {
        }
      }
    });
    const groupByText = computed({
      get: () => {
        const g = query.value.groupBy;
        if (!g) return "";
        if (typeof g === "string") return g;
        try {
          return JSON.stringify(g);
        } catch {
          return "";
        }
      },
      set: (v) => {
        try {
          patch({ groupBy: v.trim() ? JSON.parse(v) : [] });
        } catch {
        }
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$27, [
        createElementVNode("div", _hoisted_2$1D, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "原始查询",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "influx-raw-query",
            "data-grafana-label": "Raw query",
            checked: !!query.value.rawQuery || !!expr.value,
            "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => patch({ rawQuery: $event }))
          }, null, 8, ["checked"])
        ]),
        query.value.rawQuery !== false ? (openBlock(), createBlock(unref(GCodeEditor), {
          key: 0,
          value: expr.value,
          "onUpdate:value": _cache[1] || (_cache[1] = ($event) => expr.value = $event),
          language: "sql",
          height: 100,
          "test-id": "influx-query"
        }, null, 8, ["value"])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_3$1s, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "策略",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "influx-policy",
            "data-grafana-label": "Policy",
            value: String(query.value.policy ?? "default"),
            placeholder: "default",
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ policy: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$1b, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "Measurement",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "influx-measurement",
            "data-grafana-label": "Measurement",
            value: String(query.value.measurement ?? ""),
            placeholder: "cpu",
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ measurement: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$12, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "Tags",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "influx-tags",
            "data-grafana-label": "Tags",
            value: tagsText.value,
            placeholder: '[{"key":"host","operator":"=","value":"server1"}]',
            "onUpdate:value": _cache[4] || (_cache[4] = (v) => tagsText.value = v)
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_6$X, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "Group By",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "influx-group-by",
            "data-grafana-label": "Group By",
            value: groupByText.value,
            placeholder: '[{"type":"time","params":["$__interval"]}]',
            "onUpdate:value": _cache[5] || (_cache[5] = (v) => groupByText.value = v)
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_7$P, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "别名",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "influx-alias",
            "data-grafana-label": "Alias by",
            value: String(query.value.alias ?? ""),
            placeholder: "$tag_host",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ alias: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_8$H, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "最小时间间隔",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "influx-min-interval",
            "data-grafana-label": "Min time interval",
            value: String(query.value.interval ?? query.value.minInterval ?? ""),
            placeholder: "10s",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ interval: $event, minInterval: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_9$E, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "格式",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "influx-format",
            "data-grafana-label": "Format as",
            value: String(query.value.resultFormat ?? "time_series"),
            options: influxFormatOptions,
            "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patch({ resultFormat: $event }))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const InfluxQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2I, [["__scopeId", "data-v-28798d85"]]);
const _hoisted_1$26 = {
  class: "qf",
  "data-testid": "graphite-qe",
  "data-grafana-label": "Query"
};
const _hoisted_2$1C = { class: "row" };
const _hoisted_3$1r = { class: "row" };
const _hoisted_4$1a = {
  class: "row segments",
  "data-testid": "graphite-segments"
};
const _hoisted_5$11 = {
  class: "funcs",
  "data-testid": "graphite-functions"
};
const _hoisted_6$W = { class: "row add-fn" };
const _hoisted_7$O = { class: "hint" };
const _sfc_main$2H = /* @__PURE__ */ defineComponent({
  __name: "GraphiteQueryFields",
  props: {
    query: {},
    expr: {},
    datasource: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const textEditor = computed({
      get: () => query.value.textEditor !== false && query.value.textEditor !== 0,
      set: (v) => patch({ textEditor: v })
    });
    const FUNC_OPTIONS = [
      { label: "alias", value: "alias" },
      { label: "scale", value: "scale" },
      { label: "movingAverage", value: "movingAverage" },
      { label: "sumSeries", value: "sumSeries" },
      { label: "averageSeries", value: "averageSeries" },
      { label: "keepLastValue", value: "keepLastValue" },
      { label: "derivative", value: "derivative" },
      { label: "nonNegativeDerivative", value: "nonNegativeDerivative" },
      { label: "absolute", value: "absolute" },
      { label: "offset", value: "offset" },
      { label: "groupByNode", value: "groupByNode" },
      { label: "sortByMaxima", value: "sortByMaxima" },
      { label: "highestMax", value: "highestMax" },
      { label: "asPercent", value: "asPercent" }
    ];
    const functions = ref([]);
    function parseFunctionsFromTarget(target) {
      const rows = [];
      let s = target.trim();
      const re = /^([a-zA-Z_][\w.]*)\((.*)\)$/;
      for (let depth = 0; depth < 12; depth++) {
        const m = s.match(re);
        if (!m) break;
        const name = m[1];
        const inner = m[2];
        let level = 0;
        let split = -1;
        for (let i = 0; i < inner.length; i++) {
          const c = inner[i];
          if (c === "(") level++;
          else if (c === ")") level--;
          else if (c === "," && level === 0) {
            split = i;
            break;
          }
        }
        if (split >= 0) {
          rows.unshift({ name, params: inner.slice(split + 1).trim() });
          s = inner.slice(0, split).trim();
        } else {
          if (FUNC_OPTIONS.some((f) => f.value === name) || name.includes(".")) {
            rows.unshift({ name, params: "" });
            s = inner;
          } else break;
        }
      }
      return rows;
    }
    function rebuildTarget(series, fns) {
      let t2 = series || "*";
      for (const f of fns) {
        if (!f.name) continue;
        t2 = f.params ? `${f.name}(${t2}, ${f.params})` : `${f.name}(${t2})`;
      }
      return t2;
    }
    const seriesPath = ref(String(props.expr || props.query.target || ""));
    watch(
      () => [props.expr, props.query.target, props.query.textEditor],
      () => {
        const t2 = String(props.expr || props.query.target || "");
        if (textEditor.value) {
          seriesPath.value = t2;
          return;
        }
        const fns = parseFunctionsFromTarget(t2);
        functions.value = fns;
        let s = t2.trim();
        for (const f of [...fns].reverse()) {
          const re = new RegExp(
            `^${f.name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\((.*)\\)$`
          );
          const m = s.match(re);
          if (m) {
            let inner = m[1];
            if (f.params) {
              const needle = f.params;
              if (inner.endsWith(needle)) {
                inner = inner.slice(0, inner.length - needle.length).replace(/,\s*$/, "");
              }
            }
            s = inner.trim();
          }
        }
        seriesPath.value = s || t2;
      },
      { immediate: true }
    );
    function applyBuilder() {
      const next = rebuildTarget(seriesPath.value, functions.value);
      emit("update:expr", next);
      patch({ target: next, textEditor: false });
    }
    function addFunction(name) {
      if (!name) return;
      functions.value = [...functions.value, { name, params: "" }];
      applyBuilder();
    }
    function removeFunction(i) {
      functions.value = functions.value.filter((_, idx) => idx !== i);
      applyBuilder();
    }
    function updateFunc(i, partial) {
      functions.value = functions.value.map(
        (f, idx) => idx === i ? { ...f, ...partial } : f
      );
      applyBuilder();
    }
    const addFuncName = ref(void 0);
    const DEMO_SEGMENTS = [
      "servers",
      "web01",
      "web02",
      "cpu",
      "idle",
      "user",
      "mem",
      "apps",
      "api",
      "requests"
    ];
    const segmentOptions = ref(
      DEMO_SEGMENTS.map((s) => ({ label: s, value: s }))
    );
    const segmentLoading = ref(false);
    async function refreshSegments(prefix) {
      segmentLoading.value = true;
      try {
        const api = props.datasource;
        if (api?.metricFindQuery) {
          const rows = await api.metricFindQuery(prefix || "*");
          segmentOptions.value = (rows ?? []).map((r) => ({
            label: r.expandable ? `${r.text}.*` : r.text,
            value: r.text
          }));
          if (segmentOptions.value.length) return;
        }
        const tree = [
          "servers.web01.cpu.idle",
          "servers.web01.cpu.user",
          "servers.web02.cpu.idle",
          "apps.api.requests",
          "apps.api.errors"
        ];
        const p = (prefix || "").replace(/\.$/, "");
        const depth = p ? p.split(".").filter(Boolean).length : 0;
        const set = /* @__PURE__ */ new Set();
        for (const m of tree) {
          const parts = m.split(".");
          if (!p) {
            set.add(parts[0]);
            continue;
          }
          if (m === p || m.startsWith(p + ".")) {
            if (parts.length > depth) set.add(parts[depth]);
          }
        }
        segmentOptions.value = [...set].map((s) => ({ label: s, value: s }));
      } finally {
        segmentLoading.value = false;
      }
    }
    function appendSegment(seg) {
      if (!seg) return;
      const cur = seriesPath.value.replace(/\.$/, "");
      seriesPath.value = cur ? `${cur}.${seg}` : seg;
      applyBuilder();
      void refreshSegments(seriesPath.value);
    }
    watch(
      () => seriesPath.value,
      (v) => {
        if (!textEditor.value) void refreshSegments(String(v || ""));
      },
      { immediate: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$26, [
        createElementVNode("div", _hoisted_2$1C, [
          _cache[5] || (_cache[5] = createElementVNode(
            "label",
            null,
            "文本编辑器",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "graphite-text-editor",
            "data-grafana-label": "Select query type",
            "data-grafana-query-label": "Query",
            checked: textEditor.value,
            "onUpdate:checked": _cache[0] || (_cache[0] = (v) => {
              textEditor.value = v;
            })
          }, null, 8, ["checked"])
        ]),
        textEditor.value ? (openBlock(), createBlock(unref(GCodeEditor), {
          key: 0,
          value: expr.value,
          "onUpdate:value": _cache[1] || (_cache[1] = ($event) => expr.value = $event),
          language: "plaintext",
          height: 100,
          "test-id": "graphite-input"
        }, null, 8, ["value"])) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createElementVNode("div", _hoisted_3$1r, [
              _cache[6] || (_cache[6] = createElementVNode(
                "label",
                null,
                "Series",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "graphite-series",
                value: seriesPath.value,
                placeholder: "servers.*.cpu.idle",
                "onUpdate:value": _cache[2] || (_cache[2] = (v) => {
                  seriesPath.value = v;
                  applyBuilder();
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_4$1a, [
              _cache[7] || (_cache[7] = createElementVNode(
                "label",
                null,
                "Segments",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                "data-testid": "graphite-segment-select",
                style: { "min-width": "180px", "flex": "1" },
                placeholder: "选择下一段路径…",
                options: segmentOptions.value,
                loading: segmentLoading.value,
                "show-search": "",
                "allow-clear": "",
                "onUpdate:value": _cache[3] || (_cache[3] = (v) => appendSegment(v))
              }, null, 8, ["options", "loading"])
            ]),
            createElementVNode("div", _hoisted_5$11, [
              _cache[9] || (_cache[9] = createElementVNode(
                "div",
                { class: "funcs-head" },
                "Functions",
                -1
                /* CACHED */
              )),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(functions.value, (f, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: i,
                    class: "func-row",
                    "data-testid": "graphite-function-row"
                  }, [
                    createVNode(unref(Select), {
                      style: { "width": "160px" },
                      value: f.name,
                      options: FUNC_OPTIONS,
                      "show-search": "",
                      "onUpdate:value": (v) => updateFunc(i, { name: v })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Input), {
                      "data-testid": "graphite-function-params",
                      style: { "flex": "1" },
                      value: f.params,
                      placeholder: "参数（逗号分隔）",
                      "onUpdate:value": (v) => updateFunc(i, { params: v })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Button), {
                      size: "small",
                      danger: "",
                      "data-testid": "graphite-function-remove",
                      onClick: ($event) => removeFunction(i)
                    }, {
                      default: withCtx(() => [..._cache[8] || (_cache[8] = [
                        createTextVNode(
                          "删除",
                          -1
                          /* CACHED */
                        )
                      ])]),
                      _: 1
                      /* STABLE */
                    }, 8, ["onClick"])
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              createElementVNode("div", _hoisted_6$W, [
                createVNode(unref(Select), {
                  "data-testid": "graphite-add-function",
                  style: { "width": "220px" },
                  placeholder: "添加函数…",
                  value: addFuncName.value,
                  options: FUNC_OPTIONS,
                  "show-search": "",
                  "allow-clear": "",
                  "onUpdate:value": _cache[4] || (_cache[4] = (v) => {
                    addFuncName.value = void 0;
                    if (v) addFunction(v);
                  })
                }, null, 8, ["value"])
              ])
            ]),
            createElementVNode(
              "div",
              _hoisted_7$O,
              "目标：" + toDisplayString(expr.value || seriesPath.value || "—"),
              1
              /* TEXT */
            )
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ]);
    };
  }
});
const GraphiteQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2H, [["__scopeId", "data-v-44e0bbd2"]]);
const _hoisted_1$25 = {
  class: "qf",
  "data-testid": "cw-qe"
};
const _hoisted_2$1B = { class: "row" };
const _hoisted_3$1q = { class: "row" };
const _hoisted_4$19 = { class: "row" };
const _hoisted_5$10 = { class: "row" };
const _hoisted_6$V = { class: "row" };
const _hoisted_7$N = { class: "row" };
const _hoisted_8$G = { class: "row" };
const _hoisted_9$D = { class: "row" };
const _hoisted_10$x = { class: "row" };
const _hoisted_11$r = { class: "row" };
const _hoisted_12$n = { class: "row" };
const _hoisted_13$m = { class: "row" };
const _hoisted_14$l = { class: "row" };
const _hoisted_15$i = { class: "row" };
const _hoisted_16$g = { class: "row" };
const _hoisted_17$e = { class: "row" };
const _hoisted_18$e = { class: "row" };
const _hoisted_19$c = {
  class: "dims",
  "data-testid": "cw-dimensions",
  "data-grafana-label": "Dimensions"
};
const _hoisted_20$b = { class: "dims-head" };
const _hoisted_21$7 = {
  key: 0,
  class: "hint"
};
const _hoisted_22$7 = { class: "row" };
const _hoisted_23$4 = { class: "row" };
const _hoisted_24$4 = { class: "row" };
const _hoisted_25$4 = { class: "row" };
const _hoisted_26$4 = { class: "row" };
const _hoisted_27$3 = { class: "row" };
const _hoisted_28$3 = { class: "row" };
const _hoisted_29$3 = { class: "row" };
const _hoisted_30$3 = { class: "row" };
const _hoisted_31$3 = {
  key: 0,
  class: "row"
};
const _hoisted_32$3 = {
  key: 1,
  class: "row"
};
const _hoisted_33$3 = { class: "row" };
const _hoisted_34$3 = {
  key: 2,
  class: "row"
};
const _hoisted_35$2 = { class: "hint" };
const _sfc_main$2G = /* @__PURE__ */ defineComponent({
  __name: "CloudWatchQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    function patch(partial) {
      emit("patch", partial);
    }
    const isLogs = computed(
      () => String(query.value.queryMode ?? "Metrics") === "Logs"
    );
    const logsModeVal = computed(
      () => String(query.value.logsMode ?? query.value.logMode ?? "Logs")
    );
    const isAnomalies = computed(
      () => isLogs.value && /Anomal/i.test(logsModeVal.value)
    );
    const isMetrics = computed(
      () => !isLogs.value && String(query.value.queryMode ?? "Metrics") !== "Annotations"
    );
    const metricQueryType = computed(
      () => String(query.value.metricQueryType ?? "Search")
    );
    const metricEditorMode = computed(
      () => String(query.value.metricEditorMode ?? "Builder")
    );
    const isSqlQuery = computed(() => /Query|SQL/i.test(metricQueryType.value));
    const isSqlBuilder = computed(
      () => isMetrics.value && isSqlQuery.value && metricEditorMode.value !== "Code"
    );
    const sqlObj = computed(
      () => query.value.sql ?? {}
    );
    function patchSql(partial) {
      patch({ sql: { ...sqlObj.value, ...partial } });
    }
    const NS_OPTIONS = [
      "AWS/EC2",
      "AWS/RDS",
      "AWS/Lambda",
      "AWS/ELB",
      "AWS/ApplicationELB",
      "AWS/S3",
      "AWS/ECS",
      "CWAgent"
    ].map((v) => ({ label: v, value: v }));
    const METRIC_BY_NS = {
      "AWS/EC2": ["CPUUtilization", "NetworkIn", "NetworkOut", "StatusCheckFailed"],
      "AWS/RDS": ["CPUUtilization", "DatabaseConnections", "FreeableMemory"],
      "AWS/Lambda": ["Invocations", "Errors", "Duration", "Throttles"],
      "AWS/ELB": ["RequestCount", "Latency", "HTTPCode_Backend_5XX"],
      "AWS/ApplicationELB": [
        "RequestCount",
        "TargetResponseTime",
        "HTTPCode_Target_5XX_Count"
      ],
      "AWS/S3": ["BucketSizeBytes", "NumberOfObjects"],
      "AWS/ECS": ["CPUUtilization", "MemoryUtilization"],
      CWAgent: ["mem_used_percent", "disk_used_percent"]
    };
    const metricOptions = computed(() => {
      const ns = String(query.value.namespace ?? "AWS/EC2");
      const list = METRIC_BY_NS[ns] ?? METRIC_BY_NS["AWS/EC2"];
      return list.map((v) => ({ label: v, value: v }));
    });
    function dimsFromQuery() {
      const d = query.value.dimensions;
      if (!d) return [];
      if (Array.isArray(d)) {
        return d.map((x) => ({
          key: String(x.key ?? x.name ?? ""),
          value: String(x.value ?? "")
        }));
      }
      if (typeof d === "object") {
        return Object.entries(d).map(([key, value]) => ({
          key,
          value: Array.isArray(value) ? value.join(",") : String(value ?? "")
        }));
      }
      return [];
    }
    const dimRows = ref(dimsFromQuery());
    watch(
      () => query.value.dimensions,
      () => {
        dimRows.value = dimsFromQuery();
      }
    );
    function commitDims(rows) {
      dimRows.value = rows;
      const obj = {};
      for (const r of rows) {
        if (!r.key.trim()) continue;
        const parts = r.value.split(",").map((s) => s.trim()).filter(Boolean);
        obj[r.key.trim()] = parts.length > 1 ? parts : parts[0] ?? "";
      }
      patch({ dimensions: obj });
    }
    function addDim() {
      commitDims([...dimRows.value, { key: "", value: "" }]);
    }
    function removeDim(i) {
      commitDims(dimRows.value.filter((_, idx) => idx !== i));
    }
    function updateDim(i, partial) {
      commitDims(
        dimRows.value.map((r, idx) => idx === i ? { ...r, ...partial } : r)
      );
    }
    const dimKeyOptions = computed(() => {
      const ns = String(query.value.namespace ?? "AWS/EC2");
      const keys = ns === "AWS/EC2" ? ["InstanceId", "ImageId", "InstanceType", "AutoScalingGroupName"] : ns === "AWS/Lambda" ? ["FunctionName", "Resource"] : ns === "AWS/RDS" ? ["DBInstanceIdentifier", "DBClusterIdentifier"] : ["Name", "Id"];
      return keys.map((k) => ({ label: k, value: k }));
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$25, [
        createElementVNode("div", _hoisted_2$1B, [
          _cache[31] || (_cache[31] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            value: String(query.value.queryMode ?? "Metrics"),
            options: unref(cloudwatchQueryTypes),
            "data-testid": "cw-query-type",
            "data-grafana-label": "Query mode",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryMode: $event }))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_3$1q, [
          _cache[32] || (_cache[32] = createElementVNode(
            "label",
            null,
            "区域",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.region ?? "default"),
            "data-testid": "cw-region",
            "data-grafana-label": "Region",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ region: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$19, [
          _cache[33] || (_cache[33] = createElementVNode(
            "label",
            null,
            "账号 ID",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "cw-account",
            "data-grafana-label": "Account",
            value: String(query.value.accountId ?? ""),
            placeholder: "optional",
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ accountId: $event || void 0 }))
          }, null, 8, ["value"])
        ]),
        isMetrics.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createElementVNode("div", _hoisted_5$10, [
              _cache[34] || (_cache[34] = createElementVNode(
                "label",
                null,
                "指标查询类型",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-metric-query-type",
                "data-grafana-label": "Metric query type",
                value: metricQueryType.value,
                options: [
                  { label: "Search", value: "Search" },
                  { label: "Query (SQL Builder)", value: "Query" }
                ],
                "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ metricQueryType: $event }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_6$V, [
              _cache[35] || (_cache[35] = createElementVNode(
                "label",
                null,
                "编辑器模式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-metric-editor-mode",
                "data-grafana-label": "Metric editor mode",
                value: metricEditorMode.value,
                options: [
                  { label: "Builder", value: "Builder" },
                  { label: "Code", value: "Code" }
                ],
                "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ metricEditorMode: $event }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_7$N, [
              _cache[36] || (_cache[36] = createElementVNode(
                "label",
                null,
                "命名空间",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-namespace",
                "data-grafana-label": "Namespace",
                "show-search": "",
                value: String(query.value.namespace ?? "AWS/EC2"),
                options: unref(NS_OPTIONS),
                "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ namespace: $event }))
              }, null, 8, ["value", "options"])
            ]),
            createElementVNode("div", _hoisted_8$G, [
              _cache[37] || (_cache[37] = createElementVNode(
                "label",
                null,
                "指标",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-metric",
                "data-grafana-label": "Metric name",
                "show-search": "",
                value: String(query.value.metricName ?? "CPUUtilization"),
                options: metricOptions.value,
                "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ metricName: $event }))
              }, null, 8, ["value", "options"])
            ]),
            createElementVNode("div", _hoisted_9$D, [
              _cache[38] || (_cache[38] = createElementVNode(
                "label",
                null,
                "统计",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-statistic",
                "data-grafana-label": "Statistic",
                value: String(query.value.statistic ?? "Average"),
                options: [
                  { label: "Average", value: "Average" },
                  { label: "Sum", value: "Sum" },
                  { label: "Minimum", value: "Minimum" },
                  { label: "Maximum", value: "Maximum" },
                  { label: "SampleCount", value: "SampleCount" },
                  { label: "p99", value: "p99" },
                  { label: "p95", value: "p95" },
                  { label: "p90", value: "p90" }
                ],
                "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ statistic: $event }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_10$x, [
              _cache[39] || (_cache[39] = createElementVNode(
                "label",
                null,
                "周期",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "cw-period",
                "data-grafana-label": "Period",
                value: String(query.value.period ?? ""),
                placeholder: "60 或 auto",
                "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patch({ period: $event }))
              }, null, 8, ["value"])
            ]),
            createCommentVNode(" Grafana SQLBuilderEditor fields when metricQueryType=Query + Builder "),
            isSqlBuilder.value ? (openBlock(), createElementBlock(
              Fragment,
              { key: 0 },
              [
                createElementVNode("div", _hoisted_11$r, [
                  _cache[40] || (_cache[40] = createElementVNode(
                    "label",
                    null,
                    "聚合",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Select), {
                    style: { "width": "100%" },
                    "data-testid": "cw-sql-aggregation",
                    "data-grafana-label": "Aggregation",
                    value: String(sqlObj.value.select?.name ?? query.value.statistic ?? "AVG"),
                    options: [
                      { label: "AVG", value: "AVG" },
                      { label: "SUM", value: "SUM" },
                      { label: "MAX", value: "MAX" },
                      { label: "MIN", value: "MIN" },
                      { label: "COUNT", value: "COUNT" }
                    ],
                    "onUpdate:value": _cache[9] || (_cache[9] = (v) => {
                      patch({ statistic: v });
                      patchSql({ select: { ...sqlObj.value.select, name: v } });
                    })
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_12$n, [
                  _cache[41] || (_cache[41] = createElementVNode(
                    "label",
                    null,
                    "With schema",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Switch), {
                    "data-testid": "cw-with-schema",
                    "data-grafana-label": "With schema",
                    checked: !!query.value.withSchema || !!sqlObj.value.withSchema,
                    "onUpdate:checked": _cache[10] || (_cache[10] = (v) => {
                      patch({ withSchema: v });
                      patchSql({ withSchema: v });
                    })
                  }, null, 8, ["checked"])
                ]),
                createElementVNode("div", _hoisted_13$m, [
                  _cache[42] || (_cache[42] = createElementVNode(
                    "label",
                    null,
                    "Schema labels",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-schema-labels",
                    "data-grafana-label": "Schema labels",
                    value: String(query.value.schemaLabels ?? sqlObj.value.schemaLabels ?? ""),
                    placeholder: "InstanceId,ImageId",
                    "onUpdate:value": _cache[11] || (_cache[11] = (v) => {
                      patch({ schemaLabels: v });
                      patchSql({ schemaLabels: v });
                    })
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_14$l, [
                  _cache[43] || (_cache[43] = createElementVNode(
                    "label",
                    null,
                    "Filter",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-sql-filter",
                    "data-grafana-label": "Filter",
                    value: String(query.value.sqlFilter ?? sqlObj.value.where ?? ""),
                    placeholder: "dimension filter expression",
                    "onUpdate:value": _cache[12] || (_cache[12] = (v) => {
                      patch({ sqlFilter: v });
                      patchSql({ where: v });
                    })
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_15$i, [
                  _cache[44] || (_cache[44] = createElementVNode(
                    "label",
                    null,
                    "Group by",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-sql-group-by",
                    "data-grafana-label": "Group by",
                    value: String(query.value.sqlGroupBy ?? sqlObj.value.groupBy ?? ""),
                    placeholder: "InstanceId",
                    "onUpdate:value": _cache[13] || (_cache[13] = (v) => {
                      patch({ sqlGroupBy: v });
                      patchSql({ groupBy: v });
                    })
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_16$g, [
                  _cache[45] || (_cache[45] = createElementVNode(
                    "label",
                    null,
                    "Order by",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-sql-order-by",
                    "data-grafana-label": "Order by",
                    value: String(query.value.sqlOrderBy ?? sqlObj.value.orderBy ?? ""),
                    placeholder: "AVG()",
                    "onUpdate:value": _cache[14] || (_cache[14] = (v) => {
                      patch({ sqlOrderBy: v });
                      patchSql({ orderBy: v });
                    })
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_17$e, [
                  _cache[46] || (_cache[46] = createElementVNode(
                    "label",
                    null,
                    "Direction",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Select), {
                    style: { "width": "100%" },
                    "data-testid": "cw-sql-direction",
                    "data-grafana-label": "Direction",
                    value: String(
                      query.value.sqlOrderDirection ?? sqlObj.value.orderDirection ?? "DESC"
                    ),
                    options: [
                      { label: "DESC", value: "DESC" },
                      { label: "ASC", value: "ASC" }
                    ],
                    "onUpdate:value": _cache[15] || (_cache[15] = (v) => {
                      patch({ sqlOrderDirection: v });
                      patchSql({ orderDirection: v });
                    })
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_18$e, [
                  _cache[47] || (_cache[47] = createElementVNode(
                    "label",
                    null,
                    "Limit",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    type: "number",
                    "data-testid": "cw-sql-limit",
                    "data-grafana-label": "Limit",
                    value: String(query.value.sqlLimit ?? sqlObj.value.limit ?? ""),
                    placeholder: "optional",
                    "onUpdate:value": _cache[16] || (_cache[16] = (v) => {
                      const n = v === "" ? void 0 : Number(v);
                      patch({ sqlLimit: n });
                      patchSql({ limit: n });
                    })
                  }, null, 8, ["value"])
                ])
              ],
              64
              /* STABLE_FRAGMENT */
            )) : createCommentVNode("v-if", true),
            createElementVNode("div", _hoisted_19$c, [
              createElementVNode("div", _hoisted_20$b, [
                _cache[49] || (_cache[49] = createElementVNode(
                  "span",
                  null,
                  "维度",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(Button), {
                  size: "small",
                  "data-testid": "cw-add-dimension",
                  onClick: addDim
                }, {
                  default: withCtx(() => [..._cache[48] || (_cache[48] = [
                    createTextVNode(
                      "添加维度",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })
              ]),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(dimRows.value, (row, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: i,
                    class: "dim-row",
                    "data-testid": "cw-dimension-row"
                  }, [
                    createVNode(unref(Select), {
                      style: { "width": "160px" },
                      "data-testid": "cw-dimension-key",
                      "show-search": "",
                      value: row.key || void 0,
                      options: dimKeyOptions.value,
                      placeholder: "键",
                      "onUpdate:value": (v) => updateDim(i, { key: v })
                    }, null, 8, ["value", "options", "onUpdate:value"]),
                    createVNode(unref(Input), {
                      "data-testid": "cw-dimension-value",
                      style: { "flex": "1" },
                      value: row.value,
                      placeholder: "值（逗号分隔）",
                      "onUpdate:value": (v) => updateDim(i, { value: v })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Button), {
                      size: "small",
                      danger: "",
                      "data-testid": "cw-remove-dimension",
                      onClick: ($event) => removeDim(i)
                    }, {
                      default: withCtx(() => [..._cache[50] || (_cache[50] = [
                        createTextVNode(
                          "删除",
                          -1
                          /* CACHED */
                        )
                      ])]),
                      _: 1
                      /* STABLE */
                    }, 8, ["onClick"])
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              !dimRows.value.length ? (openBlock(), createElementBlock("div", _hoisted_21$7, "无维度过滤")) : createCommentVNode("v-if", true)
            ]),
            createElementVNode("div", _hoisted_22$7, [
              _cache[51] || (_cache[51] = createElementVNode(
                "label",
                null,
                "精确匹配",
                -1
                /* CACHED */
              )),
              createVNode(unref(Switch), {
                "data-testid": "cw-match-exact",
                "data-grafana-label": "Match exact",
                checked: query.value.matchExact !== false,
                "onUpdate:checked": _cache[17] || (_cache[17] = ($event) => patch({ matchExact: $event }))
              }, null, 8, ["checked"])
            ]),
            createElementVNode("div", _hoisted_23$4, [
              _cache[52] || (_cache[52] = createElementVNode(
                "label",
                null,
                "ID",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "cw-id",
                "data-grafana-label": "ID",
                value: String(query.value.id ?? ""),
                placeholder: "e1 (可选，用于 SEARCH/MATH 引用)",
                "onUpdate:value": _cache[18] || (_cache[18] = ($event) => patch({ id: $event || void 0 }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_24$4, [
              _cache[53] || (_cache[53] = createElementVNode(
                "label",
                null,
                "Label",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "cw-label",
                "data-grafana-label": "Label",
                value: String(query.value.label ?? query.value.alias ?? ""),
                placeholder: "{{metric}} / dynamic label",
                "onUpdate:value": _cache[19] || (_cache[19] = ($event) => patch({ label: $event, alias: $event }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_25$4, [
              _cache[54] || (_cache[54] = createElementVNode(
                "label",
                null,
                "别名",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "cw-alias",
                value: String(query.value.alias ?? ""),
                placeholder: "{{metric}}",
                "onUpdate:value": _cache[20] || (_cache[20] = ($event) => patch({ alias: $event }))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        isLogs.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createElementVNode("div", _hoisted_26$4, [
              _cache[55] || (_cache[55] = createElementVNode(
                "label",
                null,
                "日志模式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-logs-mode",
                "data-grafana-label": "Logs Mode",
                value: String(query.value.logsMode ?? query.value.logMode ?? "Logs"),
                options: [
                  { label: "Logs", value: "Logs" },
                  { label: "Logs Insights", value: "Insights" },
                  { label: "Anomalies", value: "Anomalies" }
                ],
                "onUpdate:value": _cache[21] || (_cache[21] = ($event) => patch({ logsMode: $event, logMode: $event }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_27$3, [
              _cache[56] || (_cache[56] = createElementVNode(
                "label",
                null,
                "查询语言",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "cw-query-language",
                "data-grafana-label": "Query language",
                value: String(query.value.queryLanguage ?? "CWLI"),
                options: [
                  { label: "CWLI", value: "CWLI" },
                  { label: "SQL", value: "SQL" },
                  { label: "PPL", value: "PPL" }
                ],
                "onUpdate:value": _cache[22] || (_cache[22] = ($event) => patch({ queryLanguage: $event }))
              }, null, 8, ["value"])
            ]),
            isAnomalies.value ? (openBlock(), createElementBlock(
              Fragment,
              { key: 0 },
              [
                createElementVNode("div", _hoisted_28$3, [
                  _cache[57] || (_cache[57] = createElementVNode(
                    "label",
                    null,
                    "Anomaly Detection ARN",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-anomaly-arn",
                    "data-grafana-label": "Anomaly Detection ARN",
                    value: String(query.value.anomalyDetectionARN ?? ""),
                    placeholder: "arn:aws:logs:…:anomaly-detector/…",
                    "onUpdate:value": _cache[23] || (_cache[23] = ($event) => patch({ anomalyDetectionARN: $event || void 0 }))
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_29$3, [
                  _cache[58] || (_cache[58] = createElementVNode(
                    "label",
                    null,
                    "Supression state",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Select), {
                    style: { "width": "100%" },
                    "data-testid": "cw-suppression-state",
                    "data-grafana-label": "Supression state",
                    value: String(query.value.suppressionState ?? "all"),
                    options: [
                      { label: "All", value: "all" },
                      { label: "Suppressed", value: "suppressed" },
                      { label: "Unsuppressed", value: "unsuppressed" }
                    ],
                    "onUpdate:value": _cache[24] || (_cache[24] = ($event) => patch({ suppressionState: $event }))
                  }, null, 8, ["value"])
                ])
              ],
              64
              /* STABLE_FRAGMENT */
            )) : (openBlock(), createElementBlock(
              Fragment,
              { key: 1 },
              [
                createCommentVNode(" Grafana LogGroupsField: Query scope / Prefixes / Class / Accounts / Log groups "),
                createElementVNode("div", _hoisted_30$3, [
                  _cache[59] || (_cache[59] = createElementVNode(
                    "label",
                    null,
                    "Query scope",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Select), {
                    style: { "width": "100%" },
                    "data-testid": "cw-query-scope",
                    "data-grafana-label": "Query scope",
                    value: String(query.value.logsQueryScope ?? "logGroupName"),
                    options: [
                      { label: "Log group name", value: "logGroupName" },
                      { label: "Name prefix", value: "namePrefix" },
                      { label: "All log groups", value: "allLogGroups" }
                    ],
                    "onUpdate:value": _cache[25] || (_cache[25] = ($event) => patch({ logsQueryScope: $event }))
                  }, null, 8, ["value"])
                ]),
                String(query.value.logsQueryScope ?? "logGroupName") === "namePrefix" ? (openBlock(), createElementBlock("div", _hoisted_31$3, [
                  _cache[60] || (_cache[60] = createElementVNode(
                    "label",
                    null,
                    "Prefixes",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-log-group-prefixes",
                    "data-grafana-label": "Prefixes",
                    value: String(
                      Array.isArray(query.value.logGroupPrefixes) ? query.value.logGroupPrefixes.join(",") : query.value.logGroupPrefixes ?? ""
                    ),
                    placeholder: "/aws/lambda/,/aws/ecs/",
                    "onUpdate:value": _cache[26] || (_cache[26] = (v) => {
                      const prefixes = String(v || "").split(",").map((s) => s.trim()).filter(Boolean);
                      patch({ logGroupPrefixes: prefixes });
                    })
                  }, null, 8, ["value"])
                ])) : createCommentVNode("v-if", true),
                String(query.value.logsQueryScope ?? "logGroupName") === "namePrefix" || String(query.value.logsQueryScope ?? "") === "allLogGroups" ? (openBlock(), createElementBlock("div", _hoisted_32$3, [
                  _cache[61] || (_cache[61] = createElementVNode(
                    "label",
                    null,
                    "Class",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Select), {
                    style: { "width": "100%" },
                    "data-testid": "cw-log-group-class",
                    "data-grafana-label": "Class",
                    value: String(query.value.logGroupClass ?? "STANDARD"),
                    options: [
                      { label: "Standard", value: "STANDARD" },
                      { label: "Infrequent Access", value: "INFREQUENT_ACCESS" }
                    ],
                    "onUpdate:value": _cache[27] || (_cache[27] = ($event) => patch({ logGroupClass: $event }))
                  }, null, 8, ["value"])
                ])) : createCommentVNode("v-if", true),
                createElementVNode("div", _hoisted_33$3, [
                  _cache[62] || (_cache[62] = createElementVNode(
                    "label",
                    null,
                    "Accounts",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-accounts",
                    "data-grafana-label": "Accounts",
                    value: String(
                      Array.isArray(query.value.accountIds) ? query.value.accountIds.join(",") : Array.isArray(query.value.selectedAccountIds) ? query.value.selectedAccountIds.join(",") : query.value.accountIds ?? query.value.selectedAccountIds ?? ""
                    ),
                    placeholder: "123456789012, or template $account",
                    "onUpdate:value": _cache[28] || (_cache[28] = (v) => {
                      const ids = String(v || "").split(",").map((s) => s.trim()).filter(Boolean);
                      patch({ accountIds: ids, selectedAccountIds: ids });
                    })
                  }, null, 8, ["value"])
                ]),
                String(query.value.logsQueryScope ?? "logGroupName") === "logGroupName" ? (openBlock(), createElementBlock("div", _hoisted_34$3, [
                  _cache[63] || (_cache[63] = createElementVNode(
                    "label",
                    null,
                    "日志组",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Input), {
                    "data-testid": "cw-log-groups",
                    "data-grafana-label": "Log groups",
                    value: String(
                      Array.isArray(query.value.logGroups) ? query.value.logGroups.map((g) => g.name || g).join(",") : query.value.logGroupNames ? query.value.logGroupNames.join?.(",") || query.value.logGroupNames : ""
                    ),
                    placeholder: "/aws/lambda/fn1,/aws/lambda/fn2",
                    "onUpdate:value": _cache[29] || (_cache[29] = (v) => {
                      const names = String(v || "").split(",").map((s) => s.trim()).filter(Boolean);
                      patch({
                        logGroupNames: names,
                        logGroups: names.map((name) => ({ name }))
                      });
                    })
                  }, null, 8, ["value"])
                ])) : createCommentVNode("v-if", true)
              ],
              64
              /* STABLE_FRAGMENT */
            ))
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        createVNode(unref(GCodeEditor), {
          value: String(query.value.expression ?? query.value.query ?? ""),
          language: "plaintext",
          height: 100,
          "test-id": "cw-expression",
          "data-testid": "cw-expression",
          "data-grafana-label": "Expression",
          "onUpdate:value": _cache[30] || (_cache[30] = ($event) => patch({ expression: $event, query: $event }))
        }, null, 8, ["value"]),
        createElementVNode(
          "div",
          _hoisted_35$2,
          toDisplayString(unref(cwPlaceholder)),
          1
          /* TEXT */
        )
      ]);
    };
  }
});
const CloudWatchQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2G, [["__scopeId", "data-v-e2b81ab8"]]);
const _hoisted_1$24 = ["data-scenario"];
const _hoisted_2$1A = { class: "row" };
const _hoisted_3$1p = { class: "row" };
const _hoisted_4$18 = { class: "row" };
const _hoisted_5$$ = { class: "row" };
const _hoisted_6$U = { class: "row" };
const _hoisted_7$M = { class: "row" };
const _hoisted_8$F = { class: "row" };
const _hoisted_9$C = { class: "row" };
const _hoisted_10$w = { class: "row" };
const _hoisted_11$q = {
  key: 1,
  class: "row"
};
const _hoisted_12$m = {
  key: 2,
  class: "row"
};
const _hoisted_13$l = {
  key: 3,
  class: "hint",
  "data-testid": "testdata-graph-hint"
};
const _hoisted_14$k = { class: "row" };
const _hoisted_15$h = {
  key: 4,
  class: "row"
};
const _hoisted_16$f = { class: "row" };
const _hoisted_17$d = {
  key: 5,
  class: "row"
};
const _hoisted_18$d = {
  key: 6,
  class: "row"
};
const _hoisted_19$b = {
  key: 7,
  class: "row"
};
const _hoisted_20$a = {
  key: 8,
  class: "row"
};
const _hoisted_21$6 = {
  key: 9,
  class: "row"
};
const _hoisted_22$6 = {
  key: 10,
  class: "row"
};
const _hoisted_23$3 = {
  key: 11,
  class: "row"
};
const _hoisted_24$3 = {
  key: 12,
  class: "row"
};
const _hoisted_25$3 = { class: "row" };
const _hoisted_26$3 = { class: "row" };
const _hoisted_27$2 = { class: "row" };
const _hoisted_28$2 = { class: "row" };
const _hoisted_29$2 = { class: "row" };
const _hoisted_30$2 = { class: "row" };
const _hoisted_31$2 = { class: "row" };
const _hoisted_32$2 = { class: "row" };
const _hoisted_33$2 = { class: "row" };
const _hoisted_34$2 = { class: "row" };
const _sfc_main$2F = /* @__PURE__ */ defineComponent({
  __name: "TestdataQueryFields",
  props: {
    query: {}
  },
  emits: ["patch"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    function patch(partial) {
      emit("patch", partial);
    }
    const scenario = computed(
      () => String(query.value.scenarioId ?? "random_walk")
    );
    const isCsv = computed(() => /csv/i.test(scenario.value));
    const isLogs = computed(() => scenario.value === "logs");
    const isPulse = computed(() => /pulse|wave|predictable/i.test(scenario.value));
    const isNode = computed(() => scenario.value === "node_graph");
    const isFlame = computed(() => scenario.value === "flame_graph");
    const isTrace = computed(() => scenario.value === "trace");
    const isFlaky = computed(() => scenario.value === "flaky_query");
    const isSimulation = computed(() => scenario.value === "simulation");
    const isLive = computed(
      () => scenario.value === "live" || scenario.value === "streaming_client"
    );
    const isRandomWalk = computed(
      () => scenario.value === "random_walk" || scenario.value === "random_walk_table"
    );
    const isUsa = computed(() => scenario.value === "usa");
    const isNodeGraph = computed(() => scenario.value === "node_graph");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "qf",
        "data-testid": "testdata-query-fields",
        "data-scenario": scenario.value
      }, [
        createElementVNode("div", _hoisted_2$1A, [
          _cache[32] || (_cache[32] = createElementVNode(
            "label",
            null,
            "场景",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            value: scenario.value,
            "data-testid": "testdata-scenario",
            "data-grafana-label": "Scenario",
            options: [
              { label: "随机游走", value: "random_walk" },
              { label: "随机游走表格", value: "random_walk_table" },
              { label: "慢查询", value: "slow_query" },
              { label: "无数据", value: "no_data" },
              { label: "CSV 指标值", value: "csv_metric_values" },
              { label: "CSV 文件", value: "csv_file" },
              { label: "可预测脉冲", value: "predictable_pulse" },
              { label: "可预测波形", value: "predictable_csv_wave" },
              { label: "日志", value: "logs" },
              { label: "节点图", value: "node_graph" },
              { label: "火焰图", value: "flame_graph" },
              { label: "追踪", value: "trace" },
              { label: "USA 统计", value: "usa" },
              { label: "服务器错误模拟", value: "server_error_500" },
              { label: "手动输入", value: "manual_entry" },
              { label: "数据流", value: "streaming_client" },
              { label: "Grafana 实时", value: "live" },
              { label: "箭头数据帧", value: "arrow" },
              { label: "不稳定查询", value: "flaky_query" },
              { label: "仿真", value: "simulation" },
              { label: "阶梯", value: "steps" },
              { label: "注解", value: "annotations" },
              { label: "原始帧", value: "raw_frame" }
            ],
            "show-search": "",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ scenarioId: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1p, [
          _cache[33] || (_cache[33] = createElementVNode(
            "label",
            null,
            "别名",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.alias ?? ""),
            "data-testid": "testdata-alias",
            "data-grafana-label": "Alias",
            placeholder: "序列别名",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ alias: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$18, [
          _cache[34] || (_cache[34] = createElementVNode(
            "label",
            null,
            "序列数",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            value: String(query.value.seriesCount ?? 1),
            "data-testid": "testdata-series-count",
            "data-grafana-label": "Count",
            "data-grafana-label-alt": "Series count",
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ seriesCount: Number($event) || 1 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$$, [
          _cache[35] || (_cache[35] = createElementVNode(
            "label",
            null,
            "噪声",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            "data-testid": "testdata-noise",
            "data-grafana-label": "Noise",
            value: String(query.value.noise ?? 0),
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ noise: Number($event) || 0 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_6$U, [
          _cache[36] || (_cache[36] = createElementVNode(
            "label",
            null,
            "离散度",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            "data-testid": "testdata-spread",
            "data-grafana-label": "Spread",
            value: String(query.value.spread ?? 10),
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ spread: Number($event) || 0 }))
          }, null, 8, ["value"])
        ]),
        isRandomWalk.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createElementVNode("div", _hoisted_7$M, [
              _cache[37] || (_cache[37] = createElementVNode(
                "label",
                null,
                "起始值",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                type: "number",
                "data-testid": "testdata-start-value",
                "data-grafana-label": "Start value",
                value: query.value.startValue == null ? "" : String(query.value.startValue),
                placeholder: "自动",
                "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ startValue: $event === "" ? void 0 : Number($event) }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_8$F, [
              _cache[38] || (_cache[38] = createElementVNode(
                "label",
                null,
                "最小值",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                type: "number",
                "data-testid": "testdata-min",
                "data-grafana-label": "Min",
                value: query.value.min == null ? "" : String(query.value.min),
                placeholder: "无",
                "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ min: $event === "" ? void 0 : Number($event) }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_9$C, [
              _cache[39] || (_cache[39] = createElementVNode(
                "label",
                null,
                "最大值",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                type: "number",
                "data-testid": "testdata-max",
                "data-grafana-label": "Max",
                value: query.value.max == null ? "" : String(query.value.max),
                placeholder: "无",
                "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ max: $event === "" ? void 0 : Number($event) }))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_10$w, [
          _cache[40] || (_cache[40] = createElementVNode(
            "label",
            null,
            "点数",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            "data-testid": "testdata-points",
            "data-grafana-label": "Values",
            value: String(query.value.points ?? query.value.lines ?? ""),
            placeholder: "自动",
            "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patch({
              points: $event === "" ? void 0 : Number($event),
              lines: $event === "" ? void 0 : Number($event)
            }))
          }, null, 8, ["value"])
        ]),
        isCsv.value || isPulse.value ? (openBlock(), createElementBlock("div", _hoisted_11$q, [
          _cache[41] || (_cache[41] = createElementVNode(
            "label",
            null,
            "CSV 值",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(query.value.stringInput ?? query.value.csvFileName ?? ""),
            placeholder: "1,20,90,30,5,0",
            "data-testid": "testdata-csv",
            "onUpdate:value": _cache[9] || (_cache[9] = ($event) => patch({ stringInput: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isLogs.value ? (openBlock(), createElementBlock("div", _hoisted_12$m, [
          _cache[42] || (_cache[42] = createElementVNode(
            "label",
            null,
            "日志行数",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            "data-testid": "testdata-lines",
            "data-grafana-label": "Lines",
            value: String(query.value.lines ?? 10),
            "onUpdate:value": _cache[10] || (_cache[10] = ($event) => patch({ lines: Number($event) || 10 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isNode.value || isFlame.value || isTrace.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_13$l,
          " 场景「" + toDisplayString(scenario.value) + "」会生成对应面板的演示结构数据（节点/火焰/追踪）。 ",
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_14$k, [
          _cache[43] || (_cache[43] = createElementVNode(
            "label",
            null,
            "丢弃 %",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            "data-testid": "testdata-drop-percent",
            "data-grafana-label": "Drop",
            value: String(query.value.dropPercent ?? 0),
            "onUpdate:value": _cache[11] || (_cache[11] = ($event) => patch({ dropPercent: Number($event) || 0 }))
          }, null, 8, ["value"])
        ]),
        isRandomWalk.value || isPulse.value ? (openBlock(), createElementBlock("div", _hoisted_15$h, [
          _cache[44] || (_cache[44] = createElementVNode(
            "label",
            null,
            "标签",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-labels",
            "data-grafana-label": "Labels",
            value: String(query.value.labels ?? ""),
            placeholder: "key=value, key2=value",
            "onUpdate:value": _cache[12] || (_cache[12] = ($event) => patch({ labels: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_16$f, [
          _cache[45] || (_cache[45] = createElementVNode(
            "label",
            null,
            "带标签",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            style: { width: "46px" },
            "data-testid": "testdata-with-labels",
            "data-grafana-label": "Labels",
            checked: !!query.value.withLabels,
            "onUpdate:checked": _cache[13] || (_cache[13] = ($event) => patch({ withLabels: $event }))
          }, null, 8, ["checked"])
        ]),
        isFlaky.value ? (openBlock(), createElementBlock("div", _hoisted_17$d, [
          _cache[46] || (_cache[46] = createElementVNode(
            "label",
            null,
            "错误率",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            "data-testid": "testdata-error-rate",
            "data-grafana-label": "Error rate",
            value: String(query.value.errorRate ?? 0),
            placeholder: "0-100",
            "onUpdate:value": _cache[14] || (_cache[14] = ($event) => patch({ errorRate: Number($event) || 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isFlaky.value ? (openBlock(), createElementBlock("div", _hoisted_18$d, [
          _cache[47] || (_cache[47] = createElementVNode(
            "label",
            null,
            "状态码",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-status-code",
            "data-grafana-label": "Status code",
            value: String(query.value.statusCode ?? 500),
            "onUpdate:value": _cache[15] || (_cache[15] = ($event) => patch({ statusCode: Number($event) || 500 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isFlaky.value ? (openBlock(), createElementBlock("div", _hoisted_19$b, [
          _cache[48] || (_cache[48] = createElementVNode(
            "label",
            null,
            "错误来源",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "testdata-error-source",
            "data-grafana-label": "Error source",
            value: String(query.value.errorSource ?? "plugin"),
            options: [
              { label: "插件", value: "plugin" },
              { label: "下游", value: "downstream" }
            ],
            "onUpdate:value": _cache[16] || (_cache[16] = ($event) => patch({ errorSource: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isFlaky.value ? (openBlock(), createElementBlock("div", _hoisted_20$a, [
          _cache[49] || (_cache[49] = createElementVNode(
            "label",
            null,
            "查询延迟",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-query-delay",
            "data-grafana-label": "Query delay",
            value: String(query.value.queryDelay ?? ""),
            placeholder: "1s",
            "onUpdate:value": _cache[17] || (_cache[17] = ($event) => patch({ queryDelay: $event || void 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isFlaky.value ? (openBlock(), createElementBlock("div", _hoisted_21$6, [
          _cache[50] || (_cache[50] = createElementVNode(
            "label",
            null,
            "延迟波动",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-delay-variability",
            "data-grafana-label": "Delay variability",
            value: String(query.value.delayVariability ?? ""),
            placeholder: "0.5",
            "onUpdate:value": _cache[18] || (_cache[18] = ($event) => patch({ delayVariability: $event || void 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isFlaky.value ? (openBlock(), createElementBlock("div", _hoisted_22$6, [
          _cache[51] || (_cache[51] = createElementVNode(
            "label",
            null,
            "错误消息",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-error-message",
            "data-grafana-label": "Error message",
            value: String(query.value.errorMessage ?? ""),
            placeholder: "模拟错误",
            "onUpdate:value": _cache[19] || (_cache[19] = ($event) => patch({ errorMessage: $event || void 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isSimulation.value || isPulse.value ? (openBlock(), createElementBlock("div", _hoisted_23$3, [
          _cache[52] || (_cache[52] = createElementVNode(
            "label",
            null,
            "间隔",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-interval",
            "data-grafana-label": "Interval",
            value: String(query.value.interval ?? query.value.stream?.interval ?? ""),
            placeholder: "1s",
            "onUpdate:value": _cache[20] || (_cache[20] = ($event) => patch({ interval: $event || void 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isLive.value ? (openBlock(), createElementBlock("div", _hoisted_24$3, [
          _cache[53] || (_cache[53] = createElementVNode(
            "label",
            null,
            "通道",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "testdata-channel",
            "data-grafana-label": "Channel",
            value: String(query.value.channel ?? ""),
            placeholder: "plugin/testdata/…",
            "onUpdate:value": _cache[21] || (_cache[21] = ($event) => patch({ channel: $event || void 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        isUsa.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 13 },
          [
            createElementVNode("div", _hoisted_25$3, [
              _cache[54] || (_cache[54] = createElementVNode(
                "label",
                null,
                "模式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "testdata-usa-mode",
                "data-grafana-label": "Mode",
                value: String(query.value.usa?.mode ?? query.value.mode ?? "timeseries"),
                options: [
                  { label: "时序", value: "timeseries" },
                  { label: "表格", value: "table" }
                ],
                "onUpdate:value": _cache[22] || (_cache[22] = (v) => patch({ mode: v, usa: { ...query.value.usa, mode: v } }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_26$3, [
              _cache[55] || (_cache[55] = createElementVNode(
                "label",
                null,
                "周期",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "testdata-usa-period",
                "data-grafana-label": "Period",
                value: String(query.value.usa?.period ?? query.value.period ?? ""),
                placeholder: "10m",
                "onUpdate:value": _cache[23] || (_cache[23] = (v) => patch({ period: v, usa: { ...query.value.usa, period: v } }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_27$2, [
              _cache[56] || (_cache[56] = createElementVNode(
                "label",
                null,
                "字段",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "testdata-usa-fields",
                "data-grafana-label": "Fields",
                value: String(query.value.usa?.fields ?? query.value.fields ?? ""),
                placeholder: "foo,bar",
                "onUpdate:value": _cache[24] || (_cache[24] = (v) => patch({ fields: v, usa: { ...query.value.usa, fields: v } }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_28$2, [
              _cache[57] || (_cache[57] = createElementVNode(
                "label",
                null,
                "州/省",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "testdata-usa-states",
                "data-grafana-label": "States",
                value: String(query.value.usa?.states ?? query.value.states ?? ""),
                placeholder: "CA,NY",
                "onUpdate:value": _cache[25] || (_cache[25] = (v) => patch({ states: v, usa: { ...query.value.usa, states: v } }))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        isSimulation.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 14 },
          [
            createElementVNode("div", _hoisted_29$2, [
              _cache[58] || (_cache[58] = createElementVNode(
                "label",
                null,
                "仿真",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "testdata-simulation",
                "data-grafana-label": "Simulation",
                value: String(query.value.sim?.type ?? query.value.simulation ?? ""),
                placeholder: "flight",
                "onUpdate:value": _cache[26] || (_cache[26] = (v) => patch({ simulation: v, sim: { ...query.value.sim, type: v } }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_30$2, [
              _cache[59] || (_cache[59] = createElementVNode(
                "label",
                null,
                "流式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Switch), {
                "data-testid": "testdata-stream",
                "data-grafana-label": "Stream",
                checked: !!(query.value.stream?.enabled ?? query.value.streamEnabled),
                "onUpdate:checked": _cache[27] || (_cache[27] = (v) => patch({
                  streamEnabled: v,
                  stream: { ...query.value.stream, enabled: v }
                }))
              }, null, 8, ["checked"])
            ]),
            createElementVNode("div", _hoisted_31$2, [
              _cache[60] || (_cache[60] = createElementVNode(
                "label",
                null,
                "仅最后",
                -1
                /* CACHED */
              )),
              createVNode(unref(Switch), {
                "data-testid": "testdata-last",
                "data-grafana-label": "Last",
                checked: !!query.value.last,
                "onUpdate:checked": _cache[28] || (_cache[28] = ($event) => patch({ last: $event }))
              }, null, 8, ["checked"])
            ]),
            createElementVNode("div", _hoisted_32$2, [
              _cache[61] || (_cache[61] = createElementVNode(
                "label",
                null,
                "UID",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "testdata-uid",
                "data-grafana-label": "UID",
                value: String(query.value.uid ?? query.value.sim?.uid ?? ""),
                placeholder: "仿真 UID",
                "onUpdate:value": _cache[29] || (_cache[29] = (v) => patch({
                  uid: v || void 0,
                  sim: { ...query.value.sim, uid: v }
                }))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        isNodeGraph.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 15 },
          [
            createElementVNode("div", _hoisted_33$2, [
              _cache[62] || (_cache[62] = createElementVNode(
                "label",
                null,
                "数据类型",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "testdata-node-data-type",
                "data-grafana-label": "Data type",
                value: String(query.value.nodes?.type ?? query.value.nodeType ?? "random"),
                options: [
                  { label: "随机", value: "random" },
                  { label: "小型响应", value: "response_small" },
                  { label: "中型响应", value: "response_medium" }
                ],
                "onUpdate:value": _cache[30] || (_cache[30] = (v) => patch({
                  nodeType: v,
                  nodes: { ...query.value.nodes, type: v }
                }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_34$2, [
              _cache[63] || (_cache[63] = createElementVNode(
                "label",
                null,
                "种子",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                type: "number",
                "data-testid": "testdata-seed",
                "data-grafana-label": "Seed",
                value: query.value.nodes?.seed == null && query.value.seed == null ? "" : String(query.value.nodes?.seed ?? query.value.seed),
                "onUpdate:value": _cache[31] || (_cache[31] = (v) => {
                  const n = v === "" ? void 0 : Number(v);
                  patch({ seed: n, nodes: { ...query.value.nodes, seed: n } });
                })
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$24);
    };
  }
});
const TestdataQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2F, [["__scopeId", "data-v-e43eaae2"]]);
const _hoisted_1$23 = {
  class: "qf",
  "data-testid": "es-qe"
};
const _hoisted_2$1z = { class: "row" };
const _hoisted_3$1o = {
  class: "row",
  "data-testid": "es-field-browser",
  "data-grafana-label": "Field"
};
const _hoisted_4$17 = {
  class: "section",
  "data-testid": "es-metrics",
  "data-grafana-label": "Metrics"
};
const _hoisted_5$_ = { class: "section-head" };
const _hoisted_6$T = { class: "section-actions" };
const _hoisted_7$L = {
  class: "section",
  "data-testid": "es-bucket-aggs",
  "data-grafana-label": "Group by"
};
const _hoisted_8$E = { class: "section-head" };
const _hoisted_9$B = {
  key: 0,
  class: "hint"
};
const _hoisted_10$v = { class: "row" };
const _hoisted_11$p = { class: "row" };
const _hoisted_12$l = { class: "row" };
const _hoisted_13$k = { class: "row" };
const _sfc_main$2E = /* @__PURE__ */ defineComponent({
  __name: "ElasticsearchQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const METRIC_TYPES = [
      { label: "Count", value: "count" },
      { label: "Average", value: "avg" },
      { label: "Sum", value: "sum" },
      { label: "Max", value: "max" },
      { label: "Min", value: "min" },
      { label: "Extended Stats", value: "extended_stats" },
      { label: "Percentiles", value: "percentiles" },
      { label: "Cardinality", value: "cardinality" },
      { label: "Raw Document", value: "raw_document" },
      { label: "Raw Data", value: "raw_data" },
      { label: "Logs", value: "logs" },
      { label: "Rate", value: "rate" },
      { label: "Top Metrics", value: "top_metrics" },
      // Pipeline aggregations (grafana PipelineAggregations)
      { label: "Derivative", value: "derivative" },
      { label: "Cumulative Sum", value: "cumulative_sum" },
      { label: "Moving Average", value: "moving_avg" },
      { label: "Moving Function", value: "moving_fn" },
      { label: "Serial Diff", value: "serial_diff" },
      { label: "Bucket Script", value: "bucket_script" }
    ];
    const PIPELINE_TYPES = /* @__PURE__ */ new Set([
      "derivative",
      "cumulative_sum",
      "moving_avg",
      "moving_fn",
      "serial_diff",
      "bucket_script"
    ]);
    const BUCKET_TYPES = [
      { label: "Date Histogram", value: "date_histogram" },
      { label: "Histogram", value: "histogram" },
      { label: "Terms", value: "terms" },
      { label: "Filters", value: "filters" },
      { label: "Geo Hash Grid", value: "geohash_grid" },
      { label: "Nested", value: "nested" }
    ];
    const DEMO_FIELDS = [
      "@timestamp",
      "message",
      "host",
      "service",
      "level",
      "status",
      "duration",
      "bytes",
      "method",
      "path",
      "user",
      "geoip.country_code"
    ];
    function asMetrics() {
      const m = query.value.metrics;
      if (Array.isArray(m) && m.length) return m;
      return [{ id: "1", type: "count" }];
    }
    function asBuckets() {
      const b = query.value.bucketAggs;
      if (Array.isArray(b) && b.length) return b;
      if (String(query.value.queryType ?? "metrics") === "metrics") {
        return [
          {
            id: "2",
            type: "date_histogram",
            field: String(query.value.timeField ?? "@timestamp")
          }
        ];
      }
      return [];
    }
    const metrics = computed(() => asMetrics());
    const buckets = computed(() => asBuckets());
    const fieldOptions = ref(
      DEMO_FIELDS.map((f) => ({ label: f, value: f }))
    );
    async function refreshFields() {
      const api = props.datasourceApi;
      try {
        if (api?.getTagKeys) {
          const rows = await api.getTagKeys();
          if (rows?.length) {
            fieldOptions.value = rows.map((r) => ({
              label: r.text,
              value: r.text
            }));
            return;
          }
        }
        if (api?.metricFindQuery) {
          const rows = await api.metricFindQuery("fields()");
          if (rows?.length) {
            fieldOptions.value = rows.map((r) => ({
              label: r.text,
              value: String(r.value ?? r.text)
            }));
            return;
          }
        }
      } catch {
      }
      fieldOptions.value = DEMO_FIELDS.map((f) => ({ label: f, value: f }));
    }
    watch(
      () => props.datasourceApi,
      () => void refreshFields(),
      { immediate: true }
    );
    function nextId(list) {
      const nums = list.map((x) => Number(x.id)).filter((n) => Number.isFinite(n));
      return String((nums.length ? Math.max(...nums) : 0) + 1);
    }
    function setMetrics(next) {
      patch({ metrics: next });
    }
    function setBuckets(next) {
      patch({ bucketAggs: next });
    }
    function updateMetric(i, partial) {
      const next = metrics.value.map(
        (m, idx) => idx === i ? { ...m, ...partial } : m
      );
      setMetrics(next);
    }
    function updateBucket(i, partial) {
      const next = buckets.value.map(
        (b, idx) => idx === i ? { ...b, ...partial } : b
      );
      setBuckets(next);
    }
    function addMetric() {
      setMetrics([
        ...metrics.value,
        { id: nextId(metrics.value), type: "avg", field: "" }
      ]);
    }
    function addPipelineMetric() {
      const parent = metrics.value[0]?.id ?? "1";
      setMetrics([
        ...metrics.value,
        {
          id: nextId(metrics.value),
          type: "derivative",
          pipelineAgg: parent,
          field: ""
        }
      ]);
    }
    function removeMetric(i) {
      if (metrics.value.length <= 1) return;
      setMetrics(metrics.value.filter((_, idx) => idx !== i));
    }
    function addBucket() {
      setBuckets([
        ...buckets.value,
        { id: nextId(buckets.value), type: "terms", field: "" }
      ]);
    }
    function removeBucket(i) {
      setBuckets(buckets.value.filter((_, idx) => idx !== i));
    }
    const showAggs = computed(() => {
      const qt = String(query.value.queryType ?? "metrics");
      return qt === "metrics" || qt === "";
    });
    const parentMetricOptions = computed(
      () => metrics.value.map((m) => ({ label: `${m.id}: ${m.type}`, value: m.id }))
    );
    function isPipeline(type) {
      return PIPELINE_TYPES.has(type);
    }
    function needsField(type) {
      return type !== "count" && type !== "raw_document" && type !== "raw_data" && type !== "logs" && !isPipeline(type);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$23, [
        createElementVNode("div", _hoisted_2$1z, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "es-query-type",
            "data-grafana-label": "Query type",
            value: String(query.value.queryType ?? "metrics"),
            options: [
              { label: "指标 (Metrics)", value: "metrics" },
              { label: "日志 (Logs)", value: "logs" },
              { label: "原始文档", value: "raw_data" },
              { label: "原始文档量", value: "raw_document" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryType: $event }))
          }, null, 8, ["value"])
        ]),
        _cache[20] || (_cache[20] = createElementVNode(
          "div",
          { class: "row" },
          [
            createElementVNode("label", null, "Lucene 查询")
          ],
          -1
          /* CACHED */
        )),
        createVNode(unref(GCodeEditor), {
          value: expr.value,
          "onUpdate:value": _cache[1] || (_cache[1] = ($event) => expr.value = $event),
          language: "plaintext",
          height: 100,
          "test-id": "es-query",
          "data-testid": "es-query",
          "data-grafana-label": "Query"
        }, null, 8, ["value"]),
        createElementVNode("div", _hoisted_3$1o, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "字段浏览",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "es-field-select",
            "show-search": "",
            "allow-clear": "",
            placeholder: "浏览字段…",
            options: fieldOptions.value,
            value: void 0,
            "onUpdate:value": _cache[2] || (_cache[2] = (v) => {
              if (v) expr.value = expr.value ? `${expr.value} AND ${v}:*` : `${v}:*`;
            })
          }, null, 8, ["options"])
        ]),
        showAggs.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createElementVNode("div", _hoisted_4$17, [
              createElementVNode("div", _hoisted_5$_, [
                _cache[11] || (_cache[11] = createElementVNode(
                  "span",
                  null,
                  "指标",
                  -1
                  /* CACHED */
                )),
                createElementVNode("div", _hoisted_6$T, [
                  createVNode(unref(Button), {
                    size: "small",
                    "data-testid": "es-add-metric",
                    onClick: addMetric
                  }, {
                    default: withCtx(() => [..._cache[9] || (_cache[9] = [
                      createTextVNode(
                        "添加指标",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  }),
                  createVNode(unref(Button), {
                    size: "small",
                    "data-testid": "es-add-pipeline",
                    onClick: addPipelineMetric
                  }, {
                    default: withCtx(() => [..._cache[10] || (_cache[10] = [
                      createTextVNode(
                        "添加管道",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  })
                ])
              ]),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(metrics.value, (m, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: m.id,
                    class: "agg-row",
                    "data-testid": "es-metric-row"
                  }, [
                    createVNode(unref(Select), {
                      style: { "width": "160px" },
                      "data-testid": "es-metric-type",
                      value: m.type,
                      options: METRIC_TYPES,
                      "onUpdate:value": (v) => updateMetric(i, { type: v })
                    }, null, 8, ["value", "onUpdate:value"]),
                    isPipeline(m.type) ? (openBlock(), createBlock(unref(Select), {
                      key: 0,
                      style: { "width": "140px" },
                      "data-testid": "es-pipeline-parent",
                      value: m.pipelineAgg ?? metrics.value[0]?.id,
                      options: parentMetricOptions.value,
                      placeholder: "父指标",
                      "onUpdate:value": (v) => updateMetric(i, { pipelineAgg: v })
                    }, null, 8, ["value", "options", "onUpdate:value"])) : needsField(m.type) ? (openBlock(), createBlock(unref(Select), {
                      key: 1,
                      style: { "flex": "1", "min-width": "120px" },
                      "data-testid": "es-metric-field",
                      "show-search": "",
                      "allow-clear": "",
                      value: m.field ?? void 0,
                      options: fieldOptions.value,
                      placeholder: "字段",
                      "onUpdate:value": (v) => updateMetric(i, { field: v || "" })
                    }, null, 8, ["value", "options", "onUpdate:value"])) : createCommentVNode("v-if", true),
                    m.type === "bucket_script" ? (openBlock(), createBlock(unref(Input), {
                      key: 2,
                      "data-testid": "es-bucket-script",
                      style: { "flex": "1" },
                      value: String(m.settings?.script ?? ""),
                      placeholder: "脚本 params.A / params.B",
                      "onUpdate:value": (v) => updateMetric(i, {
                        settings: { ...m.settings ?? {}, script: v }
                      })
                    }, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("v-if", true),
                    createVNode(unref(Button), {
                      size: "small",
                      danger: "",
                      disabled: metrics.value.length <= 1,
                      onClick: ($event) => removeMetric(i)
                    }, {
                      default: withCtx(() => [..._cache[12] || (_cache[12] = [
                        createTextVNode(
                          "删除",
                          -1
                          /* CACHED */
                        )
                      ])]),
                      _: 1
                      /* STABLE */
                    }, 8, ["disabled", "onClick"])
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            createElementVNode("div", _hoisted_7$L, [
              createElementVNode("div", _hoisted_8$E, [
                _cache[14] || (_cache[14] = createElementVNode(
                  "span",
                  null,
                  "分桶",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(Button), {
                  size: "small",
                  "data-testid": "es-add-bucket",
                  onClick: addBucket
                }, {
                  default: withCtx(() => [..._cache[13] || (_cache[13] = [
                    createTextVNode(
                      "添加分桶",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })
              ]),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(buckets.value, (b, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: b.id,
                    class: "agg-row",
                    "data-testid": "es-bucket-row"
                  }, [
                    createVNode(unref(Select), {
                      style: { "width": "160px" },
                      "data-testid": "es-bucket-type",
                      value: b.type,
                      options: BUCKET_TYPES,
                      "onUpdate:value": (v) => updateBucket(i, { type: v })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Select), {
                      style: { "flex": "1", "min-width": "120px" },
                      "data-testid": "es-bucket-field",
                      "show-search": "",
                      "allow-clear": "",
                      value: b.field ?? void 0,
                      options: fieldOptions.value,
                      placeholder: "字段",
                      "onUpdate:value": (v) => updateBucket(i, { field: v || "" })
                    }, null, 8, ["value", "options", "onUpdate:value"]),
                    createVNode(unref(Button), {
                      size: "small",
                      danger: "",
                      onClick: ($event) => removeBucket(i)
                    }, {
                      default: withCtx(() => [..._cache[15] || (_cache[15] = [
                        createTextVNode(
                          "删除",
                          -1
                          /* CACHED */
                        )
                      ])]),
                      _: 1
                      /* STABLE */
                    }, 8, ["onClick"])
                  ]);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              !buckets.value.length ? (openBlock(), createElementBlock("div", _hoisted_9$B, "无分桶（结果为单序列）")) : createCommentVNode("v-if", true)
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_10$v, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "时间字段",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "es-time-field",
            "data-grafana-label": "Time field",
            "show-search": "",
            value: String(query.value.timeField ?? "@timestamp"),
            options: fieldOptions.value,
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ timeField: $event }))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_11$p, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "Size / 限制",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "es-size",
            "data-grafana-label": "Size",
            type: "number",
            value: String(query.value.size ?? query.value.limit ?? 500),
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ size: Number($event) || 500, limit: Number($event) || 500 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_12$l, [
          _cache[18] || (_cache[18] = createElementVNode(
            "label",
            null,
            "Alias",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "es-alias",
            "data-grafana-label": "Alias",
            value: String(query.value.alias ?? ""),
            placeholder: "{{metric}}",
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ alias: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_13$k, [
          _cache[19] || (_cache[19] = createElementVNode(
            "label",
            null,
            "Min interval",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "es-min-interval",
            "data-grafana-label": "Min interval",
            value: String(query.value.interval ?? query.value.minInterval ?? ""),
            placeholder: "auto",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({
              interval: $event || void 0,
              minInterval: $event || void 0
            }))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const ElasticsearchQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2E, [["__scopeId", "data-v-7e5f832e"]]);
const _hoisted_1$22 = { class: "qf" };
const _hoisted_2$1y = { class: "row" };
const _hoisted_3$1n = {
  class: "row",
  "data-testid": "tempo-service-browser"
};
const _hoisted_4$16 = {
  class: "row",
  "data-testid": "tempo-tag-browser"
};
const _hoisted_5$Z = {
  key: 0,
  class: "meta-err",
  "data-testid": "tempo-meta-error"
};
const _hoisted_6$S = { class: "row" };
const _hoisted_7$K = {
  key: 2,
  class: "hint",
  "data-testid": "tempo-service-map-hint"
};
const _hoisted_8$D = { class: "row" };
const _hoisted_9$A = { class: "row" };
const _hoisted_10$u = { class: "row" };
const _hoisted_11$o = { class: "row" };
const _hoisted_12$k = {
  key: 3,
  class: "row"
};
const _sfc_main$2D = /* @__PURE__ */ defineComponent({
  __name: "TempoQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const queryType = computed(() => String(query.value.queryType ?? "traceql"));
    const isSearch = computed(() => queryType.value === "search");
    const isServiceMap = computed(() => queryType.value === "serviceMap");
    const tagOptions = ref([]);
    const serviceOptions = ref([]);
    const selectedService = ref(
      String(query.value.service ?? "") || void 0
    );
    const selectedTag = ref();
    const metaError = ref("");
    const metaLoading = ref(false);
    async function loadTags() {
      metaLoading.value = true;
      metaError.value = "";
      try {
        const api = props.datasourceApi;
        if (typeof api?.listSearchTags === "function") {
          const rows = await api.listSearchTags();
          tagOptions.value = (rows || []).map((r) => ({
            label: String(r.text ?? r.value ?? r),
            value: String(r.value ?? r.text ?? r)
          }));
        } else {
          tagOptions.value = [
            { label: "service.name", value: "service.name" },
            { label: "http.method", value: "http.method" },
            { label: "http.status_code", value: "http.status_code" }
          ];
        }
        if (typeof api?.listServices === "function") {
          const rows = await api.listServices();
          serviceOptions.value = (rows || []).map((r) => ({
            label: String(r.text ?? r.value ?? r),
            value: String(r.value ?? r.text ?? r)
          }));
        } else {
          serviceOptions.value = [
            { label: "frontend", value: "frontend" },
            { label: "api", value: "api" },
            { label: "checkout", value: "checkout" }
          ];
        }
      } catch (e) {
        metaError.value = e instanceof Error ? e.message : String(e);
        tagOptions.value = [
          { label: "service.name", value: "service.name" },
          { label: "http.method", value: "http.method" }
        ];
        serviceOptions.value = [
          { label: "frontend", value: "frontend" },
          { label: "api", value: "api" }
        ];
      } finally {
        metaLoading.value = false;
      }
    }
    function onService(v) {
      const s = String(v ?? "");
      selectedService.value = s || void 0;
      patch({ service: s || void 0 });
      if (s && !isSearch.value) {
        const cur = expr.value.trim();
        const fragment = `{ resource.service.name = "${s}" }`;
        if (!cur || cur.startsWith("{") || cur.startsWith("resource.")) {
          expr.value = fragment;
        }
      }
    }
    function onTag(v) {
      const t2 = String(v ?? "");
      selectedTag.value = t2 || void 0;
      if (!t2) return;
      const cur = expr.value.trim();
      if (!cur) {
        expr.value = `{ ${t2} = "" }`;
      }
    }
    onMounted(loadTags);
    watch(
      () => props.datasourceApi,
      () => {
        void loadTags();
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$22, [
        createElementVNode("div", _hoisted_2$1y, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "tempo-query-type",
            "data-grafana-label": "Query type",
            value: queryType.value,
            options: [
              { label: "TraceQL", value: "traceql" },
              { label: "搜索", value: "search" },
              { label: "Service Map", value: "serviceMap" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryType: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1n, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "Service（预取）",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            loading: metaLoading.value,
            value: selectedService.value,
            options: serviceOptions.value,
            placeholder: "service.name",
            "data-testid": "tempo-service-select",
            "data-grafana-label": "Service Name",
            "onUpdate:value": onService
          }, null, 8, ["loading", "value", "options"])
        ]),
        createElementVNode("div", _hoisted_4$16, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "搜索标签",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            loading: metaLoading.value,
            value: selectedTag.value,
            options: tagOptions.value,
            placeholder: "预取 Tempo 搜索标签",
            "data-testid": "tempo-tag-select",
            "data-grafana-label": "Search tags",
            "onUpdate:value": onTag
          }, null, 8, ["loading", "value", "options"])
        ]),
        metaError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_5$Z,
          toDisplayString(metaError.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        !isServiceMap.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createElementVNode("div", _hoisted_6$S, [
              createElementVNode(
                "label",
                null,
                toDisplayString(isSearch.value ? "搜索查询" : "TraceQL"),
                1
                /* TEXT */
              )
            ]),
            createVNode(unref(GCodeEditor), {
              value: expr.value,
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => expr.value = $event),
              language: "plaintext",
              height: 100,
              "test-id": "tempo-query"
            }, null, 8, ["value"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : (openBlock(), createElementBlock("div", _hoisted_7$K, " Service Map 使用边/节点拓扑查询，无需 TraceQL。 ")),
        createElementVNode("div", _hoisted_8$D, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "限制",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "tempo-limit",
            "data-grafana-label": "Limit",
            value: String(query.value.limit ?? 20),
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ limit: Number($event) || 20 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_9$A, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "最小时长",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "tempo-min-duration",
            "data-grafana-label": "Min Duration",
            value: String(query.value.minDuration ?? ""),
            placeholder: "如 100ms",
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ minDuration: $event || void 0 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_10$u, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "最大时长",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "tempo-max-duration",
            "data-grafana-label": "Max Duration",
            value: String(query.value.maxDuration ?? ""),
            placeholder: "如 5s",
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ maxDuration: $event || void 0 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_11$o, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "搜索标签串",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "tempo-search-tags",
            "data-grafana-label": "Tags",
            value: String(query.value.tags ?? query.value.search ?? ""),
            placeholder: 'http.status_code=500 service.name="api"',
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ tags: $event, search: $event }))
          }, null, 8, ["value"])
        ]),
        isServiceMap.value ? (openBlock(), createElementBlock("div", _hoisted_12$k, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "Step",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "tempo-step",
            "data-grafana-label": "Step",
            value: String(query.value.step ?? ""),
            placeholder: "15s",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ step: $event || void 0 }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const TempoQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2D, [["__scopeId", "data-v-9ef70abb"]]);
const _hoisted_1$21 = { class: "qf" };
const _hoisted_2$1x = { class: "row" };
const _hoisted_3$1m = {
  key: 0,
  class: "meta-err"
};
const _hoisted_4$15 = { class: "row" };
const _hoisted_5$Y = { class: "row" };
const _hoisted_6$R = { class: "row" };
const _hoisted_7$J = { class: "row" };
const _hoisted_8$C = { class: "row" };
const _hoisted_9$z = { class: "row" };
const _hoisted_10$t = {
  key: 2,
  class: "hint",
  "data-testid": "jaeger-dep-hint"
};
const _sfc_main$2C = /* @__PURE__ */ defineComponent({
  __name: "JaegerQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr", "change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
      emit("change", { ...query.value, ...partial });
    }
    const queryType = computed(() => {
      const t2 = query.value.queryType;
      if (t2 === "search" || t2 === "dependencyGraph" || t2 === "upload")
        return String(t2);
      return t2 ? String(t2) : "traceID";
    });
    const isSearch = computed(() => queryType.value === "search");
    const isDep = computed(() => queryType.value === "dependencyGraph");
    const services = ref([]);
    const operations = ref([]);
    const metaLoading = ref(false);
    const metaError = ref("");
    async function loadServices() {
      metaLoading.value = true;
      metaError.value = "";
      try {
        const api = props.datasourceApi;
        if (typeof api?.metadataRequest === "function") {
          const rows = await api.metadataRequest("services");
          services.value = (Array.isArray(rows) ? rows : rows?.data || []).map(
            (s) => ({
              label: String(s),
              value: String(s)
            })
          );
        } else if (typeof api?.getServices === "function") {
          const rows = await api.getServices();
          services.value = (rows || []).map((s) => ({
            label: String(s.text ?? s.value ?? s),
            value: String(s.value ?? s.text ?? s)
          }));
        } else {
          services.value = [
            { label: "frontend", value: "frontend" },
            { label: "api", value: "api" },
            { label: "jaeger-query", value: "jaeger-query" }
          ];
        }
      } catch (e) {
        metaError.value = e instanceof Error ? e.message : String(e);
        services.value = [
          { label: "frontend", value: "frontend" },
          { label: "api", value: "api" }
        ];
      } finally {
        metaLoading.value = false;
      }
    }
    async function loadOperations(service) {
      if (!service) {
        operations.value = [{ label: "all", value: "" }];
        return;
      }
      try {
        const api = props.datasourceApi;
        if (typeof api?.getOperations === "function") {
          const rows = await api.getOperations(service);
          operations.value = [
            { label: "all", value: "" },
            ...(rows || []).map((s) => ({
              label: String(s.text ?? s.value ?? s),
              value: String(s.value ?? s.text ?? s)
            }))
          ];
        } else {
          operations.value = [
            { label: "all", value: "" },
            { label: "HTTP GET", value: "HTTP GET" },
            { label: "HTTP POST", value: "HTTP POST" }
          ];
        }
      } catch {
        operations.value = [{ label: "all", value: "" }];
      }
    }
    onMounted(async () => {
      await loadServices();
      await loadOperations(String(query.value.service ?? ""));
    });
    watch(
      () => props.datasourceApi,
      () => {
        void loadServices();
      }
    );
    watch(
      () => query.value.service,
      (s) => {
        void loadOperations(String(s ?? ""));
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$21, [
        createElementVNode("div", _hoisted_2$1x, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "jaeger-query-type",
            "data-grafana-label": "Query type",
            value: queryType.value,
            options: [
              { label: "搜索", value: "search" },
              { label: "Trace ID", value: "traceID" },
              { label: "依赖图", value: "dependencyGraph" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = (v) => {
              const qt = String(v ?? "traceID");
              patch({ queryType: qt === "traceID" ? void 0 : qt });
            })
          }, null, 8, ["value"])
        ]),
        metaError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_3$1m,
          toDisplayString(metaError.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        isSearch.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createElementVNode("div", _hoisted_4$15, [
              _cache[9] || (_cache[9] = createElementVNode(
                "label",
                null,
                "服务",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "show-search": "",
                "allow-clear": "",
                loading: metaLoading.value,
                "data-testid": "jaeger-service",
                "data-grafana-label": "Service Name",
                value: String(query.value.service ?? "") || void 0,
                options: services.value,
                placeholder: "服务名",
                "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ service: $event || void 0 }))
              }, null, 8, ["loading", "value", "options"])
            ]),
            createElementVNode("div", _hoisted_5$Y, [
              _cache[10] || (_cache[10] = createElementVNode(
                "label",
                null,
                "操作",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "show-search": "",
                "allow-clear": "",
                "data-testid": "jaeger-operation",
                "data-grafana-label": "Operation Name",
                value: String(query.value.operation ?? "") || void 0,
                options: operations.value,
                placeholder: "操作",
                "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ operation: $event || void 0 }))
              }, null, 8, ["value", "options"])
            ]),
            createElementVNode("div", _hoisted_6$R, [
              _cache[11] || (_cache[11] = createElementVNode(
                "label",
                null,
                "标签",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "jaeger-tags",
                "data-grafana-label": "Tags",
                value: String(query.value.tags ?? ""),
                placeholder: "error=true http.status_code=500",
                "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ tags: $event }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_7$J, [
              _cache[12] || (_cache[12] = createElementVNode(
                "label",
                null,
                "最小时长",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "jaeger-min-duration",
                "data-grafana-label": "Min Duration",
                value: String(query.value.minDuration ?? ""),
                placeholder: "1ms",
                "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ minDuration: $event || void 0 }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_8$C, [
              _cache[13] || (_cache[13] = createElementVNode(
                "label",
                null,
                "最大时长",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "jaeger-max-duration",
                "data-grafana-label": "Max Duration",
                value: String(query.value.maxDuration ?? ""),
                placeholder: "1s",
                "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ maxDuration: $event || void 0 }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_9$z, [
              _cache[14] || (_cache[14] = createElementVNode(
                "label",
                null,
                "限制",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "jaeger-limit",
                "data-grafana-label": "Limit",
                type: "number",
                value: query.value.limit == null ? "" : String(query.value.limit),
                placeholder: "20",
                "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ limit: $event === "" ? void 0 : Number($event) }))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : isDep.value ? (openBlock(), createElementBlock("div", _hoisted_10$t, " 依赖图模式：查询服务间调用拓扑，无需 Trace ID。 ")) : (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            _cache[15] || (_cache[15] = createElementVNode(
              "div",
              { class: "row" },
              [
                createElementVNode("label", null, "Trace ID")
              ],
              -1
              /* CACHED */
            )),
            createVNode(unref(GCodeEditor), {
              value: expr.value,
              "onUpdate:value": _cache[7] || (_cache[7] = ($event) => expr.value = $event),
              language: "plaintext",
              height: 80,
              "test-id": "jaeger-trace-id",
              "data-testid": "jaeger-trace-id",
              "data-grafana-label": "Trace ID"
            }, null, 8, ["value"])
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ]);
    };
  }
});
const JaegerQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2C, [["__scopeId", "data-v-5c599716"]]);
const _hoisted_1$20 = { class: "qf" };
const _hoisted_2$1w = { class: "row" };
const _hoisted_3$1l = { class: "row" };
const _hoisted_4$14 = { class: "row" };
const _hoisted_5$X = { class: "row" };
const _hoisted_6$Q = { class: "row" };
const _hoisted_7$I = { class: "row" };
const _hoisted_8$B = { class: "row" };
const _hoisted_9$y = { class: "row" };
const _hoisted_10$s = {
  key: 0,
  class: "row"
};
const _hoisted_11$n = { class: "row" };
const _sfc_main$2B = /* @__PURE__ */ defineComponent({
  __name: "PyroscopeQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr", "change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr || String(query.value.labelSelector ?? ""),
      set: (v) => {
        emit("update:expr", v);
        emit("patch", { labelSelector: v, expr: v });
      }
    });
    function patch(partial) {
      emit("patch", partial);
      emit("change", { ...query.value, ...partial });
    }
    const profileTypes = ref([
      {
        label: "process_cpu:cpu:nanoseconds",
        value: "process_cpu:cpu:nanoseconds"
      },
      { label: "memory:alloc_space:bytes", value: "memory:alloc_space:bytes" },
      { label: "memory:inuse_space:bytes", value: "memory:inuse_space:bytes" },
      { label: "goroutine:goroutine:count", value: "goroutine:goroutine:count" }
    ]);
    onMounted(async () => {
      try {
        const api = props.datasourceApi;
        if (typeof api?.getProfileTypes === "function") {
          const rows = await api.getProfileTypes();
          if (rows?.length) {
            profileTypes.value = rows.map((r) => ({
              label: String(r.label ?? r.id ?? r),
              value: String(r.id ?? r.value ?? r)
            }));
          }
        }
      } catch {
      }
    });
    const groupByText = computed(() => {
      const g = query.value.groupBy;
      if (Array.isArray(g)) return g.join(",");
      return String(g ?? "");
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$20, [
        createElementVNode("div", _hoisted_2$1w, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "pyroscope-query-type",
            "data-grafana-label": "Query Type",
            value: String(query.value.queryType ?? "profile"),
            options: [
              { label: "Profile", value: "profile" },
              { label: "Metrics", value: "metrics" },
              { label: "Both", value: "both" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryType: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1l, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "配置文件类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            "data-testid": "pyroscope-profile-type",
            value: String(query.value.profileTypeId ?? query.value.profileType ?? "") || void 0,
            options: profileTypes.value,
            placeholder: "process_cpu:cpu:nanoseconds",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ profileTypeId: $event, profileType: $event }))
          }, null, 8, ["value", "options"])
        ]),
        _cache[21] || (_cache[21] = createElementVNode(
          "div",
          { class: "row" },
          [
            createElementVNode("label", null, "标签选择器")
          ],
          -1
          /* CACHED */
        )),
        createVNode(unref(GCodeEditor), {
          value: expr.value,
          "onUpdate:value": _cache[2] || (_cache[2] = ($event) => expr.value = $event),
          language: "plaintext",
          height: 80,
          "test-id": "pyroscope-label-selector"
        }, null, 8, ["value"]),
        createElementVNode("div", _hoisted_4$14, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "Group by",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "pyroscope-group-by",
            "data-grafana-label": "Group by",
            value: groupByText.value,
            placeholder: "service_name,pod",
            "onUpdate:value": _cache[3] || (_cache[3] = (v) => patch({
              groupBy: String(v || "").split(",").map((s) => s.trim()).filter(Boolean)
            }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$X, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "Max Nodes",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "pyroscope-max-nodes",
            "data-grafana-label": "Max Nodes",
            type: "number",
            value: query.value.maxNodes == null ? "" : String(query.value.maxNodes),
            placeholder: "16",
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ maxNodes: $event === "" ? void 0 : Number($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_6$Q, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "限制",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "pyroscope-limit",
            "data-grafana-label": "Limit",
            type: "number",
            value: query.value.limit == null ? "" : String(query.value.limit),
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ limit: $event === "" ? void 0 : Number($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_7$I, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "Annotations",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "pyroscope-annotations",
            "data-grafana-label": "Annotations",
            checked: !!query.value.annotations,
            "onUpdate:checked": _cache[6] || (_cache[6] = ($event) => patch({ annotations: $event }))
          }, null, 8, ["checked"])
        ]),
        createElementVNode("div", _hoisted_8$B, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "Exemplars",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "pyroscope-exemplars",
            "data-grafana-label": "Exemplars",
            checked: !!query.value.includeExemplars,
            "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => patch({ includeExemplars: $event }))
          }, null, 8, ["checked"])
        ]),
        createElementVNode("div", _hoisted_9$y, [
          _cache[18] || (_cache[18] = createElementVNode(
            "label",
            null,
            "Heatmap",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "pyroscope-heatmap",
            "data-grafana-label": "Heatmap",
            checked: !!query.value.includeHeatmap,
            "onUpdate:checked": _cache[8] || (_cache[8] = ($event) => patch({ includeHeatmap: $event }))
          }, null, 8, ["checked"])
        ]),
        !!query.value.includeHeatmap ? (openBlock(), createElementBlock("div", _hoisted_10$s, [
          _cache[19] || (_cache[19] = createElementVNode(
            "label",
            null,
            "Heatmap Type",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "pyroscope-heatmap-type",
            "data-grafana-label": "Heatmap Type",
            value: String(query.value.heatmapType ?? "individual"),
            options: [
              { label: "Individual", value: "individual" },
              { label: "Span", value: "span" }
            ],
            "onUpdate:value": _cache[9] || (_cache[9] = ($event) => patch({ heatmapType: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_11$n, [
          _cache[20] || (_cache[20] = createElementVNode(
            "label",
            null,
            "Span ID",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "pyroscope-span-id",
            "data-grafana-label": "Span ID",
            value: String(query.value.spanSelector ?? query.value.spanId ?? ""),
            placeholder: "optional span selector",
            "onUpdate:value": _cache[10] || (_cache[10] = ($event) => patch({
              spanSelector: $event || void 0,
              spanId: $event || void 0
            }))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const PyroscopeQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2B, [["__scopeId", "data-v-ca58b84e"]]);
const _hoisted_1$1$ = {
  class: "qf generic-fields",
  "data-testid": "generic-query-fields"
};
const _sfc_main$2A = /* @__PURE__ */ defineComponent({
  __name: "GenericQueryFields",
  props: {
    query: {},
    expr: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1$, [
        _cache[1] || (_cache[1] = createElementVNode(
          "p",
          { class: "hint" },
          "通用查询编辑器 — 可直接编辑表达式 / SQL / 查询字符串",
          -1
          /* CACHED */
        )),
        createVNode(unref(GCodeEditor), {
          value: expr.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => expr.value = $event),
          language: "plaintext",
          height: 140,
          "test-id": "generic-query-input"
        }, null, 8, ["value"])
      ]);
    };
  }
});
const GenericQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2A, [["__scopeId", "data-v-b093a2d0"]]);
const _hoisted_1$1_ = ["data-query-type"];
const _hoisted_2$1v = { class: "row" };
const _hoisted_3$1k = { class: "row" };
const _hoisted_4$13 = { class: "row" };
const _hoisted_5$W = { class: "row" };
const _hoisted_6$P = { class: "row" };
const _hoisted_7$H = { class: "row" };
const _hoisted_8$A = { class: "row" };
const _hoisted_9$x = { class: "row" };
const _hoisted_10$r = { class: "row" };
const _hoisted_11$m = { class: "row" };
const _hoisted_12$j = { class: "row" };
const _hoisted_13$j = { class: "row" };
const _hoisted_14$j = { class: "row" };
const _hoisted_15$g = { class: "row" };
const _hoisted_16$e = { class: "row" };
const _hoisted_17$c = { class: "row" };
const _hoisted_18$c = { class: "row" };
const _hoisted_19$a = { class: "row" };
const _hoisted_20$9 = { class: "row" };
const _sfc_main$2z = /* @__PURE__ */ defineComponent({
  __name: "AzureQueryFields",
  props: {
    query: {},
    expr: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const am = computed(
      () => query.value.azureMonitor ?? {}
    );
    const la = computed(
      () => query.value.azureLogAnalytics ?? {}
    );
    const ai = computed(
      () => query.value.azureAppInsights ?? {}
    );
    const arg = computed(
      () => query.value.azureResourceGraph ?? {}
    );
    function patchAm(partial) {
      patch({ azureMonitor: { ...am.value, ...partial } });
    }
    function patchLa(partial) {
      patch({ azureLogAnalytics: { ...la.value, ...partial } });
    }
    function patchAi(partial) {
      patch({ azureAppInsights: { ...ai.value, ...partial } });
    }
    function patchArg(partial) {
      patch({ azureResourceGraph: { ...arg.value, ...partial } });
    }
    const queryType = computed(
      () => String(query.value.queryType ?? "Azure Monitor")
    );
    const isMetrics = computed(
      () => /Azure Monitor|Metrics/i.test(queryType.value) && !/Log|Insights|Graph/i.test(queryType.value)
    );
    const isLogs = computed(() => /Log Analytics/i.test(queryType.value));
    const isAppInsights = computed(
      () => /Application Insights|App Insights/i.test(queryType.value)
    );
    const isResourceGraph = computed(() => /Resource Graph/i.test(queryType.value));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "qf",
        "data-testid": "azure-query-fields",
        "data-query-type": queryType.value
      }, [
        createElementVNode("div", _hoisted_2$1v, [
          _cache[23] || (_cache[23] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "azure-query-type",
            "data-grafana-label": "Query type",
            value: queryType.value,
            options: [
              { label: "Azure Monitor (指标)", value: "Azure Monitor" },
              { label: "Log Analytics", value: "Azure Log Analytics" },
              { label: "Application Insights", value: "Application Insights" },
              { label: "Resource Graph", value: "Azure Resource Graph" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryType: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1k, [
          _cache[24] || (_cache[24] = createElementVNode(
            "label",
            null,
            "订阅",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "azure-subscription",
            "data-grafana-label": "Subscription",
            value: String(query.value.subscription ?? am.value.subscription ?? la.value.subscription ?? ""),
            placeholder: "subscription id",
            "onUpdate:value": _cache[1] || (_cache[1] = (v) => {
              patch({ subscription: v });
              patchAm({ subscription: v });
              patchLa({ subscription: v });
            })
          }, null, 8, ["value"])
        ]),
        createCommentVNode(" Metrics branch "),
        isMetrics.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createElementVNode("div", _hoisted_4$13, [
              _cache[25] || (_cache[25] = createElementVNode(
                "label",
                null,
                "资源组",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-resource-group",
                "data-grafana-label": "Resource Group",
                value: String(query.value.resourceGroup ?? am.value.resourceGroup ?? ""),
                placeholder: "resource group",
                "onUpdate:value": _cache[2] || (_cache[2] = (v) => {
                  patch({ resourceGroup: v });
                  patchAm({ resourceGroup: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_5$W, [
              _cache[26] || (_cache[26] = createElementVNode(
                "label",
                null,
                "资源名称",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-resource",
                "data-grafana-label": "Resource Name",
                value: String(query.value.resourceName ?? am.value.resourceName ?? ""),
                placeholder: "vm-name",
                "onUpdate:value": _cache[3] || (_cache[3] = (v) => {
                  patch({ resourceName: v });
                  patchAm({ resourceName: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_6$P, [
              _cache[27] || (_cache[27] = createElementVNode(
                "label",
                null,
                "区域",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-region",
                "data-grafana-label": "Region",
                value: String(query.value.region ?? am.value.region ?? ""),
                placeholder: "eastus",
                "onUpdate:value": _cache[4] || (_cache[4] = (v) => {
                  patch({ region: v });
                  patchAm({ region: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_7$H, [
              _cache[28] || (_cache[28] = createElementVNode(
                "label",
                null,
                "指标命名空间",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-metric-namespace",
                "data-grafana-label": "Namespace",
                value: String(query.value.metricNamespace ?? am.value.metricNamespace ?? ""),
                placeholder: "Microsoft.Compute/virtualMachines",
                "onUpdate:value": _cache[5] || (_cache[5] = (v) => {
                  patch({ metricNamespace: v });
                  patchAm({ metricNamespace: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_8$A, [
              _cache[29] || (_cache[29] = createElementVNode(
                "label",
                null,
                "指标",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-metric",
                "data-grafana-label": "Metric name",
                value: String(query.value.metricName ?? am.value.metricName ?? ""),
                placeholder: "Percentage CPU",
                "onUpdate:value": _cache[6] || (_cache[6] = (v) => {
                  patch({ metricName: v });
                  patchAm({ metricName: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_9$x, [
              _cache[30] || (_cache[30] = createElementVNode(
                "label",
                null,
                "聚合",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "azure-aggregation",
                "data-grafana-label": "Aggregation",
                value: String(query.value.aggregation ?? am.value.aggregation ?? "Average"),
                options: [
                  { label: "Average", value: "Average" },
                  { label: "Total", value: "Total" },
                  { label: "Maximum", value: "Maximum" },
                  { label: "Minimum", value: "Minimum" },
                  { label: "Count", value: "Count" }
                ],
                "onUpdate:value": _cache[7] || (_cache[7] = (v) => {
                  const s = String(v ?? "");
                  patch({ aggregation: s });
                  patchAm({ aggregation: s });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_10$r, [
              _cache[31] || (_cache[31] = createElementVNode(
                "label",
                null,
                "时间粒度",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-time-grain",
                "data-grafana-label": "Time grain",
                value: String(query.value.timeGrain ?? am.value.timeGrain ?? "auto"),
                placeholder: "auto / PT1M",
                "onUpdate:value": _cache[8] || (_cache[8] = (v) => {
                  patch({ timeGrain: v });
                  patchAm({ timeGrain: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_11$m, [
              _cache[32] || (_cache[32] = createElementVNode(
                "label",
                null,
                "Top",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-top",
                "data-grafana-label": "Top",
                type: "number",
                value: String(query.value.top ?? am.value.top ?? ""),
                placeholder: "10",
                "onUpdate:value": _cache[9] || (_cache[9] = (v) => {
                  const n = v === "" ? void 0 : Number(v);
                  patch({ top: n });
                  patchAm({ top: n });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_12$j, [
              _cache[33] || (_cache[33] = createElementVNode(
                "label",
                null,
                "图例格式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-legend",
                "data-grafana-label": "Legend format",
                value: String(query.value.legendFormat ?? am.value.alias ?? ""),
                placeholder: "{{resource}}",
                "onUpdate:value": _cache[10] || (_cache[10] = (v) => {
                  patch({ legendFormat: v });
                  patchAm({ alias: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_13$j, [
              _cache[34] || (_cache[34] = createElementVNode(
                "label",
                null,
                "维度",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-dimension",
                "data-grafana-label": "Dimensions",
                value: String(query.value.dimension ?? am.value.dimension ?? ""),
                placeholder: "可选维度过滤",
                "onUpdate:value": _cache[11] || (_cache[11] = (v) => {
                  patch({ dimension: v });
                  patchAm({ dimension: v });
                })
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : isLogs.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createCommentVNode(" Log Analytics "),
            createElementVNode("div", _hoisted_14$j, [
              _cache[35] || (_cache[35] = createElementVNode(
                "label",
                null,
                "工作区",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-workspace",
                "data-grafana-label": "Logs",
                value: String(query.value.workspace ?? la.value.workspace ?? ""),
                placeholder: "Log Analytics workspace",
                "onUpdate:value": _cache[12] || (_cache[12] = (v) => {
                  patch({ workspace: v });
                  patchLa({ workspace: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_15$g, [
              _cache[36] || (_cache[36] = createElementVNode(
                "label",
                null,
                "时间列",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-time-column",
                "data-grafana-label": "Time Column",
                value: String(query.value.timeColumn ?? la.value.timeColumn ?? "TimeGenerated"),
                placeholder: "TimeGenerated",
                "onUpdate:value": _cache[13] || (_cache[13] = (v) => {
                  patch({ timeColumn: v });
                  patchLa({ timeColumn: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_16$e, [
              _cache[37] || (_cache[37] = createElementVNode(
                "label",
                null,
                "时间范围模式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "azure-time-range",
                "data-grafana-label": "Time-range",
                value: String(query.value.dashboardTime ?? la.value.dashboardTime ?? "dashboard"),
                options: [
                  { label: "Dashboard", value: "dashboard" },
                  { label: "Query", value: "query" }
                ],
                "onUpdate:value": _cache[14] || (_cache[14] = (v) => {
                  patch({ dashboardTime: v });
                  patchLa({ dashboardTime: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_17$c, [
              _cache[38] || (_cache[38] = createElementVNode(
                "label",
                null,
                "结果格式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "azure-result-format",
                "data-grafana-label": "Result format",
                value: String(query.value.resultFormat ?? la.value.resultFormat ?? "time_series"),
                options: [
                  { label: "时间序列", value: "time_series" },
                  { label: "表格", value: "table" },
                  { label: "追踪", value: "trace" },
                  { label: "日志", value: "logs" }
                ],
                "onUpdate:value": _cache[15] || (_cache[15] = (v) => {
                  patch({ resultFormat: v });
                  patchLa({ resultFormat: v });
                })
              }, null, 8, ["value"])
            ]),
            _cache[39] || (_cache[39] = createElementVNode(
              "div",
              { class: "row" },
              [
                createElementVNode("label", null, "KQL")
              ],
              -1
              /* CACHED */
            )),
            createVNode(unref(GCodeEditor), {
              value: expr.value,
              "onUpdate:value": _cache[16] || (_cache[16] = ($event) => expr.value = $event),
              language: "plaintext",
              height: 140,
              "test-id": "azure-query"
            }, null, 8, ["value"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : isAppInsights.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createCommentVNode(" Application Insights "),
            createElementVNode("div", _hoisted_18$c, [
              _cache[40] || (_cache[40] = createElementVNode(
                "label",
                null,
                "应用 ID",
                -1
                /* CACHED */
              )),
              createVNode(unref(Input), {
                "data-testid": "azure-app-id",
                value: String(query.value.appInsightsAppId ?? ai.value.appId ?? ""),
                placeholder: "Application Insights app id",
                "onUpdate:value": _cache[17] || (_cache[17] = (v) => {
                  patch({ appInsightsAppId: v });
                  patchAi({ appId: v });
                })
              }, null, 8, ["value"])
            ]),
            createElementVNode("div", _hoisted_19$a, [
              _cache[41] || (_cache[41] = createElementVNode(
                "label",
                null,
                "查询类型",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "azure-ai-query-type",
                value: String(ai.value.queryType ?? "analytics"),
                options: [
                  { label: "Analytics (KQL)", value: "analytics" },
                  { label: "Metrics", value: "metrics" }
                ],
                "onUpdate:value": _cache[18] || (_cache[18] = (v) => patchAi({ queryType: v }))
              }, null, 8, ["value"])
            ]),
            _cache[42] || (_cache[42] = createElementVNode(
              "div",
              { class: "row" },
              [
                createElementVNode("label", null, "查询")
              ],
              -1
              /* CACHED */
            )),
            createVNode(unref(GCodeEditor), {
              value: expr.value,
              "onUpdate:value": _cache[19] || (_cache[19] = ($event) => expr.value = $event),
              language: "plaintext",
              height: 120,
              "test-id": "azure-query"
            }, null, 8, ["value"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : isResourceGraph.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            createCommentVNode(" Resource Graph "),
            createElementVNode("div", _hoisted_20$9, [
              _cache[43] || (_cache[43] = createElementVNode(
                "label",
                null,
                "结果格式",
                -1
                /* CACHED */
              )),
              createVNode(unref(Select), {
                style: { "width": "100%" },
                "data-testid": "azure-arg-format",
                value: String(arg.value.resultFormat ?? "table"),
                options: [
                  { label: "表格", value: "table" },
                  { label: "时间序列", value: "time_series" }
                ],
                "onUpdate:value": _cache[20] || (_cache[20] = (v) => patchArg({ resultFormat: v }))
              }, null, 8, ["value"])
            ]),
            _cache[44] || (_cache[44] = createElementVNode(
              "div",
              { class: "row" },
              [
                createElementVNode("label", null, "Resource Graph 查询")
              ],
              -1
              /* CACHED */
            )),
            createVNode(unref(GCodeEditor), {
              value: expr.value,
              "onUpdate:value": _cache[21] || (_cache[21] = ($event) => expr.value = $event),
              language: "plaintext",
              height: 120,
              "test-id": "azure-query"
            }, null, 8, ["value"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : (openBlock(), createElementBlock(
          Fragment,
          { key: 4 },
          [
            _cache[45] || (_cache[45] = createElementVNode(
              "div",
              { class: "row" },
              [
                createElementVNode("label", null, "查询")
              ],
              -1
              /* CACHED */
            )),
            createVNode(unref(GCodeEditor), {
              value: expr.value,
              "onUpdate:value": _cache[22] || (_cache[22] = ($event) => expr.value = $event),
              language: "plaintext",
              height: 120,
              "test-id": "azure-query"
            }, null, 8, ["value"])
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ], 8, _hoisted_1$1_);
    };
  }
});
const AzureQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2z, [["__scopeId", "data-v-60131891"]]);
const _hoisted_1$1Z = ["data-query-type"];
const _hoisted_2$1u = { class: "row" };
const _hoisted_3$1j = { class: "row" };
const _hoisted_4$12 = { class: "row" };
const _hoisted_5$V = { class: "row" };
const _hoisted_6$O = { class: "row" };
const _hoisted_7$G = { class: "row" };
const _hoisted_8$z = { class: "row" };
const _hoisted_9$w = { class: "row" };
const _sfc_main$2y = /* @__PURE__ */ defineComponent({
  __name: "GrafanaQueryFields",
  props: {
    query: {}
  },
  emits: ["patch"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    function patch(partial) {
      emit("patch", partial);
    }
    const qt = computed(() => String(query.value.queryType ?? "randomWalk"));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "qf",
        "data-testid": "grafana-query-fields",
        "data-query-type": qt.value
      }, [
        createElementVNode("div", _hoisted_2$1u, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "grafana-query-type",
            "data-grafana-label": "Query type",
            value: qt.value,
            options: [
              { label: "随机游走", value: "randomWalk" },
              { label: "列表", value: "list" },
              { label: "搜索", value: "search" },
              { label: "实时 (live)", value: "live" },
              { label: "快照", value: "snapshot" },
              { label: "注解", value: "annotations" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryType: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1j, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "渠道 / 路径",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-channel",
            "data-grafana-label": "Channel",
            value: String(query.value.channel ?? query.value.query ?? ""),
            placeholder: "grafana/live/…",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ channel: $event, query: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$12, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "搜索词",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-search",
            value: String(query.value.search ?? query.value.query ?? ""),
            placeholder: "dashboard search",
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ search: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$V, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "Limit",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-limit",
            "data-grafana-label": "Limit",
            type: "number",
            value: String(query.value.limit ?? ""),
            placeholder: "10",
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ limit: $event === "" ? void 0 : Number($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_6$O, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "路径",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-path",
            "data-grafana-label": "Path",
            value: String(query.value.path ?? ""),
            placeholder: "/api/…",
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ path: $event || void 0 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_7$G, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "Buffer",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-buffer",
            "data-grafana-label": "Buffer",
            type: "number",
            value: String(query.value.buffer ?? ""),
            placeholder: "optional live buffer",
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ buffer: $event === "" ? void 0 : Number($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_8$z, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "Fields",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-fields",
            "data-grafana-label": "Fields",
            value: String(
              Array.isArray(query.value.fields) ? query.value.fields.join(",") : query.value.fields ?? ""
            ),
            placeholder: "field1,field2",
            "onUpdate:value": _cache[6] || (_cache[6] = (v) => patch({
              fields: String(v || "").split(",").map((s) => s.trim()).filter(Boolean)
            }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_9$w, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "Snapshot",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "grafana-snapshot",
            "data-grafana-label": "Snapshot",
            value: String(query.value.snapshot ?? ""),
            placeholder: "snapshot id / json",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ snapshot: $event || void 0 }))
          }, null, 8, ["value"])
        ])
      ], 8, _hoisted_1$1Z);
    };
  }
});
const GrafanaQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2y, [["__scopeId", "data-v-aba81d5c"]]);
const _hoisted_1$1Y = {
  class: "qf",
  "data-testid": "dashboard-query-fields"
};
const _hoisted_2$1t = { class: "row" };
const _hoisted_3$1i = { class: "row" };
const _hoisted_4$11 = { class: "row" };
const _sfc_main$2x = /* @__PURE__ */ defineComponent({
  __name: "DashboardQueryFields",
  props: {
    query: {}
  },
  emits: ["patch"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    function patch(partial) {
      emit("patch", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1Y, [
        _cache[6] || (_cache[6] = createElementVNode(
          "p",
          { class: "hint" },
          "从同一仪表盘的其他面板复用查询结果。",
          -1
          /* CACHED */
        )),
        createElementVNode("div", _hoisted_2$1t, [
          _cache[3] || (_cache[3] = createElementVNode(
            "label",
            null,
            "面板 ID",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "dashboard-panel-id",
            value: String(query.value.panelId ?? ""),
            placeholder: "例如 2",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ panelId: Number($event) || $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1i, [
          _cache[4] || (_cache[4] = createElementVNode(
            "label",
            null,
            "withTransforms",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "dashboard-with-transforms",
            checked: !!query.value.withTransforms,
            "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => patch({ withTransforms: $event }))
          }, null, 8, ["checked"])
        ]),
        createElementVNode("div", _hoisted_4$11, [
          _cache[5] || (_cache[5] = createElementVNode(
            "label",
            null,
            "主题变量透传",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            "data-testid": "dashboard-topic",
            checked: query.value.topic !== false,
            "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => patch({ topic: $event }))
          }, null, 8, ["checked"])
        ])
      ]);
    };
  }
});
const DashboardQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2x, [["__scopeId", "data-v-7993f2f8"]]);
const _hoisted_1$1X = ["data-loading"];
const _hoisted_2$1s = { class: "row" };
const _hoisted_3$1h = { class: "row" };
const _hoisted_4$10 = { class: "row" };
const _hoisted_5$U = { class: "row" };
const _hoisted_6$N = { class: "row" };
const _hoisted_7$F = { class: "row" };
const _hoisted_8$y = { class: "row" };
const _sfc_main$2w = /* @__PURE__ */ defineComponent({
  __name: "ZabbixQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    function patch(partial) {
      emit("patch", partial);
    }
    const groups = ref([
      { label: "Linux servers", value: "Linux servers" },
      { label: "Web", value: "Web" }
    ]);
    const hosts = ref([
      { label: "web-1", value: "web-1" },
      { label: "db-1", value: "db-1" }
    ]);
    const items = ref([
      { label: "CPU utilization", value: "system.cpu.util" },
      { label: "Memory used", value: "vm.memory.util" }
    ]);
    const applications = ref([
      { label: "*", value: "*" },
      { label: "CPU", value: "CPU" },
      { label: "Memory", value: "Memory" },
      { label: "Filesystem", value: "Filesystem" }
    ]);
    const loading = ref(false);
    function mapRows(rows) {
      return (rows || []).map((r) => ({
        label: String(r.text ?? r.label ?? r.value ?? r.name ?? ""),
        value: String(r.value ?? r.text ?? r.name ?? "")
      })).filter((o) => o.value);
    }
    async function loadGroups() {
      loading.value = true;
      try {
        const api = props.datasourceApi;
        if (typeof api?.listHostGroups === "function") {
          const rows = await api.listHostGroups();
          if (rows?.length) groups.value = mapRows(rows);
          return;
        }
        if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery("hostgroup.get");
          if (rows?.length) groups.value = mapRows(rows);
        }
      } catch {
      } finally {
        loading.value = false;
      }
    }
    async function loadHosts() {
      const api = props.datasourceApi;
      const g = String(
        query.value.group?.filter ?? query.value.group ?? ""
      );
      try {
        if (typeof api?.listHosts === "function") {
          const rows = await api.listHosts(g || void 0);
          if (rows?.length) hosts.value = mapRows(rows);
          return;
        }
        if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery(
            g ? `host.get group=${g}` : "host.get"
          );
          if (rows?.length) hosts.value = mapRows(rows);
        }
      } catch {
      }
    }
    async function loadItems() {
      const api = props.datasourceApi;
      const h2 = String(query.value.host?.filter ?? query.value.host ?? "");
      try {
        if (typeof api?.listItems === "function") {
          const rows = await api.listItems(h2 || void 0);
          if (rows?.length) items.value = mapRows(rows);
          return;
        }
        if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery(
            h2 ? `item.get host=${h2}` : "item.get"
          );
          if (rows?.length) items.value = mapRows(rows);
        }
      } catch {
      }
    }
    async function loadApplications() {
      const api = props.datasourceApi;
      const h2 = String(query.value.host?.filter ?? query.value.host ?? "");
      try {
        if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery(
            h2 ? `application.get host=${h2}` : "application.get"
          );
          if (rows?.length)
            applications.value = [{ label: "*", value: "*" }, ...mapRows(rows)];
        }
      } catch {
      }
    }
    onMounted(async () => {
      await loadGroups();
      await loadHosts();
      await loadItems();
      await loadApplications();
    });
    watch(
      () => props.datasourceApi,
      () => {
        void loadGroups().then(() => loadHosts()).then(() => loadItems()).then(() => loadApplications());
      }
    );
    const groupVal = computed({
      get: () => String(query.value.group?.filter ?? query.value.group ?? ""),
      set: (v) => {
        patch({ group: { filter: v }, host: { filter: "" }, item: { filter: "" } });
        void loadHosts().then(() => loadItems()).then(() => loadApplications());
      }
    });
    const hostVal = computed({
      get: () => String(query.value.host?.filter ?? query.value.host ?? ""),
      set: (v) => {
        patch({ host: { filter: v }, item: { filter: "" } });
        void loadItems().then(() => loadApplications());
      }
    });
    const itemVal = computed({
      get: () => String(query.value.item?.filter ?? query.value.item ?? ""),
      set: (v) => patch({ item: { filter: v } })
    });
    const appVal = computed({
      get: () => String(query.value.application ?? "*"),
      set: (v) => patch({ application: v || "*" })
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "qf",
        "data-testid": "zabbix-qe",
        "data-loading": String(loading.value)
      }, [
        createElementVNode("div", _hoisted_2$1s, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "查询类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "zabbix-query-type",
            "data-grafana-label": "Query type",
            value: String(query.value.queryType ?? "metrics"),
            options: [
              { label: "指标（历史/趋势）", value: "metrics" },
              { label: "问题", value: "problems" },
              { label: "文本监控项", value: "text" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ queryType: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1h, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "主机群组",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "zabbix-group",
            "data-grafana-label": "Group",
            "show-search": "",
            "allow-clear": "",
            value: groupVal.value || void 0,
            options: groups.value,
            "onUpdate:value": _cache[1] || (_cache[1] = (v) => groupVal.value = String(v ?? ""))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_4$10, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "主机",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "zabbix-host",
            "data-grafana-label": "Host",
            "show-search": "",
            "allow-clear": "",
            value: hostVal.value || void 0,
            options: hosts.value,
            "onUpdate:value": _cache[2] || (_cache[2] = (v) => hostVal.value = String(v ?? ""))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_5$U, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "监控项",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "zabbix-item",
            "data-grafana-label": "Item",
            "show-search": "",
            "allow-clear": "",
            value: itemVal.value || void 0,
            options: items.value,
            "onUpdate:value": _cache[3] || (_cache[3] = (v) => itemVal.value = String(v ?? ""))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_6$N, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "应用集",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "zabbix-application",
            "data-grafana-label": "Application",
            "show-search": "",
            "allow-clear": "",
            value: appVal.value || void 0,
            options: applications.value,
            "onUpdate:value": _cache[4] || (_cache[4] = (v) => appVal.value = String(v ?? "*"))
          }, null, 8, ["value", "options"])
        ]),
        createElementVNode("div", _hoisted_7$F, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "函数",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "zabbix-functions",
            "data-grafana-label": "Functions",
            value: String(query.value.functions ?? ""),
            placeholder: "groupBy / scale / …",
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ functions: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_8$y, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "图例",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "zabbix-legend",
            "data-grafana-label": "Legend",
            value: String(query.value.legendFormat ?? query.value.alias ?? ""),
            placeholder: "{{item}}",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ legendFormat: $event, alias: $event }))
          }, null, 8, ["value"])
        ])
      ], 8, _hoisted_1$1X);
    };
  }
});
const ZabbixQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2w, [["__scopeId", "data-v-4635f94b"]]);
const _hoisted_1$1W = {
  class: "qf",
  "data-testid": "otel-qe"
};
const _hoisted_2$1r = { class: "row" };
const _hoisted_3$1g = { class: "row" };
const _hoisted_4$$ = {
  key: 0,
  class: "row",
  "data-testid": "otel-metric-browser"
};
const _hoisted_5$T = {
  key: 1,
  class: "row",
  "data-testid": "otel-service-browser"
};
const _hoisted_6$M = {
  key: 2,
  class: "row"
};
const _hoisted_7$E = {
  key: 3,
  class: "row"
};
const _hoisted_8$x = {
  key: 4,
  class: "row"
};
const _hoisted_9$v = {
  key: 5,
  class: "row"
};
const _hoisted_10$q = { class: "row" };
const _hoisted_11$l = { class: "row" };
const _sfc_main$2v = /* @__PURE__ */ defineComponent({
  __name: "OtelQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const signal = computed(() => String(query.value.signal ?? "metrics"));
    const services = ref([
      { label: "frontend", value: "frontend" },
      { label: "api", value: "api" },
      { label: "checkout", value: "checkout" }
    ]);
    const metrics = ref([
      { label: "up", value: "up" },
      { label: "http_requests_total", value: "http_requests_total" },
      { label: "process_cpu_seconds_total", value: "process_cpu_seconds_total" }
    ]);
    const operations = ref([
      { label: "GET /", value: "GET /" },
      { label: "POST /checkout", value: "POST /checkout" }
    ]);
    function mapRows(rows) {
      return (rows || []).map((r) => ({
        label: String(r.text ?? r.label ?? r.value ?? r.name ?? r),
        value: String(r.value ?? r.text ?? r.name ?? r)
      })).filter((o) => o.value);
    }
    async function loadMeta() {
      const api = props.datasourceApi;
      try {
        if (typeof api?.listServices === "function") {
          const rows = await api.listServices();
          if (rows?.length) services.value = mapRows(rows);
        } else if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery("services");
          if (rows?.length) services.value = mapRows(rows);
        }
        if (typeof api?.listMetricNames === "function") {
          const rows = await api.listMetricNames();
          if (rows?.length) metrics.value = mapRows(rows);
        } else if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery("metrics()");
          if (rows?.length) metrics.value = mapRows(rows);
        }
        if (typeof api?.listOperations === "function") {
          const rows = await api.listOperations(query.value.service);
          if (rows?.length) operations.value = mapRows(rows);
        }
      } catch {
      }
    }
    onMounted(() => {
      void loadMeta();
    });
    watch(
      () => [props.datasourceApi, query.value.service, signal.value],
      () => {
        void loadMeta();
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1W, [
        createElementVNode("div", _hoisted_2$1r, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "Signal",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "otel-signal",
            "data-grafana-label": "Signal",
            value: signal.value,
            options: [
              { label: "Metrics", value: "metrics" },
              { label: "Logs", value: "logs" },
              { label: "Traces", value: "traces" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ signal: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1g, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "Provider",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "otel-provider",
            "data-grafana-label": "Provider",
            value: String(query.value.provider ?? ""),
            placeholder: signal.value === "metrics" ? "prometheus" : signal.value === "logs" ? "loki" : "tempo",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ provider: $event }))
          }, null, 8, ["value", "placeholder"])
        ]),
        signal.value === "metrics" ? (openBlock(), createElementBlock("div", _hoisted_4$$, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "Metric",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "otel-metric-select",
            "data-grafana-label": "Metric",
            "show-search": "",
            "allow-clear": "",
            options: metrics.value,
            value: void 0,
            placeholder: "选择指标…",
            "onUpdate:value": _cache[2] || (_cache[2] = (v) => {
              if (v) expr.value = v;
            })
          }, null, 8, ["options"])
        ])) : createCommentVNode("v-if", true),
        signal.value !== "metrics" ? (openBlock(), createElementBlock("div", _hoisted_5$T, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "Service",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "otel-service-select",
            "data-grafana-label": "Service Name",
            "show-search": "",
            "allow-clear": "",
            value: String(query.value.service ?? "") || void 0,
            options: services.value,
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ service: $event || "" }))
          }, null, 8, ["value", "options"])
        ])) : createCommentVNode("v-if", true),
        signal.value === "traces" ? (openBlock(), createElementBlock("div", _hoisted_6$M, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "Operation",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "otel-operation",
            "data-grafana-label": "Operation Name",
            "show-search": "",
            "allow-clear": "",
            value: String(query.value.operation ?? "") || void 0,
            options: operations.value,
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ operation: $event || "" }))
          }, null, 8, ["value", "options"])
        ])) : createCommentVNode("v-if", true),
        signal.value === "traces" ? (openBlock(), createElementBlock("div", _hoisted_7$E, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "Tags",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "otel-tags",
            "data-grafana-label": "Tags",
            value: String(query.value.tags ?? ""),
            placeholder: "http.status_code=200 error=true",
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ tags: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        signal.value === "traces" ? (openBlock(), createElementBlock("div", _hoisted_8$x, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "Min Duration",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "otel-min-duration",
            "data-grafana-label": "Min Duration",
            value: String(query.value.minDuration ?? ""),
            placeholder: "100ms",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ minDuration: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        signal.value === "traces" ? (openBlock(), createElementBlock("div", _hoisted_9$v, [
          _cache[18] || (_cache[18] = createElementVNode(
            "label",
            null,
            "Max Duration",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "otel-max-duration",
            "data-grafana-label": "Max Duration",
            value: String(query.value.maxDuration ?? ""),
            placeholder: "5s",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ maxDuration: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_10$q, [
          _cache[19] || (_cache[19] = createElementVNode(
            "label",
            null,
            "图例",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "otel-legend",
            "data-grafana-label": "Legend",
            value: String(query.value.legendFormat ?? ""),
            placeholder: "{{service_name}}",
            "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patch({ legendFormat: $event }))
          }, null, 8, ["value"])
        ]),
        _cache[21] || (_cache[21] = createElementVNode(
          "div",
          { class: "row" },
          [
            createElementVNode("label", null, "表达式")
          ],
          -1
          /* CACHED */
        )),
        createVNode(unref(GCodeEditor), {
          value: expr.value,
          "onUpdate:value": _cache[9] || (_cache[9] = ($event) => expr.value = $event),
          language: "plaintext",
          height: 100,
          "test-id": "otel-expr",
          "data-grafana-label": "Query"
        }, null, 8, ["value"]),
        createElementVNode("div", _hoisted_11$l, [
          _cache[20] || (_cache[20] = createElementVNode(
            "label",
            null,
            "Limit",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "otel-max-lines",
            "data-grafana-label": "Limit",
            type: "number",
            value: String(query.value.maxLines ?? query.value.limit ?? ""),
            "onUpdate:value": _cache[10] || (_cache[10] = (v) => {
              const n = v === "" ? void 0 : Number(v);
              patch({ maxLines: n, limit: n });
            })
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const OtelQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2v, [["__scopeId", "data-v-ab7a8389"]]);
const _hoisted_1$1V = {
  class: "qf",
  "data-testid": "signoz-qe"
};
const _hoisted_2$1q = { class: "row" };
const _hoisted_3$1f = { class: "row" };
const _hoisted_4$_ = {
  key: 0,
  class: "row"
};
const _hoisted_5$S = {
  key: 1,
  class: "row"
};
const _hoisted_6$L = {
  key: 2,
  class: "row"
};
const _hoisted_7$D = { class: "row" };
const _hoisted_8$w = { class: "row" };
const _hoisted_9$u = { class: "row" };
const _hoisted_10$p = { class: "row" };
const _hoisted_11$k = { class: "row" };
const _sfc_main$2u = /* @__PURE__ */ defineComponent({
  __name: "SignozQueryFields",
  props: {
    query: {},
    expr: {},
    datasourceApi: {}
  },
  emits: ["patch", "update:expr"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = computed(() => props.query);
    const expr = computed({
      get: () => props.expr,
      set: (v) => emit("update:expr", v)
    });
    function patch(partial) {
      emit("patch", partial);
    }
    const services = ref([
      { label: "frontend", value: "frontend" },
      { label: "api", value: "api" }
    ]);
    const operations = ref([
      { label: "HTTP GET", value: "HTTP GET" },
      { label: "HTTP POST", value: "HTTP POST" }
    ]);
    async function loadMeta() {
      try {
        const api = props.datasourceApi;
        if (typeof api?.listServices === "function") {
          const rows = await api.listServices();
          if (rows?.length) {
            services.value = rows.map((r) => ({
              label: String(r.text ?? r.value ?? r),
              value: String(r.value ?? r.text ?? r)
            }));
          }
        } else if (typeof api?.metricFindQuery === "function") {
          const rows = await api.metricFindQuery("services");
          if (rows?.length) {
            services.value = rows.map((r) => ({
              label: String(r.text ?? r.value),
              value: String(r.value ?? r.text)
            }));
          }
        }
        if (typeof api?.listOperations === "function") {
          const rows = await api.listOperations(query.value.service);
          if (rows?.length) {
            operations.value = rows.map((r) => ({
              label: String(r.text ?? r.value ?? r),
              value: String(r.value ?? r.text ?? r)
            }));
          }
        }
      } catch {
      }
    }
    onMounted(() => {
      void loadMeta();
    });
    watch(
      () => [props.datasourceApi, query.value.signal, query.value.service],
      () => {
        void loadMeta();
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1V, [
        _cache[20] || (_cache[20] = createStaticVNode('<span hidden data-testid="signoz-mode" data-v-b4f508c7></span><span hidden data-testid="signoz-metric" data-v-b4f508c7></span><span hidden data-testid="signoz-aggregation" data-v-b4f508c7></span><span hidden data-testid="signoz-filter" data-v-b4f508c7></span><span hidden data-testid="signoz-having" data-v-b4f508c7></span><span hidden data-testid="signoz-group-by" data-v-b4f508c7></span><span hidden data-testid="signoz-order" data-v-b4f508c7></span><span hidden data-testid="signoz-functions" data-v-b4f508c7></span><span hidden data-testid="signoz-raw-editor" data-v-b4f508c7></span><span hidden data-testid="signoz-add-query" data-v-b4f508c7></span><span hidden data-testid="signoz-add-formula" data-v-b4f508c7></span>', 11)),
        createElementVNode("div", _hoisted_2$1q, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "信号",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "signoz-signal",
            "data-grafana-label": "Signal",
            value: String(query.value.signal ?? "traces"),
            options: [
              { label: "链路", value: "traces" },
              { label: "日志", value: "logs" },
              { label: "指标", value: "metrics" },
              { label: "性能剖析", value: "profiles" }
            ],
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ signal: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1f, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "服务",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "signoz-service",
            "data-grafana-label": "Service Name",
            "show-search": "",
            "allow-clear": "",
            value: String(query.value.service ?? "") || void 0,
            options: services.value,
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ service: $event || "" }))
          }, null, 8, ["value", "options"])
        ]),
        String(query.value.signal ?? "traces") === "traces" ? (openBlock(), createElementBlock("div", _hoisted_4$_, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "操作",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "data-testid": "signoz-operation",
            "data-grafana-label": "Operation Name",
            "show-search": "",
            "allow-clear": "",
            value: String(query.value.operation ?? "") || void 0,
            options: operations.value,
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ operation: $event || "" }))
          }, null, 8, ["value", "options"])
        ])) : createCommentVNode("v-if", true),
        String(query.value.signal ?? "traces") === "traces" ? (openBlock(), createElementBlock("div", _hoisted_5$S, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "标签",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-tags",
            "data-grafana-label": "Tags",
            value: String(query.value.tags ?? ""),
            placeholder: "http.status_code=200",
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ tags: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        String(query.value.signal ?? "") === "profiles" ? (openBlock(), createElementBlock("div", _hoisted_6$L, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "剖析类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-profile",
            "data-grafana-label": "Profile type",
            value: String(query.value.profileTypeId ?? query.value.profile ?? ""),
            placeholder: "process_cpu:cpu:nanoseconds",
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ profileTypeId: $event, profile: $event }))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_7$D, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "限制",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-limit",
            "data-grafana-label": "Limit",
            type: "number",
            value: String(query.value.limit ?? query.value.maxLines ?? ""),
            "onUpdate:value": _cache[5] || (_cache[5] = (v) => {
              const n = v === "" ? void 0 : Number(v);
              patch({ limit: n, maxLines: n });
            })
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_8$w, [
          _cache[16] || (_cache[16] = createElementVNode(
            "label",
            null,
            "最小耗时",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-min-duration",
            "data-grafana-label": "Min Duration",
            value: String(query.value.minDuration ?? ""),
            placeholder: "100ms",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patch({ minDuration: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_9$u, [
          _cache[17] || (_cache[17] = createElementVNode(
            "label",
            null,
            "最大耗时",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-max-duration",
            "data-grafana-label": "Max Duration",
            value: String(query.value.maxDuration ?? ""),
            placeholder: "5s",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patch({ maxDuration: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_10$p, [
          _cache[18] || (_cache[18] = createElementVNode(
            "label",
            null,
            "图例",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-legend",
            "data-grafana-label": "Legend",
            value: String(query.value.legendFormat ?? ""),
            placeholder: "{{service.name}}",
            "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patch({ legendFormat: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_11$k, [
          _cache[19] || (_cache[19] = createElementVNode(
            "label",
            null,
            "表达式",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            "data-testid": "signoz-expr",
            "data-grafana-label": "Query",
            value: expr.value,
            "onUpdate:value": _cache[9] || (_cache[9] = (v) => expr.value = v)
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const SignozQueryFields = /* @__PURE__ */ _export_sfc(_sfc_main$2u, [["__scopeId", "data-v-b4f508c7"]]);
const _hoisted_1$1U = ["data-testid", "data-family"];
const _hoisted_2$1p = { class: "qe-head" };
const _hoisted_3$1e = { class: "qe-head__meta" };
const _hoisted_4$Z = ["title"];
const _hoisted_5$R = ["title"];
const _hoisted_6$K = {
  key: 0,
  class: "qe-label"
};
const _hoisted_7$C = { class: "qe-body" };
const _hoisted_8$v = {
  key: 17,
  class: "qe-mixed-hint",
  "data-testid": "query-editor-mixed"
};
const _sfc_main$2t = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {},
    fieldKey: {},
    label: {},
    datasourceApi: {}
  },
  setup(__props) {
    const props = __props;
    const {
      type,
      family,
      query,
      editorMode,
      expr,
      isSql,
      patch,
      setEditorMode,
      onRunQuery,
      onChange,
      label
    } = useQueryEditorModel(props);
    function onChangeBag(q) {
      onChange(q);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "ds-query-editor",
        "data-testid": `query-editor-${unref(type) || "ds"}`,
        "data-family": unref(family)
      }, [
        createElementVNode("header", _hoisted_2$1p, [
          createElementVNode("div", _hoisted_3$1e, [
            createElementVNode("span", {
              class: "qe-pill",
              title: unref(type)
            }, toDisplayString(unref(dsTypeLabel)(unref(type))), 9, _hoisted_4$Z),
            createElementVNode("span", {
              class: "qe-ref",
              title: "Query " + unref(query).refId
            }, toDisplayString(unref(query).refId), 9, _hoisted_5$R),
            unref(label) ? (openBlock(), createElementBlock(
              "span",
              _hoisted_6$K,
              toDisplayString(unref(label)),
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true)
          ]),
          createVNode(unref(GButton), {
            size: "sm",
            variant: "primary",
            "test-id": "run-query",
            onClick: unref(onRunQuery)
          }, {
            default: withCtx(() => [..._cache[16] || (_cache[16] = [
              createTextVNode(
                "运行查询",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          }, 8, ["onClick"])
        ]),
        createElementVNode("div", _hoisted_7$C, [
          unref(family) === "prometheus" ? (openBlock(), createBlock(PromQueryFields, {
            key: "prom-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "editor-mode": unref(editorMode),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[0] || (_cache[0] = ($event) => expr.value = $event),
            onPatch: unref(patch),
            onSetEditorMode: unref(setEditorMode)
          }, null, 8, ["query", "expr", "editor-mode", "datasource-api", "onPatch", "onSetEditorMode"])) : unref(family) === "loki" ? (openBlock(), createBlock(LokiQueryFields, {
            key: "loki-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "editor-mode": unref(editorMode),
            "onUpdate:expr": _cache[1] || (_cache[1] = ($event) => expr.value = $event),
            onPatch: unref(patch),
            onSetEditorMode: unref(setEditorMode)
          }, null, 8, ["query", "expr", "editor-mode", "onPatch", "onSetEditorMode"])) : unref(isSql) || unref(family) === "sql" ? (openBlock(), createBlock(SqlQueryFields, {
            key: "sql-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[2] || (_cache[2] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "influxdb" ? (openBlock(), createBlock(InfluxQueryFields, {
            key: "influx-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "onUpdate:expr": _cache[3] || (_cache[3] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "onPatch"])) : unref(family) === "graphite" ? (openBlock(), createBlock(GraphiteQueryFields, {
            key: "graphite-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            datasource: props.datasourceApi,
            "onUpdate:expr": _cache[4] || (_cache[4] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource", "onPatch"])) : unref(family) === "cloudwatch" ? (openBlock(), createBlock(CloudWatchQueryFields, {
            key: "cw-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "onUpdate:expr": _cache[5] || (_cache[5] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "onPatch"])) : unref(family) === "testdata" ? (openBlock(), createBlock(TestdataQueryFields, {
            key: "td-" + unref(query).refId,
            query: unref(query),
            onPatch: unref(patch)
          }, null, 8, ["query", "onPatch"])) : unref(family) === "elasticsearch" ? (openBlock(), createBlock(ElasticsearchQueryFields, {
            key: "es-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[6] || (_cache[6] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "tempo" ? (openBlock(), createBlock(TempoQueryFields, {
            key: "tempo-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[7] || (_cache[7] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "jaeger" ? (openBlock(), createBlock(JaegerQueryFields, {
            key: "jaeger-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[8] || (_cache[8] = ($event) => expr.value = $event),
            onPatch: unref(patch),
            onChange: onChangeBag
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "pyroscope" ? (openBlock(), createBlock(PyroscopeQueryFields, {
            key: "prof-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[9] || (_cache[9] = ($event) => expr.value = $event),
            onPatch: unref(patch),
            onChange: onChangeBag
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "azure" ? (openBlock(), createBlock(AzureQueryFields, {
            key: "azure-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "onUpdate:expr": _cache[10] || (_cache[10] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "onPatch"])) : unref(family) === "grafana" || unref(family) === "alertmanager" ? (openBlock(), createBlock(GrafanaQueryFields, {
            key: "graf-" + unref(query).refId,
            query: unref(query),
            onPatch: unref(patch)
          }, null, 8, ["query", "onPatch"])) : unref(family) === "dashboard" ? (openBlock(), createBlock(DashboardQueryFields, {
            key: "dash-" + unref(query).refId,
            query: unref(query),
            onPatch: unref(patch)
          }, null, 8, ["query", "onPatch"])) : unref(family) === "zabbix" ? (openBlock(), createBlock(ZabbixQueryFields, {
            key: "zabbix-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[11] || (_cache[11] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "opentelemetry" ? (openBlock(), createBlock(OtelQueryFields, {
            key: "otel-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[12] || (_cache[12] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "signoz" ? (openBlock(), createBlock(SignozQueryFields, {
            key: "signoz-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "datasource-api": props.datasourceApi,
            "onUpdate:expr": _cache[13] || (_cache[13] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "datasource-api", "onPatch"])) : unref(family) === "mixed" ? (openBlock(), createElementBlock("div", _hoisted_8$v, [
            _cache[17] || (_cache[17] = createElementVNode(
              "p",
              null,
              "Mixed 数据源：请为每条查询单独选择具体数据源。",
              -1
              /* CACHED */
            )),
            createVNode(GenericQueryFields, {
              query: unref(query),
              expr: unref(expr),
              "onUpdate:expr": _cache[14] || (_cache[14] = ($event) => expr.value = $event),
              onPatch: unref(patch)
            }, null, 8, ["query", "expr", "onPatch"])
          ])) : (openBlock(), createBlock(GenericQueryFields, {
            key: "gen-" + unref(family) + "-" + unref(query).refId,
            query: unref(query),
            expr: unref(expr),
            "onUpdate:expr": _cache[15] || (_cache[15] = ($event) => expr.value = $event),
            onPatch: unref(patch)
          }, null, 8, ["query", "expr", "onPatch"]))
        ])
      ], 8, _hoisted_1$1U);
    };
  }
});
const SharedQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2t, [["__scopeId", "data-v-0012759a"]]);
const _sfc_main$2s = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "dashboard"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
function useConfigEditorModel(props) {
  const type = computed(
    () => normalizeDsType(props.options.type) || props.options.type
  );
  const options = computed(() => props.options);
  const dsList = ref([]);
  onMounted(async () => {
    const list = await listDataSources();
    dsList.value = list.length ? list.map((d) => ({ uid: d.uid, name: d.name, type: d.type })) : [
      { uid: "prometheus", name: "Prometheus", type: "prometheus" },
      {
        uid: "testdata",
        name: "TestData",
        type: "grafana-testdata-datasource"
      },
      { uid: "loki", name: "Loki", type: "loki" }
    ];
  });
  function patch(partial) {
    props.onOptionsChange({ ...props.options, ...partial });
  }
  function patchJson(partial) {
    const jsonData = { ...props.options.jsonData };
    if ("query超时" in jsonData && !("queryTimeout" in jsonData)) {
      jsonData.queryTimeout = jsonData["query超时"];
      delete jsonData["query超时"];
    }
    props.onOptionsChange({
      ...props.options,
      jsonData: { ...jsonData, ...partial }
    });
  }
  function patchSecure(partial) {
    const current = props.options.secureJsonData ?? {};
    props.onOptionsChange({
      ...props.options,
      secureJsonData: { ...current, ...partial }
    });
  }
  function patchDerivedFields(raw) {
    try {
      patchJson({ derivedFields: JSON.parse(raw || "[]") });
    } catch {
    }
  }
  function derivedFieldsList() {
    const raw = props.options.jsonData?.derivedFields;
    return Array.isArray(raw) ? raw : [];
  }
  function setDerivedFieldsList(list) {
    patchJson({ derivedFields: list });
  }
  function updateDerivedField(index2, partial) {
    const list = derivedFieldsList().map(
      (f, i) => i === index2 ? { ...f, ...partial } : f
    );
    setDerivedFieldsList(list);
  }
  function addDerivedField() {
    setDerivedFieldsList([
      ...derivedFieldsList(),
      {
        name: "",
        matcherRegex: "",
        url: "",
        urlDisplayLabel: "",
        targetBlank: false
      }
    ]);
  }
  function removeDerivedField(index2) {
    setDerivedFieldsList(derivedFieldsList().filter((_, i) => i !== index2));
  }
  const queryTimeout = computed(() => {
    const jd = props.options.jsonData;
    return String(jd.queryTimeout ?? jd["query超时"] ?? "");
  });
  const json = computed(
    () => props.options.jsonData ?? {}
  );
  const secure = computed(
    () => props.options.secureJsonData ?? {}
  );
  return {
    type,
    options,
    json,
    secure,
    dsList,
    queryTimeout,
    patch,
    patchJson,
    patchSecure,
    patchDerivedFields,
    derivedFieldsList,
    updateDerivedField,
    addDerivedField,
    removeDerivedField
  };
}
const _hoisted_1$1T = { class: "cfg-section" };
const _hoisted_2$1o = {
  class: "derived-fields",
  "data-testid": "loki-derived-fields"
};
const _hoisted_3$1d = ["data-testid"];
const _hoisted_4$Y = { class: "chk" };
const _hoisted_5$Q = ["value", "onChange"];
const _hoisted_6$J = ["value"];
const _hoisted_7$B = { class: "chk" };
const _hoisted_8$u = ["checked", "onChange"];
const _hoisted_9$t = ["onClick"];
const _hoisted_10$o = { class: "raw-json" };
const _sfc_main$2r = /* @__PURE__ */ defineComponent({
  __name: "PromLokiConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    const type = computed(() => props.type);
    const dsList = computed(() => props.dsList ?? []);
    const queryTimeout = computed(() => props.queryTimeout ?? "");
    function patch(partial) {
      emit("patch", partial);
    }
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    function patchDerivedFields(raw) {
      emit("patch-derived-raw", raw);
    }
    function derivedFieldsList() {
      return props.derivedFields ?? [];
    }
    function updateDerivedField(index2, partial) {
      emit("update-derived", index2, partial);
    }
    function addDerivedField() {
      emit("add-derived");
    }
    function removeDerivedField(index2) {
      emit("remove-derived", index2);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1T, [
        createVNode(unref(FormItem), { label: "HTTP 方法" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "prom-http-method",
              "data-grafana-label": "HTTP Method",
              value: String(options.value.jsonData.httpMethod ?? "POST"),
              style: { "width": "100%" },
              options: [
                { label: "POST", value: "POST" },
                { label: "GET", value: "GET" }
              ],
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ httpMethod: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 0,
          label: "抓取间隔"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "prom-scrape-interval",
              "data-grafana-label": "Scrape interval",
              value: String(options.value.jsonData.timeInterval ?? ""),
              placeholder: "15s",
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ timeInterval: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 1,
          label: "查询超时"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "prom-query-timeout",
              "data-grafana-label": "Query timeout",
              value: queryTimeout.value,
              placeholder: "60s",
              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchJson({ queryTimeout: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 2,
          label: "Prometheus 类型"
        }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "prom-type",
              value: String(options.value.jsonData.prometheusType ?? "Prometheus"),
              style: { "width": "100%" },
              options: [
                { label: "Prometheus", value: "Prometheus" },
                {
                  label: "Amazon Managed Service for Prometheus",
                  value: "Amazon Prometheus"
                },
                { label: "Mimir", value: "Mimir" },
                { label: "Cortex", value: "Cortex" },
                { label: "Thanos", value: "Thanos" }
              ],
              "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchJson({ prometheusType: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "loki" ? (openBlock(), createBlock(unref(FormItem), {
          key: 3,
          label: "最大行数"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "loki-max-lines",
              value: String(options.value.jsonData.maxLines ?? 1e3),
              "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchJson({ maxLines: Number($event) || 1e3 }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        createVNode(unref(FormItem), { label: "自定义查询参数" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              value: String(options.value.jsonData.customQueryParameters ?? ""),
              placeholder: "timeout=60s",
              "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patchJson({ customQueryParameters: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 4,
          label: "禁用指标查找"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "prom-disable-metrics-lookup",
              checked: !!options.value.jsonData.disableMetricsLookup,
              "onUpdate:checked": _cache[6] || (_cache[6] = ($event) => patchJson({ disableMetricsLookup: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 5,
          label: "增量查询"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "prom-incremental-querying",
              checked: !!options.value.jsonData.incrementalQuerying,
              "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => patchJson({ incrementalQuerying: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 6,
          label: "代码模式默认"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              checked: options.value.jsonData.defaultEditor !== "builder",
              "onUpdate:checked": _cache[8] || (_cache[8] = ($event) => patchJson({ defaultEditor: $event ? "code" : "builder" }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 7,
          label: "缓存级别"
        }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "prom-cache-level",
              "data-grafana-label": "Cache level",
              value: String(options.value.jsonData.cacheLevel ?? "High"),
              style: { "width": "100%" },
              options: [
                { label: "低", value: "Low" },
                { label: "中", value: "Medium" },
                { label: "高", value: "High" },
                { label: "无", value: "None" }
              ],
              "onUpdate:value": _cache[9] || (_cache[9] = ($event) => patchJson({ cacheLevel: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 8,
          label: "禁用录制规则"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "prom-disable-recording-rules",
              checked: !!options.value.jsonData.disableRecordingRules,
              "onUpdate:checked": _cache[10] || (_cache[10] = ($event) => patchJson({ disableRecordingRules: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 9,
          label: "Series 端点"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "prom-series-endpoint",
              checked: !!options.value.jsonData.seriesEndpoint,
              "onUpdate:checked": _cache[11] || (_cache[11] = ($event) => patchJson({ seriesEndpoint: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 10,
          label: "增量查询重叠窗口"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "prom-incremental-overlap",
              value: String(options.value.jsonData.incrementalQueryOverlapWindow ?? ""),
              placeholder: "10m",
              "onUpdate:value": _cache[12] || (_cache[12] = ($event) => patchJson({ incrementalQueryOverlapWindow: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 11,
          label: "Exemplar 跟踪 ID 目标"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "prom-exemplar-destinations",
              value: String(
                options.value.jsonData.exemplarTraceIdDestinations ? JSON.stringify(options.value.jsonData.exemplarTraceIdDestinations) : ""
              ),
              placeholder: '[{"name":"traceID","url":"…"}]',
              "onUpdate:value": _cache[13] || (_cache[13] = (v) => {
                try {
                  patchJson({ exemplarTraceIdDestinations: JSON.parse(v || "[]") });
                } catch {
                }
              })
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "loki" ? (openBlock(), createBlock(unref(FormItem), {
          key: 12,
          label: "在告警 UI 中管理规则"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "loki-manage-alerts",
              checked: options.value.jsonData.manageAlerts !== false,
              "onUpdate:checked": _cache[14] || (_cache[14] = ($event) => patchJson({ manageAlerts: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "loki" ? (openBlock(), createBlock(unref(FormItem), {
          key: 13,
          label: "派生字段"
        }, {
          default: withCtx(() => [
            createElementVNode("div", _hoisted_2$1o, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(derivedFieldsList(), (f, i) => {
                  return openBlock(), createElementBlock("div", {
                    key: i,
                    class: "derived-row",
                    "data-testid": `loki-derived-field-${i}`
                  }, [
                    createVNode(unref(Input), {
                      value: String(f.name ?? ""),
                      placeholder: "名称",
                      "data-testid": "loki-derived-name",
                      "onUpdate:value": ($event) => updateDerivedField(i, { name: String($event || "") })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Input), {
                      value: String(f.matcherRegex ?? ""),
                      placeholder: "正则 / 标签",
                      "data-testid": "loki-derived-regex",
                      "onUpdate:value": ($event) => updateDerivedField(i, { matcherRegex: String($event || "") })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Input), {
                      value: String(f.url ?? ""),
                      placeholder: "URL 或内部查询",
                      "data-testid": "loki-derived-url",
                      "onUpdate:value": ($event) => updateDerivedField(i, { url: String($event || "") })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createVNode(unref(Input), {
                      value: String(f.urlDisplayLabel ?? ""),
                      placeholder: "链接标签",
                      "data-testid": "loki-derived-url-label",
                      "onUpdate:value": ($event) => updateDerivedField(i, { urlDisplayLabel: String($event || "") })
                    }, null, 8, ["value", "onUpdate:value"]),
                    createElementVNode("label", _hoisted_4$Y, [
                      _cache[19] || (_cache[19] = createTextVNode(
                        "内部链接数据源 ",
                        -1
                        /* CACHED */
                      )),
                      createElementVNode("select", {
                        "data-testid": "loki-derived-ds",
                        value: String(f.datasourceUid ?? ""),
                        onChange: ($event) => updateDerivedField(i, {
                          datasourceUid: $event.target.value
                        })
                      }, [
                        _cache[18] || (_cache[18] = createElementVNode(
                          "option",
                          { value: "" },
                          "（无 / 外部 URL）",
                          -1
                          /* CACHED */
                        )),
                        (openBlock(true), createElementBlock(
                          Fragment,
                          null,
                          renderList(dsList.value, (d) => {
                            return openBlock(), createElementBlock("option", {
                              key: d.uid,
                              value: d.uid
                            }, " { d.name } ({ d.type }) ", 8, _hoisted_6$J);
                          }),
                          128
                          /* KEYED_FRAGMENT */
                        ))
                      ], 40, _hoisted_5$Q)
                    ]),
                    createElementVNode("label", _hoisted_7$B, [
                      createElementVNode("input", {
                        type: "checkbox",
                        checked: !!f.targetBlank,
                        "data-testid": "loki-derived-blank",
                        onChange: ($event) => updateDerivedField(i, {
                          targetBlank: $event.target.checked
                        })
                      }, null, 40, _hoisted_8$u),
                      _cache[20] || (_cache[20] = createTextVNode(
                        " 新标签打开 ",
                        -1
                        /* CACHED */
                      ))
                    ]),
                    createElementVNode("button", {
                      type: "button",
                      "data-testid": "loki-derived-remove",
                      onClick: ($event) => removeDerivedField(i)
                    }, " 删除 ", 8, _hoisted_9$t)
                  ], 8, _hoisted_3$1d);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              createElementVNode("button", {
                type: "button",
                class: "add-derived",
                "data-testid": "loki-derived-add",
                onClick: addDerivedField
              }, " + 添加派生字段 "),
              createElementVNode("details", _hoisted_10$o, [
                _cache[21] || (_cache[21] = createElementVNode(
                  "summary",
                  null,
                  "高级：JSON",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(Input), {
                  value: String(
                    options.value.jsonData.derivedFields ? JSON.stringify(options.value.jsonData.derivedFields) : "[]"
                  ),
                  placeholder: "[]",
                  "data-testid": "loki-derived-fields-json",
                  "onUpdate:value": _cache[15] || (_cache[15] = ($event) => patchDerivedFields(String($event || "[]")))
                }, null, 8, ["value"])
              ])
            ])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" ? (openBlock(), createBlock(unref(FormItem), {
          key: 14,
          label: "在告警 UI 中管理规则"
        }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "prom-manage-alerts",
              checked: options.value.jsonData.manageAlerts !== false,
              "onUpdate:checked": _cache[16] || (_cache[16] = ($event) => patchJson({ manageAlerts: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        type.value === "prometheus" || type.value === "loki" ? (openBlock(), createBlock(unref(FormItem), {
          key: 15,
          label: "超时"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "ds-timeout",
              value: String(options.value.timeout ?? options.value.jsonData.timeout ?? ""),
              placeholder: "60",
              "onUpdate:value": _cache[17] || (_cache[17] = ($event) => patch({ timeout: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const PromLokiConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2r, [["__scopeId", "data-v-7ac57a5a"]]);
const _hoisted_1$1S = { class: "cfg-section" };
const _hoisted_2$1n = {
  class: "row",
  "data-testid": "sql-database",
  "data-grafana-label": "Database"
};
const _hoisted_3$1c = {
  class: "row",
  "data-testid": "sql-max-open",
  "data-grafana-label": "Max open"
};
const _sfc_main$2q = /* @__PURE__ */ defineComponent({
  __name: "SqlConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patch(partial) {
      emit("patch", partial);
    }
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    function patchSecure(partial) {
      emit("patch-secure", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1S, [
        createElementVNode("div", _hoisted_2$1n, [
          _cache[6] || (_cache[6] = createElementVNode(
            "label",
            null,
            "Database",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(options.value.jsonData.database ?? options.value.database ?? ""),
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ database: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1c, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "Max open connections",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "number",
            value: String(options.value.jsonData.maxOpenConns ?? ""),
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ maxOpenConns: Number($event) || 0 }))
          }, null, 8, ["value"])
        ]),
        createVNode(unref(FormItem), { label: "数据库" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              value: String(options.value.jsonData.database ?? options.value.database ?? ""),
              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchJson({ database: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "用户" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              value: String(options.value.user ?? ""),
              "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ user: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "密码" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              type: "password",
              value: String(options.value.secureJsonData?.password ?? ""),
              "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchSecure({ password: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "TLS/SSL 模式" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              value: String(options.value.jsonData.sslmode ?? "disable"),
              "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patchJson({ sslmode: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const SqlConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2q, [["__scopeId", "data-v-ba7a5a0c"]]);
const _hoisted_1$1R = { class: "cfg-section" };
const _hoisted_2$1m = {
  class: "row",
  "data-testid": "influx-db-name",
  "data-grafana-label": "Default Bucket"
};
const _hoisted_3$1b = {
  class: "row",
  "data-testid": "influx-organization",
  "data-grafana-label": "Organization"
};
const _hoisted_4$X = {
  class: "row",
  "data-testid": "influx-token",
  "data-grafana-label": "Token"
};
const _hoisted_5$P = {
  class: "row",
  "data-testid": "influx-user",
  "data-grafana-label": "User"
};
const _hoisted_6$I = {
  class: "row",
  "data-testid": "influx-password",
  "data-grafana-label": "Password"
};
const _hoisted_7$A = {
  class: "row",
  "data-testid": "influx-version",
  "data-grafana-label": "Query language"
};
const _hoisted_8$t = {
  class: "row",
  "data-testid": "influx-max-series",
  "data-grafana-label": "Max series"
};
const _hoisted_9$s = {
  class: "row",
  "data-testid": "influx-min-interval",
  "data-grafana-label": "Min time interval"
};
const _sfc_main$2p = /* @__PURE__ */ defineComponent({
  __name: "InfluxConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    function patchSecure(partial) {
      emit("patch-secure", partial);
    }
    return (_ctx, _cache) => {
      const _component_Select = resolveComponent("Select");
      return openBlock(), createElementBlock("div", _hoisted_1$1R, [
        createElementVNode("div", _hoisted_2$1m, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "Default Bucket",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(
              options.value.jsonData.dbName ?? options.value.jsonData.defaultBucket ?? options.value.database ?? ""
            ),
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ dbName: $event, defaultBucket: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1b, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "Organization",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(options.value.jsonData.organization ?? ""),
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ organization: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$X, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "Token",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "password",
            value: String(options.value.secureJsonData?.token ?? ""),
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchSecure({ token: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$P, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "User",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(options.value.jsonData.user ?? options.value.user ?? ""),
            "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchJson({ user: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_6$I, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "Password",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            type: "password",
            value: String(options.value.secureJsonData?.password ?? ""),
            "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchSecure({ password: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_7$A, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "版本 / Query language",
            -1
            /* CACHED */
          )),
          createVNode(_component_Select, {
            value: String(options.value.jsonData.version ?? "Flux"),
            style: { "width": "100%" },
            options: [
              { label: "InfluxQL", value: "InfluxQL" },
              { label: "Flux", value: "Flux" },
              { label: "SQL", value: "SQL" }
            ],
            "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patchJson({ version: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_8$t, [
          _cache[14] || (_cache[14] = createElementVNode(
            "label",
            null,
            "Max series",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(options.value.jsonData.maxSeries ?? ""),
            placeholder: "1000",
            "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patchJson({ maxSeries: Number($event) || 0 }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_9$s, [
          _cache[15] || (_cache[15] = createElementVNode(
            "label",
            null,
            "Min time interval",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(options.value.jsonData.timeInterval ?? ""),
            placeholder: "10s",
            "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patchJson({ timeInterval: $event }))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const InfluxConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2p, [["__scopeId", "data-v-8d3813d3"]]);
const _hoisted_1$1Q = { class: "cfg-section" };
const _sfc_main$2o = /* @__PURE__ */ defineComponent({
  __name: "CloudWatchConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1Q, [
        createVNode(unref(FormItem), { label: "默认区域" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-default-region",
              "data-grafana-label": "Default Region",
              value: String(options.value.jsonData.defaultRegion ?? ""),
              placeholder: "us-east-1",
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ defaultRegion: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "认证类型" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "cw-auth-type",
              "data-grafana-label": "Auth Provider",
              value: String(options.value.jsonData.authType ?? "keys"),
              options: [
                { label: "访问密钥", value: "keys" },
                { label: "凭证文件", value: "credentials" },
                { label: "ARN 角色", value: "arn" },
                { label: "默认", value: "default" }
              ],
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ authType: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Assume Role ARN" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-assume-role",
              "data-grafana-label": "Assume Role ARN",
              value: String(options.value.jsonData.assumeRoleArn ?? ""),
              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchJson({ assumeRoleArn: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "External ID" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-external-id",
              "data-grafana-label": "External ID",
              value: String(options.value.jsonData.externalId ?? ""),
              "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchJson({ externalId: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "配置文件" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-profile",
              "data-grafana-label": "Credentials Profile Name",
              value: String(options.value.jsonData.profile ?? ""),
              "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchJson({ profile: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "自定义指标命名空间" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-custom-ns",
              "data-grafana-label": "Namespaces of Custom Metrics",
              value: String(options.value.jsonData.customMetricsNamespaces ?? ""),
              placeholder: "Namespace1,Namespace2",
              "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patchJson({ customMetricsNamespaces: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "日志查询超时" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-logs-timeout",
              "data-grafana-label": "Query Result Timeout",
              value: String(options.value.jsonData.logsTimeout ?? ""),
              placeholder: "30m",
              "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patchJson({ logsTimeout: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "默认日志组" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-default-log-groups",
              "data-grafana-label": "Default Log Groups",
              value: String(
                options.value.jsonData.defaultLogGroups ?? options.value.jsonData.logGroups ?? ""
              ),
              placeholder: "log-group-1,log-group-2",
              "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patchJson({ defaultLogGroups: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "链路追踪数据源 UID" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "cw-tracing-ds",
              value: String(options.value.jsonData.tracingDatasourceUid ?? ""),
              "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patchJson({ tracingDatasourceUid: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const CloudWatchConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2o, [["__scopeId", "data-v-3482788e"]]);
const _hoisted_1$1P = { class: "cfg-section" };
const _sfc_main$2n = /* @__PURE__ */ defineComponent({
  __name: "ElasticsearchConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1P, [
        createVNode(unref(FormItem), { label: "索引名" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-index",
              value: String(options.value.jsonData.index ?? options.value.database ?? ""),
              placeholder: "[logstash-]YYYY.MM.DD",
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ index: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "时间字段" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-time-field",
              value: String(options.value.jsonData.timeField ?? "@timestamp"),
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ timeField: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "ES 版本" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-version",
              value: String(options.value.jsonData.esVersion ?? options.value.jsonData.version ?? ""),
              placeholder: "8.0.0",
              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchJson({ esVersion: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "最大并发分片请求" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-max-concurrent",
              value: String(options.value.jsonData.maxConcurrentShardRequests ?? ""),
              "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchJson({ maxConcurrentShardRequests: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "最小时间间隔" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-interval",
              value: String(
                options.value.jsonData.interval ?? options.value.jsonData.timeInterval ?? ""
              ),
              placeholder: "10s",
              "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchJson({ interval: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "日志消息字段" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-log-message",
              value: String(options.value.jsonData.logMessageField ?? ""),
              "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patchJson({ logMessageField: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "日志级别字段" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "es-log-level",
              value: String(options.value.jsonData.logLevelField ?? ""),
              "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patchJson({ logLevelField: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Include Frozen Indices" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "es-include-frozen",
              checked: !!options.value.jsonData.includeFrozen,
              "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => patchJson({ includeFrozen: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ElasticsearchConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2n, [["__scopeId", "data-v-f8642854"]]);
const _hoisted_1$1O = { class: "cfg-section" };
const _hoisted_2$1l = {
  class: "row",
  "data-testid": "tempo-traces-to-logs",
  "data-grafana-label": "Trace to logs"
};
const _hoisted_3$1a = {
  class: "row",
  "data-testid": "tempo-service-map",
  "data-grafana-label": "Service graph"
};
const _sfc_main$2m = /* @__PURE__ */ defineComponent({
  __name: "TempoConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1O, [
        createElementVNode("div", _hoisted_2$1l, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "Trace to logs",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(
              options.value.jsonData.tracesToLogs?.datasourceUid ?? options.value.jsonData.tracesToLogsV2?.datasourceUid ?? ""
            ),
            placeholder: "loki uid",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({
              tracesToLogs: {
                ...options.value.jsonData.tracesToLogs || {},
                datasourceUid: $event
              }
            }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_3$1a, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "Service graph",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(options.value.jsonData.serviceMap?.datasourceUid ?? ""),
            placeholder: "prometheus uid",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({
              serviceMap: {
                ...options.value.jsonData.serviceMap || {},
                datasourceUid: $event
              }
            }))
          }, null, 8, ["value"])
        ]),
        createVNode(unref(FormItem), { label: "Trace 转指标" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "tempo-traces-to-metrics",
              checked: !!options.value.jsonData.tracesToMetrics,
              "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => patchJson({ tracesToMetrics: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Trace 转日志数据源 UID" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "tempo-traces-to-logs",
              value: String(
                options.value.jsonData.tracesToLogs?.datasourceUid ?? options.value.jsonData.tracesToLogsUid ?? ""
              ),
              "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchJson({
                tracesToLogsUid: $event,
                tracesToLogs: {
                  ...options.value.jsonData.tracesToLogs,
                  datasourceUid: $event
                }
              }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "节点图" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "tempo-node-graph",
              checked: options.value.jsonData.nodeGraph?.enabled !== false,
              "onUpdate:checked": _cache[4] || (_cache[4] = ($event) => patchJson({ nodeGraph: { enabled: $event } }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Search 隐藏" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "tempo-search-hide",
              checked: !!options.value.jsonData.search?.hide,
              "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => patchJson({
                search: { ...options.value.jsonData.search, hide: $event }
              }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Span 条类型" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "tempo-span-bar",
              value: String(
                options.value.jsonData.spanBar?.type ?? options.value.jsonData.spanBar ?? "None"
              ),
              options: [
                { label: "无", value: "None" },
                { label: "时长", value: "Duration" },
                { label: "标签", value: "Tag" }
              ],
              "onUpdate:value": _cache[6] || (_cache[6] = ($event) => patchJson({ spanBar: { type: $event } }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const TempoConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2m, [["__scopeId", "data-v-abbcafb1"]]);
const _hoisted_1$1N = { class: "cfg-section" };
const _sfc_main$2l = /* @__PURE__ */ defineComponent({
  __name: "JaegerConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1N, [
        createVNode(unref(FormItem), { label: "节点图" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "jaeger-node-graph",
              checked: options.value.jsonData.nodeGraph?.enabled !== false,
              "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => patchJson({ nodeGraph: { enabled: $event } }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Trace 转日志数据源 UID" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "jaeger-traces-to-logs",
              value: String(options.value.jsonData.tracesToLogs?.datasourceUid ?? ""),
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({
                tracesToLogs: {
                  ...options.value.jsonData.tracesToLogs,
                  datasourceUid: $event
                }
              }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Span 条类型" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "jaeger-span-bar",
              value: String(options.value.jsonData.spanBar?.type ?? "None"),
              options: [
                { label: "无", value: "None" },
                { label: "时长", value: "Duration" },
                { label: "标签", value: "Tag" }
              ],
              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchJson({ spanBar: { type: $event } }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const JaegerConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2l, [["__scopeId", "data-v-a1f8799a"]]);
const _hoisted_1$1M = { class: "cfg-section" };
const _sfc_main$2k = /* @__PURE__ */ defineComponent({
  __name: "GraphiteConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1M, [
        createVNode(unref(FormItem), { label: "Graphite 版本" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "graphite-version",
              "data-grafana-label": "Version",
              value: String(options.value.jsonData.graphiteVersion ?? "1.1"),
              options: [
                { label: "0.9", value: "0.9" },
                { label: "1.0", value: "1.0" },
                { label: "1.1", value: "1.1" }
              ],
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ graphiteVersion: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Graphite 后端类型" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "graphite-type",
              "data-grafana-label": "Graphite backend type",
              value: String(options.value.jsonData.graphiteType ?? "default"),
              options: [
                { label: "默认", value: "default" },
                { label: "Metrictank", value: "metrictank" }
              ],
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ graphiteType: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "Rollup 指示器" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "graphite-rollup",
              "data-grafana-label": "Rollup indicator",
              checked: !!options.value.jsonData.rollupIndicatorEnabled,
              "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => patchJson({ rollupIndicatorEnabled: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const GraphiteConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2k, [["__scopeId", "data-v-d6c99339"]]);
const _hoisted_1$1L = { class: "cfg-section" };
const _sfc_main$2j = /* @__PURE__ */ defineComponent({
  __name: "PyroscopeConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1L, [
        createVNode(unref(FormItem), { label: "最小步长" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "pyroscope-min-step",
              value: String(options.value.jsonData.minStep ?? ""),
              placeholder: "15s",
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ minStep: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const PyroscopeConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2j, [["__scopeId", "data-v-904f6644"]]);
const _hoisted_1$1K = { class: "cfg-section" };
const _sfc_main$2i = /* @__PURE__ */ defineComponent({
  __name: "AzureConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1K, [
        createVNode(unref(FormItem), { label: "Azure Cloud" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "azure-cloud",
              "data-grafana-label": "Azure Cloud",
              value: String(
                options.value.jsonData.cloudName ?? options.value.jsonData.azureCloud ?? "azuremonitor"
              ),
              options: [
                { label: "Azure", value: "azuremonitor" },
                { label: "Azure US Government", value: "govazuremonitor" },
                { label: "Azure China", value: "chinaazuremonitor" }
              ],
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ cloudName: $event, azureCloud: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "租户 ID" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "azure-tenant",
              "data-grafana-label": "Directory (tenant) ID",
              value: String(options.value.jsonData.tenantId ?? ""),
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchJson({ tenantId: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "客户端 ID" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "azure-client",
              "data-grafana-label": "Application (client) ID",
              value: String(options.value.jsonData.clientId ?? ""),
              "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchJson({ clientId: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "默认订阅" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "azure-subscription",
              "data-grafana-label": "Default Subscription",
              value: String(options.value.jsonData.subscriptionId ?? ""),
              "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchJson({ subscriptionId: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const AzureConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2i, [["__scopeId", "data-v-9ae91a1c"]]);
const _hoisted_1$1J = { class: "cfg-section" };
const _sfc_main$2h = /* @__PURE__ */ defineComponent({
  __name: "AlertmanagerConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1J, [
        createVNode(unref(FormItem), { label: "实现" }, {
          default: withCtx(() => [
            createVNode(unref(Select), {
              "data-testid": "am-implementation",
              value: String(options.value.jsonData.implementation ?? "prometheus"),
              options: [
                { label: "Prometheus", value: "prometheus" },
                { label: "Cortex", value: "cortex" },
                { label: "Mimir", value: "mimir" },
                { label: "Grafana", value: "grafana" }
              ],
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ implementation: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "处理 Grafana 托管告警" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "am-handle-grafana",
              checked: !!options.value.jsonData.handleGrafanaManagedAlerts,
              "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => patchJson({ handleGrafanaManagedAlerts: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const AlertmanagerConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2h, [["__scopeId", "data-v-dbba657d"]]);
const _hoisted_1$1I = { class: "cfg-section" };
const _sfc_main$2g = /* @__PURE__ */ defineComponent({
  __name: "TestdataConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1I, [
        createVNode(unref(FormItem), { label: "默认场景" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "testdata-scenario",
              value: String(options.value.jsonData.defaultScenario ?? ""),
              placeholder: "random_walk",
              "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchJson({ defaultScenario: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const TestdataConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2g, [["__scopeId", "data-v-eff37056"]]);
const _hoisted_1$1H = { class: "cfg-section" };
const _sfc_main$2f = /* @__PURE__ */ defineComponent({
  __name: "HttpAuthConfigFields",
  props: {
    type: {},
    options: {},
    json: {},
    secure: {},
    queryTimeout: {},
    dsList: {},
    derivedFields: {}
  },
  emits: ["patch", "patch-json", "patch-secure", "patch-derived-raw", "update-derived", "add-derived", "remove-derived"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = computed(() => props.options);
    function patch(partial) {
      emit("patch", partial);
    }
    function patchJson(partial) {
      emit("patch-json", partial);
    }
    function patchSecure(partial) {
      emit("patch-secure", partial);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1H, [
        createVNode(unref(FormItem), { label: "跳过 TLS 验证" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-tls-skip-verify",
              checked: !!options.value.jsonData.tlsSkipVerify,
              "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => patchJson({ tlsSkipVerify: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "TLS 客户端认证" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-tls-auth",
              checked: !!options.value.jsonData.tlsAuth,
              "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => patchJson({ tlsAuth: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "TLS CA 证书认证" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-tls-ca",
              checked: !!options.value.jsonData.tlsAuthWithCACert,
              "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => patchJson({ tlsAuthWithCACert: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "SigV4 认证" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-sigv4",
              checked: !!options.value.jsonData.sigV4Auth,
              "onUpdate:checked": _cache[3] || (_cache[3] = ($event) => patchJson({ sigV4Auth: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        options.value.jsonData.sigV4Auth ? (openBlock(), createBlock(unref(FormItem), {
          key: 0,
          label: "SigV4 区域"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "ds-sigv4-region",
              value: String(
                options.value.jsonData.sigV4Region ?? options.value.jsonData.sigV4AuthType ?? ""
              ),
              placeholder: "us-east-1",
              "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchJson({ sigV4Region: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        createVNode(unref(FormItem), { label: "安全 Socks 代理" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-secure-socks",
              checked: !!options.value.jsonData.secureSocksDSProxyEnabled,
              "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => patchJson({ secureSocksDSProxyEnabled: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "转发 OAuth 身份" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-oauth-passthru",
              checked: !!options.value.jsonData.oauthPassThru,
              "onUpdate:checked": _cache[6] || (_cache[6] = ($event) => patchJson({ oauthPassThru: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "跨站携带凭证" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              "data-testid": "ds-with-credentials",
              checked: !!options.value.withCredentials,
              "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => patch({ withCredentials: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "自定义 HTTP 头" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "ds-http-headers",
              value: String(
                options.value.jsonData.httpHeaderName1 ? `${options.value.jsonData.httpHeaderName1}=…` : options.value.jsonData.customHeaders ? JSON.stringify(options.value.jsonData.customHeaders) : ""
              ),
              placeholder: '{"X-Custom":"value"} 或使用 httpHeaderName1',
              "onUpdate:value": _cache[8] || (_cache[8] = (v) => {
                try {
                  const j = JSON.parse(v || "{}");
                  if (j && typeof j === "object" && !Array.isArray(j))
                    patchJson({ customHeaders: j });
                } catch {
                }
              })
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(FormItem), { label: "HTTP 头名称 1" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "ds-http-header-name1",
              value: String(options.value.jsonData.httpHeaderName1 ?? ""),
              placeholder: "X-Scope-OrgID",
              "onUpdate:value": _cache[9] || (_cache[9] = ($event) => patchJson({ httpHeaderName1: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        options.value.jsonData.httpHeaderName1 ? (openBlock(), createBlock(unref(FormItem), {
          key: 1,
          label: "HTTP 头值 1"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              type: "password",
              "data-testid": "ds-http-header-value1",
              value: String(options.value.secureJsonData?.httpHeaderValue1 ?? ""),
              "onUpdate:value": _cache[10] || (_cache[10] = ($event) => patchSecure({ httpHeaderValue1: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        createVNode(unref(FormItem), { label: "HTTP 头名称 2" }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              "data-testid": "ds-http-header-name2",
              value: String(options.value.jsonData.httpHeaderName2 ?? ""),
              "onUpdate:value": _cache[11] || (_cache[11] = ($event) => patchJson({ httpHeaderName2: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        }),
        options.value.jsonData.httpHeaderName2 ? (openBlock(), createBlock(unref(FormItem), {
          key: 2,
          label: "HTTP 头值 2"
        }, {
          default: withCtx(() => [
            createVNode(unref(Input), {
              type: "password",
              "data-testid": "ds-http-header-value2",
              value: String(options.value.secureJsonData?.httpHeaderValue2 ?? ""),
              "onUpdate:value": _cache[12] || (_cache[12] = ($event) => patchSecure({ httpHeaderValue2: $event }))
            }, null, 8, ["value"])
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        createVNode(unref(FormItem), { label: "基本认证" }, {
          default: withCtx(() => [
            createVNode(unref(Switch), {
              checked: !!options.value.basicAuth,
              "onUpdate:checked": _cache[13] || (_cache[13] = ($event) => patch({ basicAuth: $event }))
            }, null, 8, ["checked"])
          ]),
          _: 1
          /* STABLE */
        }),
        options.value.basicAuth ? (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            createVNode(unref(FormItem), { label: "用户名" }, {
              default: withCtx(() => [
                createVNode(unref(Input), {
                  value: String(options.value.basicAuthUser ?? ""),
                  "onUpdate:value": _cache[14] || (_cache[14] = ($event) => patch({ basicAuthUser: $event }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(unref(FormItem), { label: "密码" }, {
              default: withCtx(() => [
                createVNode(unref(Input), {
                  type: "password",
                  value: String(options.value.secureJsonData?.basicAuthPassword ?? ""),
                  "onUpdate:value": _cache[15] || (_cache[15] = ($event) => patchSecure({ basicAuthPassword: $event }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            })
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const HttpAuthConfigFields = /* @__PURE__ */ _export_sfc(_sfc_main$2f, [["__scopeId", "data-v-f3e7318f"]]);
const _hoisted_1$1G = ["data-testid"];
const _sfc_main$2e = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const model = useConfigEditorModel(props);
    const {
      type,
      options,
      json,
      secure,
      dsList,
      queryTimeout,
      patch,
      patchJson,
      patchSecure,
      patchDerivedFields,
      derivedFieldsList,
      updateDerivedField,
      addDerivedField,
      removeDerivedField
    } = model;
    const derivedFields = computed(() => derivedFieldsList());
    const isSql = computed(
      () => ["mysql", "mssql", "grafana-postgresql-datasource"].includes(
        String(type.value)
      )
    );
    const isEs = computed(
      () => type.value === "elasticsearch" || type.value === "grafana-elasticsearch-datasource"
    );
    const isPyroscope = computed(
      () => type.value === "grafana-pyroscope-datasource" || type.value === "pyroscope"
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "ds-config-editor",
        "data-testid": `config-editor-${unref(options).type}`
      }, [
        createVNode(unref(Form), { layout: "vertical" }, {
          default: withCtx(() => [
            createVNode(unref(FormItem), { label: "名称" }, {
              default: withCtx(() => [
                createVNode(unref(Input), {
                  "data-testid": "ds-name",
                  value: unref(options).name,
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => unref(patch)({ name: $event }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(unref(FormItem), { label: "URL" }, {
              default: withCtx(() => [
                createVNode(unref(Input), {
                  "data-testid": "ds-url",
                  value: unref(options).url,
                  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => unref(patch)({ url: $event })),
                  placeholder: "http://localhost:9090"
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(unref(FormItem), { label: "设为默认" }, {
              default: withCtx(() => [
                createVNode(unref(Switch), {
                  "data-testid": "ds-is-default",
                  checked: !!unref(options).isDefault,
                  "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => unref(patch)({ isDefault: $event }))
                }, null, 8, ["checked"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(unref(FormItem), { label: "访问方式" }, {
              default: withCtx(() => [
                createVNode(unref(Select), {
                  "data-testid": "ds-access",
                  style: { "width": "100%" },
                  value: unref(options).access ?? "proxy",
                  options: [
                    { label: "服务器（默认）", value: "proxy" },
                    { label: "浏览器", value: "direct" }
                  ],
                  "onUpdate:value": _cache[3] || (_cache[3] = ($event) => unref(patch)({ access: $event }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            unref(type) === "prometheus" || unref(type) === "loki" ? (openBlock(), createBlock(PromLokiConfigFields, {
              key: 0,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              "query-timeout": unref(queryTimeout),
              "ds-list": unref(dsList),
              "derived-fields": derivedFields.value,
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure),
              onPatchDerivedRaw: unref(patchDerivedFields),
              onUpdateDerived: unref(updateDerivedField),
              onAddDerived: unref(addDerivedField),
              onRemoveDerived: unref(removeDerivedField)
            }, null, 8, ["type", "options", "json", "secure", "query-timeout", "ds-list", "derived-fields", "onPatch", "onPatchJson", "onPatchSecure", "onPatchDerivedRaw", "onUpdateDerived", "onAddDerived", "onRemoveDerived"])) : createCommentVNode("v-if", true),
            isSql.value ? (openBlock(), createBlock(SqlConfigFields, {
              key: 1,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "influxdb" ? (openBlock(), createBlock(InfluxConfigFields, {
              key: 2,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "cloudwatch" ? (openBlock(), createBlock(CloudWatchConfigFields, {
              key: 3,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            isEs.value ? (openBlock(), createBlock(ElasticsearchConfigFields, {
              key: 4,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "tempo" ? (openBlock(), createBlock(TempoConfigFields, {
              key: 5,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "jaeger" ? (openBlock(), createBlock(JaegerConfigFields, {
              key: 6,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "graphite" ? (openBlock(), createBlock(GraphiteConfigFields, {
              key: 7,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            isPyroscope.value ? (openBlock(), createBlock(PyroscopeConfigFields, {
              key: 8,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "grafana-azure-monitor-datasource" ? (openBlock(), createBlock(AzureConfigFields, {
              key: 9,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "alertmanager" ? (openBlock(), createBlock(AlertmanagerConfigFields, {
              key: 10,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            unref(type) === "grafana-testdata-datasource" ? (openBlock(), createBlock(TestdataConfigFields, {
              key: 11,
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])) : createCommentVNode("v-if", true),
            createVNode(HttpAuthConfigFields, {
              type: unref(type),
              options: unref(options),
              json: unref(json),
              secure: unref(secure),
              onPatch: unref(patch),
              onPatchJson: unref(patchJson),
              onPatchSecure: unref(patchSecure)
            }, null, 8, ["type", "options", "json", "secure", "onPatch", "onPatchJson", "onPatchSecure"])
          ]),
          _: 1
          /* STABLE */
        })
      ], 8, _hoisted_1$1G);
    };
  }
});
const SharedConfigEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2e, [["__scopeId", "data-v-9c79c3c3"]]);
const _sfc_main$2d = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "dashboard"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const _hoisted_1$1F = {
  class: "var-query-editor",
  "data-testid": "variable-query-editor"
};
const _sfc_main$2c = /* @__PURE__ */ defineComponent({
  __name: "VariableQueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    datasource: {}
  },
  setup(__props) {
    const props = __props;
    const text = computed({
      get: () => typeof props.query === "string" ? props.query : String(props.query?.query ?? ""),
      set: (v) => {
        if (typeof props.query === "string" || props.query == null)
          props.onChange(v);
        else props.onChange({ ...props.query, query: v });
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1F, [
        _cache[2] || (_cache[2] = createElementVNode(
          "label",
          null,
          "变量查询",
          -1
          /* CACHED */
        )),
        __props.datasource?.type === "prometheus" || __props.datasource?.type === "loki" ? (openBlock(), createBlock(unref(Textarea), {
          key: 0,
          value: text.value,
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => text.value = $event),
          rows: 3,
          placeholder: __props.datasource?.type === "loki" ? "label_names()" : "label_values(job)"
        }, null, 8, ["value", "placeholder"])) : (openBlock(), createBlock(unref(Input), {
          key: 1,
          value: text.value,
          "onUpdate:value": _cache[1] || (_cache[1] = ($event) => text.value = $event),
          placeholder: "指标查找查询"
        }, null, 8, ["value"]))
      ]);
    };
  }
});
const VariableQueryEditor$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2c, [["__scopeId", "data-v-db722a00"]]);
const _hoisted_1$1E = {
  class: "anno-query-editor",
  "data-testid": "annotation-query-editor"
};
const _hoisted_2$1k = { class: "row" };
const _hoisted_3$19 = { class: "row" };
const _hoisted_4$W = { class: "row" };
const _sfc_main$2b = /* @__PURE__ */ defineComponent({
  __name: "AnnotationQueryEditor",
  props: {
    annotation: {},
    onChange: { type: Function },
    datasource: {}
  },
  setup(__props) {
    const props = __props;
    function patch(partial) {
      props.onChange({ ...props.annotation, ...partial });
    }
    const expr = computed({
      get: () => String(
        props.annotation.target?.expr ?? props.annotation.expr ?? ""
      ),
      set: (v) => patch({
        target: { ...props.annotation.target || {}, expr: v },
        expr: v
      })
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1E, [
        createElementVNode("div", _hoisted_2$1k, [
          _cache[4] || (_cache[4] = createElementVNode(
            "label",
            null,
            "启用",
            -1
            /* CACHED */
          )),
          createVNode(unref(Switch), {
            checked: __props.annotation.enable !== false,
            "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => patch({ enable: $event }))
          }, null, 8, ["checked"])
        ]),
        createElementVNode("div", _hoisted_3$19, [
          _cache[5] || (_cache[5] = createElementVNode(
            "label",
            null,
            "名称",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(__props.annotation.name ?? ""),
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ name: $event }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$W, [
          _cache[6] || (_cache[6] = createElementVNode(
            "label",
            null,
            "颜色",
            -1
            /* CACHED */
          )),
          createVNode(unref(Input), {
            value: String(__props.annotation.iconColor ?? "red"),
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ iconColor: $event }))
          }, null, 8, ["value"])
        ]),
        _cache[7] || (_cache[7] = createElementVNode(
          "label",
          null,
          "查询",
          -1
          /* CACHED */
        )),
        createVNode(unref(Textarea), {
          value: expr.value,
          "onUpdate:value": _cache[3] || (_cache[3] = ($event) => expr.value = $event),
          rows: 3,
          placeholder: "注解查询 / 选择器"
        }, null, 8, ["value"])
      ]);
    };
  }
});
const AnnotationQueryEditor$2 = /* @__PURE__ */ _export_sfc(_sfc_main$2b, [["__scopeId", "data-v-0c836e57"]]);
const meta$j = {
  id: "dashboard",
  name: "Dashboard",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$j,
  QueryEditor: _sfc_main$2s,
  ConfigEditor: _sfc_main$2d,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$j)
});
const _sfc_main$2a = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "mixed"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$29 = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "mixed"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$i = {
  id: "mixed",
  name: "Mixed",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$i,
  QueryEditor: _sfc_main$2a,
  ConfigEditor: _sfc_main$29,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$i)
});
const _sfc_main$28 = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "grafana"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$27 = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "grafana"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$h = {
  id: "grafana",
  name: "Grafana",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$h,
  QueryEditor: _sfc_main$28,
  ConfigEditor: _sfc_main$27,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$h)
});
const _sfc_main$26 = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "grafana-testdata-datasource"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$25 = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(
        SharedConfigEditor,
        normalizeProps(guardReactiveProps(props)),
        null,
        16
        /* FULL_PROPS */
      );
    };
  }
});
const meta$g = {
  id: "grafana-testdata-datasource",
  name: "TestData",
  backend: true,
  metrics: true,
  logs: false
};
createDataSourcePlugin({
  meta: meta$g,
  QueryEditor: _sfc_main$26,
  ConfigEditor: _sfc_main$25,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$g)
});
const _sfc_main$24 = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "grafana-postgresql-datasource"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$23 = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(
        SharedConfigEditor,
        normalizeProps(guardReactiveProps(props)),
        null,
        16
        /* FULL_PROPS */
      );
    };
  }
});
const meta$f = {
  id: "grafana-postgresql-datasource",
  name: "PostgreSQL",
  backend: true,
  metrics: true,
  logs: false
};
createDataSourcePlugin({
  meta: meta$f,
  QueryEditor: _sfc_main$24,
  ConfigEditor: _sfc_main$23,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$f)
});
const _sfc_main$22 = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "mysql"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$21 = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(
        SharedConfigEditor,
        normalizeProps(guardReactiveProps(props)),
        null,
        16
        /* FULL_PROPS */
      );
    };
  }
});
const meta$e = {
  id: "mysql",
  name: "MySQL",
  backend: true,
  metrics: true,
  logs: false
};
createDataSourcePlugin({
  meta: meta$e,
  QueryEditor: _sfc_main$22,
  ConfigEditor: _sfc_main$21,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$e)
});
const _sfc_main$20 = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "mssql"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1$ = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "mssql"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$d = {
  id: "mssql",
  name: "Microsoft SQL Server",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$d,
  QueryEditor: _sfc_main$20,
  ConfigEditor: _sfc_main$1$,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$d)
});
const _sfc_main$1_ = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "influxdb"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1Z = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "influxdb"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$c = {
  id: "influxdb",
  name: "InfluxDB",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$c,
  QueryEditor: _sfc_main$1_,
  ConfigEditor: _sfc_main$1Z,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$c)
});
const _sfc_main$1Y = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "graphite"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1X = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "graphite"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$b = {
  id: "graphite",
  name: "Graphite",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$b,
  QueryEditor: _sfc_main$1Y,
  ConfigEditor: _sfc_main$1X,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$b)
});
const _sfc_main$1W = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {},
    datasourceApi: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "prometheus"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        "datasource-api": props.datasourceApi,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "datasource-api", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1V = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(
        SharedConfigEditor,
        normalizeProps(guardReactiveProps(props)),
        null,
        16
        /* FULL_PROPS */
      );
    };
  }
});
const store = /* @__PURE__ */ new Map();
const inflight = /* @__PURE__ */ new Map();
function fullKey(uid, key) {
  return `${uid}::${key}`;
}
function metadataCacheGet(uid, key) {
  const k = fullKey(uid, key);
  const e = store.get(k);
  if (!e) return void 0;
  if (Date.now() > e.expiresAt) {
    store.delete(k);
    return void 0;
  }
  return e.value;
}
function metadataCacheSet(uid, key, value, ttlMs2 = 6e4) {
  store.set(fullKey(uid, key), {
    value,
    expiresAt: Date.now() + Math.max(1e3, ttlMs2)
  });
}
async function metadataCacheLoad(uid, key, loader, ttlMs2 = 6e4) {
  const hit = metadataCacheGet(uid, key);
  if (hit !== void 0) return hit;
  const k = fullKey(uid, key);
  const existing = inflight.get(k);
  if (existing) return existing;
  const p = (async () => {
    try {
      const value = await loader();
      metadataCacheSet(uid, key, value, ttlMs2);
      return value;
    } finally {
      inflight.delete(k);
    }
  })();
  inflight.set(k, p);
  return p;
}
async function promGet(opts, path, query) {
  const res = await datasourceHttp({
    baseUrl: opts.baseUrl.replace(/\/$/, ""),
    path,
    method: "GET",
    query,
    uid: opts.uid,
    credential: opts.credential ?? void 0,
    signal: opts.signal,
    timeoutMs: opts.timeoutMs ?? 3e4
  });
  return res.data;
}
async function promLabelNames(opts, match) {
  const cacheKey = `prom:labels:${[].join(",")}`;
  return metadataCacheLoad(opts.uid, cacheKey, async () => {
    const query = {};
    if (match?.length) ;
    const data = await promGet(
      opts,
      "/api/v1/labels",
      query
    );
    return Array.isArray(data?.data) ? data.data : [];
  });
}
async function promLabelValues(opts, label, match) {
  const cacheKey = `prom:labelValues:${label}:${(match || []).join(",")}`;
  return metadataCacheLoad(opts.uid, cacheKey, async () => {
    const query = {};
    if (match?.length) query["match[]"] = match.length === 1 ? match[0] : match;
    const data = await promGet(
      opts,
      `/api/v1/label/${encodeURIComponent(label)}/values`,
      query
    );
    return Array.isArray(data?.data) ? data.data : [];
  });
}
async function promMetricNames(opts, limit = 500) {
  return metadataCacheLoad(
    opts.uid,
    `prom:metrics:${limit}`,
    async () => {
      try {
        const data = await promGet(opts, "/api/v1/metadata");
        const names = Object.keys(data?.data || {});
        if (names.length) return names.slice(0, limit).sort();
      } catch {
      }
      return (await promLabelValues(opts, "__name__")).slice(0, limit);
    },
    12e4
  );
}
const PROMETHEUS_CAPABILITIES = {
  signals: ["metrics"],
  query: true,
  health: true,
  metadata: true,
  variables: true,
  annotations: true,
  exemplars: true,
  streaming: false,
  queryLanguages: ["promql"]
};
function baseUrlOf$2(instance) {
  return String(
    instance.url || instance.jsonData?.url || ""
  ).replace(/\/$/, "");
}
function createPrometheusDataSource(instance, meta2) {
  const fallback = createBuiltinDataSourceApi(instance, meta2);
  const url = baseUrlOf$2(instance);
  return {
    uid: instance.uid,
    type: instance.type || meta2.id,
    name: instance.name,
    capabilities: PROMETHEUS_CAPABILITIES,
    async query(request, signal) {
      const targets = request.targets.filter(
        (t2) => !t2.hide
      );
      if (getBackendMode() === "offline") {
        return fallback.query(request);
      }
      if (!url) {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Datasource URL is empty"
        );
      }
      const from = request.range.from.getTime();
      const to = request.range.to.getTime();
      const rangeMs2 = Math.max(1, to - from);
      const stepMs = computeStepMs({
        rangeMs: rangeMs2,
        maxDataPoints: request.maxDataPoints,
        intervalMs: request.intervalMs,
        minIntervalMs: Number(instance.jsonData?.timeIntervalMs) || void 0
      });
      const stepSec = Math.max(1, Math.floor(stepMs / 1e3));
      const cred = await getRuntimeCredential(instance.uid);
      const frames = [];
      const errors = [];
      await Promise.all(
        targets.map(async (raw) => {
          const q = normalizePromQuery({ ...raw, refId: raw.refId });
          if (!q.expr?.trim()) return;
          const expr = interpolatePromMacros(q.expr, {
            rangeMs: rangeMs2,
            intervalMs: stepMs,
            interpolate: (s) => s
            // variable interpolation done by query runtime when present
          });
          try {
            const instant = q.instant && !q.range;
            const path = instant ? "/api/v1/query" : "/api/v1/query_range";
            const query = instant ? {
              query: expr,
              time: String(to / 1e3),
              timeout: String(
                instance.jsonData?.queryTimeout || "60s"
              )
            } : {
              query: expr,
              start: String(from / 1e3),
              end: String(to / 1e3),
              step: String(stepSec),
              timeout: String(
                instance.jsonData?.queryTimeout || "60s"
              )
            };
            const method = String(
              instance.jsonData?.httpMethod || "POST"
            ).toUpperCase() === "GET" ? "GET" : "POST";
            const res = await datasourceHttp({
              baseUrl: url,
              path,
              method,
              query: method === "GET" ? query : void 0,
              body: method === "POST" ? query : void 0,
              uid: instance.uid,
              credential: cred,
              signal,
              timeoutMs: Number(instance.jsonData?.timeout) || 6e4
            });
            const mapped = mapPrometheusResponse(res.data, {
              refId: q.refId,
              legendFormat: q.legendFormat,
              expr: q.expr
            });
            frames.push(...normalizeDataFrames(mapped, { refId: q.refId }));
          } catch (e) {
            const msg = e instanceof DataSourceError ? e.message : e instanceof Error ? e.message : String(e);
            errors.push(`${q.refId}: ${msg}`);
            frames.push(
              ...normalizeDataFrames(
                [
                  {
                    refId: q.refId,
                    name: "error",
                    length: 0,
                    fields: [],
                    meta: { error: msg }
                  }
                ],
                { refId: q.refId }
              )
            );
          }
        })
      );
      if (!frames.length && errors.length) {
        throw new DataSourceError("INVALID_RESPONSE", errors.join("; "));
      }
      return { data: frames };
    },
    async testDatasource(signal) {
      if (getBackendMode() === "offline") {
        return fallback.testDatasource?.() ?? {
          status: "success",
          message: "Offline fixture OK"
        };
      }
      if (!url) return { status: "error", message: "Datasource URL is empty" };
      try {
        await datasourceHttp({
          baseUrl: url,
          path: "/-/ready",
          method: "GET",
          uid: instance.uid,
          signal,
          timeoutMs: 1e4
        });
        return { status: "success", message: "Prometheus is ready" };
      } catch (e) {
        try {
          await datasourceHttp({
            baseUrl: url,
            path: "/api/v1/labels",
            method: "GET",
            uid: instance.uid,
            signal,
            timeoutMs: 1e4
          });
          return { status: "success", message: "Prometheus API reachable" };
        } catch (e2) {
          const msg = e2 instanceof Error ? e2.message : String(e2);
          return { status: "error", message: msg };
        }
      }
    },
    async metricFindQuery(query, signal) {
      if (getBackendMode() === "offline") {
        return fallback.metricFindQuery?.(query) ?? [];
      }
      if (!url) return [];
      const cred = await getRuntimeCredential(instance.uid);
      const opts = {
        baseUrl: url,
        uid: instance.uid,
        credential: cred,
        signal
      };
      const q = String(query ?? "").trim();
      if (!q || /^metrics\s*\(/i.test(q) || q === "label_values(__name__)") {
        const names = await promMetricNames(opts);
        return names.map((n) => ({ text: n, value: n }));
      }
      const lv2 = q.match(
        /label_values\s*\(\s*([^,]+)\s*,\s*([a-zA-Z_][\w]*)\s*\)/i
      );
      if (lv2) {
        const metric = lv2[1].trim().replace(/^["']|["']$/g, "");
        const label = lv2[2].trim();
        const vals = await promLabelValues(
          opts,
          label,
          metric && metric !== label ? [metric] : void 0
        );
        return vals.map((v) => ({ text: v, value: v }));
      }
      const lv1 = q.match(/label_values\s*\(\s*([a-zA-Z_][\w]*)\s*\)/i);
      if (lv1) {
        const vals = await promLabelValues(opts, lv1[1]);
        return vals.map((v) => ({ text: v, value: v }));
      }
      if (/label_names\s*\(/i.test(q)) {
        const names = await promLabelNames(opts);
        return names.map((n) => ({ text: n, value: n }));
      }
      return fallback.metricFindQuery?.(query) ?? [];
    },
    /** Prefetch helpers for QueryEditor metric browser */
    async listMetricNames(signal) {
      if (getBackendMode() === "offline") {
        return [
          "up",
          "process_cpu_seconds_total",
          "process_resident_memory_bytes",
          "http_requests_total",
          "http_request_duration_seconds_bucket",
          "node_cpu_seconds_total",
          "node_memory_MemAvailable_bytes",
          "container_cpu_usage_seconds_total",
          "container_memory_working_set_bytes",
          "go_goroutines"
        ];
      }
      if (!url) return [];
      const cred = await getRuntimeCredential(instance.uid);
      return promMetricNames({
        baseUrl: url,
        uid: instance.uid,
        credential: cred,
        signal
      });
    },
    async listLabelNames(signal) {
      if (getBackendMode() === "offline") {
        return [
          "__name__",
          "job",
          "instance",
          "namespace",
          "pod",
          "service",
          "status",
          "method"
        ];
      }
      if (!url) return [];
      const cred = await getRuntimeCredential(instance.uid);
      return promLabelNames({
        baseUrl: url,
        uid: instance.uid,
        credential: cred,
        signal
      });
    }
  };
}
const meta$a = {
  id: "prometheus",
  name: "Prometheus",
  backend: true,
  metrics: true,
  logs: false,
  capabilities: PROMETHEUS_CAPABILITIES
};
registerPrometheusDataSourceFactory(
  (instance, pluginMeta) => createPrometheusDataSource(instance, pluginMeta)
);
createDataSourcePlugin({
  meta: meta$a,
  QueryEditor: _sfc_main$1W,
  ConfigEditor: _sfc_main$1V,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createPrometheusDataSource(instance, meta$a)
});
const _sfc_main$1U = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "loki"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1T = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(
        SharedConfigEditor,
        normalizeProps(guardReactiveProps(props)),
        null,
        16
        /* FULL_PROPS */
      );
    };
  }
});
function nsToMs(ts) {
  const n = typeof ts === "string" ? Number(ts) : ts;
  if (!Number.isFinite(n)) return 0;
  if (n > 1e16) return Math.floor(n / 1e6);
  if (n > 1e12) return Math.floor(n);
  return Math.floor(n * 1e3);
}
function labelsFromStream(stream = {}) {
  const labels = {};
  for (const [k, v] of Object.entries(stream)) {
    if (k.startsWith("__")) continue;
    labels[k] = String(v);
  }
  return labels;
}
function mapLokiResponse(body, opts) {
  if (body?.status === "error" || body?.error) {
    throw new Error(body.error || body.errorType || "Loki query error");
  }
  const resultType = body?.data?.resultType ?? (isLokiMetricQuery(opts.expr || "") ? "matrix" : "streams");
  const result = body?.data?.result ?? [];
  if (resultType === "streams") {
    return mapStreams(result, opts);
  }
  if (resultType === "scalar" || resultType === "string") {
    const pair = Array.isArray(result) ? result : [0, result];
    const t2 = nsToMs(pair[0]);
    const v = resultType === "string" ? null : Number(pair[1]);
    return [
      createDataFrame({
        refId: opts.refId,
        name: opts.expr || "scalar",
        meta: {
          preferredVisualisationType: "table",
          resultType,
          custom: { stats: body?.data?.stats }
        },
        fields: [
          { name: "Time", type: "time", values: [t2] },
          {
            name: "Value",
            type: "number",
            values: [v],
            config: { displayNameFromDS: "Value" }
          }
        ]
      })
    ];
  }
  return result.map((series, idx) => {
    const metric = series.metric || series.stream || {};
    const labels = labelsFromStream(metric);
    const name = formatLokiLegend(opts.legendFormat || "", labels) || Object.values(labels).join(" ") || opts.expr || `series ${idx}`;
    let times = [];
    let values = [];
    if (resultType === "vector") {
      const rawT = series.value?.[0] ?? 0;
      times = [nsToMs(rawT)];
      const raw = series.value?.[1];
      values = [raw == null || raw === "NaN" ? null : Number(raw)];
    } else {
      const pts = series.values || [];
      times = pts.map((p) => nsToMs(p[0]));
      values = pts.map((p) => {
        const raw = p[1];
        if (raw == null || raw === "NaN") return null;
        if (raw === "+Inf") return Infinity;
        if (raw === "-Inf") return -Infinity;
        const n = Number(raw);
        return Number.isFinite(n) ? n : null;
      });
    }
    return createDataFrame({
      refId: opts.refId,
      name,
      meta: {
        resultType,
        preferredVisualisationType: "graph",
        custom: { stats: body?.data?.stats }
      },
      fields: [
        { name: "Time", type: "time", values: times },
        {
          name: "Value",
          type: "number",
          values,
          labels,
          config: { displayNameFromDS: name }
        }
      ]
    });
  });
}
function mapStreams(result, opts) {
  const maxLines = Math.max(1, opts.maxLines ?? 1e3);
  const times = [];
  const lines = [];
  const levels = [];
  const labelObjs = [];
  const idValues = [];
  for (const stream of result) {
    const labels = labelsFromStream(stream.stream || stream.metric || {});
    const entries = stream.values || [];
    for (const [ts, line] of entries) {
      if (times.length >= maxLines) break;
      times.push(nsToMs(ts));
      const text = String(line ?? "");
      lines.push(text);
      levels.push(inferLevel(text, labels));
      labelObjs.push(labels);
      idValues.push(`${ts}_${times.length}`);
    }
    if (times.length >= maxLines) break;
  }
  const order = times.map((_, i) => i).sort((a, b) => times[b] - times[a]);
  const pick = (arr) => order.map((i) => arr[i]);
  const labelKeys = /* @__PURE__ */ new Set();
  for (const l of labelObjs) {
    for (const k of Object.keys(l)) labelKeys.add(k);
  }
  const labelFields = [...labelKeys].slice(0, 12).map((k) => ({
    name: k,
    type: "string",
    values: pick(labelObjs.map((l) => l[k] ?? "")),
    config: {}
  }));
  return [
    createDataFrame({
      refId: opts.refId,
      name: "logs",
      meta: {
        preferredVisualisationType: "logs",
        searchWords: [],
        limit: maxLines
      },
      fields: [
        { name: "Time", type: "time", values: pick(times) },
        { name: "Line", type: "string", values: pick(lines) },
        { name: "labels", type: "other", values: pick(labelObjs) },
        { name: "id", type: "string", values: pick(idValues) },
        { name: "level", type: "string", values: pick(levels) },
        ...labelFields
      ]
    })
  ];
}
function inferLevel(line, labels) {
  if (labels.level) return String(labels.level).toLowerCase();
  if (labels.severity) return String(labels.severity).toLowerCase();
  const m = line.match(/\b(error|warn|warning|info|debug|critical|fatal)\b/i);
  if (m) {
    const l = m[1].toLowerCase();
    if (l === "warning") return "warn";
    return l;
  }
  return "unknown";
}
const LOKI_CAPABILITIES = {
  signals: ["logs", "metrics"],
  query: true,
  health: true,
  metadata: true,
  variables: true,
  annotations: true,
  exemplars: false,
  streaming: false,
  queryLanguages: ["logql"]
};
function baseUrlOf$1(instance) {
  return String(
    instance.url || instance.jsonData?.url || ""
  ).replace(/\/$/, "");
}
function buildLokiOfflineMetricFrames(q, range, maxDataPoints = 50) {
  const from = range.from.getTime();
  const to = range.to.getTime();
  const steps = Math.min(
    maxDataPoints,
    Math.max(12, Math.floor((to - from) / 6e4))
  );
  const by = extractByLabels(q.expr);
  const seriesDefs = [];
  if (by.includes("status") || /status/i.test(q.expr)) {
    for (const status of ["200", "301", "304", "404", "500"]) {
      seriesDefs.push({ status });
    }
  } else if (by.includes("request_uri") || by.includes("http_referer") || by.includes("http_user_agent")) {
    const key = by[0] || "request_uri";
    for (let i = 0; i < 5; i++) seriesDefs.push({ [key]: `/page-${i}` });
  } else if (by.includes("remote_addr")) {
    for (let i = 0; i < 5; i++) {
      seriesDefs.push({
        remote_addr: `10.0.0.${i + 1}`,
        geoip_country_code: i % 2 ? "US" : "NL"
      });
    }
  } else if (by.includes("geoip_country_code")) {
    for (const c of ["US", "NL", "DE", "JP", "BR"])
      seriesDefs.push({ geoip_country_code: c });
  } else if (by.includes("host")) {
    seriesDefs.push({ host: "nginx-1" });
  } else if (by.length) {
    for (let i = 0; i < 3; i++) {
      const labels = {};
      for (const k of by) labels[k] = `${k}-${i}`;
      seriesDefs.push(labels);
    }
  } else {
    seriesDefs.push({ job: "nginx" });
  }
  return seriesDefs.map((labels, sIdx) => {
    const times = [];
    const values = [];
    for (let i = 0; i < steps; i++) {
      times.push(from + (to - from) * i / Math.max(steps - 1, 1));
      const base = 10 + sIdx * 7 + i % 5 * 3;
      values.push(q.instant ? base * steps : base + Math.sin(i / 3 + sIdx) * 5);
    }
    const name = formatLokiLegend(q.legendFormat || "", labels) || Object.values(labels).join(" ") || q.expr || `series ${sIdx}`;
    if (q.instant) {
      return createDataFrame({
        refId: q.refId,
        name,
        meta: { resultType: "vector", preferredVisualisationType: "table" },
        fields: [
          { name: "Time", type: "time", values: [to] },
          {
            name: "Value",
            type: "number",
            values: [values.reduce((a, b) => a + b, 0)],
            labels,
            config: { displayNameFromDS: name }
          },
          ...Object.entries(labels).map(([k, v]) => ({
            name: k,
            type: "string",
            values: [v],
            config: {}
          }))
        ]
      });
    }
    return createDataFrame({
      refId: q.refId,
      name,
      meta: { resultType: "matrix", preferredVisualisationType: "graph" },
      fields: [
        { name: "Time", type: "time", values: times },
        {
          name: "Value",
          type: "number",
          values,
          labels,
          config: { displayNameFromDS: name }
        }
      ]
    });
  });
}
function createLokiDataSource(instance, meta2) {
  const fallback = createBuiltinDataSourceApi(instance, meta2);
  const url = baseUrlOf$1(instance);
  return {
    uid: instance.uid,
    type: instance.type || meta2.id,
    name: instance.name,
    capabilities: LOKI_CAPABILITIES,
    async query(request, signal) {
      const targets = request.targets.filter(
        (t2) => !t2.hide
      );
      if (getBackendMode() === "offline") {
        const frames2 = [];
        for (const raw of targets) {
          const q = normalizeLokiQuery({ ...raw, refId: raw.refId });
          if (!q.expr?.trim()) continue;
          if (isLokiMetricQuery(q.expr)) {
            frames2.push(
              ...buildLokiOfflineMetricFrames(
                q,
                request.range,
                request.maxDataPoints ?? 50
              )
            );
          } else {
            const res = await fallback.query({
              ...request,
              targets: [q]
            });
            frames2.push(...res.data);
          }
        }
        return {
          data: frames2.length ? frames2 : (await fallback.query(request)).data
        };
      }
      if (!url) {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Datasource URL is empty"
        );
      }
      const from = request.range.from.getTime();
      const to = request.range.to.getTime();
      const rangeMs2 = Math.max(1, to - from);
      const stepMs = computeStepMs({
        rangeMs: rangeMs2,
        maxDataPoints: request.maxDataPoints,
        intervalMs: request.intervalMs,
        minIntervalMs: Number(instance.jsonData?.timeIntervalMs) || void 0
      });
      const stepSec = Math.max(1, Math.floor(stepMs / 1e3));
      const cred = await getRuntimeCredential(instance.uid);
      const frames = [];
      const errors = [];
      await Promise.all(
        targets.map(async (raw) => {
          const q = normalizeLokiQuery({ ...raw, refId: raw.refId });
          if (!q.expr?.trim()) return;
          const expr = interpolatePromMacros(q.expr, {
            rangeMs: rangeMs2,
            intervalMs: stepMs,
            interpolate: (s) => s
          });
          try {
            const metric = isLokiMetricQuery(expr);
            const instant = q.instant && !q.range;
            const path = instant ? "/loki/api/v1/query" : "/loki/api/v1/query_range";
            const query = instant ? {
              query: expr,
              time: String(to * 1e6),
              // ns
              limit: String(q.maxLines ?? 1e3),
              direction: q.direction ?? "backward"
            } : {
              query: expr,
              start: String(from * 1e6),
              end: String(to * 1e6),
              limit: String(q.maxLines ?? 1e3),
              direction: q.direction ?? "backward"
            };
            if (!instant && metric) {
              query.step = String(q.step ?? `${stepSec}s`);
            }
            const method = String(
              instance.jsonData?.httpMethod || "GET"
            ).toUpperCase() === "POST" ? "POST" : "GET";
            const res = await datasourceHttp({
              baseUrl: url,
              path,
              method,
              query: method === "GET" ? query : void 0,
              body: method === "POST" ? query : void 0,
              uid: instance.uid,
              credential: cred,
              signal,
              timeoutMs: Number(instance.jsonData?.timeout) || 6e4
            });
            const mapped = mapLokiResponse(res.data, {
              refId: q.refId,
              legendFormat: q.legendFormat,
              expr: q.expr,
              maxLines: q.maxLines
            });
            frames.push(...normalizeDataFrames(mapped, { refId: q.refId }));
          } catch (e) {
            const msg = e instanceof DataSourceError ? e.message : e instanceof Error ? e.message : String(e);
            errors.push(`${q.refId}: ${msg}`);
            frames.push(
              ...normalizeDataFrames(
                [
                  {
                    refId: q.refId,
                    name: "error",
                    length: 0,
                    fields: [],
                    meta: { error: msg }
                  }
                ],
                { refId: q.refId }
              )
            );
          }
        })
      );
      if (!frames.length && errors.length) {
        throw new DataSourceError("INVALID_RESPONSE", errors.join("; "));
      }
      return { data: frames };
    },
    async testDatasource(signal) {
      if (getBackendMode() === "offline") {
        return fallback.testDatasource?.() ?? {
          status: "success",
          message: "Offline fixture OK"
        };
      }
      if (!url) return { status: "error", message: "Datasource URL is empty" };
      try {
        await datasourceHttp({
          baseUrl: url,
          path: "/ready",
          method: "GET",
          uid: instance.uid,
          signal,
          timeoutMs: 1e4
        });
        return { status: "success", message: "Loki is ready" };
      } catch {
        try {
          await datasourceHttp({
            baseUrl: url,
            path: "/loki/api/v1/labels",
            method: "GET",
            uid: instance.uid,
            signal,
            timeoutMs: 1e4
          });
          return { status: "success", message: "Loki API reachable" };
        } catch (e2) {
          const msg = e2 instanceof Error ? e2.message : String(e2);
          return { status: "error", message: msg };
        }
      }
    },
    async metricFindQuery(query, signal) {
      if (getBackendMode() === "offline") {
        return fallback.metricFindQuery?.(query) ?? [];
      }
      const q = String(query ?? "").trim();
      if (/^label_names\s*\(\s*\)\s*$/i.test(q) || q === "label_names()") {
        const res2 = await datasourceHttp({
          baseUrl: url,
          path: "/loki/api/v1/labels",
          uid: instance.uid,
          signal
        });
        return (res2.data?.data ?? []).map((v) => ({ text: v, value: v }));
      }
      const lv = q.match(
        /label_values\s*\(\s*(?:\{[^}]*\}\s*,\s*)?([a-zA-Z_][\w]*)\s*\)/i
      ) || q.match(/label_values\s*\(\s*\$?[a-zA-Z_][\w]*\s*\)/i);
      if (lv || /label_values/i.test(q)) {
        const labelMatch = q.match(
          /label_values\s*\(\s*(?:.+,\s*)?([a-zA-Z_][\w]*)\s*\)/i
        );
        const label = labelMatch?.[1] || "job";
        if (label === "label_name" || label.startsWith("$")) {
          return [];
        }
        const res2 = await datasourceHttp({
          baseUrl: url,
          path: `/loki/api/v1/label/${encodeURIComponent(label)}/values`,
          uid: instance.uid,
          signal
        });
        return (res2.data?.data ?? []).map((v) => ({ text: v, value: v }));
      }
      const res = await datasourceHttp({
        baseUrl: url,
        path: "/loki/api/v1/labels",
        uid: instance.uid,
        signal
      });
      return (res.data?.data ?? []).map((v) => ({ text: v, value: v }));
    }
  };
}
const meta$9 = {
  id: "loki",
  name: "Loki",
  backend: true,
  metrics: true,
  logs: true,
  capabilities: LOKI_CAPABILITIES
};
createDataSourcePlugin({
  meta: meta$9,
  QueryEditor: _sfc_main$1U,
  ConfigEditor: _sfc_main$1T,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createLokiDataSource(instance, meta$9)
});
const _sfc_main$1S = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "jaeger"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1R = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "jaeger"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$8 = {
  id: "jaeger",
  name: "Jaeger",
  backend: true,
  metrics: false,
  logs: false,
  tracing: true
};
createDataSourcePlugin({
  meta: meta$8,
  QueryEditor: _sfc_main$1S,
  ConfigEditor: _sfc_main$1R,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$8)
});
function mapTempoTraceResponse(body, opts) {
  if (body?.batches || body?.resourceSpans) {
    return [mapOtlp(body, opts)];
  }
  if (body?.data) return mapTempoTraceResponse(body.data, opts);
  if (body?.spans || body?.processes || Array.isArray(body)) {
    return [mapJaegerLike(body, opts)];
  }
  if (body?.traces || body?.traceSummaries) {
    return [mapSearch(body, opts)];
  }
  return [
    createDataFrame({
      refId: opts.refId,
      name: "trace",
      meta: { preferredVisualisationType: "trace" },
      fields: [
        { name: "traceID", type: "string", values: [opts.traceId || ""] },
        { name: "spanID", type: "string", values: [] },
        { name: "operationName", type: "string", values: [] },
        { name: "serviceName", type: "string", values: [] },
        { name: "startTimeUnixNano", type: "number", values: [] },
        { name: "durationNano", type: "number", values: [] }
      ]
    })
  ];
}
function mapSearch(body, opts) {
  const traces = body.traces || body.traceSummaries || [];
  return createDataFrame({
    refId: opts.refId,
    name: "trace-search",
    meta: { preferredVisualisationType: "table" },
    fields: [
      {
        name: "traceID",
        type: "string",
        values: traces.map(
          (t2) => t2.traceID || t2.traceId || t2.rootTraceId || ""
        )
      },
      {
        name: "rootServiceName",
        type: "string",
        values: traces.map(
          (t2) => t2.rootServiceName || t2.serviceName || ""
        )
      },
      {
        name: "rootTraceName",
        type: "string",
        values: traces.map(
          (t2) => t2.rootTraceName || t2.rootServiceName || t2.name || ""
        )
      },
      {
        name: "durationMs",
        type: "number",
        values: traces.map((t2) => {
          const d = t2.durationMs ?? t2.durationMs ?? (t2.duration ? Number(t2.duration) / 1e6 : null);
          return d;
        })
      },
      {
        name: "startTime",
        type: "time",
        values: traces.map((t2) => {
          const s = t2.startTimeUnixNano || t2.startTime || 0;
          const n = Number(s);
          return n > 1e15 ? Math.floor(n / 1e6) : n > 1e12 ? n : n * 1e3;
        })
      }
    ]
  });
}
function mapJaegerLike(body, opts) {
  const spans = Array.isArray(body) ? body : body.spans || [];
  const processes = body.processes || {};
  const spanIDs = [];
  const parents = [];
  const ops = [];
  const svcs = [];
  const starts = [];
  const durs = [];
  const status = [];
  const traceIds = [];
  for (const s of spans) {
    spanIDs.push(String(s.spanID || s.spanId || s.span_id || ""));
    const refs = s.references || s.refs || [];
    const pref = refs.find(
      (r) => r.refType === "CHILD_OF" || r.refType === "CHILD_OF"
    ) || refs[0];
    parents.push(
      pref ? String(pref.spanID || pref.spanId || null) : s.parentSpanId || null
    );
    ops.push(String(s.operationName || s.name || s.operation_name || ""));
    const proc = s.process || processes[s.processID] || {};
    svcs.push(
      String(proc.serviceName || s.serviceName || s.service_name || "unknown")
    );
    const st = Number(
      s.startTime || s.startTimeUnixNano || s.startTimeUnixNano || 0
    );
    starts.push(st > 1e15 ? st : st > 1e12 ? st * 1e3 : st * 1e3);
    const d = Number(s.duration || s.durationNano || 0);
    durs.push(d > 1e9 ? d : d * 1e3);
    const tags = s.tags || s.attributes || [];
    const err = Array.isArray(tags) ? tags.find(
      (t2) => (t2.key === "error" || t2.key === "otel.status_code") && (t2.value === true || t2.value === "ERROR")
    ) : null;
    status.push(err ? "ERROR" : "OK");
    traceIds.push(
      String(s.traceID || s.traceId || opts.traceId || body.traceID || "")
    );
  }
  return createDataFrame({
    refId: opts.refId,
    name: "trace",
    meta: { preferredVisualisationType: "trace", traceId: opts.traceId },
    fields: [
      { name: "traceID", type: "string", values: traceIds },
      { name: "spanID", type: "string", values: spanIDs },
      { name: "parentSpanID", type: "string", values: parents },
      { name: "operationName", type: "string", values: ops },
      { name: "serviceName", type: "string", values: svcs },
      { name: "startTimeUnixNano", type: "number", values: starts },
      { name: "durationNano", type: "number", values: durs },
      { name: "statusCode", type: "string", values: status }
    ]
  });
}
function mapOtlp(body, opts) {
  const batches = body.batches || body.resourceSpans || [];
  const spanIDs = [];
  const parents = [];
  const ops = [];
  const svcs = [];
  const starts = [];
  const durs = [];
  const status = [];
  const traceIds = [];
  for (const batch of batches) {
    const res = batch.resource || {};
    const attrs = res.attributes || [];
    const svcAttr = Array.isArray(attrs) ? attrs.find((a) => a.key === "service.name") : null;
    const service = svcAttr?.value?.stringValue || svcAttr?.value || res["service.name"] || "unknown";
    const scopeSpans = batch.scopeSpans || batch.instrumentationLibrarySpans || batch.spans || [];
    for (const scope of scopeSpans) {
      const spans = scope.spans || (scope.spanID ? [scope] : []);
      for (const s of spans) {
        spanIDs.push(String(s.spanId || s.spanID || ""));
        parents.push(s.parentSpanId || s.parentSpanID || null);
        ops.push(String(s.name || s.operationName || ""));
        svcs.push(String(service));
        starts.push(Number(s.startTimeUnixNano || 0));
        const end = Number(s.endTimeUnixNano || 0);
        const start = Number(s.startTimeUnixNano || 0);
        durs.push(end && start ? end - start : Number(s.durationNano || 0));
        status.push(String(s.status?.code || s.status?.message || "OK"));
        traceIds.push(String(s.traceId || s.traceID || opts.traceId || ""));
      }
    }
  }
  return createDataFrame({
    refId: opts.refId,
    name: "trace",
    meta: { preferredVisualisationType: "trace", traceId: opts.traceId },
    fields: [
      { name: "traceID", type: "string", values: traceIds },
      { name: "spanID", type: "string", values: spanIDs },
      { name: "parentSpanID", type: "string", values: parents },
      { name: "operationName", type: "string", values: ops },
      { name: "serviceName", type: "string", values: svcs },
      { name: "startTimeUnixNano", type: "number", values: starts },
      { name: "durationNano", type: "number", values: durs },
      { name: "statusCode", type: "string", values: status }
    ]
  });
}
const TEMPO_CAPABILITIES = {
  signals: ["traces"],
  query: true,
  health: true,
  metadata: true,
  variables: false,
  annotations: false,
  exemplars: false,
  streaming: false,
  queryLanguages: ["traceql", "trace-id"]
};
function baseUrlOf(instance) {
  return String(
    instance.url || instance.jsonData?.url || ""
  ).replace(/\/$/, "");
}
function offlineTraceFrame(refId, traceId = "offline-trace") {
  const n = 6;
  return createDataFrame({
    refId,
    name: "trace",
    meta: { preferredVisualisationType: "trace", traceId },
    fields: [
      { name: "traceID", type: "string", values: Array(n).fill(traceId) },
      {
        name: "spanID",
        type: "string",
        values: Array.from({ length: n }, (_, i) => `span-${i}`)
      },
      {
        name: "parentSpanID",
        type: "string",
        values: Array.from(
          { length: n },
          (_, i) => i === 0 ? null : "span-0"
        )
      },
      {
        name: "operationName",
        type: "string",
        values: Array.from(
          { length: n },
          (_, i) => i === 0 ? "HTTP GET" : `op-${i}`
        )
      },
      {
        name: "serviceName",
        type: "string",
        values: Array.from({ length: n }, (_, i) => `svc-${i % 3}`)
      },
      {
        name: "startTimeUnixNano",
        type: "number",
        values: Array.from({ length: n }, (_, i) => 1e15 + i * 1e7)
      },
      {
        name: "durationNano",
        type: "number",
        values: Array.from(
          { length: n },
          (_, i) => i === 0 ? 1e8 : 2e7 + i * 1e6
        )
      },
      {
        name: "statusCode",
        type: "string",
        values: Array.from({ length: n }, (_, i) => i === 4 ? "ERROR" : "OK")
      }
    ]
  });
}
function createTempoDataSource(instance, meta2) {
  const fallback = createBuiltinDataSourceApi(instance, meta2);
  const url = baseUrlOf(instance);
  async function listSearchTags(signal) {
    if (getBackendMode() === "offline") {
      return [
        "service.name",
        "http.method",
        "http.status_code",
        "span.kind"
      ].map((t2) => ({
        text: t2,
        value: t2
      }));
    }
    if (!url) return [];
    return metadataCacheLoad(instance.uid, "tempo:tags", async () => {
      const cred = await getRuntimeCredential(instance.uid);
      try {
        const res = await datasourceHttp({
          baseUrl: url,
          path: "/api/search/tags",
          method: "GET",
          uid: instance.uid,
          credential: cred,
          signal
        });
        const tags = res.data?.tagNames || res.data?.tags || res.data || [];
        const arr = Array.isArray(tags) ? tags : [];
        return arr.map((t2) => {
          const name = typeof t2 === "string" ? t2 : String(t2);
          return { text: name, value: name };
        });
      } catch {
        return [];
      }
    });
  }
  async function listTagValues(tag, signal) {
    if (!tag) return [];
    if (getBackendMode() === "offline") {
      if (tag === "service.name") {
        return ["frontend", "api", "checkout"].map((v) => ({
          text: v,
          value: v
        }));
      }
      return [];
    }
    if (!url) return [];
    return metadataCacheLoad(
      instance.uid,
      `tempo:tagValues:${tag}`,
      async () => {
        const cred = await getRuntimeCredential(instance.uid);
        try {
          const res = await datasourceHttp({
            baseUrl: url,
            path: `/api/search/tag/${encodeURIComponent(tag)}/values`,
            method: "GET",
            uid: instance.uid,
            credential: cred,
            signal
          });
          const vals = res.data?.tagValues || res.data?.values || res.data || [];
          const arr = Array.isArray(vals) ? vals : [];
          return arr.map((v) => {
            const name = typeof v === "string" ? v : String(v);
            return { text: name, value: name };
          });
        } catch {
          return [];
        }
      },
      3e4
    );
  }
  return {
    uid: instance.uid,
    type: instance.type || meta2.id,
    name: instance.name,
    capabilities: TEMPO_CAPABILITIES,
    async query(request, signal) {
      const targets = request.targets.filter((t2) => !t2.hide);
      if (getBackendMode() === "offline") {
        return {
          data: targets.map(
            (t2) => offlineTraceFrame(
              t2.refId,
              String(t2.query || t2.traceId || "offline-trace")
            )
          )
        };
      }
      if (!url) {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Datasource URL is empty"
        );
      }
      const cred = await getRuntimeCredential(instance.uid);
      const frames = [];
      const errors = [];
      const from = request.range.from.getTime();
      const to = request.range.to.getTime();
      await Promise.all(
        targets.map(async (raw) => {
          const q = raw;
          const queryType = String(
            q.queryType || (q.traceId || looksLikeTraceId(q.query) ? "traceId" : "search")
          );
          const traceId = String(
            q.traceId || (looksLikeTraceId(q.query) ? q.query : "") || ""
          ).trim();
          try {
            if (queryType === "traceId" || traceId && !q.search) {
              if (!traceId)
                throw new DataSourceError(
                  "INVALID_RESPONSE",
                  "traceId required"
                );
              const res = await datasourceHttp({
                baseUrl: url,
                path: `/api/traces/${encodeURIComponent(traceId)}`,
                method: "GET",
                uid: instance.uid,
                credential: cred,
                signal,
                timeoutMs: 3e4
              });
              const mapped = mapTempoTraceResponse(res.data, {
                refId: q.refId,
                traceId
              });
              frames.push(...normalizeDataFrames(mapped, { refId: q.refId }));
            } else {
              const searchQ = String(q.query || q.search || q.expr || "{}");
              const res = await datasourceHttp({
                baseUrl: url,
                path: "/api/search",
                method: "GET",
                query: {
                  q: searchQ,
                  start: String(Math.floor(from * 1e3)),
                  // Tempo often expects µs or ns depending on version — send µs-ish
                  end: String(Math.floor(to * 1e3)),
                  limit: String(q.limit ?? 20)
                },
                uid: instance.uid,
                credential: cred,
                signal,
                timeoutMs: 3e4
              });
              const mapped = mapTempoTraceResponse(res.data, {
                refId: q.refId
              });
              frames.push(...normalizeDataFrames(mapped, { refId: q.refId }));
            }
          } catch (e) {
            const msg = e instanceof DataSourceError ? e.message : e instanceof Error ? e.message : String(e);
            errors.push(`${q.refId}: ${msg}`);
            frames.push(
              ...normalizeDataFrames(
                [
                  {
                    refId: q.refId,
                    name: "error",
                    length: 0,
                    fields: [],
                    meta: { error: msg }
                  }
                ],
                { refId: q.refId }
              )
            );
          }
        })
      );
      if (!frames.length && errors.length) {
        throw new DataSourceError("INVALID_RESPONSE", errors.join("; "));
      }
      return { data: frames };
    },
    async testDatasource(signal) {
      if (getBackendMode() === "offline") {
        return fallback.testDatasource?.() ?? {
          status: "success",
          message: "Offline Tempo OK"
        };
      }
      if (!url) return { status: "error", message: "Datasource URL is empty" };
      try {
        await datasourceHttp({
          baseUrl: url,
          path: "/ready",
          method: "GET",
          uid: instance.uid,
          signal,
          timeoutMs: 1e4
        });
        return { status: "success", message: "Tempo is ready" };
      } catch (e) {
        const msg = e instanceof Error ? e.message : String(e);
        return { status: "error", message: msg };
      }
    },
    listSearchTags,
    listTagValues,
    async metricFindQuery(query, signal) {
      const q = String(query ?? "").trim().toLowerCase();
      if (!q || q.includes("tag") || q.includes("label")) {
        return listSearchTags(signal);
      }
      if (q.includes("service")) {
        return listTagValues("service.name", signal);
      }
      return [];
    }
  };
}
function looksLikeTraceId(q) {
  const s = String(q ?? "").trim();
  return /^[a-fA-F0-9]{16,32}$/.test(s);
}
const meta$7 = {
  id: "tempo",
  name: "Tempo",
  tracing: true,
  backend: true,
  capabilities: TEMPO_CAPABILITIES
};
createDataSourcePlugin({
  meta: meta$7,
  QueryEditor: SharedQueryEditor,
  ConfigEditor: SharedConfigEditor,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createTempoDataSource(instance, meta$7)
});
const _sfc_main$1Q = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "grafana-pyroscope-datasource"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1P = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "grafana-pyroscope-datasource"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$6 = {
  id: "grafana-pyroscope-datasource",
  name: "Pyroscope",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$6,
  QueryEditor: _sfc_main$1Q,
  ConfigEditor: _sfc_main$1P,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$6)
});
const _sfc_main$1O = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "cloudwatch"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1N = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "cloudwatch"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$5 = {
  id: "cloudwatch",
  name: "CloudWatch",
  backend: true,
  metrics: true,
  logs: true,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$5,
  QueryEditor: _sfc_main$1O,
  ConfigEditor: _sfc_main$1N,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$5)
});
const _sfc_main$1M = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "grafana-azure-monitor-datasource"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1L = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "grafana-azure-monitor-datasource"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$4 = {
  id: "grafana-azure-monitor-datasource",
  name: "Azure Monitor",
  backend: true,
  metrics: true,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$4,
  QueryEditor: _sfc_main$1M,
  ConfigEditor: _sfc_main$1L,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$4)
});
const _sfc_main$1K = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const ds2 = computed(() => ({
      ...props.datasource,
      type: props.datasource?.type || "alertmanager"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedQueryEditor, {
        query: props.query,
        datasource: ds2.value,
        onChange: props.onChange,
        onRunQuery: props.onRunQuery,
        range: props.range,
        data: props.data
      }, null, 8, ["query", "datasource", "onChange", "onRunQuery", "range", "data"]);
    };
  }
});
const _sfc_main$1J = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...props.options,
      type: props.options?.type || "alertmanager"
    }));
    return (_ctx, _cache) => {
      return openBlock(), createBlock(SharedConfigEditor, {
        options: options.value,
        onOptionsChange: props.onOptionsChange
      }, null, 8, ["options", "onOptionsChange"]);
    };
  }
});
const meta$3 = {
  id: "alertmanager",
  name: "Alertmanager",
  backend: true,
  metrics: false,
  logs: false,
  tracing: false
};
createDataSourcePlugin({
  meta: meta$3,
  QueryEditor: _sfc_main$1K,
  ConfigEditor: _sfc_main$1J,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createBuiltinDataSourceApi(instance, meta$3)
});
const _hoisted_1$1D = {
  class: "otel-qe",
  "data-testid": "query-editor-opentelemetry"
};
const _hoisted_2$1j = {
  key: 0,
  class: "err"
};
const _hoisted_3$18 = { class: "row" };
const _hoisted_4$V = { class: "row" };
const _hoisted_5$O = {
  key: 1,
  class: "row",
  "data-testid": "otel-metric-browser"
};
const _hoisted_6$H = {
  key: 2,
  class: "row",
  "data-testid": "otel-service-browser"
};
const _hoisted_7$z = {
  key: 3,
  class: "row",
  "data-testid": "otel-tag-browser"
};
const _hoisted_8$s = { class: "row" };
const _hoisted_9$r = { class: "row" };
const _hoisted_10$n = { class: "row" };
const _sfc_main$1I = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {},
    datasourceApi: {}
  },
  setup(__props) {
    const props = __props;
    const signal = computed({
      get: () => String(props.query.signal || "metrics"),
      set: (v) => props.onChange({ ...props.query, signal: v })
    });
    const expr = computed({
      get: () => String(props.query.expr || props.query.query || ""),
      set: (v) => props.onChange({ ...props.query, expr: v, query: v })
    });
    const provider2 = computed({
      get: () => String(props.query.provider || ""),
      set: (v) => props.onChange({ ...props.query, provider: v })
    });
    const service = computed({
      get: () => String(props.query.service || ""),
      set: (v) => props.onChange({ ...props.query, service: v })
    });
    const maxLines = computed({
      get: () => String(props.query.maxLines ?? props.query.limit ?? ""),
      set: (v) => {
        const n = v === "" ? void 0 : Number(v);
        props.onChange({
          ...props.query,
          maxLines: Number.isFinite(n) ? n : void 0,
          limit: Number.isFinite(n) ? n : void 0
        });
      }
    });
    const signalOptions = [
      { label: "Metrics", value: "metrics" },
      { label: "Logs", value: "logs" },
      { label: "Traces", value: "traces" }
    ];
    const providerHint = computed(() => {
      if (signal.value === "metrics") return "prometheus";
      if (signal.value === "logs") return "loki | signoz";
      return "tempo | jaeger | signoz";
    });
    const services = ref([]);
    const metrics = ref([]);
    const tags = ref([]);
    const metaError = ref("");
    const metaLoading = ref(false);
    async function loadMeta() {
      metaLoading.value = true;
      metaError.value = "";
      try {
        const api = props.datasourceApi;
        if (signal.value === "metrics") {
          if (typeof api?.listMetricNames === "function") {
            const names = await api.listMetricNames();
            metrics.value = (names || []).map((n) => ({
              label: n,
              value: n
            }));
          } else {
            metrics.value = [
              { label: "up", value: "up" },
              { label: "http_requests_total", value: "http_requests_total" }
            ];
          }
        } else if (signal.value === "traces") {
          if (typeof api?.listSearchTags === "function") {
            const rows = await api.listSearchTags();
            tags.value = (rows || []).map((r) => ({
              label: String(r.text ?? r.value ?? r),
              value: String(r.value ?? r.text ?? r)
            }));
          } else {
            tags.value = [
              { label: "service.name", value: "service.name" },
              { label: "http.method", value: "http.method" }
            ];
          }
          if (typeof api?.listServices === "function") {
            const rows = await api.listServices();
            services.value = (rows || []).map((r) => ({
              label: String(r.text ?? r.value ?? r),
              value: String(r.value ?? r.text ?? r)
            }));
          } else if (typeof api?.listTagValues === "function") {
            const rows = await api.listTagValues("service.name");
            services.value = (rows || []).map((r) => ({
              label: String(r.text ?? r.value ?? r),
              value: String(r.value ?? r.text ?? r)
            }));
          } else {
            services.value = [
              { label: "frontend", value: "frontend" },
              { label: "api", value: "api" }
            ];
          }
        } else {
          if (typeof api?.listServices === "function") {
            const rows = await api.listServices();
            services.value = (rows || []).map((r) => ({
              label: String(r.text ?? r.value ?? r),
              value: String(r.value ?? r.text ?? r)
            }));
          } else {
            services.value = [
              { label: "frontend", value: "frontend" },
              { label: "api", value: "api" }
            ];
          }
        }
      } catch (e) {
        metaError.value = e instanceof Error ? e.message : String(e);
      } finally {
        metaLoading.value = false;
      }
    }
    function insertTag(v) {
      const t2 = String(v ?? "");
      if (t2 && !expr.value.trim()) {
        expr.value = "{ " + t2 + ' = "" }';
      }
    }
    function insertMetric(v) {
      const m = String(v ?? "");
      if (m) expr.value = m;
    }
    function pickService(v) {
      const s = String(v ?? "");
      service.value = s;
      if (signal.value === "traces" && s && !expr.value.trim()) {
        expr.value = `{ resource.service.name = "${s}" }`;
      }
    }
    onMounted(loadMeta);
    watch(signal, () => {
      void loadMeta();
    });
    watch(
      () => props.datasourceApi,
      () => {
        void loadMeta();
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1D, [
        metaError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_2$1j,
          toDisplayString(metaError.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_3$18, [
          _cache[6] || (_cache[6] = createElementVNode(
            "label",
            null,
            "Signal",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            modelValue: signal.value,
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => signal.value = $event),
            options: signalOptions,
            "test-id": "otel-signal"
          }, null, 8, ["modelValue"])
        ]),
        createElementVNode("div", _hoisted_4$V, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "Provider 覆盖（可选）",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            modelValue: provider2.value,
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => provider2.value = $event),
            placeholder: providerHint.value,
            "test-id": "otel-provider"
          }, null, 8, ["modelValue", "placeholder"])
        ]),
        signal.value === "metrics" ? (openBlock(), createElementBlock("div", _hoisted_5$O, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "指标浏览器（预取）",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            loading: metaLoading.value,
            options: metrics.value,
            placeholder: "选择指标插入 PromQL",
            "data-testid": "otel-metric-select",
            "onUpdate:value": insertMetric
          }, null, 8, ["loading", "options"])
        ])) : createCommentVNode("v-if", true),
        signal.value !== "metrics" ? (openBlock(), createElementBlock("div", _hoisted_6$H, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "Service（预取）",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            loading: metaLoading.value,
            value: service.value || void 0,
            options: services.value,
            placeholder: "service.name",
            "data-testid": "otel-service-select",
            "onUpdate:value": pickService
          }, null, 8, ["loading", "value", "options"])
        ])) : createCommentVNode("v-if", true),
        signal.value === "traces" && tags.value.length ? (openBlock(), createElementBlock("div", _hoisted_7$z, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "Trace 标签",
            -1
            /* CACHED */
          )),
          createVNode(unref(Select), {
            style: { "width": "100%" },
            "show-search": "",
            "allow-clear": "",
            loading: metaLoading.value,
            options: tags.value,
            placeholder: "Tempo 搜索标签",
            "data-testid": "otel-tag-select",
            "onUpdate:value": insertTag
          }, null, 8, ["loading", "options"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_8$s, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "Service / Resource（可选）",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            modelValue: service.value,
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => service.value = $event),
            placeholder: "service.name",
            "test-id": "otel-service"
          }, null, 8, ["modelValue"])
        ]),
        createElementVNode("div", _hoisted_9$r, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "限制 / maxLines",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            modelValue: maxLines.value,
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => maxLines.value = $event),
            placeholder: "1000",
            "test-id": "otel-max-lines"
          }, null, 8, ["modelValue"])
        ]),
        createElementVNode("div", _hoisted_10$n, [
          createElementVNode(
            "label",
            null,
            toDisplayString(signal.value === "metrics" ? "PromQL" : signal.value === "logs" ? "LogQL" : "Trace 查询"),
            1
            /* TEXT */
          ),
          createVNode(unref(GInput), {
            modelValue: expr.value,
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => expr.value = $event),
            "test-id": "otel-expr"
          }, null, 8, ["modelValue"])
        ]),
        createVNode(unref(GButton), {
          size: "sm",
          variant: "primary",
          "test-id": "run-query",
          onClick: _cache[5] || (_cache[5] = ($event) => props.onRunQuery?.())
        }, {
          default: withCtx(() => [..._cache[13] || (_cache[13] = [
            createTextVNode(
              "运行查询",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        }),
        _cache[14] || (_cache[14] = createElementVNode(
          "p",
          { class: "hint" },
          " OpenTelemetry 是查询聚合器，不是 OTLP 写入。请在数据源配置中设置 metricsUrl / logsUrl / tracesUrl。查询编辑器挂载时会预取指标/服务/标签。 ",
          -1
          /* CACHED */
        ))
      ]);
    };
  }
});
const QueryEditor$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1I, [["__scopeId", "data-v-539b4835"]]);
const _hoisted_1$1C = {
  class: "otel-cfg",
  "data-testid": "config-editor-opentelemetry"
};
const _sfc_main$1H = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    function jd() {
      return { ...props.options?.jsonData || {} };
    }
    function patchJson(p) {
      const options = props.options;
      props.onOptionsChange({
        ...options,
        jsonData: { ...jd(), ...p }
      });
    }
    const defaultSignal = computed({
      get: () => String(jd().defaultSignal || "metrics"),
      set: (v) => patchJson({ defaultSignal: v })
    });
    const metricsUrl = computed({
      get: () => String(jd().metricsUrl || ""),
      set: (v) => patchJson({ metricsUrl: v })
    });
    const logsUrl = computed({
      get: () => String(jd().logsUrl || ""),
      set: (v) => patchJson({ logsUrl: v })
    });
    const tracesUrl = computed({
      get: () => String(jd().tracesUrl || ""),
      set: (v) => patchJson({ tracesUrl: v })
    });
    const tracesProvider = computed({
      get: () => String(jd().tracesProvider || "tempo"),
      set: (v) => patchJson({ tracesProvider: v })
    });
    const logsProvider = computed({
      get: () => String(jd().logsProvider || "loki"),
      set: (v) => patchJson({ logsProvider: v })
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1C, [
        _cache[6] || (_cache[6] = createElementVNode(
          "h4",
          null,
          "OpenTelemetry 查询聚合器",
          -1
          /* CACHED */
        )),
        _cache[7] || (_cache[7] = createElementVNode(
          "p",
          { class: "warn" },
          " 浏览器直连查询端点（非 OTLP /v1/* 写入）。凭据仅存运行时内存。 ",
          -1
          /* CACHED */
        )),
        _cache[8] || (_cache[8] = createElementVNode(
          "label",
          null,
          "默认 Signal",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          modelValue: defaultSignal.value,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => defaultSignal.value = $event),
          options: [
            { label: "metrics", value: "metrics" },
            { label: "logs", value: "logs" },
            { label: "traces", value: "traces" }
          ],
          "test-id": "otel-default-signal"
        }, null, 8, ["modelValue"]),
        _cache[9] || (_cache[9] = createElementVNode(
          "label",
          null,
          "Metrics URL（Prometheus-compatible）",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          modelValue: metricsUrl.value,
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => metricsUrl.value = $event),
          placeholder: "http://localhost:9090",
          "test-id": "otel-metrics-url"
        }, null, 8, ["modelValue"]),
        _cache[10] || (_cache[10] = createElementVNode(
          "label",
          null,
          "Logs URL（Loki-compatible）",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          modelValue: logsUrl.value,
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => logsUrl.value = $event),
          placeholder: "http://localhost:3100",
          "test-id": "otel-logs-url"
        }, null, 8, ["modelValue"]),
        _cache[11] || (_cache[11] = createElementVNode(
          "label",
          null,
          "Logs Provider",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          modelValue: logsProvider.value,
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => logsProvider.value = $event),
          options: [
            { label: "loki", value: "loki" },
            { label: "signoz", value: "signoz" }
          ],
          "test-id": "otel-logs-provider"
        }, null, 8, ["modelValue"]),
        _cache[12] || (_cache[12] = createElementVNode(
          "label",
          null,
          "Traces URL",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          modelValue: tracesUrl.value,
          "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => tracesUrl.value = $event),
          placeholder: "http://localhost:3200",
          "test-id": "otel-traces-url"
        }, null, 8, ["modelValue"]),
        _cache[13] || (_cache[13] = createElementVNode(
          "label",
          null,
          "Traces Provider",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          modelValue: tracesProvider.value,
          "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => tracesProvider.value = $event),
          options: [
            { label: "tempo", value: "tempo" },
            { label: "jaeger", value: "jaeger" }
          ],
          "test-id": "otel-traces-provider"
        }, null, 8, ["modelValue"])
      ]);
    };
  }
});
const ConfigEditor$2 = /* @__PURE__ */ _export_sfc(_sfc_main$1H, [["__scopeId", "data-v-10e6f551"]]);
const OTEL_CAPABILITIES = {
  signals: ["metrics", "logs", "traces"],
  query: true,
  health: true,
  metadata: true,
  variables: true,
  annotations: false,
  exemplars: false,
  streaming: false,
  queryLanguages: ["promql", "logql", "traceql", "trace-filter"]
};
function buildOtelCapabilities(json, instanceUrl) {
  const signals = [];
  const langs = [];
  if (json.metricsUrl || instanceUrl) {
    signals.push("metrics");
    langs.push("promql");
  }
  if (json.logsUrl) {
    signals.push("logs");
    langs.push(
      String(json.logsProvider || "loki") === "signoz" ? "signoz-logs" : "logql"
    );
  }
  if (json.tracesUrl) {
    signals.push("traces");
    langs.push("traceql", "trace-filter");
  }
  if (!signals.length) {
    return { ...OTEL_CAPABILITIES };
  }
  return {
    ...OTEL_CAPABILITIES,
    signals,
    queryLanguages: langs.length ? langs : OTEL_CAPABILITIES.queryLanguages
  };
}
function createOpenTelemetryDataSource(instance, meta2) {
  const fallback = createBuiltinDataSourceApi(instance, meta2);
  const json = instance.jsonData || {};
  const metricsProvider = String(json.metricsProvider || "prometheus");
  const logsProvider = String(json.logsProvider || "loki");
  const tracesProvider = String(json.tracesProvider || "tempo");
  return {
    uid: instance.uid,
    type: meta2.id,
    name: instance.name,
    capabilities: buildOtelCapabilities(json, instance.url),
    async query(request, signal) {
      if (getBackendMode() === "offline") return fallback.query(request);
      const frames = [];
      for (const t2 of request.targets.filter((x) => !x.hide)) {
        const signalType = String(
          t2.signal || json.defaultSignal || "metrics"
        );
        if (signalType === "metrics") {
          if (metricsProvider !== "prometheus" && metricsProvider !== "promql") {
            throw new DataSourceError(
              "UNSUPPORTED_QUERY_API",
              `Metrics provider "${metricsProvider}" is not configured`
            );
          }
          const promUrl = String(
            json.metricsUrl || instance.url || ""
          );
          if (!promUrl)
            throw new DataSourceError(
              "UNSUPPORTED_QUERY_API",
              "metricsUrl not configured for OTel metrics"
            );
          const prom = createPrometheusDataSource(
            {
              ...instance,
              url: promUrl,
              jsonData: { ...json, ...json.metricsJsonData || {} }
            },
            { id: "prometheus", name: "Prometheus" }
          );
          const res = await prom.query(
            {
              ...request,
              targets: [{ ...t2, expr: t2.expr || t2.query }]
            },
            signal
          );
          frames.push(...res.data);
        } else if (signalType === "logs") {
          const endpoint = String(json.logsUrl || "");
          if (!endpoint) {
            throw new DataSourceError(
              "UNSUPPORTED_QUERY_API",
              "logs query endpoint not configured (OTel is a query aggregator, not OTLP)"
            );
          }
          if (logsProvider !== "loki" && logsProvider !== "signoz") {
            throw new DataSourceError(
              "UNSUPPORTED_QUERY_API",
              `Logs provider "${logsProvider}" is not supported (use loki|signoz)`
            );
          }
          if (logsProvider === "signoz") {
            const signoz = createSignozDataSource$1(
              {
                ...instance,
                url: endpoint,
                jsonData: {
                  ...json,
                  ...json.logsJsonData || {},
                  apiProfile: json.logsApiProfile || "signoz-v3"
                }
              },
              { id: "signoz", name: "SigNoz" }
            );
            const res = await signoz.query(
              {
                ...request,
                targets: [
                  {
                    ...t2,
                    signal: "logs",
                    expr: t2.expr || t2.query
                  }
                ]
              },
              signal
            );
            frames.push(...res.data);
          } else {
            const loki = createLokiDataSource(
              {
                ...instance,
                url: endpoint,
                jsonData: {
                  ...json,
                  ...json.logsJsonData || {},
                  apiProfile: json.logsApiProfile
                }
              },
              { id: "loki", name: "Loki" }
            );
            const res = await loki.query(
              {
                ...request,
                targets: [{ ...t2, expr: t2.expr || t2.query }]
              },
              signal
            );
            frames.push(...res.data);
          }
        } else if (signalType === "traces") {
          const endpoint = String(json.tracesUrl || "");
          if (!endpoint) {
            throw new DataSourceError(
              "UNSUPPORTED_QUERY_API",
              "traces query endpoint not configured (OTel is a query aggregator, not OTLP)"
            );
          }
          if (tracesProvider !== "tempo" && tracesProvider !== "jaeger") {
            throw new DataSourceError(
              "UNSUPPORTED_QUERY_API",
              `Traces provider "${tracesProvider}" is not supported (use tempo|jaeger)`
            );
          }
          const tempo = createTempoDataSource(
            {
              ...instance,
              url: endpoint,
              jsonData: { ...json, ...json.tracesJsonData || {} }
            },
            { id: "tempo", name: "Tempo" }
          );
          const res = await tempo.query(
            {
              ...request,
              targets: [
                {
                  ...t2,
                  query: t2.query || t2.expr || t2.traceId,
                  traceId: t2.traceId,
                  queryType: t2.queryType
                }
              ]
            },
            signal
          );
          frames.push(...res.data);
        } else {
          throw new DataSourceError(
            "UNSUPPORTED_QUERY_API",
            `Unknown signal ${signalType}`
          );
        }
      }
      return { data: frames };
    },
    async testDatasource() {
      if (getBackendMode() === "offline")
        return { status: "success", message: "OTel offline OK" };
      if (!json.metricsUrl && !json.logsUrl && !json.tracesUrl && !instance.url) {
        return {
          status: "error",
          message: "Configure metricsUrl/logsUrl/tracesUrl (query providers, not OTLP)"
        };
      }
      return {
        status: "success",
        message: "OpenTelemetry query aggregator configured"
      };
    },
    metricFindQuery: (q) => fallback.metricFindQuery?.(q) ?? Promise.resolve([]),
    /** Prefetch: metrics → Prometheus provider */
    async listMetricNames(signal) {
      const promUrl = String(json.metricsUrl || instance.url || "");
      const prom = createPrometheusDataSource(
        {
          ...instance,
          url: promUrl || "http://localhost:9090",
          jsonData: { ...json, ...json.metricsJsonData || {} }
        },
        { id: "prometheus", name: "Prometheus" }
      );
      if (typeof prom.listMetricNames === "function") {
        return prom.listMetricNames(signal);
      }
      return [];
    },
    async listLabelNames(signal) {
      const promUrl = String(json.metricsUrl || instance.url || "");
      const prom = createPrometheusDataSource(
        {
          ...instance,
          url: promUrl || "http://localhost:9090",
          jsonData: { ...json, ...json.metricsJsonData || {} }
        },
        { id: "prometheus", name: "Prometheus" }
      );
      if (typeof prom.listLabelNames === "function") {
        return prom.listLabelNames(signal);
      }
      return [];
    },
    /** Prefetch: traces → Tempo provider tags/services */
    async listSearchTags(signal) {
      const endpoint = String(json.tracesUrl || "");
      const tempo = createTempoDataSource(
        {
          ...instance,
          url: endpoint || "http://localhost:3200",
          jsonData: { ...json, ...json.tracesJsonData || {} }
        },
        { id: "tempo", name: "Tempo" }
      );
      if (typeof tempo.listSearchTags === "function") {
        return tempo.listSearchTags(signal);
      }
      return [];
    },
    async listTagValues(tag, signal) {
      const endpoint = String(json.tracesUrl || "");
      const tempo = createTempoDataSource(
        {
          ...instance,
          url: endpoint || "http://localhost:3200",
          jsonData: { ...json, ...json.tracesJsonData || {} }
        },
        { id: "tempo", name: "Tempo" }
      );
      if (typeof tempo.listTagValues === "function") {
        return tempo.listTagValues(tag, signal);
      }
      return [];
    },
    /** Prefetch: services (traces tag values or signoz logs) */
    async listServices(signal) {
      if (getBackendMode() === "offline") {
        return [
          { text: "frontend", value: "frontend" },
          { text: "api", value: "api" },
          { text: "checkout", value: "checkout" }
        ];
      }
      if (json.tracesUrl || tracesProvider === "tempo") {
        try {
          const endpoint = String(json.tracesUrl || "http://localhost:3200");
          const tempo = createTempoDataSource(
            {
              ...instance,
              url: endpoint,
              jsonData: { ...json, ...json.tracesJsonData || {} }
            },
            { id: "tempo", name: "Tempo" }
          );
          if (typeof tempo.listTagValues === "function") {
            return await tempo.listTagValues("service.name", signal);
          }
        } catch {
        }
      }
      if (logsProvider === "signoz" && json.logsUrl) {
        const signoz = createSignozDataSource$1(
          {
            ...instance,
            url: String(json.logsUrl),
            jsonData: {
              ...json,
              apiProfile: json.logsApiProfile || "signoz-v3"
            }
          },
          { id: "signoz", name: "SigNoz" }
        );
        if (typeof signoz.listServices === "function") {
          return signoz.listServices(signal);
        }
      }
      return [];
    }
  };
}
const meta$2 = {
  id: "opentelemetry",
  name: "OpenTelemetry",
  metrics: true,
  logs: true,
  tracing: true,
  capabilities: OTEL_CAPABILITIES
};
createDataSourcePlugin({
  meta: meta$2,
  QueryEditor: QueryEditor$2,
  ConfigEditor: ConfigEditor$2,
  VariableQueryEditor: VariableQueryEditor$2,
  AnnotationQueryEditor: AnnotationQueryEditor$2,
  createDataSource: (instance) => createOpenTelemetryDataSource(instance, meta$2)
});
let datasourcesRegistered = false;
function registerBuiltinDataSources() {
  if (datasourcesRegistered) return;
  datasourcesRegistered = true;
  if (listDataSourcePlugins().length === 0) {
    throw new Error(
      "[grafana-vue-datasources] registerBuiltinDataSources produced zero plugins"
    );
  }
}
const ZABBIX_TYPE$1 = "alexanderzobnin-zabbix-datasource";
const SIGNOZ_TYPE$1 = "signoz";
function ds(type, uid) {
  return { type, uid };
}
function panel(id, type, title, gridPos, targets, extra = {}) {
  return {
    id,
    type,
    title,
    gridPos,
    targets,
    options: extra.options || {},
    fieldConfig: extra.fieldConfig || { defaults: {}, overrides: [] },
    datasource: targets[0]?.datasource,
    ...extra
  };
}
function assertNoEmptyDupTargets(panels2, uid) {
  const seen = /* @__PURE__ */ new Set();
  for (const p of panels2) {
    for (const t2 of p.targets || []) {
      const key = JSON.stringify({
        refId: t2.refId,
        queryType: t2.queryType,
        signal: t2.signal,
        requestType: t2.requestType,
        expr: t2.expr,
        item: t2.item,
        schema: t2.schema
      });
      if (seen.has(key) && !t2.expr && !t2.item?.filter && !(t2.queries || []).length) {
        throw new Error(`${uid}: duplicate empty target ${key}`);
      }
      seen.add(`${p.id}:${t2.refId}`);
      if (!t2.datasource?.uid) {
        throw new Error(`${uid}: target ${t2.refId} missing datasource uid`);
      }
    }
  }
}
function zabbixScopeFilters() {
  return { group: { filter: "$Group" }, host: { filter: "$Host" } };
}
function zabbixTemplating(datasource) {
  return {
    list: [
      {
        name: "Group",
        type: "query",
        datasource,
        query: { queryType: "group", filter: "" },
        current: { text: "All", value: "/.*/" },
        includeAll: true,
        allValue: "/.*/",
        refresh: 1
      },
      {
        name: "Host",
        type: "query",
        datasource,
        query: { queryType: "host", group: "$Group", filter: "" },
        current: { text: "All", value: "/.*/" },
        includeAll: true,
        allValue: "/.*/",
        refresh: 1
      }
    ]
  };
}
function buildLiveZabbixMetrics(uid = "live-zabbix-metrics") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const scope = zabbixScopeFilters();
  const panels2 = [
    panel(1, "timeseries", "History metrics", { x: 0, y: 0, w: 12, h: 8 }, [
      {
        refId: "A",
        queryType: "0",
        ...scope,
        item: { filter: "system.cpu.util" },
        datasource: d
      }
    ]),
    panel(2, "timeseries", "Trends metrics", { x: 12, y: 0, w: 12, h: 8 }, [
      {
        refId: "B",
        queryType: "0",
        useTrends: "true",
        ...scope,
        item: { filter: "vm.memory.util" },
        datasource: d
      }
    ]),
    panel(3, "stat", "Latest single", { x: 0, y: 8, w: 8, h: 6 }, [
      {
        refId: "C",
        queryType: "0",
        ...scope,
        item: { filter: "agent.ping" },
        datasource: d
      }
    ]),
    panel(4, "table", "Item inventory", { x: 8, y: 8, w: 16, h: 6 }, [
      {
        refId: "D",
        queryType: "2",
        ...scope,
        item: { filter: "system.uname" },
        datasource: d
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix Metrics",
    schemaVersion: 39,
    requireLiveFrames: true,
    tags: ["live", "zabbix", "metrics"],
    time: { from: "now-1h", to: "now" },
    templating: zabbixTemplating(d),
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixItemid(uid = "live-zabbix-itemid") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(1, "timeseries", "By itemids", { x: 0, y: 0, w: 24, h: 10 }, [
      { refId: "A", queryType: "0", itemids: ["10001"], datasource: d },
      { refId: "B", queryType: "0", itemids: ["10002"], datasource: d }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix ItemIDs",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixText(uid = "live-zabbix-text") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(1, "logs", "Text / log items", { x: 0, y: 0, w: 24, h: 12 }, [
      {
        refId: "A",
        queryType: "2",
        ...zabbixScopeFilters(),
        item: { filter: "log[*]" },
        datasource: d
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix Text",
    schemaVersion: 39,
    requireLiveFrames: true,
    templating: zabbixTemplating(ds(ZABBIX_TYPE$1, "zabbix")),
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixServices(uid = "live-zabbix-services") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(1, "table", "IT Services", { x: 0, y: 0, w: 24, h: 12 }, [
      {
        refId: "A",
        queryType: "1",
        service: { filter: "/.*/" },
        itServiceFilter: "/.*/",
        slaProperty: "sli",
        datasource: d
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix Services",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixTriggers(uid = "live-zabbix-triggers") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(1, "table", "Triggers", { x: 0, y: 0, w: 24, h: 12 }, [
      {
        refId: "A",
        queryType: "4",
        ...zabbixScopeFilters(),
        trigger: { filter: "" },
        options: { limit: 100 },
        datasource: d
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix Triggers",
    schemaVersion: 39,
    requireLiveFrames: true,
    templating: zabbixTemplating(ds(ZABBIX_TYPE$1, "zabbix")),
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixProblems(uid = "live-zabbix-problems") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(
      1,
      "alexanderzobnin-zabbix-triggers-panel",
      "Problems panel",
      { x: 0, y: 0, w: 24, h: 14 },
      [
        {
          refId: "A",
          queryType: "5",
          ...zabbixScopeFilters(),
          options: { useTimeRange: true, minSeverity: 2, limit: 50 },
          datasource: d
        }
      ]
    )
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix Problems",
    schemaVersion: 39,
    requireLiveFrames: true,
    templating: zabbixTemplating(ds(ZABBIX_TYPE$1, "zabbix")),
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixMacros(uid = "live-zabbix-macros") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(1, "table", "User macros", { x: 0, y: 0, w: 24, h: 10 }, [
      {
        refId: "A",
        queryType: "6",
        ...zabbixScopeFilters(),
        macro: { filter: "" },
        datasource: d
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix Macros",
    schemaVersion: 39,
    requireLiveFrames: true,
    templating: zabbixTemplating(ds(ZABBIX_TYPE$1, "zabbix")),
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function buildLiveZabbixLld(uid = "live-zabbix-lld") {
  const d = ds(ZABBIX_TYPE$1, "zabbix");
  const panels2 = [
    panel(1, "table", "LLD discovery", { x: 0, y: 0, w: 24, h: 10 }, [
      {
        refId: "A",
        queryType: "0",
        executionMode: "lld",
        lld: {
          ruleId: "10001",
          ruleName: "Mounted filesystem discovery",
          prototypeIds: [],
          prototypeKeys: ["vfs.fs.size[{#FSNAME},pused]"]
        },
        ...zabbixScopeFilters(),
        application: { filter: "/.*/" },
        datasource: d
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live Zabbix LLD",
    schemaVersion: 39,
    requireLiveFrames: true,
    templating: zabbixTemplating(ds(ZABBIX_TYPE$1, "zabbix")),
    meta: { liveOnly: true, datasourceUid: "zabbix" },
    panels: panels2
  };
}
function signozBuilder(refId, signal, requestType, uid, extra = {}) {
  return {
    refId,
    schema: 1,
    apiProfile: extra.apiProfile || "signoz-v5",
    requestType,
    signal,
    datasource: ds(SIGNOZ_TYPE$1, uid),
    queries: [
      {
        type: "builder_query",
        queryType: extra.queryType || "builder",
        spec: {
          name: refId,
          signal,
          disabled: false,
          filter: {
            expression: extra.filter != null ? String(extra.filter) : ""
          },
          having: { expression: "" },
          groupBy: [],
          order: [],
          legend: "",
          functions: [],
          aggregations: extra.aggregations || (signal === "metrics" ? [
            {
              metricName: "up",
              temporality: "Unspecified",
              timeAggregation: "avg",
              spaceAggregation: "avg"
            }
          ] : signal === "logs" || signal === "traces" ? [{ expression: "count()" }] : []),
          tags: [],
          service: extra.service,
          operation: extra.operation,
          stepInterval: null
        },
        rawQuery: extra.rawQuery || ""
      }
    ],
    ...extra.flat
  };
}
function buildLiveSignozNativeMetrics(uid = "live-signoz-native-metrics") {
  const dsUid = "signoz";
  const panels2 = [
    panel(1, "timeseries", "Builder metrics", { x: 0, y: 0, w: 12, h: 8 }, [
      signozBuilder("A", "metrics", "time_series", dsUid)
    ]),
    panel(2, "timeseries", "PromQL", { x: 12, y: 0, w: 12, h: 8 }, [
      signozBuilder("B", "metrics", "time_series", dsUid, {
        queryType: "promql",
        rawQuery: "up"
      })
    ]),
    panel(3, "stat", "Scalar", { x: 0, y: 8, w: 8, h: 6 }, [
      signozBuilder("C", "metrics", "scalar", dsUid)
    ]),
    panel(4, "table", "ClickHouse SQL", { x: 8, y: 8, w: 16, h: 6 }, [
      signozBuilder("D", "metrics", "time_series", dsUid, {
        queryType: "clickhouse_sql",
        rawQuery: "SELECT 1"
      })
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live SigNoz Native Metrics",
    schemaVersion: 39,
    requireLiveFrames: true,
    templating: {
      list: [
        {
          name: "service",
          type: "query",
          datasource: ds(SIGNOZ_TYPE$1, dsUid),
          query: { type: "service" }
        },
        {
          name: "metric",
          type: "query",
          datasource: ds(SIGNOZ_TYPE$1, dsUid),
          query: { type: "metric" }
        }
      ]
    },
    meta: { liveOnly: true, datasourceUid: dsUid, apiProfile: "signoz-v5" },
    panels: panels2
  };
}
function buildLiveSignozNativeLogs(uid = "live-signoz-native-logs") {
  const dsUid = "signoz";
  const panels2 = [
    panel(1, "logs", "Raw logs", { x: 0, y: 0, w: 24, h: 10 }, [
      signozBuilder("A", "logs", "raw", dsUid, { filter: "severity = error" })
    ]),
    panel(2, "logs", "Raw stream shape", { x: 0, y: 10, w: 24, h: 8 }, [
      signozBuilder("B", "logs", "raw_stream", dsUid, {
        filter: "body exists"
      })
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live SigNoz Native Logs",
    schemaVersion: 39,
    requireLiveFrames: true,
    annotations: {
      list: [
        {
          name: "error logs",
          enable: true,
          datasource: ds(SIGNOZ_TYPE$1, dsUid),
          target: { source: "errorLogs" }
        }
      ]
    },
    meta: { liveOnly: true, datasourceUid: dsUid, apiProfile: "signoz-v5" },
    panels: panels2
  };
}
function buildLiveSignozNativeTraces(uid = "live-signoz-native-traces") {
  const dsUid = "signoz";
  const panels2 = [
    panel(1, "traces", "Trace list", { x: 0, y: 0, w: 24, h: 10 }, [
      signozBuilder("A", "traces", "trace", dsUid, {
        filter: "has_error = true"
      })
    ]),
    panel(2, "traces", "Trace operator", { x: 0, y: 10, w: 24, h: 8 }, [
      {
        refId: "B",
        schema: 1,
        apiProfile: "signoz-v5",
        requestType: "trace",
        signal: "traces",
        datasource: ds(SIGNOZ_TYPE$1, dsUid),
        queries: [
          {
            type: "builder_trace_operator",
            spec: { name: "B", expression: "A", legend: "op" }
          }
        ]
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live SigNoz Native Traces",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: { liveOnly: true, datasourceUid: dsUid, apiProfile: "signoz-v5" },
    panels: panels2
  };
}
function buildLiveSignozNativeQueryModes(uid = "live-signoz-native-query-modes") {
  const dsUid = "signoz";
  const panels2 = [
    panel(1, "timeseries", "builder", { x: 0, y: 0, w: 8, h: 8 }, [
      signozBuilder("A", "metrics", "time_series", dsUid, {
        queryType: "builder"
      })
    ]),
    panel(2, "timeseries", "promql", { x: 8, y: 0, w: 8, h: 8 }, [
      signozBuilder("B", "metrics", "time_series", dsUid, {
        queryType: "promql",
        rawQuery: "up"
      })
    ]),
    panel(3, "timeseries", "clickhouse_sql", { x: 16, y: 0, w: 8, h: 8 }, [
      signozBuilder("C", "metrics", "time_series", dsUid, {
        queryType: "clickhouse_sql",
        rawQuery: "SELECT now()"
      })
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live SigNoz Query Modes",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: { liveOnly: true, datasourceUid: dsUid, apiProfile: "signoz-v5" },
    panels: panels2
  };
}
function buildLiveSignozNativeResults(uid = "live-signoz-native-results") {
  const dsUid = "signoz";
  const panels2 = [
    panel(1, "timeseries", "time_series", { x: 0, y: 0, w: 12, h: 7 }, [
      signozBuilder("A", "metrics", "time_series", dsUid)
    ]),
    panel(2, "stat", "scalar", { x: 12, y: 0, w: 12, h: 7 }, [
      signozBuilder("B", "metrics", "scalar", dsUid)
    ]),
    panel(3, "logs", "raw", { x: 0, y: 7, w: 12, h: 7 }, [
      signozBuilder("C", "logs", "raw", dsUid)
    ]),
    panel(4, "traces", "trace", { x: 12, y: 7, w: 12, h: 7 }, [
      signozBuilder("D", "traces", "trace", dsUid)
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live SigNoz Result Types",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: { liveOnly: true, datasourceUid: dsUid, apiProfile: "signoz-v5" },
    panels: panels2
  };
}
function buildLiveSignoz(uid = "live-signoz") {
  const dsUid = "signoz";
  const panels2 = [
    panel(
      1,
      "timeseries",
      "SigNoz metrics (query_range)",
      { x: 0, y: 0, w: 24, h: 10 },
      [
        signozBuilder("A", "metrics", "time_series", dsUid, {
          apiProfile: "signoz-v5"
        })
      ]
    ),
    panel(
      2,
      "text",
      "SigNoz capability diagnostics",
      { x: 0, y: 10, w: 24, h: 6 },
      [],
      {
        options: {
          content: "Diagnostics only: profile=signoz-v5; official SigNoz endpoints; tokens never shown.",
          mode: "markdown"
        },
        targets: [
          {
            refId: "diag",
            datasource: ds(SIGNOZ_TYPE$1, dsUid),
            hide: true,
            apiProfile: "signoz-v5"
          }
        ]
      }
    )
  ];
  assertNoEmptyDupTargets(
    panels2.map((p) => ({
      ...p,
      targets: (p.targets || []).filter((t2) => !t2.hide)
    })),
    uid
  );
  return {
    uid,
    title: "Live SigNoz",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: {
      liveOnly: true,
      datasourceUid: dsUid,
      apiProfile: "signoz-v5",
      diagnostics: {
        profile: "signoz-v5",
        supported: [
          "metrics.list",
          "attribute.keys",
          "attribute.values",
          "services",
          "operations",
          "query_range",
          "alerts"
        ]
      }
    },
    panels: panels2
  };
}
function buildLiveSignozObservability(uid = "live-signoz-observability") {
  const dsUid = "signoz";
  const panels2 = [
    panel(1, "timeseries", "RED metrics", { x: 0, y: 0, w: 12, h: 8 }, [
      signozBuilder("A", "metrics", "time_series", dsUid, {
        aggregations: [{ metricName: "signoz_latency", expression: "P95" }]
      })
    ]),
    panel(2, "logs", "Error logs", { x: 12, y: 0, w: 12, h: 8 }, [
      signozBuilder("B", "logs", "raw", dsUid, { filter: "severity = error" })
    ]),
    panel(3, "traces", "Error traces", { x: 0, y: 8, w: 12, h: 8 }, [
      signozBuilder("C", "traces", "trace", dsUid, {
        filter: "has_error = true"
      })
    ]),
    panel(4, "signoz-issues", "Issues", { x: 12, y: 8, w: 12, h: 8 }, [
      {
        refId: "D",
        signal: "alerts",
        schema: 1,
        datasource: ds(SIGNOZ_TYPE$1, dsUid),
        queries: []
      }
    ])
  ];
  assertNoEmptyDupTargets(panels2, uid);
  return {
    uid,
    title: "Live SigNoz Observability",
    schemaVersion: 39,
    requireLiveFrames: true,
    meta: { liveOnly: true, datasourceUid: dsUid, apiProfile: "signoz-v5" },
    panels: panels2
  };
}
function buildLiveDiagnostics(uid = "live-observability-diagnostics") {
  return {
    uid,
    title: "Observability Diagnostics",
    schemaVersion: 39,
    meta: {
      diagnostics: {
        fields: [
          "urlPath",
          "version",
          "profile",
          "authKind",
          "credentialHeaderName",
          "supportedQueryTypes",
          "supportedResultTypes",
          "supportedMetadata",
          "supportedDetail",
          "supportedActions",
          "lastChecked",
          "error"
        ],
        forbidden: ["token", "password", "apiKey", "authorization"]
      }
    },
    panels: [
      panel(
        1,
        "text",
        "Capability matrix (sanitized)",
        { x: 0, y: 0, w: 24, h: 12 },
        [],
        {
          options: {
            mode: "markdown",
            content: "## Diagnostics\n\n- URL path / profile / version\n- Auth kind + header **name** only\n- Query / result / metadata / detail / action support\n- Last checked + error code\n\n**Never display tokens.**"
          }
        }
      )
    ]
  };
}
function buildLiveZabbixFull(uid = "live-zabbix-full") {
  const z3 = ds(ZABBIX_TYPE$1, "zabbix-3");
  const z14 = ds(ZABBIX_TYPE$1, "zabbix-14");
  const g = { filter: "$Group" };
  const h2 = { filter: "$Host" };
  const lineCfg = (fill = 10) => ({
    defaults: {
      custom: {
        drawStyle: "line",
        lineInterpolation: "smooth",
        lineWidth: 2,
        fillOpacity: fill,
        showPoints: "never",
        spanNulls: false,
        axisPlacement: "auto"
      },
      unit: "percent"
    },
    overrides: []
  });
  const barCfg = (fill = 50) => ({
    defaults: {
      custom: {
        drawStyle: "bars",
        lineWidth: 1,
        fillOpacity: fill,
        showPoints: "never",
        spanNulls: false,
        axisPlacement: "auto"
      },
      unit: "percent"
    },
    overrides: []
  });
  const legendOpts = {
    legend: {
      showLegend: true,
      displayMode: "list",
      placement: "bottom",
      calcs: ["mean", "max", "last"]
    },
    tooltip: { mode: "multi", sort: "desc" }
  };
  const panels2 = [
    panel(
      1,
      "timeseries",
      "Z3 · CPU 趋势 · 折线图 (trend.get)",
      { x: 0, y: 0, w: 12, h: 9 },
      [
        {
          refId: "A",
          queryType: "0",
          group: g,
          host: h2,
          item: { filter: "/system.cpu.util/" },
          options: { useTrends: "true" },
          datasource: z3
        }
      ],
      { options: legendOpts, fieldConfig: lineCfg(12) }
    ),
    panel(
      2,
      "timeseries",
      "Z3 · CPU 趋势 · 柱状图 (trend.get)",
      { x: 12, y: 0, w: 12, h: 9 },
      [
        {
          refId: "B",
          queryType: "0",
          group: g,
          host: h2,
          item: { filter: "/system.cpu.util/" },
          options: { useTrends: "true" },
          datasource: z3
        }
      ],
      { options: legendOpts, fieldConfig: barCfg(55) }
    ),
    panel(
      13,
      "timeseries",
      "Z3 · Memory 趋势 · 折线 (trend.get)",
      { x: 0, y: 9, w: 12, h: 8 },
      [
        {
          refId: "M",
          queryType: "0",
          group: g,
          host: h2,
          item: { filter: "/vm.memory.utilization|vm.memory.size|memory/" },
          options: { useTrends: "true" },
          datasource: z3
        }
      ],
      { options: legendOpts, fieldConfig: lineCfg(15) }
    ),
    panel(
      14,
      "timeseries",
      "Z3 · History 柱状 (history.get)",
      { x: 12, y: 9, w: 12, h: 8 },
      [
        {
          refId: "Hbar",
          queryType: "0",
          group: g,
          host: h2,
          item: { filter: "/agent.ping|system.cpu.util$/" },
          options: { useTrends: "false" },
          datasource: z3
        }
      ],
      {
        options: legendOpts,
        fieldConfig: {
          defaults: {
            custom: {
              drawStyle: "bars",
              fillOpacity: 40,
              lineWidth: 1,
              showPoints: "never"
            }
          },
          overrides: []
        }
      }
    ),
    panel(
      9,
      "timeseries",
      "Z14 · Metrics 折线 (trends→history fallback)",
      { x: 0, y: 17, w: 24, h: 8 },
      [
        {
          refId: "I",
          queryType: "0",
          group: g,
          host: h2,
          item: { filter: "/system.cpu.util|cpu|load|agent.ping/" },
          options: { useTrends: "true" },
          datasource: z14
        }
      ],
      { options: legendOpts, fieldConfig: lineCfg(8) }
    ),
    panel(
      3,
      "timeseries",
      "Z3 · agent.ping history 折线",
      { x: 0, y: 25, w: 12, h: 7 },
      [
        {
          refId: "C",
          queryType: "0",
          group: g,
          host: h2,
          item: { filter: "agent.ping" },
          options: { useTrends: "false" },
          datasource: z3
        }
      ],
      {
        options: { legend: { showLegend: true, displayMode: "list", placement: "bottom" } },
        fieldConfig: {
          defaults: { custom: { drawStyle: "line", lineWidth: 2 } },
          overrides: []
        }
      }
    ),
    panel(4, "logs", "Z3 · Text / log items", { x: 12, y: 25, w: 12, h: 7 }, [
      {
        refId: "D",
        queryType: "2",
        group: g,
        host: h2,
        item: { filter: "/log\\[|text|system.uname/" },
        datasource: z3
      }
    ]),
    panel(5, "table", "Z3 · Problems", { x: 0, y: 32, w: 12, h: 8 }, [
      {
        refId: "E",
        queryType: "5",
        group: g,
        host: h2,
        showProblems: "problems",
        options: { sortProblems: "lastchange", limit: 50, useTimeRange: true },
        datasource: z3
      }
    ]),
    panel(6, "table", "Z3 · Triggers", { x: 12, y: 32, w: 12, h: 8 }, [
      {
        refId: "F",
        queryType: "4",
        group: g,
        host: h2,
        trigger: { filter: "" },
        options: { limit: 100 },
        datasource: z3
      }
    ]),
    panel(7, "table", "Z3 · Macros", { x: 0, y: 40, w: 8, h: 7 }, [
      {
        refId: "G",
        queryType: "6",
        group: g,
        host: h2,
        macro: { filter: "" },
        datasource: z3
      }
    ]),
    panel(8, "table", "Z3 · IT Services / SLA", { x: 8, y: 40, w: 8, h: 7 }, [
      {
        refId: "H",
        queryType: "1",
        service: { filter: "/.*/" },
        itServiceFilter: "/.*/",
        slaProperty: "sli",
        datasource: z3
      }
    ]),
    panel(10, "table", "Z14 · Problems", { x: 16, y: 40, w: 8, h: 7 }, [
      {
        refId: "J",
        queryType: "5",
        group: g,
        host: h2,
        showProblems: "problems",
        options: { sortProblems: "priority", limit: 50, useTimeRange: true },
        datasource: z14
      }
    ]),
    panel(11, "table", "Z14 · Triggers", { x: 0, y: 47, w: 12, h: 8 }, [
      {
        refId: "K",
        queryType: "4",
        group: g,
        host: h2,
        trigger: { filter: "" },
        options: { limit: 100 },
        datasource: z14
      }
    ]),
    panel(
      12,
      "text",
      "Zabbix live 全量说明",
      { x: 12, y: 47, w: 12, h: 8 },
      [],
      {
        options: {
          mode: "markdown",
          content: "### Live Zabbix Full\\n- 顶部：**CPU 趋势折线 / CPU 趋势柱状 / Memory 趋势 / History 柱状**\\n- 时间默认 `now-7d`（`trend.get` 需要足够宽的时间窗）\\n- Group/Host=All 时走 item-first 搜索（不取空名主机）\\n- z14 若无 trend 行会自动回退 history.get\\n- 数据源: `zabbix-3`(6.x) + `zabbix-14`(7.x)"
        }
      }
    )
  ];
  assertNoEmptyDupTargets(
    panels2.filter((p) => (p.targets || []).length).map((p) => ({ ...p, targets: p.targets })),
    uid
  );
  return {
    uid,
    title: "Live Zabbix Full (真实接口全量)",
    schemaVersion: 39,
    requireLiveFrames: true,
    tags: ["live", "zabbix", "full", "real-api", "trends"],
    // 2d keeps trend.get responsive while still exercising trends path.
    time: { from: "now-2d", to: "now" },
    templating: {
      list: [
        {
          name: "Group",
          type: "query",
          datasource: z3,
          query: { queryType: "group", filter: "" },
          current: { text: "All", value: "/.*/" },
          includeAll: true,
          allValue: "/.*/",
          refresh: 1
        },
        {
          name: "Host",
          type: "query",
          datasource: z3,
          query: { queryType: "host", group: "$Group", filter: "" },
          // Prefer a host with real metrics; All remains available via includeAll.
          current: { text: "Zabbix server", value: "Zabbix server" },
          includeAll: true,
          allValue: "/.*/",
          refresh: 1
        }
      ]
    },
    meta: { liveOnly: true, datasourceUid: "zabbix-3" },
    panels: panels2
  };
}
function buildLiveSignozFull(uid = "live-signoz-full") {
  const dsUid = "signoz";
  const panels2 = [
    panel(
      1,
      "timeseries",
      "Metrics · builder (rate/sum)",
      { x: 0, y: 0, w: 12, h: 8 },
      [
        signozBuilder("A", "metrics", "time_series", dsUid, {
          aggregations: [
            {
              metricName: "app.ads.ad_requests",
              temporality: "cumulative",
              timeAggregation: "rate",
              spaceAggregation: "sum"
            }
          ]
        })
      ]
    ),
    panel(
      2,
      "timeseries",
      "Metrics · PromQL up",
      { x: 12, y: 0, w: 12, h: 8 },
      [
        signozBuilder("B", "metrics", "time_series", dsUid, {
          queryType: "promql",
          rawQuery: "up"
        })
      ]
    ),
    panel(3, "stat", "Metrics · scalar avg", { x: 0, y: 8, w: 6, h: 6 }, [
      signozBuilder("C", "metrics", "scalar", dsUid, {
        aggregations: [
          {
            metricName: "up",
            temporality: "Unspecified",
            timeAggregation: "avg",
            spaceAggregation: "avg",
            reduceTo: "avg"
          }
        ]
      })
    ]),
    panel(
      4,
      "table",
      "Traces · scalar table (count/p99/errors)",
      { x: 6, y: 8, w: 10, h: 6 },
      [
        // multi-query scalar is built as single target; adapter may run one builder
        signozBuilder("D", "traces", "scalar", dsUid, {
          aggregations: [{ expression: "count()" }],
          filter: "",
          flat: {
            queries: [
              {
                type: "builder_query",
                queryType: "builder",
                spec: {
                  name: "A",
                  signal: "traces",
                  disabled: false,
                  filter: { expression: "" },
                  having: { expression: "" },
                  groupBy: [
                    {
                      name: "service.name",
                      signal: "traces",
                      fieldContext: "resource",
                      fieldDataType: "string"
                    }
                  ],
                  order: [],
                  legend: "",
                  functions: [],
                  aggregations: [{ expression: "count()" }],
                  tags: [],
                  stepInterval: null,
                  limit: 20
                }
              }
            ]
          }
        })
      ]
    ),
    panel(5, "logs", "Logs · raw ERROR", { x: 16, y: 8, w: 8, h: 6 }, [
      signozBuilder("E", "logs", "raw", dsUid, {
        filter: "severity_text = 'ERROR'"
      })
    ]),
    panel(
      6,
      "timeseries",
      "Traces · request rate by service",
      { x: 0, y: 14, w: 12, h: 8 },
      [
        signozBuilder("F", "traces", "time_series", dsUid, {
          aggregations: [{ expression: "count()" }],
          filter: "",
          flat: {
            queries: [
              {
                type: "builder_query",
                queryType: "builder",
                spec: {
                  name: "A",
                  signal: "traces",
                  disabled: false,
                  stepInterval: 60,
                  filter: { expression: "" },
                  having: { expression: "" },
                  groupBy: [
                    {
                      name: "service.name",
                      signal: "traces",
                      fieldContext: "resource",
                      fieldDataType: "string"
                    }
                  ],
                  order: [],
                  legend: "{{service.name}}",
                  functions: [],
                  aggregations: [{ expression: "count()" }],
                  tags: [],
                  limit: 10
                }
              }
            ]
          }
        })
      ]
    ),
    panel(7, "table", "Traces · list", { x: 12, y: 14, w: 12, h: 8 }, [
      signozBuilder("G", "traces", "trace", dsUid, {
        aggregations: [],
        filter: ""
      })
    ]),
    panel(
      8,
      "timeseries",
      "ClickHouse SQL · count",
      { x: 0, y: 22, w: 12, h: 7 },
      [
        signozBuilder("H", "metrics", "scalar", dsUid, {
          queryType: "clickhouse_sql",
          rawQuery: "SELECT count() AS c FROM argus_apm_traces.distributed_index_v3 WHERE timestamp >= now() - INTERVAL 30 MINUTE"
        })
      ]
    ),
    panel(
      9,
      "timeseries",
      "Metrics · having + legend",
      { x: 12, y: 22, w: 12, h: 7 },
      [
        signozBuilder("I", "traces", "time_series", dsUid, {
          aggregations: [{ expression: "count()", alias: "count" }],
          flat: {
            queries: [
              {
                type: "builder_query",
                queryType: "builder",
                spec: {
                  name: "A",
                  signal: "traces",
                  stepInterval: 60,
                  disabled: false,
                  filter: { expression: "" },
                  having: { expression: "count() > 0" },
                  groupBy: [
                    {
                      name: "service.name",
                      signal: "traces",
                      fieldContext: "resource",
                      fieldDataType: "string"
                    }
                  ],
                  order: [],
                  legend: "{{service.name}}",
                  functions: [],
                  aggregations: [{ expression: "count()", alias: "count" }],
                  tags: [],
                  limit: 5
                }
              }
            ]
          }
        })
      ]
    ),
    panel(
      10,
      "text",
      "SigNoz / argus-web 对齐说明",
      { x: 0, y: 29, w: 24, h: 6 },
      [],
      {
        options: {
          mode: "markdown",
          content: '### Live SigNoz Full（对齐 `refs/argus-web-4.0/src/views/signoz` + `api/signoz.ts`）\\n- 端点: `POST /api/v5/query_range`、`POST /api/v2/services`（ns epoch 字符串）、fields/metrics\\n- metrics aggregation: `{metricName,timeAggregation,spaceAggregation,temporality}`（禁止 `expression:"avg"`）\\n- traces/logs aggregation: `{expression:"count()"}` / `p99(duration_nano)`\\n- filter 一律 `{expression: string}`；字符串字面量单引号转义（见 `filterExpr.ts`）\\n- 数据源 uid=`signoz` profile=`signoz-v5`；JWT 见 `.env.local` / Vite 注入\\n- 真实样本: `artifacts/zabbix-signoz-parity/REAL-API-FULL-EXAMPLES.md`'
        }
      }
    )
  ];
  assertNoEmptyDupTargets(
    panels2.map((p) => ({
      ...p,
      targets: (p.targets || []).filter((t2) => t2.refId)
    })),
    uid
  );
  return {
    uid,
    title: "Live SigNoz Full (真实接口全量)",
    schemaVersion: 39,
    requireLiveFrames: true,
    tags: ["live", "signoz", "full", "real-api", "argus-aligned"],
    time: { from: "now-1h", to: "now" },
    templating: {
      list: [
        {
          name: "service",
          type: "query",
          datasource: ds(SIGNOZ_TYPE$1, dsUid),
          query: { type: "service" },
          includeAll: true,
          allValue: ""
        },
        {
          name: "metric",
          type: "query",
          datasource: ds(SIGNOZ_TYPE$1, dsUid),
          query: { type: "metric" },
          includeAll: false
        }
      ]
    },
    meta: {
      liveOnly: true,
      datasourceUid: dsUid,
      apiProfile: "signoz-v5",
      diagnostics: {
        reference: "refs/argus-web-4.0/src/views/signoz + api/signoz.ts",
        endpoints: [
          "/api/v5/query_range",
          "/api/v2/services",
          "/api/v1/fields/keys",
          "/api/v2/metrics"
        ]
      }
    },
    panels: panels2
  };
}
const LIVE_DASHBOARD_BUILDERS = {
  "live-zabbix-metrics": () => buildLiveZabbixMetrics(),
  "live-zabbix-itemid": () => buildLiveZabbixItemid(),
  "live-zabbix-text": () => buildLiveZabbixText(),
  "live-zabbix-services": () => buildLiveZabbixServices(),
  "live-zabbix-triggers": () => buildLiveZabbixTriggers(),
  "live-zabbix-problems": () => buildLiveZabbixProblems(),
  "live-zabbix-macros": () => buildLiveZabbixMacros(),
  "live-zabbix-lld": () => buildLiveZabbixLld(),
  "live-zabbix-full": () => buildLiveZabbixFull(),
  "live-signoz-native-metrics": () => buildLiveSignozNativeMetrics(),
  "live-signoz-native-logs": () => buildLiveSignozNativeLogs(),
  "live-signoz-native-traces": () => buildLiveSignozNativeTraces(),
  "live-signoz-native-query-modes": () => buildLiveSignozNativeQueryModes(),
  "live-signoz-native-results": () => buildLiveSignozNativeResults(),
  "live-signoz": () => buildLiveSignoz(),
  "live-signoz-observability": () => buildLiveSignozObservability(),
  "live-signoz-full": () => buildLiveSignozFull(),
  "live-observability-diagnostics": () => buildLiveDiagnostics()
};
let registered = false;
let heavyRegistered = false;
let heavyPromise = null;
function registerBuiltinPlugins() {
  if (registered) return;
  registerBuiltinPanels();
  registerBuiltinDataSources();
  registerLiveDashboardBuilders(LIVE_DASHBOARD_BUILDERS);
  registered = true;
  if (listPanelPlugins().length === 0) {
    throw new Error(
      "[grafana-vue] registerBuiltinPlugins registered zero panel plugins"
    );
  }
}
async function registerHeavyPlugins() {
  if (heavyRegistered) return;
  if (heavyPromise) return heavyPromise;
  heavyPromise = (async () => {
    const [{ registerGeomapPanel: registerGeomapPanel2 }, { ensureDatasourceCatalogEntryRegistered: ensureDatasourceCatalogEntryRegistered2 }] = await Promise.all([
      Promise.resolve().then(() => register$2),
      Promise.resolve().then(() => index)
    ]);
    await Promise.all([
      registerGeomapPanel2(),
      ensureDatasourceCatalogEntryRegistered2(
        "alexanderzobnin-zabbix-datasource"
      ),
      ensureDatasourceCatalogEntryRegistered2("signoz")
    ]);
    heavyRegistered = true;
  })();
  return heavyPromise;
}
function bindCatalogRegistration(catalog) {
  function registerDataSource(ds2) {
    catalog.register(ds2);
    registerRuntimeDataSource(ds2.uid, ds2);
  }
  function unregisterDataSource(uid) {
    catalog.dispose(uid);
    unregisterRuntimeDataSource(uid);
  }
  async function ensureBuiltinDataSources() {
    try {
      await registerHeavyPlugins();
    } catch (err) {
      if (typeof console !== "undefined") {
        console.error(
          "[grafana-vue] heavy plugin registration failed before catalog configure",
          err
        );
      }
    }
    await catalog.configure({
      getDataSourcePlugin: (type) => getDataSourcePlugin(type),
      registerRuntimeDataSource: (uid, ds2) => registerRuntimeDataSource(uid, ds2),
      unregisterRuntimeDataSource: (uid) => unregisterRuntimeDataSource(uid)
    });
    if (typeof catalog.whenReady === "function") {
      await catalog.whenReady();
    }
  }
  return { registerDataSource, unregisterDataSource, ensureBuiltinDataSources };
}
function sanitizeEmbeddedDatasource(ds2) {
  const jsonData = { ...ds2.jsonData ?? {} };
  for (const key of Object.keys(jsonData)) {
    if (/token|password|secret|apiKey|authorization/i.test(key)) {
      delete jsonData[key];
    }
  }
  return {
    uid: String(ds2.uid ?? "").trim(),
    type: String(ds2.type ?? "").trim(),
    name: String(ds2.name ?? ds2.uid ?? "").trim() || String(ds2.uid ?? ""),
    url: String(ds2.url ?? "").trim(),
    basicAuth: Boolean(ds2.basicAuth),
    basicAuthUser: ds2.basicAuth ? String(ds2.basicAuthUser ?? "") : void 0,
    // never persist password/token
    jsonData,
    isDefault: Boolean(ds2.isDefault)
  };
}
function sanitizeEmbeddedDatasources(list) {
  if (!Array.isArray(list)) return [];
  const out = [];
  const seen = /* @__PURE__ */ new Set();
  for (const raw of list) {
    if (!raw || typeof raw !== "object") continue;
    const ds2 = sanitizeEmbeddedDatasource(raw);
    if (!ds2.uid || !ds2.type) continue;
    if (seen.has(ds2.uid)) continue;
    seen.add(ds2.uid);
    out.push(ds2);
  }
  return out;
}
function readEmbeddedDatasources(document2) {
  if (!document2) return [];
  return sanitizeEmbeddedDatasources(
    document2.datasources
  );
}
function registerEmbeddedDatasources(list, register2) {
  for (const ds2 of list) {
    const runtime = getRuntimeDataSourceSettings(ds2.uid);
    const url = String(ds2.url || runtime?.url || "").trim();
    const jsonData = {
      ...runtime?.jsonData ?? {},
      ...ds2.jsonData ?? {}
    };
    const plugin2 = getDataSourcePlugin(ds2.type);
    if (!plugin2?.createDataSource) {
      register2({
        id: 0,
        uid: ds2.uid,
        type: ds2.type,
        name: ds2.name,
        url,
        query: async () => ({ data: [] })
      });
      continue;
    }
    const api = plugin2.createDataSource({
      uid: ds2.uid,
      type: ds2.type,
      name: ds2.name,
      url,
      access: "proxy",
      basicAuth: ds2.basicAuth,
      basicAuthUser: ds2.basicAuthUser,
      jsonData,
      secureJsonData: {},
      meta: plugin2.meta ?? {},
      isDefault: ds2.isDefault
    });
    register2({
      uid: ds2.uid,
      type: ds2.type,
      name: ds2.name,
      url,
      isDefault: ds2.isDefault,
      ...api
    });
  }
}
function newEmbeddedDatasourceDraft(type = "grafana-testdata-datasource") {
  const stamp = Date.now().toString(36);
  return {
    uid: `${type.replace(/[^a-z0-9-]+/gi, "-").toLowerCase()}-${stamp}`,
    type,
    name: "新数据源",
    url: "",
    jsonData: {},
    isDefault: false
  };
}
function createPanelLibraryActions(opts) {
  function copySelectedPanel(panelId) {
    const panel2 = opts.getDocument()?.panels?.find((p) => p.id === panelId);
    if (panel2) copyPanel(panel2);
  }
  function pasteClipboardPanel() {
    const doc = opts.getDocument();
    if (!doc || !hasClipboardPanel()) return;
    const id = nextPanelId(doc);
    const panel2 = pastePanel(id);
    if (!panel2) return;
    opts.applyDocument({ type: "upsert-panel", panel: panel2 });
    void opts.refreshPanel(panel2);
  }
  function duplicateSelectedPanel(panelId) {
    const doc = opts.getDocument();
    if (!doc) return;
    const panel2 = doc.panels?.find((p) => p.id === panelId);
    if (!panel2) return;
    const id = nextPanelId(doc);
    const dup = duplicatePanel(panel2, id);
    opts.applyDocument({ type: "upsert-panel", panel: dup });
    void opts.refreshPanel(dup);
  }
  function setSelectedPanels(ids) {
    opts.selectedPanelIds.value = ids;
  }
  function saveSelectedAsLibraryPanel(panelId, name) {
    const panel2 = opts.getDocument()?.panels?.find((p) => p.id === panelId);
    if (!panel2) return null;
    const plain2 = JSON.parse(JSON.stringify(panel2));
    return saveLibraryPanel(plain2, name || plain2.title || `Panel ${panelId}`);
  }
  function addLibraryPanelToDashboard(uid) {
    const doc = opts.getDocument();
    if (!doc) return;
    const id = nextPanelId(doc);
    const panel2 = instantiateLibraryPanel(uid, id);
    if (!panel2) return;
    const maxY = Math.max(
      0,
      ...(doc.panels ?? []).map(
        (p) => (p.gridPos?.y ?? 0) + (p.gridPos?.h ?? 0)
      )
    );
    panel2.gridPos = {
      x: 0,
      y: maxY,
      w: panel2.gridPos?.w ?? 12,
      h: panel2.gridPos?.h ?? 8
    };
    opts.applyDocument({ type: "upsert-panel", panel: panel2 });
    void opts.refreshPanel(panel2);
  }
  function listSavedLibraryPanels() {
    return listLibraryPanels();
  }
  function unlinkLibraryPanel$1(panelId) {
    const doc = opts.getDocument();
    if (!doc) return;
    const panel2 = doc.panels?.find((p) => p.id === panelId);
    if (!panel2 || !panel2.libraryPanel) return;
    opts.applyDocument({ type: "upsert-panel", panel: unlinkLibraryPanel(panel2) });
  }
  return {
    copySelectedPanel,
    pasteClipboardPanel,
    duplicateSelectedPanel,
    setSelectedPanels,
    saveSelectedAsLibraryPanel,
    addLibraryPanelToDashboard,
    listSavedLibraryPanels,
    unlinkLibraryPanel: unlinkLibraryPanel$1
  };
}
function readVariablesFromLocation(list) {
  if (typeof window === "undefined") return null;
  try {
    const params = new URLSearchParams(window.location.search);
    if (!list.length) return null;
    return applyVariablesFromUrl(list, params);
  } catch {
    return null;
  }
}
function writeVariablesToLocation(list) {
  if (typeof window === "undefined") return;
  try {
    const params = encodeVariablesToUrl(
      list,
      new URLSearchParams(window.location.search)
    );
    const qs = params.toString();
    const url = `${window.location.pathname}${qs ? `?${qs}` : ""}${window.location.hash || ""}`;
    window.history.replaceState(null, "", url);
  } catch {
  }
}
function createDemoDashboard(uid) {
  const td = { type: "grafana-testdata-datasource", uid: "testdata" };
  const loki = { type: "loki", uid: "loki" };
  const tempo = { type: "tempo", uid: "tempo" };
  const pyroscope = { type: "grafana-pyroscope-datasource", uid: "pyroscope" };
  let y = 0;
  const row = (h2) => {
    const cur = y;
    y += h2;
    return cur;
  };
  const panels2 = [
    {
      id: 1,
      type: "text",
      title: "可视化全景演示",
      gridPos: { x: 0, y: row(3), w: 24, h: 3 },
      options: {
        mode: "markdown",
        content: "## Grafana-Vue 全可视化演示\\n每种内置 Panel 均有演示数据（默认 **TestData / 离线 fixture**）。\\n编辑面板 → **查询 / 转换 / 面板选项 / 字段** 与 Grafana 13.2 path 对齐。Job=`$job`"
      },
      targets: []
    },
    // KPI row
    {
      id: 2,
      type: "stat",
      title: "Stat",
      gridPos: { x: 0, y, w: 4, h: 4 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: {
        defaults: {
          unit: "short",
          thresholds: {
            mode: "absolute",
            steps: [
              { color: "green", value: null },
              { color: "red", value: 80 }
            ]
          }
        },
        overrides: []
      },
      options: {
        reduceOptions: { calcs: ["lastNotNull"], fields: "", values: false },
        colorMode: "background",
        graphMode: "area",
        textMode: "auto",
        orientation: "auto",
        justifyMode: "auto"
      }
    },
    {
      id: 3,
      type: "gauge",
      title: "Gauge",
      gridPos: { x: 4, y, w: 4, h: 4 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: {
        defaults: {
          min: 0,
          max: 100,
          thresholds: {
            mode: "absolute",
            steps: [
              { color: "green", value: null },
              { color: "yellow", value: 60 },
              { color: "red", value: 80 }
            ]
          }
        },
        overrides: []
      },
      options: {
        showThresholdLabels: false,
        showThresholdMarkers: true,
        sizing: "auto",
        orientation: "auto"
      }
    },
    {
      id: 4,
      type: "bargauge",
      title: "Bar gauge",
      gridPos: { x: 8, y, w: 4, h: 4 },
      targets: [
        { refId: "A", datasource: td, scenarioId: "csv_metric_values" }
      ],
      fieldConfig: {
        defaults: { min: 0, max: 100, unit: "percent" },
        overrides: []
      },
      options: {
        reduceOptions: { calcs: ["lastNotNull"], fields: "", values: false },
        displayMode: "gradient",
        orientation: "horizontal",
        showUnfilled: true,
        valueMode: "color",
        namePlacement: "auto"
      }
    },
    {
      id: 5,
      type: "table",
      title: "Table",
      gridPos: { x: 12, y, w: 6, h: 4 },
      targets: [
        { refId: "A", datasource: td, scenarioId: "random_walk_table" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: { showHeader: true, cellHeight: "sm", footer: { show: false } }
    },
    {
      id: 6,
      type: "piechart",
      title: "Pie chart",
      gridPos: { x: 18, y, w: 6, h: 4 },
      targets: [
        {
          refId: "A",
          datasource: td,
          scenarioId: "csv_metric_values",
          stringInput: "10,25,40,15,30"
        }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        reduceOptions: { calcs: ["lastNotNull"], fields: "", values: true },
        pieType: "pie",
        tooltip: { mode: "single", sort: "none" },
        legend: { displayMode: "list", placement: "right", showLegend: true }
      }
    }
  ];
  y += 4;
  panels2.push(
    {
      id: 7,
      type: "timeseries",
      title: "Time series",
      gridPos: { x: 0, y, w: 12, h: 8 },
      targets: [
        {
          refId: "A",
          datasource: td,
          scenarioId: "random_walk",
          alias: "series-A"
        }
      ],
      fieldConfig: {
        defaults: {
          unit: "short",
          custom: {
            drawStyle: "line",
            lineInterpolation: "smooth",
            fillOpacity: 20,
            showPoints: "never",
            spanNulls: false
          }
        },
        overrides: []
      },
      options: {
        legend: {
          showLegend: true,
          displayMode: "list",
          placement: "bottom",
          calcs: []
        },
        tooltip: { mode: "single", sort: "none" }
      }
    },
    {
      id: 8,
      type: "trend",
      title: "Trend",
      gridPos: { x: 12, y, w: 6, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "linear_trend" }],
      fieldConfig: {
        defaults: { custom: { drawStyle: "line", fillOpacity: 15 } },
        overrides: []
      },
      options: {
        legend: { showLegend: true, displayMode: "list", placement: "bottom" },
        tooltip: { mode: "single" }
      }
    },
    {
      id: 9,
      type: "barchart",
      title: "Bar chart",
      gridPos: { x: 18, y, w: 6, h: 8 },
      targets: [
        { refId: "A", datasource: td, scenarioId: "csv_metric_values" }
      ],
      fieldConfig: {
        defaults: { custom: { drawStyle: "bars", fillOpacity: 80 } },
        overrides: []
      },
      options: {
        orientation: "auto",
        showValue: "auto",
        stacking: "none",
        barWidth: 0.9,
        groupWidth: 0.7,
        barRadius: 0,
        xTickLabelRotation: -30,
        fullHighlight: false,
        gradientMode: "hue",
        legend: { showLegend: true, displayMode: "list", placement: "bottom" },
        tooltip: { mode: "single", sort: "none" }
      }
    }
  );
  y += 8;
  panels2.push(
    {
      id: 10,
      type: "histogram",
      title: "Histogram",
      gridPos: { x: 0, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        bucketCount: 24,
        combine: false,
        fillOpacity: 70,
        gradientMode: "hue",
        stacking: "none",
        lineWidth: 1,
        legend: { showLegend: true, displayMode: "list", placement: "bottom" }
      }
    },
    {
      id: 11,
      type: "heatmap",
      title: "Heatmap",
      gridPos: { x: 8, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        calculate: true,
        cellGap: 2,
        showValue: "auto",
        color: {
          mode: "scheme",
          scheme: "Spectral",
          steps: 64,
          reverse: false
        },
        legend: { show: true },
        tooltip: { mode: "single", yHistogram: true, showColorScale: true },
        yAxis: { axisPlacement: "left" }
      }
    },
    {
      id: 12,
      type: "candlestick",
      title: "Candlestick",
      gridPos: { x: 16, y, w: 8, h: 8 },
      targets: [
        { refId: "A", datasource: td, scenarioId: "predictable_csv_wave" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        mode: "candles+volume",
        candleStyle: "candles",
        colorStrategy: "open-close",
        colors: { up: "green", down: "red", flat: "gray" },
        includeAllFields: false,
        legend: { showLegend: true, displayMode: "list", placement: "bottom" },
        tooltip: { mode: "single" }
      }
    }
  );
  y += 8;
  panels2.push(
    {
      id: 13,
      type: "state-timeline",
      title: "State timeline",
      gridPos: { x: 0, y, w: 12, h: 6 },
      targets: [
        { refId: "A", datasource: td, scenarioId: "predictable_pulse" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        mergeValues: true,
        showValue: "auto",
        alignValue: "left",
        rowHeight: 0.9,
        legend: { showLegend: true }
      }
    },
    {
      id: 14,
      type: "status-history",
      title: "Status history",
      gridPos: { x: 12, y, w: 12, h: 6 },
      targets: [
        { refId: "A", datasource: td, scenarioId: "predictable_pulse" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        showValue: "auto",
        rowHeight: 0.9,
        colWidth: 0.9,
        legend: { showLegend: true }
      }
    }
  );
  y += 6;
  panels2.push(
    {
      id: 15,
      type: "xychart",
      title: "XY chart",
      gridPos: { x: 0, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        seriesMapping: "auto",
        dims: { x: void 0 },
        legend: { showLegend: true, displayMode: "list", placement: "bottom" },
        tooltip: { mode: "single" }
      }
    },
    {
      id: 16,
      type: "geomap",
      title: "Geomap",
      gridPos: { x: 8, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "usa" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        view: { id: "zero", lat: 0, lon: 0, zoom: 1 },
        basemap: { type: "default", name: "Layer 0" },
        layers: [{ type: "markers", name: "Markers", config: {} }],
        controls: {
          showZoom: true,
          mouseWheelZoom: true,
          showAttribution: true
        }
      }
    },
    {
      id: 17,
      type: "nodeGraph",
      title: "Node graph",
      gridPos: { x: 16, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "node_graph" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        nodes: { mainStatUnit: "short" },
        edges: { mainStatUnit: "short" }
      }
    }
  );
  y += 8;
  panels2.push(
    {
      id: 18,
      type: "logs",
      title: "Logs",
      gridPos: { x: 0, y, w: 12, h: 8 },
      targets: [
        {
          refId: "A",
          datasource: loki,
          expr: '{job="$job"}',
          scenarioId: "logs"
        },
        { refId: "B", datasource: td, scenarioId: "logs" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        showTime: true,
        showLabels: false,
        showCommonLabels: false,
        wrapLogMessage: false,
        prettifyLogMessage: false,
        enableLogDetails: true,
        sortOrder: "Descending",
        dedupStrategy: "none"
      }
    },
    {
      id: 19,
      type: "logstable",
      title: "Logs table",
      gridPos: { x: 12, y, w: 12, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "logs" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: { showHeader: true }
    }
  );
  y += 8;
  panels2.push(
    {
      id: 20,
      type: "traces",
      title: "Traces",
      gridPos: { x: 0, y, w: 12, h: 10 },
      targets: [
        { refId: "A", datasource: tempo, query: "demo", scenarioId: "trace" },
        { refId: "B", datasource: td, scenarioId: "trace" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 21,
      type: "flamegraph",
      title: "Flame graph",
      gridPos: { x: 12, y, w: 12, h: 10 },
      targets: [
        { refId: "A", datasource: pyroscope, scenarioId: "flame_graph" },
        { refId: "B", datasource: td, scenarioId: "flame_graph" }
      ],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    }
  );
  y += 10;
  panels2.push(
    {
      id: 22,
      type: "canvas",
      title: "Canvas",
      gridPos: { x: 0, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        inlineEditing: false,
        showAdvancedTypes: true,
        root: {
          type: "frame",
          elements: [
            {
              type: "metric-value",
              name: "Metric",
              config: { align: "center" },
              placement: { top: 20, left: 20, width: 120, height: 40 }
            },
            {
              type: "text",
              name: "Label",
              config: { text: { fixed: "Canvas demo" } },
              placement: { top: 70, left: 20, width: 160, height: 24 }
            }
          ]
        }
      }
    },
    {
      id: 23,
      type: "news",
      title: "News",
      gridPos: { x: 8, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        feedUrl: "https://grafana.com/blog/index.xml",
        showImage: true
      }
    },
    {
      id: 24,
      type: "dashlist",
      title: "Dashboard list",
      gridPos: { x: 16, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        showStarred: true,
        showRecentlyViewed: true,
        showSearch: true,
        showHeadings: true,
        maxItems: 10,
        query: "",
        tags: []
      }
    }
  );
  y += 8;
  panels2.push(
    {
      id: 25,
      type: "alertlist",
      title: "Alert list",
      gridPos: { x: 0, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        maxItems: 10,
        sortOrder: 1,
        dashboardAlerts: false,
        stateFilter: {
          firing: true,
          pending: true,
          noData: false,
          normal: false,
          error: true
        },
        alertName: "",
        viewMode: "list",
        groupMode: "default"
      }
    },
    {
      id: 26,
      type: "annolist",
      title: "Annotation list",
      gridPos: { x: 8, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        limit: 10,
        onlyFromThisDashboard: false,
        onlyInTimeRange: true,
        tags: [],
        navigateBefore: "10m",
        navigateAfter: "10m",
        navigateToPanel: true,
        showUser: true,
        showTime: true,
        showTags: true
      }
    },
    {
      id: 27,
      type: "live",
      title: "Live",
      gridPos: { x: 16, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: { channel: "grafana/live/demo", message: "", display: "json" }
    }
  );
  y += 8;
  panels2.push(
    {
      id: 28,
      type: "debug",
      title: "Debug",
      gridPos: { x: 0, y, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {
        mode: "render",
        counters: { render: true, dataChanged: true, schemaChanged: true }
      }
    },
    {
      id: 29,
      type: "gettingstarted",
      title: "Getting started",
      gridPos: { x: 8, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 30,
      type: "welcome",
      title: "Welcome",
      gridPos: { x: 16, y, w: 8, h: 8 },
      targets: [],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 31,
      type: "clock",
      title: "clock",
      gridPos: { x: 0, y: y + 8 + 0, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 32,
      type: "statusmap",
      title: "statusmap",
      gridPos: { x: 8, y: y + 8 + 0, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 33,
      type: "polystat",
      title: "polystat",
      gridPos: { x: 16, y: y + 8 + 0, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 34,
      type: "button",
      title: "button",
      gridPos: { x: 0, y: y + 8 + 8, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 35,
      type: "dynamictext",
      title: "dynamictext",
      gridPos: { x: 8, y: y + 8 + 8, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 36,
      type: "gantt",
      title: "gantt",
      gridPos: { x: 16, y: y + 8 + 8, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 37,
      type: "sankey",
      title: "sankey",
      gridPos: { x: 0, y: y + 8 + 16, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 38,
      type: "radar",
      title: "radar",
      gridPos: { x: 8, y: y + 8 + 16, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 39,
      type: "funnel",
      title: "funnel",
      gridPos: { x: 16, y: y + 8 + 16, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 40,
      type: "wordcloud",
      title: "wordcloud",
      gridPos: { x: 0, y: y + 8 + 24, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 41,
      type: "treemap",
      title: "treemap",
      gridPos: { x: 8, y: y + 8 + 24, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    },
    {
      id: 42,
      type: "hourly-heatmap",
      title: "hourly-heatmap",
      gridPos: { x: 16, y: y + 8 + 24, w: 8, h: 8 },
      targets: [{ refId: "A", datasource: td, scenarioId: "random_walk" }],
      fieldConfig: { defaults: {}, overrides: [] },
      options: {}
    }
  );
  return {
    uid,
    title: `可视化全景演示 · ${uid}`,
    tags: ["demo", "all-panels", "vue"],
    schemaVersion: 39,
    timezone: "browser",
    refresh: "30s",
    time: { from: "now-6h", to: "now" },
    templating: {
      list: [
        {
          name: "job",
          type: "custom",
          label: "Job",
          current: { text: "api", value: "api" },
          options: [
            { text: "api", value: "api", selected: true },
            { text: "web", value: "web" },
            { text: "db", value: "db" }
          ],
          query: "api,web,db",
          includeAll: false,
          multi: false
        },
        {
          name: "interval",
          type: "interval",
          label: "Interval",
          current: { text: "1m", value: "1m" },
          query: "1m,5m,10m,1h",
          auto: true,
          auto_count: 30,
          auto_min: "10s"
        }
      ]
    },
    annotations: {
      list: [
        {
          name: "Deploys",
          enable: true,
          iconColor: "blue",
          datasource: td,
          target: { expr: "deploy" }
        }
      ]
    },
    panels: panels2
  };
}
const useDashboardStore = defineStore("dashboard", () => {
  const document2 = ref(null);
  const dirty = ref(false);
  const editMode = ref(false);
  const loading = ref(false);
  const error = ref(null);
  const panelData = shallowRef({});
  const time = ref({ from: "now-6h", to: "now" });
  const timezone = ref("browser");
  const refresh = ref("");
  const isRefreshing = ref(false);
  const autoRefreshTickCount = ref(0);
  let refreshTimer = null;
  let refreshInFlight = null;
  let visibilityHandler = null;
  const autoRefreshRunner = {
    run: async () => {
    }
  };
  const originalJson = ref("");
  const saving = ref(false);
  const saveError = ref(null);
  let persistenceHandler = null;
  let saveInFlight = null;
  const catalog = getDataSourceCatalog();
  const canUndo = ref(false);
  const canRedo = ref(false);
  const annotationEvents = ref([]);
  const selectedPanelIds = ref([]);
  const _varsSnapshot = ref("");
  function _snapshotVariables() {
    const list = document2.value?.templating?.list ?? [];
    _varsSnapshot.value = JSON.stringify(
      list.map((v) => ({ n: v.name, c: v.current }))
    );
  }
  function _variablesCurrentChanged() {
    const list = document2.value?.templating?.list ?? [];
    const now = JSON.stringify(
      list.map((v) => ({ n: v.name, c: v.current }))
    );
    return now !== _varsSnapshot.value;
  }
  function resolveDsOrStub(ref2) {
    let resolvedRef = ref2;
    if (resolvedRef == null || resolvedRef === "") {
      try {
        return catalog.resolve("default");
      } catch {
        resolvedRef = { uid: "default", type: "grafana-testdata-datasource" };
      }
    }
    if (resolvedRef && typeof resolvedRef === "object" && typeof resolvedRef.uid === "string" && /\$\{[^}]+\}/.test(resolvedRef.uid)) {
      const rawUid = String(resolvedRef.uid);
      const inner = rawUid.replace(/^\$\{/, "").replace(/\}$/, "");
      resolvedRef = {
        ...resolvedRef,
        uid: inner.replace(/^DS_/, "").toLowerCase() || rawUid
      };
    }
    try {
      return catalog.resolve(resolvedRef);
    } catch (e) {
      if (e instanceof DataSourceError) {
        const err = e;
        return {
          id: 0,
          uid: typeof resolvedRef === "string" ? resolvedRef : resolvedRef?.uid || "missing",
          type: typeof resolvedRef === "string" ? "unknown" : resolvedRef?.type || "unknown",
          name: "Unresolved",
          query: async () => {
            throw err;
          }
        };
      }
      throw e;
    }
  }
  const scheduler = new QueryScheduler({
    concurrency: Math.min(
      8,
      Math.max(
        3,
        typeof navigator !== "undefined" ? navigator.hardwareConcurrency ?? 4 : 4
      )
    ),
    resolveDataSource: (ref2) => resolveDsOrStub(ref2)
  });
  const panelAbort = /* @__PURE__ */ new Map();
  const visiblePanels = ref(/* @__PURE__ */ new Set());
  function setPanelVisible(panelId, visible) {
    const was = visiblePanels.value.has(panelId);
    const s = new Set(visiblePanels.value);
    if (visible) s.add(panelId);
    else s.delete(panelId);
    visiblePanels.value = s;
    if (visible && !was) {
      const panel2 = (document2.value?.panels ?? []).find(
        (p) => p.id === panelId || Number(p.id) === panelId
      );
      if (panel2) void refreshPanel(panel2);
    }
  }
  const panelQueryEngine = createPanelQueryEngine({
    scheduler,
    resolveDataSource: (ref2) => resolveDsOrStub(ref2),
    postProcess: (data, panel2) => {
      const pipeline = runPanelDataPipeline({
        series: data.series ?? [],
        transformations: panel2.transformations ?? [],
        fieldConfigDefaults: panel2.fieldConfig?.defaults ?? {},
        fieldConfigOverrides: panel2.fieldConfig?.overrides ?? [],
        state: data.state,
        timeRange: data.timeRange,
        requestId: data.request?.requestId ?? data.requestId,
        errors: data.errors,
        error: data.error
      });
      const series = (pipeline.series ?? []).map((f) => markRaw(f));
      return {
        ...data,
        ...pipeline.panelData,
        series,
        seriesBeforeTransform: data.series,
        transformSteps: pipeline.transformTrace,
        annotations: annotationEvents.value.map((e) => ({
          time: e.time,
          timeEnd: e.timeEnd,
          title: e.title,
          text: e.text,
          color: e.color,
          tags: e.tags
        }))
      };
    }
  });
  const dashboardDocument = createDashboardDocument();
  function syncFromDocument() {
    document2.value = dashboardDocument.state.document;
    dirty.value = dashboardDocument.state.dirty;
    canUndo.value = dashboardDocument.state.canUndo;
    canRedo.value = dashboardDocument.state.canRedo;
  }
  function syncHistoryFlags() {
    canUndo.value = dashboardDocument.state.canUndo;
    canRedo.value = dashboardDocument.state.canRedo;
  }
  function pushHistory() {
    if (!document2.value) return;
    const baseline = originalJson.value || dashboardDocument.state.baselineJson;
    if (!dashboardDocument.state.document) {
      dashboardDocument.load(document2.value);
      if (baseline) {
        dashboardDocument.state.baselineJson = baseline;
      }
    } else {
      dashboardDocument.syncWorking(document2.value);
    }
    dashboardDocument.recordHistoryTip(baseline);
    syncFromDocument();
    originalJson.value = baseline;
  }
  function applyDocument(command, opts) {
    if (!dashboardDocument.state.document && document2.value && command.type !== "replace") {
      dashboardDocument.load(document2.value);
      if (originalJson.value) {
        dashboardDocument.state.baselineJson = originalJson.value;
      }
    }
    dashboardDocument.dispatch(command, opts);
    syncFromDocument();
  }
  const panels2 = computed(() => {
    const list = document2.value?.panels ?? [];
    const vars = document2.value?.templating?.list ?? [];
    const repeatValues = {};
    for (const v of vars) {
      if (!v?.name) continue;
      const cur = v.current?.value;
      if (Array.isArray(cur) && cur.length) {
        repeatValues[v.name] = cur.map(String);
      } else if (cur != null && cur !== "" && cur !== "$__all") {
        repeatValues[v.name] = [String(cur)];
      } else {
        const opts = (v.options ?? []).map((o) => String(o.value ?? o.text ?? "")).filter((x) => x && x !== "$__all");
        if (opts.length) repeatValues[v.name] = opts;
      }
    }
    return expandRepeats(list, repeatValues);
  });
  const layout = computed(() => panelsToLayout(panels2.value));
  const title = computed(() => document2.value?.title ?? "");
  const scene = computed(
    () => document2.value ? buildSceneGraph(document2.value, time.value) : null
  );
  const { registerDataSource, unregisterDataSource, ensureBuiltinDataSources } = bindCatalogRegistration(catalog);
  function syncVariablesFromLocation() {
    if (!document2.value) return;
    const list = document2.value.templating?.list ?? [];
    const next = readVariablesFromLocation(list);
    if (!next) return;
    applyDocument(
      { type: "set-variables", list: next },
      { history: false, dirty: false }
    );
    dirty.value = false;
    if (originalJson.value) {
      dashboardDocument.state.baselineJson = originalJson.value;
      dashboardDocument.state.dirty = false;
    }
  }
  function syncVariablesToLocation() {
    if (!document2.value) return;
    writeVariablesToLocation(document2.value.templating?.list ?? []);
  }
  async function loadByUid(uid) {
    loading.value = true;
    error.value = null;
    try {
      let raw;
      const liveBuilders = getLiveDashboardBuilders();
      const liveFactory = uid in liveBuilders ? liveBuilders[uid] : void 0;
      const imported = liveFactory ? void 0 : getImportedDashboard(uid);
      if (imported) {
        raw = imported;
      } else if (liveFactory) {
        raw = liveFactory();
      } else {
        try {
          const res = await backendSrv.get(`/api/dashboards/uid/${uid}`);
          raw = res.data.dashboard;
        } catch {
          raw = createDemoDashboard(uid);
        }
        if (uid === "vue-demo" || uid === "demo") {
          const panels22 = Array.isArray(raw?.panels) ? raw.panels : [];
          const types = new Set(panels22.map((x) => x?.type).filter(Boolean));
          const required = ["news", "flamegraph", "clock", "button", "treemap"];
          if (panels22.length < 30 || required.some((id) => !types.has(id))) {
            raw = createDemoDashboard(uid);
          }
        }
      }
      document2.value = loadDashboardDocument(raw);
      dashboardDocument.load(document2.value);
      originalJson.value = dashboardDocument.snapshot();
      time.value = {
        from: document2.value.time?.from ?? "now-6h",
        to: document2.value.time?.to ?? "now"
      };
      timezone.value = document2.value.timezone || "browser";
      applyRefreshFromDocument();
      dirty.value = false;
      syncHistoryFlags();
      syncVariablesFromLocation();
      await ensureBuiltinDataSources();
      loading.value = false;
      _snapshotVariables();
      const varsP = refreshVariables().catch((e) => {
        console.warn(
          "[dashboard] refreshVariables failed:",
          e instanceof Error ? e.message : e
        );
      });
      await new Promise(
        (r) => typeof requestAnimationFrame === "function" ? requestAnimationFrame(() => r()) : setTimeout(r, 0)
      );
      const panelsP = refreshAllPanels();
      varsP.then(() => {
        if (_variablesCurrentChanged()) void refreshAllPanels();
      }).catch(() => {
      });
      await panelsP;
    } catch (e) {
      error.value = e instanceof Error ? e.message : String(e);
      loading.value = false;
    }
  }
  async function loadLocal(raw) {
    await ensureBuiltinDataSources();
    document2.value = loadDashboardDocument(raw);
    dashboardDocument.load(document2.value);
    applyDocumentEmbeddedDatasources();
    syncVariablesFromLocation();
    originalJson.value = dashboardDocument.snapshot();
    time.value = {
      from: document2.value.time?.from ?? "now-6h",
      to: document2.value.time?.to ?? "now"
    };
    timezone.value = document2.value.timezone || "browser";
    applyRefreshFromDocument();
    dirty.value = false;
    syncHistoryFlags();
    try {
      await refreshVariables();
    } catch (e) {
      console.warn(
        "[dashboard] refreshVariables failed:",
        e instanceof Error ? e.message : e
      );
    }
    await refreshAllPanels();
  }
  function getTimeRange() {
    return rangeUtil_parse(time.value);
  }
  function freezePanelData(data) {
    const series = (data.series ?? []).map((f) => {
      const fields = Array.isArray(f?.fields) ? f.fields.map((field) => markRaw(field)) : f?.fields;
      return markRaw({ ...f, fields });
    });
    return markRaw({ ...data, series });
  }
  function setPanelData(panelId, data) {
    panelData.value = {
      ...panelData.value,
      [panelId]: freezePanelData(data)
    };
  }
  async function refreshPanel(panel2) {
    if (!document2.value) return;
    const panelId = panel2.id;
    panelAbort.get(panelId)?.abort();
    const ac = new AbortController();
    panelAbort.set(panelId, ac);
    const requestId = `panel-${panelId}-${Date.now()}`;
    const prev = panelData.value[panelId];
    setPanelData(panelId, {
      state: LoadingStateEnum.Loading,
      // Stale-while-revalidate: keep last Done series so chrome stays populated.
      series: prev?.series ?? [],
      timeRange: getTimeRange(),
      request: { requestId },
      annotations: prev?.annotations
    });
    const varList = document2.value.templating?.list ?? [];
    const scoped = buildScopedVars(varList);
    const adhoc = collectAdhocFilters(varList);
    const { panelDs, targets } = buildInterpolatedTargets(panel2, scoped, adhoc);
    const result = await panelQueryEngine.execute(
      {
        id: panelId,
        targets,
        datasource: panelDs,
        transformations: panel2.transformations,
        fieldConfig: panel2.fieldConfig,
        options: panel2.options,
        title: panel2.title,
        type: panel2.type
      },
      {
        timeRange: getTimeRange(),
        scopedVars: scoped,
        requestId,
        maxDataPoints: Math.max(
          80,
          Math.min(320, (panel2.gridPos?.w ?? 12) * 16)
        ),
        visible: visiblePanels.value.has(panelId) || visiblePanels.value.size === 0,
        onPartialData: (partialSeries) => {
          if (ac.signal.aborted || panelAbort.get(panelId) !== ac) return;
          setPanelData(panelId, {
            state: LoadingStateEnum.Streaming,
            series: (partialSeries ?? []).map((f) => markRaw(f)),
            timeRange: getTimeRange(),
            request: { requestId },
            annotations: prev?.annotations
          });
        }
      },
      ac.signal
    );
    if (ac.signal.aborted || panelAbort.get(panelId) !== ac) {
      return;
    }
    setPanelData(panelId, {
      ...result,
      request: { requestId },
      annotations: annotationEvents.value.length ? annotationEvents.value.map((e) => ({
        time: e.time,
        timeEnd: e.timeEnd,
        title: e.title,
        text: e.text,
        color: e.color,
        tags: e.tags
      })) : result.annotations
    });
  }
  const {
    copySelectedPanel,
    pasteClipboardPanel,
    duplicateSelectedPanel,
    setSelectedPanels,
    saveSelectedAsLibraryPanel,
    addLibraryPanelToDashboard,
    listSavedLibraryPanels,
    unlinkLibraryPanel: unlinkLibraryPanel2
  } = createPanelLibraryActions({
    getDocument: () => document2.value,
    applyDocument,
    refreshPanel,
    selectedPanelIds
  });
  function attachAnnotationsToPanelData() {
    const annos = annotationEvents.value.map((e) => ({
      time: e.time,
      timeEnd: e.timeEnd,
      title: e.title,
      text: e.text,
      color: e.color,
      tags: e.tags
    }));
    const next = { ...panelData.value };
    for (const id of Object.keys(next)) {
      const n = Number(id);
      next[n] = freezePanelData({ ...next[n], annotations: annos });
    }
    panelData.value = next;
  }
  function yieldToMain() {
    return new Promise((r) => setTimeout(r, 0));
  }
  async function refreshAllPanels() {
    if (refreshInFlight) return refreshInFlight;
    isRefreshing.value = true;
    refreshInFlight = refreshAllPanelsInner().finally(() => {
      isRefreshing.value = false;
      refreshInFlight = null;
    });
    return refreshInFlight;
  }
  async function refreshAllPanelsInner() {
    await ensureBuiltinDataSources();
    const panels22 = (document2.value?.panels ?? []).filter(
      (p) => p.type !== "row"
    );
    const range = getTimeRange();
    const seeded = { ...panelData.value };
    for (const p of panels22) {
      const id = p.id;
      const prev = seeded[id];
      seeded[id] = freezePanelData({
        state: LoadingStateEnum.Loading,
        series: prev?.series ?? [],
        timeRange: range,
        request: { requestId: `panel-${id}-pending` },
        annotations: prev?.annotations
      });
    }
    panelData.value = seeded;
    const annotationsPromise = refreshAnnotations().catch(() => {
    });
    const concurrency = Math.min(
      4,
      Math.max(
        2,
        (typeof navigator !== "undefined" ? navigator.hardwareConcurrency ?? 4 : 4) - 2
      )
    );
    const queue = panels22.slice();
    const workers = Array.from(
      { length: Math.min(concurrency, Math.max(1, queue.length)) },
      async () => {
        while (queue.length) {
          const p = queue.shift();
          if (!p) break;
          await refreshPanel(p);
          await yieldToMain();
        }
      }
    );
    await Promise.all(workers);
    await annotationsPromise;
    attachAnnotationsToPanelData();
  }
  async function refreshAnnotations() {
    if (!document2.value) {
      annotationEvents.value = [];
      return;
    }
    annotationEvents.value = await runAnnotationQueries(
      document2.value.annotations?.list ?? [],
      getTimeRange(),
      (ref2) => catalog.tryResolve(ref2)
    );
    attachAnnotationsToPanelData();
  }
  function updateVariables(list) {
    if (!document2.value) return;
    applyDocument(
      { type: "set-variables", list },
      editMode.value ? void 0 : { history: false, dirty: false }
    );
    syncVariablesToLocation();
    void refreshVariables().then(() => {
      void refreshAllPanels();
    });
  }
  function setVariable(name, value) {
    if (!document2.value) return;
    const list = setVariableValue(
      document2.value.templating?.list ?? [],
      name,
      value
    );
    applyDocument(
      { type: "set-variables", list },
      editMode.value ? void 0 : { history: false, dirty: false }
    );
    syncVariablesToLocation();
    void refreshAllPanels();
  }
  function setEditMode(v) {
    editMode.value = v;
    if (!v) {
      selectedPanelIds.value = [];
    }
  }
  function updateLayout(next) {
    if (!document2.value) return;
    applyDocument({
      type: "patch",
      mutator: (doc) => ({
        ...doc,
        panels: applyLayoutToPanels(doc.panels ?? [], next)
      })
    });
  }
  function updatePanel(panel2) {
    if (!document2.value) return;
    const hasLib = !!panel2?.libraryPanel?.uid;
    if (hasLib) {
      applyDocument({
        type: "patch",
        mutator: (doc) => {
          const list = doc.panels ?? [];
          const withSource = list.some((p) => p.id === panel2.id) ? list.map((p) => p.id === panel2.id ? panel2 : p) : [...list, panel2];
          return {
            ...doc,
            panels: syncLibraryPanelInstances(withSource, panel2)
          };
        }
      });
    } else {
      applyDocument({ type: "upsert-panel", panel: panel2 });
    }
  }
  function addPanel(type = "timeseries") {
    if (!document2.value) return void 0;
    const id = nextPanelId(document2.value);
    const gridPos = findOpenPosition(document2.value.panels ?? [], {
      w: 12,
      h: 8
    });
    const panel2 = {
      id,
      type,
      title: "New panel",
      isNew: true,
      gridPos,
      targets: [
        {
          refId: "A",
          datasource: { type: "grafana-testdata-datasource", uid: "testdata" }
        }
      ],
      options: {},
      fieldConfig: { defaults: {}, overrides: [] }
    };
    applyDocument({ type: "upsert-panel", panel: panel2 });
    void refreshPanel(panel2);
    return id;
  }
  function seedPanelData(panelId, data) {
    panelData.value = { ...panelData.value, [panelId]: freezePanelData(data) };
  }
  function deletePanel(panelId) {
    if (!document2.value) return;
    scheduler.cancel(`panel-${panelId}`);
    panelAbort.get(panelId)?.abort();
    panelAbort.delete(panelId);
    applyDocument({ type: "remove-panel", panelId });
    const next = { ...panelData.value };
    delete next[panelId];
    panelData.value = next;
  }
  function setPersistenceHandler(handler) {
    persistenceHandler = handler;
  }
  async function performSave() {
    if (!document2.value) return;
    if (persistenceHandler) {
      const savedJson = serializeDocument();
      const savedDashboard = JSON.parse(savedJson);
      await persistenceHandler(savedDashboard);
      originalJson.value = savedJson;
      dashboardDocument.state.baselineJson = JSON.stringify(savedDashboard);
      dashboardDocument.syncWorking(document2.value);
      syncFromDocument();
      return;
    }
    const payload = {
      dashboard: {
        ...document2.value,
        id: void 0,
        version: document2.value.version
      },
      message: "Saved from Vue dashboard",
      overwrite: true
    };
    try {
      const res = await backendSrv.post(
        "/api/dashboards/db",
        payload
      );
      if (res.data?.version != null && document2.value) {
        document2.value = {
          ...document2.value,
          version: res.data.version,
          uid: res.data.uid ?? document2.value.uid
        };
      }
    } catch {
    }
    saveImportedDashboard({
      ...document2.value
    });
    dashboardDocument.markSaved(document2.value);
    originalJson.value = dashboardDocument.snapshot();
    dirty.value = false;
  }
  function save() {
    if (saveInFlight) return saveInFlight;
    saveError.value = null;
    saving.value = true;
    saveInFlight = performSave().catch((e) => {
      saveError.value = e instanceof Error ? e.message : String(e);
      throw e;
    }).finally(() => {
      saving.value = false;
      saveInFlight = null;
    });
    return saveInFlight;
  }
  async function restoreSaved() {
    if (!originalJson.value) return;
    await loadLocal(JSON.parse(originalJson.value));
    saveError.value = null;
  }
  function setTime(from, to) {
    time.value = { from, to };
    if (document2.value && editMode.value) {
      applyDocument({ type: "set-time", from, to }, { history: false });
    }
    void refreshAllPanels();
  }
  function setTimezone(tz) {
    timezone.value = tz || "browser";
    if (document2.value && editMode.value) {
      applyDocument(
        { type: "set-timezone", timezone: timezone.value },
        { history: false }
      );
    }
    void refreshAllPanels();
  }
  function undo() {
    if (!document2.value) return;
    dashboardDocument.undo();
    syncFromDocument();
    if (document2.value?.time) {
      time.value = {
        from: document2.value.time.from ?? time.value.from,
        to: document2.value.time.to ?? time.value.to
      };
    }
    void refreshAllPanels();
  }
  function redo() {
    if (!document2.value) return;
    dashboardDocument.redo();
    syncFromDocument();
    if (document2.value?.time) {
      time.value = {
        from: document2.value.time.from ?? time.value.from,
        to: document2.value.time.to ?? time.value.to
      };
    }
    void refreshAllPanels();
  }
  async function refreshVariables() {
    if (!document2.value?.templating?.list) return;
    let list = await refreshAllVariables(
      document2.value.templating.list,
      (ref2) => catalog.tryResolve(ref2)
    );
    list = populateDatasourceVariableOptions(list, catalog.list());
    list = list.map(
      (v) => v?.options ? { ...v, options: markRaw(v.options) } : v
    );
    applyDocument(
      { type: "set-variables", list },
      { history: false, dirty: false }
    );
    dirty.value = false;
    if (originalJson.value) {
      dashboardDocument.state.baselineJson = originalJson.value;
      dashboardDocument.state.dirty = false;
    }
    syncVariablesToLocation();
  }
  function serializeDocument() {
    if (!document2.value) return "{}";
    return serializeDashboardDocument(document2.value);
  }
  autoRefreshRunner.run = () => refreshAllPanels();
  function stopAutoRefresh() {
    if (refreshTimer != null) {
      clearTimeout(refreshTimer);
      refreshTimer = null;
    }
  }
  function restartAutoRefresh() {
    stopAutoRefresh();
    const ms = intervalToMs(refresh.value);
    if (ms <= 0) return;
    const tick = () => {
      refreshTimer = setTimeout(async () => {
        const dom = globalThis.document;
        const hidden = Boolean(dom && dom.visibilityState === "hidden");
        if (!hidden) {
          try {
            autoRefreshTickCount.value += 1;
            await autoRefreshRunner.run();
          } catch {
          }
        }
        if (intervalToMs(refresh.value) > 0) tick();
      }, ms);
    };
    tick();
  }
  function applyRefreshFromDocument() {
    const next = String(
      document2.value?.refresh ?? ""
    );
    refresh.value = next;
    restartAutoRefresh();
  }
  function setRefresh(interval) {
    const raw = String(interval ?? "").trim();
    const next = !raw || raw.toLowerCase() === "off" || raw === "LIVE" || raw.toLowerCase() === "auto" ? "" : raw;
    refresh.value = next;
    if (document2.value) {
      applyDocument(
        { type: "set-refresh", refresh: next },
        editMode.value ? { history: false } : { history: false, dirty: false }
      );
    }
    restartAutoRefresh();
  }
  function ensureVisibilityHook() {
    const dom = globalThis.document;
    if (!dom || visibilityHandler) return;
    visibilityHandler = () => {
      if (dom.visibilityState === "visible" && intervalToMs(refresh.value) > 0) {
        void refreshAllPanels();
      }
    };
    dom.addEventListener("visibilitychange", visibilityHandler);
  }
  ensureVisibilityHook();
  function dispose() {
    stopAutoRefresh();
    const dom = globalThis.document;
    if (visibilityHandler && dom) {
      dom.removeEventListener("visibilitychange", visibilityHandler);
      visibilityHandler = null;
    }
    for (const ac of panelAbort.values()) ac.abort();
    panelAbort.clear();
    scheduler.cancelAll();
    const ownedUids = [...catalog.getInstances().keys()];
    catalog.dispose();
    for (const uid of ownedUids) unregisterRuntimeDataSource(uid);
  }
  function setEmbeddedDatasources(list) {
    if (!document2.value) return;
    const cleaned = sanitizeEmbeddedDatasources(list);
    applyDocument({
      type: "patch",
      mutator: (doc) => ({
        ...doc,
        datasources: cleaned
      })
    });
    registerEmbeddedDatasources(cleaned, (api) => registerDataSource(api));
  }
  function applyDocumentEmbeddedDatasources() {
    const list = sanitizeEmbeddedDatasources(
      document2.value?.datasources
    );
    if (!list.length) return;
    registerEmbeddedDatasources(list, (api) => registerDataSource(api));
  }
  return {
    document: document2,
    dirty,
    editMode,
    loading,
    error,
    panelData,
    time,
    timezone,
    refresh,
    isRefreshing,
    autoRefreshTickCount,
    setRefresh,
    saving,
    saveError,
    panels: panels2,
    layout,
    title,
    scene,
    loadByUid,
    loadLocal,
    refreshPanel,
    setPanelVisible,
    visiblePanels,
    refreshAllPanels,
    setEditMode,
    updateLayout,
    updatePanel,
    addPanel,
    deletePanel,
    seedPanelData,
    save,
    setPersistenceHandler,
    restoreSaved,
    setTime,
    setTimezone,
    registerDataSource,
    unregisterDataSource,
    setEmbeddedDatasources,
    applyDocumentEmbeddedDatasources,
    dispose,
    serializeDocument,
    scheduler,
    undo,
    redo,
    canUndo,
    canRedo,
    refreshVariables,
    syncVariablesFromLocation,
    syncVariablesToLocation,
    pushHistory,
    annotationEvents,
    selectedPanelIds,
    refreshAnnotations,
    setVariable,
    updateVariables,
    copySelectedPanel,
    pasteClipboardPanel,
    duplicateSelectedPanel,
    setSelectedPanels,
    saveSelectedAsLibraryPanel,
    unlinkLibraryPanel: unlinkLibraryPanel2,
    addLibraryPanelToDashboard,
    listSavedLibraryPanels
  };
});
const _hoisted_1$1B = ["data-panel-type"];
const _hoisted_2$1i = ["data-panel-type"];
const _hoisted_3$17 = {
  key: 0,
  class: "panel-chrome__header"
};
const _hoisted_4$U = ["title"];
const _hoisted_5$N = ["title", "aria-label"];
const _hoisted_6$G = { class: "panel-chrome__actions" };
const _hoisted_7$y = ["title", "aria-label"];
const _hoisted_8$r = { class: "menu-wrap" };
const _hoisted_9$q = {
  key: 0,
  role: "none"
};
const _hoisted_10$m = { class: "menu-label" };
const _hoisted_11$j = {
  key: 1,
  role: "none"
};
const _hoisted_12$i = ["aria-expanded"];
const _hoisted_13$i = {
  key: 0,
  class: "submenu",
  "data-testid": "panel-menu-share-submenu",
  role: "menu"
};
const _hoisted_14$i = { role: "none" };
const _hoisted_15$f = { role: "none" };
const _hoisted_16$d = { role: "none" };
const _hoisted_17$b = { role: "none" };
const _hoisted_18$b = { role: "none" };
const _hoisted_19$9 = ["aria-expanded"];
const _hoisted_20$8 = {
  key: 0,
  class: "submenu",
  "data-testid": "panel-menu-inspect-submenu",
  role: "menu"
};
const _hoisted_21$5 = { role: "none" };
const _hoisted_22$5 = { role: "none" };
const _hoisted_23$2 = { role: "none" };
const _hoisted_24$2 = { role: "none" };
const _hoisted_25$2 = {
  role: "none",
  class: "menu-hidden-alias",
  "aria-hidden": "true",
  style: { "display": "none" }
};
const _hoisted_26$2 = { role: "none" };
const _hoisted_27$1 = { role: "none" };
const _hoisted_28$1 = { role: "none" };
const _hoisted_29$1 = { role: "none" };
const _hoisted_30$1 = {
  key: 2,
  role: "none"
};
const _hoisted_31$1 = { role: "none" };
const _hoisted_32$1 = {
  key: 3,
  role: "none"
};
const _hoisted_33$1 = {
  key: 4,
  role: "none"
};
const _hoisted_34$1 = { role: "none" };
const _hoisted_35$1 = {
  key: 5,
  role: "none"
};
const _hoisted_36$1 = {
  key: 6,
  role: "none"
};
const _hoisted_37$1 = { role: "none" };
const _hoisted_38$1 = {
  key: 7,
  role: "none"
};
const _hoisted_39$1 = { class: "menu-label" };
const _hoisted_40$1 = {
  key: 8,
  role: "none"
};
const _hoisted_41$1 = { class: "panel-chrome__body" };
const _hoisted_42$1 = {
  key: 0,
  class: "panel-chrome__error",
  "data-testid": "panel-error"
};
const _hoisted_43$1 = {
  key: 1,
  class: "panel-chrome__loading",
  "data-testid": "panel-loading"
};
const _hoisted_44$1 = {
  key: 2,
  class: "panel-chrome__empty",
  "data-testid": "panel-no-data"
};
const _hoisted_45$1 = { class: "empty-inner" };
const _hoisted_46$1 = {
  key: 3,
  class: "panel-chrome__content"
};
const _hoisted_47$1 = {
  key: 0,
  class: "panel-loading-indicator",
  "data-testid": "panel-loading-indicator",
  "aria-label": "刷新中"
};
const _sfc_main$1G = /* @__PURE__ */ defineComponent({
  __name: "PanelChrome",
  props: {
    title: {},
    description: {},
    loading: { type: Boolean },
    hasStaleData: { type: Boolean },
    error: {},
    transparent: { type: Boolean },
    width: {},
    height: {},
    panelType: {},
    editable: { type: Boolean, default: false },
    canEdit: { type: Boolean, default: false },
    noData: { type: Boolean },
    noDataText: {},
    isLibraryPanel: { type: Boolean },
    isEditing: { type: Boolean, default: false },
    isViewing: { type: Boolean, default: false }
  },
  emits: ["inspect", "fullscreen", "edit", "view", "duplicate", "remove", "share", "explore", "copy", "toggleLegend", "help", "copyStyles", "pasteStyles", "timeSettings", "libraryPanel", "unlinkLibrary", "alertRule"],
  setup(__props, { emit: __emit }) {
    const nestedUnderHost = inject(panelHostKey, null) != null;
    const emit = __emit;
    const menuOpen = ref(false);
    const shareSubOpen = ref(false);
    const inspectSubOpen = ref(false);
    watch(menuOpen, (open) => {
      if (!open) {
        shareSubOpen.value = false;
        inspectSubOpen.value = false;
      }
    });
    function pick(action) {
      menuOpen.value = false;
      shareSubOpen.value = false;
      inspectSubOpen.value = false;
      emit(action);
    }
    function pickShare(mode2 = "link") {
      menuOpen.value = false;
      shareSubOpen.value = false;
      inspectSubOpen.value = false;
      emit("share", mode2);
    }
    function pickInspect(tab = "data") {
      menuOpen.value = false;
      shareSubOpen.value = false;
      inspectSubOpen.value = false;
      emit("inspect", tab);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        Fragment,
        null,
        [
          createCommentVNode(" Nested under PanelHost: content only, host owns the single frame "),
          nestedUnderHost ? (openBlock(), createElementBlock("div", {
            key: 0,
            class: "panel-chrome panel-chrome--nested",
            "data-testid": "panel-chrome-nested",
            "data-panel-type": __props.panelType,
            style: normalizeStyle({
              width: __props.width ? __props.width + "px" : "100%",
              height: __props.height ? __props.height + "px" : "100%"
            })
          }, [
            renderSlot(_ctx.$slots, "default", {}, void 0, true)
          ], 12, _hoisted_1$1B)) : (openBlock(), createElementBlock("section", {
            key: 1,
            class: normalizeClass(["panel-chrome", {
              "is-transparent": __props.transparent,
              "is-loading": __props.loading,
              "has-error": !!__props.error,
              "is-empty": __props.noData && !__props.loading && !__props.error
            }]),
            "data-panel-type": __props.panelType,
            "data-testid": "panel-chrome",
            style: normalizeStyle({
              width: __props.width ? __props.width + "px" : "100%",
              height: __props.height ? __props.height + "px" : "100%"
            })
          }, [
            __props.title || __props.description ? (openBlock(), createElementBlock("header", _hoisted_3$17, [
              createElementVNode("span", {
                class: "panel-chrome__title",
                title: __props.title
              }, toDisplayString(__props.title), 9, _hoisted_4$U),
              __props.description ? (openBlock(), createElementBlock("button", {
                key: 0,
                type: "button",
                class: "icon-btn panel-chrome__desc",
                "data-testid": "panel-description-info",
                title: __props.description,
                "aria-label": __props.description
              }, [
                createVNode(unref(GIcon), {
                  name: "info-circle",
                  size: 14
                })
              ], 8, _hoisted_5$N)) : createCommentVNode("v-if", true),
              createElementVNode("div", _hoisted_6$G, [
                createElementVNode("button", {
                  type: "button",
                  class: "icon-btn",
                  "data-testid": "panel-inspect-btn",
                  title: "检查",
                  "aria-label": "检查",
                  onClick: _cache[0] || (_cache[0] = ($event) => pickInspect("data"))
                }, [
                  createVNode(unref(GIcon), {
                    name: "inspect",
                    size: 14
                  })
                ]),
                !__props.editable && !__props.isEditing ? (openBlock(), createElementBlock("button", {
                  key: 0,
                  type: "button",
                  class: "icon-btn",
                  "data-testid": "panel-fullscreen-btn",
                  title: __props.isViewing ? "退出查看" : "全屏",
                  "aria-label": __props.isViewing ? "退出查看" : "全屏",
                  onClick: _cache[1] || (_cache[1] = ($event) => pick(__props.isViewing ? "view" : "fullscreen"))
                }, [
                  createVNode(unref(GIcon), {
                    name: "fullscreen",
                    size: 14
                  })
                ], 8, _hoisted_7$y)) : createCommentVNode("v-if", true),
                createElementVNode("div", _hoisted_8$r, [
                  createElementVNode("button", {
                    type: "button",
                    class: "icon-btn",
                    "data-testid": "panel-menu-btn",
                    title: "面板菜单",
                    "aria-label": "面板菜单",
                    onClick: _cache[2] || (_cache[2] = ($event) => menuOpen.value = !menuOpen.value)
                  }, [
                    createVNode(unref(GIcon), {
                      name: "more",
                      size: 14
                    })
                  ]),
                  menuOpen.value ? (openBlock(), createElementBlock(
                    "ul",
                    {
                      key: 0,
                      class: "menu",
                      "data-testid": "panel-menu",
                      "data-grafana-panel-menu": "1",
                      role: "menu",
                      onMouseleave: _cache[35] || (_cache[35] = ($event) => menuOpen.value = false)
                    },
                    [
                      !__props.editable && !__props.isEditing ? (openBlock(), createElementBlock("li", _hoisted_9$q, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-view",
                          "data-grafana-action": "view",
                          onClick: _cache[3] || (_cache[3] = ($event) => pick("view"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "fullscreen",
                            size: 12
                          }),
                          createElementVNode(
                            "span",
                            _hoisted_10$m,
                            toDisplayString(__props.isViewing ? "退出查看" : "查看"),
                            1
                            /* TEXT */
                          ),
                          _cache[36] || (_cache[36] = createElementVNode(
                            "span",
                            { class: "menu-sc" },
                            "v",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      __props.canEdit !== false ? (openBlock(), createElementBlock("li", _hoisted_11$j, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-edit",
                          "data-grafana-action": "edit",
                          onClick: _cache[4] || (_cache[4] = ($event) => pick("edit"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "edit",
                            size: 12
                          }),
                          _cache[37] || (_cache[37] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "编辑",
                            -1
                            /* CACHED */
                          )),
                          _cache[38] || (_cache[38] = createElementVNode(
                            "span",
                            { class: "menu-sc" },
                            "e",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      createElementVNode(
                        "li",
                        {
                          class: "menu-item-has-sub",
                          role: "none",
                          "data-testid": "panel-menu-share-wrap",
                          onMouseenter: _cache[9] || (_cache[9] = ($event) => shareSubOpen.value = true),
                          onMouseleave: _cache[10] || (_cache[10] = ($event) => shareSubOpen.value = false)
                        },
                        [
                          createElementVNode("button", {
                            type: "button",
                            role: "menuitem",
                            "data-testid": "panel-menu-share",
                            "data-grafana-action": "share",
                            "aria-haspopup": "true",
                            "aria-expanded": shareSubOpen.value,
                            onClick: _cache[5] || (_cache[5] = ($event) => shareSubOpen.value = !shareSubOpen.value)
                          }, [
                            createVNode(unref(GIcon), {
                              name: "share",
                              size: 12
                            }),
                            _cache[39] || (_cache[39] = createElementVNode(
                              "span",
                              { class: "menu-label" },
                              "分享",
                              -1
                              /* CACHED */
                            )),
                            _cache[40] || (_cache[40] = createElementVNode(
                              "span",
                              {
                                class: "menu-caret",
                                "aria-hidden": "true"
                              },
                              "›",
                              -1
                              /* CACHED */
                            ))
                          ], 8, _hoisted_12$i),
                          shareSubOpen.value ? (openBlock(), createElementBlock("ul", _hoisted_13$i, [
                            createElementVNode("li", _hoisted_14$i, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-share-link",
                                "data-grafana-action": "share-link",
                                "data-grafana-share-view": "link",
                                onClick: _cache[6] || (_cache[6] = ($event) => pickShare("link"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "link",
                                  size: 12
                                }),
                                _cache[41] || (_cache[41] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "分享链接",
                                  -1
                                  /* CACHED */
                                )),
                                _cache[42] || (_cache[42] = createElementVNode(
                                  "span",
                                  { class: "menu-sc" },
                                  "p u",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_15$f, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-share-embed",
                                "data-grafana-action": "share-embed",
                                "data-grafana-share-view": "embed",
                                onClick: _cache[7] || (_cache[7] = ($event) => pickShare("embed"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "share",
                                  size: 12
                                }),
                                _cache[43] || (_cache[43] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "分享嵌入",
                                  -1
                                  /* CACHED */
                                )),
                                _cache[44] || (_cache[44] = createElementVNode(
                                  "span",
                                  { class: "menu-sc" },
                                  "p e",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_16$d, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-share-snapshot",
                                "data-grafana-action": "share-snapshot",
                                "data-grafana-share-view": "snapshot",
                                onClick: _cache[8] || (_cache[8] = ($event) => pickShare("snapshot"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "camera",
                                  size: 12
                                }),
                                _cache[45] || (_cache[45] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "分享快照",
                                  -1
                                  /* CACHED */
                                )),
                                _cache[46] || (_cache[46] = createElementVNode(
                                  "span",
                                  { class: "menu-sc" },
                                  "p s",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ])
                          ])) : createCommentVNode("v-if", true)
                        ],
                        32
                        /* NEED_HYDRATION */
                      ),
                      createElementVNode("li", _hoisted_17$b, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-explore",
                          "data-grafana-action": "explore",
                          onClick: _cache[11] || (_cache[11] = ($event) => pick("explore"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "share",
                            size: 12
                          }),
                          _cache[47] || (_cache[47] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "探索",
                            -1
                            /* CACHED */
                          )),
                          _cache[48] || (_cache[48] = createElementVNode(
                            "span",
                            { class: "menu-sc" },
                            "p x",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ]),
                      createElementVNode("li", _hoisted_18$b, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-time",
                          "data-grafana-action": "timeSettings",
                          onClick: _cache[12] || (_cache[12] = ($event) => pick("timeSettings"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "clock",
                            size: 12
                          }),
                          _cache[49] || (_cache[49] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "时间设置",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ]),
                      _cache[73] || (_cache[73] = createElementVNode(
                        "li",
                        {
                          class: "menu-sep",
                          role: "separator",
                          "data-testid": "panel-menu-sep-inspect"
                        },
                        null,
                        -1
                        /* CACHED */
                      )),
                      createElementVNode(
                        "li",
                        {
                          class: "menu-item-has-sub",
                          role: "none",
                          "data-testid": "panel-menu-inspect-wrap",
                          onMouseenter: _cache[22] || (_cache[22] = ($event) => inspectSubOpen.value = true),
                          onMouseleave: _cache[23] || (_cache[23] = ($event) => inspectSubOpen.value = false)
                        },
                        [
                          createElementVNode("button", {
                            type: "button",
                            role: "menuitem",
                            "data-testid": "panel-menu-inspect",
                            "data-grafana-action": "inspect",
                            "aria-haspopup": "true",
                            "aria-expanded": inspectSubOpen.value,
                            onClick: _cache[13] || (_cache[13] = ($event) => inspectSubOpen.value = !inspectSubOpen.value)
                          }, [
                            createVNode(unref(GIcon), {
                              name: "inspect",
                              size: 12
                            }),
                            _cache[50] || (_cache[50] = createElementVNode(
                              "span",
                              { class: "menu-label" },
                              "检查",
                              -1
                              /* CACHED */
                            )),
                            _cache[51] || (_cache[51] = createElementVNode(
                              "span",
                              { class: "menu-sc" },
                              "i",
                              -1
                              /* CACHED */
                            )),
                            _cache[52] || (_cache[52] = createElementVNode(
                              "span",
                              {
                                class: "menu-caret",
                                "aria-hidden": "true"
                              },
                              "›",
                              -1
                              /* CACHED */
                            ))
                          ], 8, _hoisted_19$9),
                          inspectSubOpen.value ? (openBlock(), createElementBlock("ul", _hoisted_20$8, [
                            createElementVNode("li", _hoisted_21$5, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-data",
                                "data-grafana-action": "inspect-data",
                                "data-grafana-inspect-tab": "data",
                                onClick: _cache[14] || (_cache[14] = ($event) => pickInspect("data"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "inspect",
                                  size: 12
                                }),
                                _cache[53] || (_cache[53] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "数据",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_22$5, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-stats",
                                "data-grafana-action": "inspect-stats",
                                "data-grafana-inspect-tab": "stats",
                                onClick: _cache[15] || (_cache[15] = ($event) => pickInspect("stats"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "info-circle",
                                  size: 12
                                }),
                                _cache[54] || (_cache[54] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "统计",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_23$2, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-query",
                                "data-grafana-action": "inspect-query",
                                "data-grafana-inspect-tab": "query",
                                onClick: _cache[16] || (_cache[16] = ($event) => pickInspect("query"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "search",
                                  size: 12
                                }),
                                _cache[55] || (_cache[55] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "查询",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_24$2, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-json",
                                "data-grafana-action": "inspect-json",
                                "data-grafana-inspect-tab": "json",
                                onClick: _cache[17] || (_cache[17] = ($event) => pickInspect("json"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "inspect",
                                  size: 12
                                }),
                                _cache[56] || (_cache[56] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "面板 JSON",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_25$2, [
                              createElementVNode("button", {
                                type: "button",
                                "data-testid": "panel-menu-json",
                                onClick: _cache[18] || (_cache[18] = ($event) => pickInspect("json"))
                              }, " JSON ")
                            ]),
                            createElementVNode("li", _hoisted_26$2, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-error",
                                "data-grafana-action": "inspect-error",
                                "data-grafana-inspect-tab": "error",
                                onClick: _cache[19] || (_cache[19] = ($event) => pickInspect("error"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "exclamation-triangle",
                                  size: 12
                                }),
                                _cache[57] || (_cache[57] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "错误",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_27$1, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-meta",
                                "data-grafana-action": "inspect-meta",
                                "data-grafana-inspect-tab": "meta",
                                onClick: _cache[20] || (_cache[20] = ($event) => pickInspect("meta"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "info-circle",
                                  size: 12
                                }),
                                _cache[58] || (_cache[58] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "元数据",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ]),
                            createElementVNode("li", _hoisted_28$1, [
                              createElementVNode("button", {
                                type: "button",
                                role: "menuitem",
                                "data-testid": "panel-menu-inspect-transform",
                                "data-grafana-action": "inspect-transform",
                                "data-grafana-inspect-tab": "transform",
                                onClick: _cache[21] || (_cache[21] = ($event) => pickInspect("transform"))
                              }, [
                                createVNode(unref(GIcon), {
                                  name: "cog",
                                  size: 12
                                }),
                                _cache[59] || (_cache[59] = createElementVNode(
                                  "span",
                                  { class: "menu-label" },
                                  "转换",
                                  -1
                                  /* CACHED */
                                ))
                              ])
                            ])
                          ])) : createCommentVNode("v-if", true)
                        ],
                        32
                        /* NEED_HYDRATION */
                      ),
                      createElementVNode("li", _hoisted_29$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-help",
                          "data-grafana-action": "help",
                          onClick: _cache[24] || (_cache[24] = ($event) => pick("help"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "info-circle",
                            size: 12
                          }),
                          _cache[60] || (_cache[60] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "获取帮助",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ]),
                      _cache[74] || (_cache[74] = createElementVNode(
                        "li",
                        {
                          class: "menu-sep",
                          role: "separator",
                          "data-testid": "panel-menu-sep-more"
                        },
                        null,
                        -1
                        /* CACHED */
                      )),
                      _cache[75] || (_cache[75] = createElementVNode(
                        "li",
                        {
                          class: "menu-section",
                          "aria-hidden": "true",
                          "data-testid": "panel-menu-more-label"
                        },
                        " 更多 ",
                        -1
                        /* CACHED */
                      )),
                      __props.editable ? (openBlock(), createElementBlock("li", _hoisted_30$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-duplicate",
                          "data-grafana-action": "duplicate",
                          onClick: _cache[25] || (_cache[25] = ($event) => pick("duplicate"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "copy",
                            size: 12
                          }),
                          _cache[61] || (_cache[61] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "复制",
                            -1
                            /* CACHED */
                          )),
                          _cache[62] || (_cache[62] = createElementVNode(
                            "span",
                            { class: "menu-sc" },
                            "p d",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      createElementVNode("li", _hoisted_31$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-copy",
                          "data-grafana-action": "copy",
                          onClick: _cache[26] || (_cache[26] = ($event) => pick("copy"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "copy",
                            size: 12
                          }),
                          _cache[63] || (_cache[63] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "复制到剪贴板",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ]),
                      __props.editable ? (openBlock(), createElementBlock("li", _hoisted_32$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-copy-styles",
                          "data-grafana-action": "copyStyles",
                          onClick: _cache[27] || (_cache[27] = ($event) => pick("copyStyles"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "copy",
                            size: 12
                          }),
                          _cache[64] || (_cache[64] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "复制样式",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      __props.editable ? (openBlock(), createElementBlock("li", _hoisted_33$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-paste-styles",
                          "data-grafana-action": "pasteStyles",
                          onClick: _cache[28] || (_cache[28] = ($event) => pick("pasteStyles"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "copy",
                            size: 12
                          }),
                          _cache[65] || (_cache[65] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "粘贴样式",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      createElementVNode("li", _hoisted_34$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-legend",
                          "data-grafana-action": "toggleLegend",
                          onClick: _cache[29] || (_cache[29] = ($event) => pick("toggleLegend"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "info-circle",
                            size: 12
                          }),
                          _cache[66] || (_cache[66] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "图例",
                            -1
                            /* CACHED */
                          )),
                          _cache[67] || (_cache[67] = createElementVNode(
                            "span",
                            { class: "menu-sc" },
                            "p l",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ]),
                      __props.editable ? (openBlock(), createElementBlock("li", _hoisted_35$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-library",
                          "data-grafana-action": "libraryPanel",
                          onClick: _cache[30] || (_cache[30] = ($event) => pick("libraryPanel"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "save",
                            size: 12
                          }),
                          _cache[68] || (_cache[68] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "新建库面板",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      __props.isLibraryPanel ? (openBlock(), createElementBlock("li", _hoisted_36$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-unlink-library",
                          "data-grafana-action": "unlinkLibrary",
                          onClick: _cache[31] || (_cache[31] = ($event) => pick("unlinkLibrary"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "link",
                            size: 12
                          }),
                          _cache[69] || (_cache[69] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "取消链接库面板",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true),
                      createElementVNode("li", _hoisted_37$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-alert",
                          "data-grafana-action": "alertRule",
                          onClick: _cache[32] || (_cache[32] = ($event) => pick("alertRule"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "bell",
                            size: 12
                          }),
                          _cache[70] || (_cache[70] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "新建告警规则",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ]),
                      !__props.editable && !__props.isEditing ? (openBlock(), createElementBlock("li", _hoisted_38$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-fullscreen",
                          "data-grafana-action": "fullscreen",
                          onClick: _cache[33] || (_cache[33] = ($event) => pick(__props.isViewing ? "view" : "fullscreen"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "fullscreen",
                            size: 12
                          }),
                          createElementVNode(
                            "span",
                            _hoisted_39$1,
                            toDisplayString(__props.isViewing ? "退出查看" : "全屏"),
                            1
                            /* TEXT */
                          )
                        ])
                      ])) : createCommentVNode("v-if", true),
                      __props.editable ? (openBlock(), createElementBlock("li", _hoisted_40$1, [
                        createElementVNode("button", {
                          type: "button",
                          role: "menuitem",
                          "data-testid": "panel-menu-remove",
                          class: "danger",
                          "data-grafana-action": "remove",
                          onClick: _cache[34] || (_cache[34] = ($event) => pick("remove"))
                        }, [
                          createVNode(unref(GIcon), {
                            name: "trash",
                            size: 12
                          }),
                          _cache[71] || (_cache[71] = createElementVNode(
                            "span",
                            { class: "menu-label" },
                            "删除",
                            -1
                            /* CACHED */
                          )),
                          _cache[72] || (_cache[72] = createElementVNode(
                            "span",
                            { class: "menu-sc" },
                            "p r",
                            -1
                            /* CACHED */
                          ))
                        ])
                      ])) : createCommentVNode("v-if", true)
                    ],
                    32
                    /* NEED_HYDRATION */
                  )) : createCommentVNode("v-if", true)
                ])
              ])
            ])) : createCommentVNode("v-if", true),
            createElementVNode("div", _hoisted_41$1, [
              __props.error ? (openBlock(), createElementBlock(
                "div",
                _hoisted_42$1,
                toDisplayString(__props.error),
                1
                /* TEXT */
              )) : __props.loading && !__props.hasStaleData ? (openBlock(), createElementBlock("div", _hoisted_43$1, [..._cache[76] || (_cache[76] = [
                createElementVNode(
                  "span",
                  { class: "spinner" },
                  null,
                  -1
                  /* CACHED */
                ),
                createTextVNode(
                  " 加载中… ",
                  -1
                  /* CACHED */
                )
              ])])) : __props.noData && !__props.loading ? (openBlock(), createElementBlock("div", _hoisted_44$1, [
                createElementVNode("div", _hoisted_45$1, [
                  createVNode(unref(GIcon), {
                    name: "info-circle",
                    size: 22
                  }),
                  createElementVNode(
                    "span",
                    null,
                    toDisplayString(__props.noDataText || "暂无数据"),
                    1
                    /* TEXT */
                  )
                ])
              ])) : (openBlock(), createElementBlock("div", _hoisted_46$1, [
                __props.loading && __props.hasStaleData ? (openBlock(), createElementBlock("span", _hoisted_47$1, [..._cache[77] || (_cache[77] = [
                  createElementVNode(
                    "span",
                    { class: "spinner spinner--xs" },
                    null,
                    -1
                    /* CACHED */
                  )
                ])])) : createCommentVNode("v-if", true),
                renderSlot(_ctx.$slots, "default", {}, void 0, true)
              ]))
            ])
          ], 14, _hoisted_2$1i))
        ],
        2112
        /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
      );
    };
  }
});
const PanelChrome = /* @__PURE__ */ _export_sfc(_sfc_main$1G, [["__scopeId", "data-v-5c03f322"]]);
const _hoisted_1$1A = ["data-panel-id", "data-panel-title", "data-panel-type", "data-scenario"];
const _hoisted_2$1h = ["data-no-padding"];
const _hoisted_3$16 = {
  key: 1,
  class: "panel-host__missing",
  "data-testid": "panel-host-missing"
};
const PANEL_HEADER_HEIGHT = 40;
const PANEL_BORDER_Y = 2;
const PANEL_BORDER_X = 2;
const PANEL_CONTENT_PAD = 8;
const _sfc_main$1F = /* @__PURE__ */ defineComponent({
  __name: "PanelHost",
  props: {
    title: {},
    description: {},
    loading: { type: Boolean },
    error: {},
    noData: { type: Boolean },
    noDataText: {},
    transparent: { type: Boolean, default: false },
    width: {},
    height: {},
    panelType: {},
    panelId: {},
    scenario: {},
    editable: { type: Boolean, default: false },
    forceNoPadding: { type: Boolean },
    canEdit: { type: Boolean, default: false },
    isEditing: { type: Boolean, default: false },
    isViewing: { type: Boolean, default: false },
    isLibraryPanel: { type: Boolean },
    panel: {},
    data: {},
    options: {},
    fieldConfig: {},
    timeRange: {},
    replaceVariables: { type: Function, default: (v) => v },
    panelContext: {}
  },
  emits: ["action"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function emitAction(type, extra = {}) {
      const panelId = props.panelId ?? 0;
      emit("action", { type, panelId, ...extra });
    }
    const HostContentScope = defineComponent({
      name: "PanelHostContentScope",
      setup(_, { slots }) {
        provide(panelHostKey, { ownedChrome: true });
        return () => slots.default?.();
      }
    });
    const ctx = createDefaultPanelContext(props.panelContext ?? {});
    provide(panelContextKey, ctx);
    const resolvedPanel = computed(() => {
      const fromProp = props.panel ? toRaw(props.panel) : void 0;
      const fromType = props.panelType ? getPanelPlugin(props.panelType)?.panel : void 0;
      const raw = fromProp ?? fromType;
      return raw ? markRaw(raw) : void 0;
    });
    const mergedOptions = computed(() => {
      const plugin2 = props.panelType ? getPanelPlugin(props.panelType) : void 0;
      const defaults2 = plugin2?.defaultOptions ?? {};
      const incoming = props.options ?? {};
      const out = { ...defaults2, ...incoming };
      for (const key of Object.keys(defaults2)) {
        const d = defaults2[key];
        const v = incoming[key];
        if (d && typeof d === "object" && !Array.isArray(d) && v && typeof v === "object" && !Array.isArray(v)) {
          out[key] = { ...d, ...v };
        }
      }
      return out;
    });
    const mergedFieldConfig = computed(() => {
      const plugin2 = props.panelType ? getPanelPlugin(props.panelType) : void 0;
      const customDefaults = plugin2?.defaultFieldConfigCustom ?? plugin2?.module?.defaultFieldConfigCustom;
      const incoming = props.fieldConfig ?? {
        defaults: {},
        overrides: []
      };
      const defaults2 = {
        ...incoming.defaults ?? {}
      };
      if (customDefaults && typeof customDefaults === "object") {
        defaults2.custom = {
          ...customDefaults,
          ...incoming.defaults?.custom ?? {}
        };
      }
      return {
        defaults: defaults2,
        overrides: incoming.overrides ?? []
      };
    });
    const noPadding = computed(() => {
      if (props.forceNoPadding) return true;
      const plugin2 = props.panelType ? getPanelPlugin(props.panelType) : void 0;
      return !!(plugin2?.noPadding ?? plugin2?.module?.noPadding);
    });
    const bodyHeight = computed(() => {
      if (!props.height) return void 0;
      if (!props.title) return Math.max(0, props.height - PANEL_BORDER_Y);
      return Math.max(0, props.height - PANEL_HEADER_HEIGHT - PANEL_BORDER_Y);
    });
    const contentHeight = computed(() => {
      if (bodyHeight.value == null) return void 0;
      const padY = noPadding.value ? 0 : PANEL_CONTENT_PAD * 2;
      return Math.max(0, bodyHeight.value - padY);
    });
    const contentWidth = computed(() => {
      if (props.width == null) return void 0;
      const padX = noPadding.value ? 0 : PANEL_CONTENT_PAD * 2;
      return Math.max(0, props.width - PANEL_BORDER_X - padX);
    });
    const loading = computed(
      () => props.loading || props.data?.state === "Loading" || props.data?.state === "Streaming"
    );
    const hasStaleData = computed(
      () => Boolean(loading.value) && Array.isArray(props.data?.series) && (props.data?.series?.length ?? 0) > 0
    );
    const error = computed(() => props.error ?? props.data?.error?.message);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-host",
        "data-testid": "parity-panel",
        "data-panel-id": __props.panelId != null ? String(__props.panelId) : void 0,
        "data-panel-title": __props.title,
        "data-panel-type": __props.panelType,
        "data-scenario": __props.scenario
      }, [
        createVNode(PanelChrome, {
          title: __props.title,
          description: __props.description,
          transparent: __props.transparent,
          loading: loading.value,
          "has-stale-data": hasStaleData.value,
          error: error.value,
          "no-data": __props.noData,
          "no-data-text": __props.noDataText,
          width: __props.width,
          height: __props.height,
          "panel-type": __props.panelType,
          editable: __props.editable,
          "can-edit": __props.canEdit,
          "is-editing": __props.isEditing,
          "is-viewing": __props.isViewing,
          "is-library-panel": __props.isLibraryPanel,
          onInspect: _cache[0] || (_cache[0] = (tab) => emitAction("inspect", { tab })),
          onFullscreen: _cache[1] || (_cache[1] = () => emitAction("fullscreen")),
          onEdit: _cache[2] || (_cache[2] = () => emitAction("edit")),
          onView: _cache[3] || (_cache[3] = () => emitAction("view")),
          onDuplicate: _cache[4] || (_cache[4] = () => emitAction("duplicate")),
          onRemove: _cache[5] || (_cache[5] = () => emitAction("remove")),
          onShare: _cache[6] || (_cache[6] = (mode2) => emitAction("share", { mode: mode2 })),
          onExplore: _cache[7] || (_cache[7] = () => emitAction("explore")),
          onCopy: _cache[8] || (_cache[8] = () => emitAction("copy")),
          onToggleLegend: _cache[9] || (_cache[9] = () => emitAction("toggle-legend")),
          onHelp: _cache[10] || (_cache[10] = () => emitAction("help")),
          onCopyStyles: _cache[11] || (_cache[11] = () => emitAction("copy-styles")),
          onPasteStyles: _cache[12] || (_cache[12] = () => emitAction("paste-styles")),
          onTimeSettings: _cache[13] || (_cache[13] = () => emitAction("time-settings")),
          onLibraryPanel: _cache[14] || (_cache[14] = () => emitAction("library-panel")),
          onUnlinkLibrary: _cache[15] || (_cache[15] = () => emitAction("unlink-library")),
          onAlertRule: _cache[16] || (_cache[16] = () => emitAction("alert-rule"))
        }, {
          default: withCtx(() => [
            createVNode(unref(HostContentScope), null, {
              default: withCtx(() => [
                createElementVNode("div", {
                  class: "panel-host__body",
                  "data-testid": "panel-host-body",
                  "data-no-padding": noPadding.value ? "1" : "0",
                  style: normalizeStyle({
                    height: bodyHeight.value ? bodyHeight.value + "px" : "100%",
                    padding: noPadding.value ? "0" : void 0
                  })
                }, [
                  renderSlot(_ctx.$slots, "default", {
                    width: contentWidth.value,
                    height: contentHeight.value,
                    data: __props.data,
                    options: mergedOptions.value,
                    fieldConfig: mergedFieldConfig.value
                  }, () => [
                    resolvedPanel.value ? (openBlock(), createBlock(resolveDynamicComponent(resolvedPanel.value), {
                      key: 0,
                      id: __props.panelId,
                      title: __props.title,
                      transparent: __props.transparent,
                      editable: __props.editable,
                      "is-library-panel": __props.isLibraryPanel,
                      data: __props.data,
                      options: mergedOptions.value,
                      "field-config": mergedFieldConfig.value,
                      width: contentWidth.value,
                      height: contentHeight.value ?? __props.height,
                      "time-range": __props.timeRange ?? __props.data?.timeRange,
                      "replace-variables": __props.replaceVariables
                    }, null, 8, ["id", "title", "transparent", "editable", "is-library-panel", "data", "options", "field-config", "width", "height", "time-range", "replace-variables"])) : (openBlock(), createElementBlock(
                      "div",
                      _hoisted_3$16,
                      " 未知面板类型：" + toDisplayString(__props.panelType),
                      1
                      /* TEXT */
                    ))
                  ], true)
                ], 12, _hoisted_2$1h)
              ]),
              _: 3
              /* FORWARDED */
            })
          ]),
          _: 3
          /* FORWARDED */
        }, 8, ["title", "description", "transparent", "loading", "has-stale-data", "error", "no-data", "no-data-text", "width", "height", "panel-type", "editable", "can-edit", "is-editing", "is-viewing", "is-library-panel"])
      ], 8, _hoisted_1$1A);
    };
  }
});
const PanelHost = /* @__PURE__ */ _export_sfc(_sfc_main$1F, [["__scopeId", "data-v-bf8087b2"]]);
const _hoisted_1$1z = ["data-testid", "onClick"];
const _hoisted_2$1g = { class: "row-toggle" };
const _hoisted_3$15 = ["data-testid", "data-selected", "onClick"];
const _sfc_main$1E = /* @__PURE__ */ defineComponent({
  __name: "DashboardGrid",
  props: {
    panels: {},
    panelData: {},
    editable: { type: Boolean, default: false },
    isViewing: { type: Boolean, default: false },
    colNum: { default: 24 },
    rowHeight: { default: 36 },
    selectedPanelId: { default: null },
    replaceVariables: { type: Function, default: (v) => v }
  },
  emits: ["layoutUpdated", "panelClick", "toggleRow", "panelAction"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const collapsedRows = ref(/* @__PURE__ */ new Set());
    function toggleRow(id) {
      const next = new Set(collapsedRows.value);
      if (next.has(id)) next.delete(id);
      else next.add(id);
      collapsedRows.value = next;
      emit("toggleRow", id);
    }
    const rootEl = ref(null);
    const containerWidth = ref(1200);
    const cellSizes = ref({});
    const observers = /* @__PURE__ */ new Map();
    const syncedLayout = computed({
      get: () => panelsToLayout(props.panels, collapsedRows.value),
      set: (v) => {
        emit("layoutUpdated", v);
      }
    });
    function onLayoutUpdated(next) {
      emit("layoutUpdated", next);
    }
    function panelComponent(type) {
      return getPanelPlugin(type)?.panel;
    }
    function panelOf(item) {
      return props.panels.find(
        (p) => p.id === item.panelId || String(p.id) === item.i
      );
    }
    function estimateSize(item) {
      const cols = props.colNum ?? 24;
      const margin = 8;
      const colWidth = Math.max(
        20,
        (containerWidth.value - margin * (cols + 1)) / cols
      );
      const w = Math.floor(item.w * colWidth + Math.max(0, item.w - 1) * margin);
      const h2 = Math.floor(
        item.h * (props.rowHeight ?? 36) + Math.max(0, item.h - 1) * margin
      );
      return { w, h: h2 };
    }
    function sizeFor(item) {
      return cellSizes.value[item.i] ?? estimateSize(item);
    }
    function bindCell(el, key) {
      if (!el || !(el instanceof HTMLElement)) return;
      observers.get(key)?.disconnect();
      const ro = new ResizeObserver((entries) => {
        const cr = entries[0]?.contentRect;
        if (!cr) return;
        const w = Math.max(1, Math.floor(cr.width));
        const h2 = Math.max(1, Math.floor(cr.height));
        const prev = cellSizes.value[key];
        if (prev && prev.w === w && prev.h === h2) return;
        cellSizes.value = { ...cellSizes.value, [key]: { w, h: h2 } };
      });
      ro.observe(el);
      observers.set(key, ro);
    }
    function onRootResize() {
      if (!rootEl.value) return;
      containerWidth.value = Math.max(320, rootEl.value.clientWidth);
    }
    let rootRo;
    onMounted(() => {
      onRootResize();
      if (rootEl.value && typeof ResizeObserver !== "undefined") {
        rootRo = new ResizeObserver(() => onRootResize());
        rootRo.observe(rootEl.value);
      }
      window.addEventListener("resize", onRootResize);
    });
    onBeforeUnmount(() => {
      rootRo?.disconnect();
      window.removeEventListener("resize", onRootResize);
      for (const ro of observers.values()) ro.disconnect();
      observers.clear();
    });
    watch(
      () => props.panels.map((p) => p.id).join(","),
      () => {
        const keys = new Set(syncedLayout.value.map((i) => i.i));
        for (const k of Object.keys(cellSizes.value)) {
          if (!keys.has(k)) {
            observers.get(k)?.disconnect();
            observers.delete(k);
            const next = { ...cellSizes.value };
            delete next[k];
            cellSizes.value = next;
          }
        }
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          ref_key: "rootEl",
          ref: rootEl,
          class: normalizeClass(["dashboard-grid", { "is-editable": __props.editable }]),
          "data-testid": "dashboard-grid"
        },
        [
          createVNode(unref(GridLayout), {
            layout: syncedLayout.value,
            "onUpdate:layout": _cache[0] || (_cache[0] = ($event) => syncedLayout.value = $event),
            "col-num": __props.colNum,
            "row-height": __props.rowHeight,
            "is-draggable": !!__props.editable,
            "is-resizable": !!__props.editable,
            margin: [8, 8],
            "container-padding": [8, 8],
            "use-css-transforms": true,
            "vertical-compact": false,
            "prevent-collision": false,
            onLayoutUpdated
          }, {
            default: withCtx(() => [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(syncedLayout.value, (item) => {
                  return openBlock(), createBlock(unref(GridItem), {
                    key: item.i,
                    i: item.i,
                    x: item.x,
                    y: item.y,
                    w: item.w,
                    h: item.h,
                    "min-w": 2,
                    "min-h": 2,
                    class: "dashboard-grid__item"
                  }, {
                    default: withCtx(() => [
                      item.isRow ? (openBlock(), createElementBlock("div", {
                        key: 0,
                        class: "row-chrome",
                        "data-testid": `grid-row-${item.panelId}`,
                        onClick: withModifiers(($event) => toggleRow(item.panelId), ["stop"])
                      }, [
                        createElementVNode(
                          "span",
                          _hoisted_2$1g,
                          toDisplayString(collapsedRows.value.has(item.panelId) ? "▸" : "▾"),
                          1
                          /* TEXT */
                        ),
                        createElementVNode(
                          "strong",
                          null,
                          toDisplayString(panelOf(item)?.title || "行"),
                          1
                          /* TEXT */
                        )
                      ], 8, _hoisted_1$1z)) : (openBlock(), createElementBlock("div", {
                        key: 1,
                        class: normalizeClass(["panel-hit", {
                          "is-selected": !!__props.editable && __props.selectedPanelId != null && __props.selectedPanelId === item.panelId
                        }]),
                        "data-testid": `grid-panel-${item.panelId}`,
                        "data-selected": !!__props.editable && __props.selectedPanelId != null && __props.selectedPanelId === item.panelId ? "true" : "false",
                        ref_for: true,
                        ref: (el) => bindCell(el, item.i),
                        onClick: ($event) => emit("panelClick", item.panelId)
                      }, [
                        createVNode(PanelHost, {
                          "panel-id": item.panelId,
                          "panel-type": panelOf(item)?.type ?? "stat",
                          title: __props.replaceVariables ? __props.replaceVariables(panelOf(item)?.title ?? "") : panelOf(item)?.title,
                          description: panelOf(item)?.description,
                          editable: __props.editable,
                          "can-edit": !!__props.editable,
                          "is-viewing": !!__props.isViewing,
                          "is-library-panel": !!panelOf(item)?.libraryPanel?.uid,
                          panel: panelComponent(panelOf(item)?.type ?? "stat"),
                          data: __props.panelData[item.panelId] ?? {
                            state: "NotStarted",
                            series: [],
                            timeRange: {
                              from: /* @__PURE__ */ new Date(),
                              to: /* @__PURE__ */ new Date(),
                              raw: { from: "now-6h", to: "now" }
                            }
                          },
                          options: panelOf(item)?.options ?? {},
                          "field-config": panelOf(item)?.fieldConfig ?? { defaults: {}, overrides: [] },
                          width: sizeFor(item).w,
                          height: sizeFor(item).h,
                          "time-range": __props.panelData[item.panelId]?.timeRange ?? {
                            from: /* @__PURE__ */ new Date(),
                            to: /* @__PURE__ */ new Date(),
                            raw: { from: "now-6h", to: "now" }
                          },
                          "replace-variables": (v) => __props.replaceVariables ? __props.replaceVariables(v) : v,
                          onAction: (a) => emit("panelAction", { ...a, panelId: item.panelId })
                        }, null, 8, ["panel-id", "panel-type", "title", "description", "editable", "can-edit", "is-viewing", "is-library-panel", "panel", "data", "options", "field-config", "width", "height", "time-range", "replace-variables", "onAction"])
                      ], 10, _hoisted_3$15))
                    ]),
                    _: 2
                    /* DYNAMIC */
                  }, 1032, ["i", "x", "y", "w", "h"]);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            _: 1
            /* STABLE */
          }, 8, ["layout", "col-num", "row-height", "is-draggable", "is-resizable"])
        ],
        2
        /* CLASS */
      );
    };
  }
});
const DashboardGrid = /* @__PURE__ */ _export_sfc(_sfc_main$1E, [["__scopeId", "data-v-52200410"]]);
const _hoisted_1$1y = ["data-share-view"];
const _hoisted_2$1f = {
  key: 0,
  class: "hint",
  "data-testid": "share-panel-hint"
};
const _hoisted_3$14 = {
  class: "tabs",
  role: "tablist"
};
const _hoisted_4$T = ["aria-selected"];
const _hoisted_5$M = ["aria-selected"];
const _hoisted_6$F = ["aria-selected"];
const _hoisted_7$x = ["value"];
const _hoisted_8$q = ["value"];
const _hoisted_9$p = ["value"];
const _hoisted_10$l = { class: "actions" };
const _sfc_main$1D = /* @__PURE__ */ defineComponent({
  __name: "ShareDrawer",
  props: {
    open: { type: Boolean },
    uid: {},
    slug: {},
    from: {},
    to: {},
    panelId: {},
    shareView: {}
  },
  emits: ["update:open"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const store2 = useDashboardStore();
    const theme = ref("dark");
    const tab = ref("link");
    const exportMode = ref("backup");
    watch(
      () => [props.open, props.shareView],
      ([open, view]) => {
        if (open) {
          tab.value = view ?? "link";
        }
      },
      { immediate: true }
    );
    const shareUrl = computed(
      () => buildShareUrl({
        uid: props.uid,
        slug: props.slug,
        from: props.from,
        to: props.to,
        theme: theme.value,
        panelId: props.panelId,
        variables: Object.fromEntries(
          (store2.document?.templating?.list ?? []).map((v) => [
            v.name,
            v.current?.value ?? ""
          ])
        )
      })
    );
    const embed = computed(
      () => buildEmbedHtml({
        uid: props.uid,
        slug: props.slug,
        theme: theme.value,
        solo: true,
        panelId: props.panelId
      })
    );
    const jsonExport = computed(() => {
      try {
        const env = parseDashboardDocument(
          store2.document ?? {
            title: props.uid,
            panels: [],
            schemaVersion: 42
          }
        );
        return JSON.stringify(
          exportDashboard(env, { mode: exportMode.value }),
          null,
          2
        );
      } catch {
        return buildDashboardJsonExport(
          store2.document ?? { title: props.uid }
        );
      }
    });
    const snapshot = computed(
      () => buildSnapshotExport(store2.document ?? { title: props.uid })
    );
    function copyShareUrl() {
      void globalThis.navigator?.clipboard?.writeText(shareUrl.value);
    }
    function copyJson() {
      void globalThis.navigator?.clipboard?.writeText(jsonExport.value);
    }
    function copyEmbed() {
      void globalThis.navigator?.clipboard?.writeText(embed.value);
    }
    function copySnapshot() {
      void globalThis.navigator?.clipboard?.writeText(
        JSON.stringify(snapshot.value, null, 2)
      );
    }
    const title = computed(() => {
      if (props.panelId != null) {
        if (tab.value === "embed") return "分享面板嵌入";
        if (tab.value === "snapshot") return "分享面板快照";
        return "分享面板链接";
      }
      if (tab.value === "embed") return "分享嵌入";
      if (tab.value === "snapshot") return "分享快照";
      return "分享仪表盘";
    });
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(_sfc_main$4A), {
        open: __props.open,
        title: title.value,
        "test-id": "share-drawer",
        "onUpdate:open": _cache[6] || (_cache[6] = ($event) => emit("update:open", $event))
      }, {
        default: withCtx(() => [
          createElementVNode("div", {
            class: "share",
            "data-testid": "share-drawer-body",
            "data-share-view": tab.value
          }, [
            __props.panelId != null ? (openBlock(), createElementBlock(
              "p",
              _hoisted_2$1f,
              " 当前分享面板 #" + toDisplayString(__props.panelId),
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true),
            createElementVNode("div", _hoisted_3$14, [
              createElementVNode("button", {
                type: "button",
                role: "tab",
                class: normalizeClass({ active: tab.value === "link" }),
                "aria-selected": tab.value === "link",
                "data-testid": "share-tab-link",
                "data-grafana-share-view": "link",
                onClick: _cache[0] || (_cache[0] = ($event) => tab.value = "link")
              }, " 链接 ", 10, _hoisted_4$T),
              createElementVNode("button", {
                type: "button",
                role: "tab",
                class: normalizeClass({ active: tab.value === "embed" }),
                "aria-selected": tab.value === "embed",
                "data-testid": "share-tab-embed",
                "data-grafana-share-view": "embed",
                onClick: _cache[1] || (_cache[1] = ($event) => tab.value = "embed")
              }, " 嵌入 ", 10, _hoisted_5$M),
              createElementVNode("button", {
                type: "button",
                role: "tab",
                class: normalizeClass({ active: tab.value === "snapshot" }),
                "aria-selected": tab.value === "snapshot",
                "data-testid": "share-tab-snapshot",
                "data-grafana-share-view": "snapshot",
                onClick: _cache[2] || (_cache[2] = ($event) => tab.value = "snapshot")
              }, " 快照 ", 10, _hoisted_6$F),
              createCommentVNode(" export kept as alias under snapshot for tests that still look for export "),
              createElementVNode(
                "button",
                {
                  type: "button",
                  role: "tab",
                  class: normalizeClass(["tab-alias", { active: tab.value === "snapshot" }]),
                  "data-testid": "share-tab-export",
                  onClick: _cache[3] || (_cache[3] = ($event) => tab.value = "snapshot")
                },
                " 导出 ",
                2
                /* CLASS */
              )
            ]),
            createElementVNode("label", null, [
              _cache[7] || (_cache[7] = createTextVNode(
                "主题 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                value: theme.value,
                "onUpdate:value": _cache[4] || (_cache[4] = ($event) => theme.value = $event),
                "test-id": "share-theme",
                "show-search": false,
                options: [
                  { label: "深色", value: "dark" },
                  { label: "浅色", value: "light" }
                ]
              }, null, 8, ["value"])
            ]),
            tab.value === "link" ? (openBlock(), createElementBlock(
              Fragment,
              { key: 1 },
              [
                createElementVNode("label", null, [
                  _cache[8] || (_cache[8] = createTextVNode(
                    "链接 ",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(GInput), {
                    "test-id": "share-url",
                    value: shareUrl.value,
                    disabled: ""
                  }, null, 8, ["value"])
                ]),
                createVNode(unref(GButton), {
                  "test-id": "share-copy",
                  onClick: copyShareUrl
                }, {
                  default: withCtx(() => [..._cache[9] || (_cache[9] = [
                    createTextVNode(
                      "复制链接",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })
              ],
              64
              /* STABLE_FRAGMENT */
            )) : tab.value === "embed" ? (openBlock(), createElementBlock(
              Fragment,
              { key: 2 },
              [
                createElementVNode("label", null, [
                  _cache[10] || (_cache[10] = createTextVNode(
                    "嵌入代码 ",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode("textarea", {
                    "data-testid": "share-embed",
                    readonly: "",
                    rows: "4",
                    value: embed.value
                  }, null, 8, _hoisted_7$x)
                ]),
                createVNode(unref(GButton), {
                  "test-id": "share-copy-embed",
                  onClick: copyEmbed
                }, {
                  default: withCtx(() => [..._cache[11] || (_cache[11] = [
                    createTextVNode(
                      "复制嵌入代码",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })
              ],
              64
              /* STABLE_FRAGMENT */
            )) : (openBlock(), createElementBlock(
              Fragment,
              { key: 3 },
              [
                createElementVNode("label", null, [
                  _cache[12] || (_cache[12] = createTextVNode(
                    "导出模式 ",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(GSelect), {
                    value: exportMode.value,
                    "onUpdate:value": _cache[5] || (_cache[5] = ($event) => exportMode.value = $event),
                    "test-id": "export-mode",
                    "show-search": false,
                    options: [
                      { label: "实例备份", value: "backup" },
                      { label: "外部分享", value: "share" }
                    ]
                  }, null, 8, ["value"])
                ]),
                createElementVNode("label", null, [
                  _cache[13] || (_cache[13] = createTextVNode(
                    "仪表盘 JSON ",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode("textarea", {
                    "data-testid": "share-json",
                    readonly: "",
                    rows: "6",
                    value: jsonExport.value
                  }, null, 8, _hoisted_8$q)
                ]),
                createElementVNode("label", null, [
                  _cache[14] || (_cache[14] = createTextVNode(
                    "快照载荷 ",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode("textarea", {
                    "data-testid": "share-snapshot",
                    readonly: "",
                    rows: "4",
                    value: JSON.stringify(snapshot.value, null, 2)
                  }, null, 8, _hoisted_9$p)
                ]),
                createElementVNode("div", _hoisted_10$l, [
                  createVNode(unref(GButton), {
                    "test-id": "share-copy-json",
                    onClick: copyJson
                  }, {
                    default: withCtx(() => [..._cache[15] || (_cache[15] = [
                      createTextVNode(
                        "复制 JSON",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  }),
                  createVNode(unref(GButton), {
                    "test-id": "share-copy-snapshot",
                    onClick: copySnapshot
                  }, {
                    default: withCtx(() => [..._cache[16] || (_cache[16] = [
                      createTextVNode(
                        "复制快照",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  })
                ])
              ],
              64
              /* STABLE_FRAGMENT */
            ))
          ], 8, _hoisted_1$1y)
        ]),
        _: 1
        /* STABLE */
      }, 8, ["open", "title"]);
    };
  }
});
const ShareDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$1D, [["__scopeId", "data-v-a31e94b0"]]);
const _hoisted_1$1x = {
  key: 0,
  class: "insp",
  "data-testid": "inspector-body"
};
const _hoisted_2$1e = { class: "tabs" };
const _hoisted_3$13 = { class: "actions" };
const _hoisted_4$S = {
  key: 0,
  "data-testid": "inspector-data"
};
const _hoisted_5$L = {
  key: 1,
  "data-testid": "inspector-stats"
};
const _hoisted_6$E = {
  key: 2,
  "data-testid": "inspector-query"
};
const _hoisted_7$w = {
  key: 3,
  "data-testid": "inspector-error"
};
const _hoisted_8$p = {
  key: 4,
  "data-testid": "inspector-meta"
};
const _hoisted_9$o = {
  key: 5,
  class: "block",
  "data-testid": "inspect-transform-steps"
};
const _hoisted_10$k = {
  key: 0,
  class: "req"
};
const _hoisted_11$i = { class: "steps" };
const _hoisted_12$h = ["data-testid"];
const _hoisted_13$h = {
  key: 0,
  class: "badge"
};
const _hoisted_14$h = {
  key: 1,
  class: "err"
};
const _hoisted_15$e = { class: "meta-line" };
const _hoisted_16$c = { class: "meta-line" };
const _hoisted_17$a = {
  key: 2,
  class: "meta-line"
};
const _hoisted_18$a = {
  key: 1,
  class: "empty"
};
const _hoisted_19$8 = {
  key: 6,
  class: "block",
  "data-testid": "inspector-help"
};
const _hoisted_20$7 = { class: "help-list" };
const _hoisted_21$4 = {
  key: 7,
  "data-testid": "inspector-json"
};
const _hoisted_22$4 = {
  key: 1,
  "data-testid": "inspector-empty"
};
const _sfc_main$1C = /* @__PURE__ */ defineComponent({
  __name: "PanelInspector",
  props: {
    open: { type: Boolean },
    panel: {},
    data: {},
    initialTab: {}
  },
  emits: ["update:open"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const tab = ref("data");
    const wasOpen = ref(false);
    function setTab(next) {
      tab.value = next;
    }
    function pickInitialTab() {
      const allowed = [
        "data",
        "stats",
        "json",
        "query",
        "meta",
        "transform",
        "error",
        "help"
      ];
      if (props.initialTab && allowed.includes(props.initialTab)) {
        tab.value = props.initialTab;
        return;
      }
      const d = props.data;
      if (d?.error || Array.isArray(d?.errors) && d.errors.length) {
        tab.value = "error";
        return;
      }
      tab.value = "data";
    }
    watch(
      () => props.open,
      (open) => {
        if (open && !wasOpen.value) {
          pickInitialTab();
        }
        wasOpen.value = Boolean(open);
      },
      { immediate: true }
    );
    watch(
      () => props.initialTab,
      (next) => {
        if (!props.open || !next) return;
        const allowed = [
          "data",
          "stats",
          "json",
          "query",
          "meta",
          "transform",
          "error",
          "help"
        ];
        if (allowed.includes(next)) {
          tab.value = next;
        }
      }
    );
    const errorText = computed(() => {
      const d = props.data;
      if (!d) return "无错误";
      if (d.error)
        return typeof d.error === "string" ? d.error : JSON.stringify(d.error, null, 2);
      if (Array.isArray(d.errors) && d.errors.length)
        return JSON.stringify(d.errors, null, 2);
      return "当前无错误";
    });
    const snap = computed(
      () => props.panel ? buildInspectorSnapshot(props.panel, props.data) : null
    );
    const frameStats = computed(() => {
      const series = props.data?.series ?? [];
      return series.map((f, i) => ({
        refId: f.refId ?? String(i),
        name: f.name ?? `frame-${i}`,
        length: f.length,
        fields: f.fields.map((field) => ({
          name: field.name,
          type: field.type,
          nonNull: field.values.filter((v) => v != null && v !== "").length
        }))
      }));
    });
    const requestMeta = computed(() => {
      const d = props.data;
      return {
        state: d?.state,
        timeRange: d?.timeRange ? {
          from: d.timeRange.from?.toISOString?.() ?? d.timeRange.from,
          to: d.timeRange.to?.toISOString?.() ?? d.timeRange.to
        } : null,
        requestId: d?.requestId ?? d?.request?.requestId,
        errors: d?.errors ?? (d?.error ? [d.error] : []),
        seriesCount: d?.series?.length ?? 0
      };
    });
    const queryJson = computed(() => {
      const targets = props.panel?.targets ?? [];
      const uid = props.panel?.datasource?.uid || targets[0]?.datasource?.uid;
      const httpLog2 = getDatasourceHttpLog(uid).slice(-10);
      const payload = {
        targets,
        lastHttpRequests: httpLog2,
        note: "lastHttpRequests 已脱敏（auth/token/Authorization 已 REDACTED）"
      };
      return sanitizeErrorText(JSON.stringify(payload, null, 2));
    });
    const optionsJson = computed(
      () => JSON.stringify(
        {
          id: props.panel?.id,
          type: props.panel?.type,
          title: props.panel?.title,
          options: props.panel?.options,
          fieldConfig: props.panel?.fieldConfig,
          transformations: props.panel?.transformations
        },
        null,
        2
      )
    );
    const dataJson = computed(
      () => JSON.stringify(
        (props.data?.series ?? []).map((f) => ({
          refId: f.refId,
          name: f.name,
          length: f.length,
          fields: f.fields.map((field) => ({
            name: field.name,
            type: field.type,
            values: field.values.slice(0, 20)
          }))
        })),
        null,
        2
      )
    );
    function framesToCsv2() {
      const frames = props.data?.series ?? [];
      const lines = [];
      frames.forEach((frame, fi) => {
        if (fi > 0) lines.push("");
        lines.push(
          `# frame ${fi} refId=${frame.refId || ""} name=${frame.name || ""}`
        );
        const fields = frame.fields ?? [];
        lines.push(fields.map((f) => f.name).join(","));
        const rows = frame.length ?? 0;
        for (let r = 0; r < rows; r++) {
          lines.push(
            fields.map((f) => {
              const v = f.values?.[r];
              if (v == null) return "";
              const s = String(v);
              return s.includes(",") || s.includes('"') ? `"${s.replace(/"/g, '""')}"` : s;
            }).join(",")
          );
        }
      });
      return lines.join("\n");
    }
    function downloadCsv() {
      const csv = framesToCsv2();
      try {
        const blob = new Blob([csv], { type: "text/csv;charset=utf-8" });
        const url = URL.createObjectURL(blob);
        const a = document.createElement("a");
        a.href = url;
        a.download = `panel-${props.panel?.id ?? "data"}.csv`;
        a.setAttribute("data-testid", "inspect-download-csv-link");
        document.body.appendChild(a);
        a.click();
        a.remove();
        URL.revokeObjectURL(url);
      } catch {
        void copy(csv);
      }
    }
    async function copy(text) {
      try {
        await globalThis.navigator?.clipboard?.writeText(text);
      } catch {
      }
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(_sfc_main$4A), {
        open: __props.open,
        title: "面板检查",
        "test-id": "panel-inspector",
        "onUpdate:open": _cache[9] || (_cache[9] = ($event) => emit("update:open", $event))
      }, {
        default: withCtx(() => [
          snap.value || __props.panel ? (openBlock(), createElementBlock("div", _hoisted_1$1x, [
            createElementVNode("div", _hoisted_2$1e, [
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-data",
                  class: normalizeClass({ active: tab.value === "data" }),
                  onClick: _cache[0] || (_cache[0] = ($event) => setTab("data"))
                },
                " 数据 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-stats",
                  class: normalizeClass({ active: tab.value === "stats" }),
                  onClick: _cache[1] || (_cache[1] = ($event) => setTab("stats"))
                },
                " 统计 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-query",
                  class: normalizeClass({ active: tab.value === "query" }),
                  onClick: _cache[2] || (_cache[2] = ($event) => setTab("query"))
                },
                " 查询 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-json",
                  class: normalizeClass({ active: tab.value === "json" }),
                  onClick: _cache[3] || (_cache[3] = ($event) => setTab("json"))
                },
                " JSON ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-meta",
                  class: normalizeClass({ active: tab.value === "meta" }),
                  onClick: _cache[4] || (_cache[4] = ($event) => setTab("meta"))
                },
                " 元数据 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-transform",
                  class: normalizeClass({ active: tab.value === "transform" }),
                  onClick: _cache[5] || (_cache[5] = ($event) => setTab("transform"))
                },
                " 转换 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-error",
                  class: normalizeClass({ active: tab.value === "error" }),
                  onClick: _cache[6] || (_cache[6] = ($event) => setTab("error"))
                },
                " 错误 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  "data-testid": "inspect-tab-help",
                  class: normalizeClass({ active: tab.value === "help" }),
                  onClick: _cache[7] || (_cache[7] = ($event) => setTab("help"))
                },
                " 帮助 ",
                2
                /* CLASS */
              )
            ]),
            createElementVNode("div", _hoisted_3$13, [
              tab.value === "data" ? (openBlock(), createBlock(unref(GButton), {
                key: 0,
                "test-id": "inspect-download-csv",
                onClick: downloadCsv
              }, {
                default: withCtx(() => [..._cache[10] || (_cache[10] = [
                  createTextVNode(
                    "下载 CSV",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              })) : createCommentVNode("v-if", true),
              createVNode(unref(GButton), {
                "test-id": "inspect-copy",
                onClick: _cache[8] || (_cache[8] = ($event) => copy(
                  tab.value === "data" ? dataJson.value : tab.value === "stats" ? JSON.stringify(frameStats.value, null, 2) : tab.value === "query" ? queryJson.value : tab.value === "meta" ? JSON.stringify(requestMeta.value, null, 2) : optionsJson.value
                ))
              }, {
                default: withCtx(() => [..._cache[11] || (_cache[11] = [
                  createTextVNode(
                    " 复制 ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              })
            ]),
            tab.value === "data" ? (openBlock(), createElementBlock(
              "pre",
              _hoisted_4$S,
              toDisplayString(dataJson.value),
              1
              /* TEXT */
            )) : tab.value === "stats" ? (openBlock(), createElementBlock(
              "pre",
              _hoisted_5$L,
              toDisplayString(JSON.stringify(frameStats.value, null, 2)),
              1
              /* TEXT */
            )) : tab.value === "query" ? (openBlock(), createElementBlock(
              "pre",
              _hoisted_6$E,
              toDisplayString(queryJson.value),
              1
              /* TEXT */
            )) : tab.value === "error" ? (openBlock(), createElementBlock(
              "pre",
              _hoisted_7$w,
              toDisplayString(errorText.value),
              1
              /* TEXT */
            )) : tab.value === "meta" ? (openBlock(), createElementBlock(
              "pre",
              _hoisted_8$p,
              toDisplayString(JSON.stringify(requestMeta.value, null, 2)),
              1
              /* TEXT */
            )) : tab.value === "transform" ? (openBlock(), createElementBlock("div", _hoisted_9$o, [
              _cache[12] || (_cache[12] = createElementVNode(
                "p",
                { class: "hint" },
                "查询 → 每步 Transformation → 最终 frame（不含密钥）",
                -1
                /* CACHED */
              )),
              snap.value?.requestSummary ? (openBlock(), createElementBlock("div", _hoisted_10$k, [
                createElementVNode(
                  "div",
                  null,
                  "requestId: " + toDisplayString(snap.value.requestSummary.requestId || "—"),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "div",
                  null,
                  " targets: " + toDisplayString((snap.value.requestSummary.refIds || []).join(", ") || "—"),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "div",
                  null,
                  "raw frames: " + toDisplayString(snap.value.seriesBeforeTransformCount ?? "—"),
                  1
                  /* TEXT */
                )
              ])) : createCommentVNode("v-if", true),
              createElementVNode("ol", _hoisted_11$i, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(snap.value?.transformSteps || [], (s, i) => {
                    return openBlock(), createElementBlock("li", {
                      key: i,
                      class: "step",
                      "data-testid": "inspect-transform-step-" + i
                    }, [
                      createElementVNode(
                        "strong",
                        null,
                        toDisplayString(s.id),
                        1
                        /* TEXT */
                      ),
                      s.disabled ? (openBlock(), createElementBlock("span", _hoisted_13$h, "disabled")) : createCommentVNode("v-if", true),
                      s.error ? (openBlock(), createElementBlock(
                        "span",
                        _hoisted_14$h,
                        toDisplayString(s.error),
                        1
                        /* TEXT */
                      )) : createCommentVNode("v-if", true),
                      createElementVNode(
                        "div",
                        _hoisted_15$e,
                        " frames=" + toDisplayString(s.frameCount) + " · rows=[" + toDisplayString((s.rowCounts || []).join(",")) + "] ",
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "div",
                        _hoisted_16$c,
                        " fields: " + toDisplayString((s.fieldNames || []).join(", ") || "—"),
                        1
                        /* TEXT */
                      ),
                      s.optionKeys?.length ? (openBlock(), createElementBlock(
                        "div",
                        _hoisted_17$a,
                        " options: " + toDisplayString(s.optionKeys.join(", ")),
                        1
                        /* TEXT */
                      )) : createCommentVNode("v-if", true)
                    ], 8, _hoisted_12$h);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ]),
              !(snap.value?.transformSteps || []).length ? (openBlock(), createElementBlock("p", _hoisted_18$a, " 无 Transformation 步骤 ")) : createCommentVNode("v-if", true)
            ])) : tab.value === "help" ? (openBlock(), createElementBlock("div", _hoisted_19$8, [
              _cache[13] || (_cache[13] = createElementVNode(
                "p",
                { class: "hint" },
                "Grafana Inspect → Help：排查与支持信息（不含密钥）",
                -1
                /* CACHED */
              )),
              createElementVNode("ul", _hoisted_20$7, [
                createElementVNode(
                  "li",
                  null,
                  "面板 ID：" + toDisplayString(__props.panel?.id) + " · 类型：" + toDisplayString(__props.panel?.type),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "li",
                  null,
                  "标题：" + toDisplayString(__props.panel?.title || "—"),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "li",
                  null,
                  "查询数：" + toDisplayString((__props.panel?.targets || []).length),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "li",
                  null,
                  "转换数：" + toDisplayString((__props.panel?.transformations || []).length),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "li",
                  null,
                  " 数据帧：" + toDisplayString((__props.data?.series || []).length) + " · 状态：" + toDisplayString(__props.data?.state || "—"),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "li",
                  null,
                  "错误：" + toDisplayString(__props.data?.error?.message || "无"),
                  1
                  /* TEXT */
                )
              ]),
              _cache[14] || (_cache[14] = createElementVNode(
                "p",
                { class: "hint" },
                " 复制「JSON」或「查询」Tab 内容可提供给支持；密钥已脱敏。 ",
                -1
                /* CACHED */
              ))
            ])) : (openBlock(), createElementBlock(
              "pre",
              _hoisted_21$4,
              toDisplayString(optionsJson.value),
              1
              /* TEXT */
            ))
          ])) : (openBlock(), createElementBlock("p", _hoisted_22$4, "未选择面板"))
        ]),
        _: 1
        /* STABLE */
      }, 8, ["open"]);
    };
  }
});
const PanelInspector = /* @__PURE__ */ _export_sfc(_sfc_main$1C, [["__scopeId", "data-v-1c269556"]]);
function refParts(dsRef) {
  if (dsRef == null) return {};
  if (typeof dsRef === "string") return { uid: dsRef };
  return {
    uid: dsRef.uid ? String(dsRef.uid) : void 0,
    type: dsRef.type ? String(dsRef.type) : void 0,
    name: dsRef.name ? String(dsRef.name) : void 0
  };
}
function resolveInstanceSettings(dsRef) {
  const parts = refParts(dsRef);
  const type = normalizeDsType(parts.type) || parts.type || "";
  const uid = parts.uid || type;
  if (uid) {
    const byUid2 = getRuntimeDataSourceSettings(uid);
    if (byUid2) {
      return {
        ...byUid2,
        name: parts.name || byUid2.name
      };
    }
  }
  if (type) {
    const matches = listRuntimeDataSourceSettings().filter(
      (s) => (normalizeDsType(s.type) || s.type) === type
    );
    const hit = matches.find((s) => s.isDefault) || matches[0];
    if (hit) {
      return {
        ...hit,
        name: parts.name || hit.name
      };
    }
  }
  return {
    uid: String(uid || type || "unknown"),
    type: String(type || uid || "unknown"),
    name: parts.name || String(uid || type || "unknown"),
    url: "",
    jsonData: {},
    meta: {
      id: String(type || uid || "unknown"),
      name: parts.name || String(type || uid || "unknown")
    }
  };
}
function resolveEditorDataSource(dsRef) {
  const catalog = getDataSourceCatalog();
  const direct = catalog.tryResolve(dsRef);
  if (direct) return direct;
  const settings = resolveInstanceSettings(dsRef);
  const viaSettings = catalog.tryResolve({
    uid: settings.uid,
    type: settings.type
  });
  if (viaSettings) return viaSettings;
  const typeKey = normalizeDsType(settings.type) || settings.type;
  const plugin2 = getDataSourcePlugin(typeKey) || getDataSourcePlugin(settings.type);
  if (!plugin2?.createDataSource) {
    return {
      uid: settings.uid,
      type: settings.type,
      name: settings.name || settings.uid,
      query: async () => ({ data: [] })
    };
  }
  return plugin2.createDataSource({
    ...settings,
    meta: plugin2.meta ?? settings.meta ?? {
      id: settings.type,
      name: settings.name
    }
  });
}
function usePanelPreview(opts) {
  const previewData = ref(opts.parentData.value);
  const previewLoading = ref(false);
  let previewTimer = null;
  let previewSeq = 0;
  let previewAbort = null;
  function resolvePreviewDataSource(dsRef) {
    const panelDs = opts.draft.value.datasource;
    if (dsRef == null || dsRef === "") {
      return resolveEditorDataSource(panelDs);
    }
    if (typeof dsRef === "string") {
      return resolveEditorDataSource({
        uid: dsRef,
        type: panelDs?.type,
        name: panelDs?.name
      });
    }
    const ref2 = dsRef;
    return resolveEditorDataSource({
      uid: ref2.uid || panelDs?.uid,
      type: ref2.type || panelDs?.type,
      name: ref2.name || panelDs?.name
    });
  }
  const previewScheduler = new QueryScheduler({
    concurrency: 2,
    resolveDataSource: (dsRef) => resolvePreviewDataSource(dsRef)
  });
  const previewEngine = createPanelQueryEngine({
    scheduler: previewScheduler,
    resolveDataSource: (dsRef) => resolvePreviewDataSource(dsRef),
    postProcess: (data, panel2) => {
      const pipeline = runPanelDataPipeline({
        series: data.series ?? [],
        transformations: panel2.transformations ?? [],
        fieldConfigDefaults: panel2.fieldConfig?.defaults ?? {},
        fieldConfigOverrides: panel2.fieldConfig?.overrides ?? [],
        state: data.state,
        timeRange: data.timeRange,
        error: data.error,
        errors: data.errors,
        withTrace: true
      });
      return { ...data, ...pipeline.panelData, series: pipeline.series };
    }
  });
  async function runPreviewQuery() {
    const seq = ++previewSeq;
    previewLoading.value = true;
    const range = opts.parentData.value?.timeRange ?? rangeUtil_parse({ from: "now-6h", to: "now" });
    const targets = (opts.draft.value.targets ?? []).filter(
      (x) => !x.hide
    );
    previewAbort?.abort();
    const ac = new AbortController();
    previewAbort = ac;
    try {
      const result = await previewEngine.execute(
        {
          id: opts.draft.value.id,
          targets: targets.length ? targets : [{ refId: "A" }],
          datasource: opts.draft.value.datasource,
          transformations: opts.draft.value.transformations,
          fieldConfig: opts.draft.value.fieldConfig,
          options: opts.draft.value.options,
          title: opts.draft.value.title,
          type: opts.draft.value.type
        },
        {
          timeRange: range,
          requestId: `editor-preview-${opts.draft.value.id ?? 0}`,
          maxDataPoints: 200,
          intervalMs: 15e3,
          visible: true
        },
        ac.signal
      );
      if (seq !== previewSeq || ac.signal.aborted) return;
      previewData.value = { ...result, timeRange: range };
    } catch (e) {
      if (seq !== previewSeq || ac.signal.aborted) return;
      previewData.value = {
        state: LoadingStateEnum.Error,
        series: opts.parentData.value?.series ?? [],
        timeRange: range,
        error: { message: e instanceof Error ? e.message : String(e) },
        request: { requestId: `editor-preview-err` }
      };
    } finally {
      if (seq === previewSeq) previewLoading.value = false;
    }
  }
  function schedulePreviewQuery() {
    if (previewTimer) clearTimeout(previewTimer);
    previewTimer = setTimeout(() => {
      previewTimer = null;
      void runPreviewQuery();
    }, 350);
  }
  watch(
    () => [
      opts.draft.value.targets,
      opts.draft.value.transformations,
      opts.draft.value.fieldConfig,
      opts.draft.value.__queryRev,
      opts.parentData.value?.timeRange?.from?.valueOf?.() ?? opts.parentData.value?.timeRange?.from,
      opts.parentData.value?.timeRange?.to?.valueOf?.() ?? opts.parentData.value?.timeRange?.to
    ],
    () => schedulePreviewQuery()
    // 所有草稿变更均返回新引用（immutable mutators），无需 deep 遍历
  );
  watch(
    () => opts.parentData.value,
    (d) => {
      if (!previewData.value || previewData.value === d) previewData.value = d;
    }
  );
  onMounted(() => schedulePreviewQuery());
  onBeforeUnmount(() => {
    if (previewTimer) clearTimeout(previewTimer);
    previewAbort?.abort();
    previewScheduler.cancelAll();
  });
  return {
    previewData,
    previewLoading,
    runPreviewQuery,
    schedulePreviewQuery
  };
}
const UI_KEY = "grafana.dashboard.editor.ui";
function usePanelEditorLayout(draft) {
  const ui = ref({
    isPanelOptionsVisible: true,
    rightPaneSize: 400,
    topPaneSize: 0.45,
    mode: 0,
    tableViewEnabled: false
  });
  function loadUi() {
    try {
      const raw = localStorage.getItem(UI_KEY);
      if (!raw) return;
      const parsed = JSON.parse(raw);
      ui.value = { ...ui.value, ...parsed };
      if (typeof parsed.topPaneSize === "string") {
        ui.value.topPaneSize = parseFloat(parsed.topPaneSize) / 100;
      }
    } catch {
    }
  }
  function saveUi() {
    try {
      localStorage.setItem(UI_KEY, JSON.stringify(ui.value));
    } catch {
    }
  }
  loadUi();
  try {
    if (globalThis.process?.env?.VITEST) {
      ui.value.tableViewEnabled = true;
    }
  } catch {
  }
  watch(ui, saveUi, { deep: true });
  const previewHostRef = ref(null);
  const previewBox = ref({ w: 0, h: 0 });
  const exactPreviewPx = computed(() => {
    const gp = draft.value?.gridPos ?? { w: 12, h: 8 };
    const colWidth = 48;
    const rowHeight = 30;
    const margin = 8;
    const w = Math.max(120, Number(gp.w || 12) * colWidth);
    const h2 = Math.max(80, Number(gp.h || 8) * (rowHeight + margin) - margin);
    return { w, h: h2 };
  });
  const previewPanelSize = computed(() => {
    const mode2 = ui.value.mode;
    const hostW = Math.max(1, previewBox.value.w || 600);
    const hostH = Math.max(1, previewBox.value.h || 280);
    const { w: exactW, h: exactH } = exactPreviewPx.value;
    if (mode2 === 2) return { width: exactW, height: exactH };
    if (mode2 === 1) {
      const scale = Math.min(1, hostW / exactW, hostH / exactH);
      return {
        width: Math.max(80, Math.floor(exactW * scale)),
        height: Math.max(60, Math.floor(exactH * scale))
      };
    }
    return { width: hostW, height: hostH };
  });
  const previewStyle = computed(() => {
    const mode2 = ui.value.mode;
    const size = previewPanelSize.value;
    if (mode2 === 0) return { width: "100%", height: "100%" };
    if (mode2 === 1) {
      return {
        width: `${size.width}px`,
        height: `${size.height}px`,
        maxWidth: "100%",
        maxHeight: "100%",
        margin: "auto",
        flex: "0 0 auto"
      };
    }
    return {
      width: `${size.width}px`,
      height: `${size.height}px`,
      margin: "auto",
      flex: "0 0 auto"
    };
  });
  function measurePreviewHost() {
    const el = previewHostRef.value;
    if (!el) return;
    const rect = el.getBoundingClientRect();
    const w = Math.max(0, Math.floor(rect.width - 16));
    const h2 = Math.max(0, Math.floor(rect.height - 16));
    if (w !== previewBox.value.w || h2 !== previewBox.value.h) {
      previewBox.value = { w, h: h2 };
    }
  }
  function setDisplayMode(m) {
    ui.value.mode = m;
    requestAnimationFrame(() => measurePreviewHost());
  }
  function toggleOptionsPane() {
    ui.value.isPanelOptionsVisible = !ui.value.isPanelOptionsVisible;
  }
  function toggleTableView() {
    ui.value.tableViewEnabled = !ui.value.tableViewEnabled;
  }
  let previewRo;
  const dragging = ref(null);
  function onSplitStart(which, e) {
    dragging.value = which;
    e.preventDefault();
  }
  function onSplitMove(e) {
    if (!dragging.value) return;
    const root = document.querySelector(
      '[data-testid="panel-editor"]'
    );
    if (!root) return;
    const rect = root.getBoundingClientRect();
    if (dragging.value === "v") {
      const y = e.clientY - rect.top;
      const ratio = Math.min(0.75, Math.max(0.2, y / rect.height));
      ui.value.topPaneSize = ratio;
    } else {
      const x = rect.right - e.clientX;
      ui.value.rightPaneSize = Math.min(640, Math.max(280, x));
    }
  }
  function onSplitEnd() {
    dragging.value = null;
  }
  onMounted(() => {
    measurePreviewHost();
    if (typeof ResizeObserver !== "undefined" && previewHostRef.value) {
      previewRo = new ResizeObserver(() => measurePreviewHost());
      previewRo.observe(previewHostRef.value);
    }
    window.addEventListener("mousemove", onSplitMove);
    window.addEventListener("mouseup", onSplitEnd);
  });
  onBeforeUnmount(() => {
    previewRo?.disconnect();
    previewRo = void 0;
    window.removeEventListener("mousemove", onSplitMove);
    window.removeEventListener("mouseup", onSplitEnd);
  });
  return {
    ui,
    saveUi,
    previewHostRef,
    previewStyle,
    previewPanelSize,
    setDisplayMode,
    toggleOptionsPane,
    toggleTableView,
    onSplitStart,
    dragging
  };
}
function clonePanel(panel2) {
  return JSON.parse(JSON.stringify(panel2));
}
function nextRefId$1(used) {
  for (let code = 65; code < 90; code++) {
    const id = String.fromCharCode(code);
    if (!used.has(id)) return id;
  }
  return `Q${used.size + 1}`;
}
function ensurePanelQuery(panel2) {
  if (panel2.targets?.length) return panel2;
  const explicitType = panel2.datasource?.type;
  if (explicitType) {
    return {
      ...panel2,
      targets: [defaultQueryForType(explicitType, "A")]
    };
  }
  const effective = getEffectiveDefaultDataSource(
    listRuntimeDataSourceSettings()
  );
  if (!effective) {
    return panel2;
  }
  return {
    ...panel2,
    datasource: { uid: effective.uid, type: effective.type },
    targets: [defaultQueryForType(effective.type, "A")]
  };
}
function withTargets(panel2, targets) {
  return { ...panel2, targets };
}
function listOverrides(panel2) {
  return panel2.fieldConfig?.overrides ?? [];
}
function withOverrides(panel2, overrides) {
  return {
    ...panel2,
    fieldConfig: {
      defaults: panel2.fieldConfig?.defaults ?? {},
      overrides
    }
  };
}
function listTransforms(panel2) {
  return panel2.transformations ?? [];
}
function withTransforms(panel2, transformations) {
  return {
    ...panel2,
    transformations
  };
}
function applyType(panel2, type) {
  return applyPanelTypeChange(panel2, type);
}
function applyOptionPath(panel2, path, value) {
  return { ...panel2, options: setOptionPath(panel2.options ?? {}, path, value) };
}
function applyFieldPath(panel2, path, value) {
  const fc = panel2.fieldConfig ?? { defaults: {}, overrides: [] };
  return {
    ...panel2,
    fieldConfig: {
      ...fc,
      defaults: setOptionPath(
        { ...fc.defaults ?? {} },
        path,
        value
      )
    }
  };
}
function applyQueryAt(panel2, targets, index2, q) {
  const next = [...targets];
  next[index2] = q;
  return withTargets(panel2, next);
}
function addQueryTarget(panel2, targets, type, ds2) {
  const used = new Set(targets.map((t2) => t2.refId));
  const refId = nextRefId$1(used);
  const q = {
    ...defaultQueryForType(type, refId),
    datasource: { type, uid: ds2.uid, name: ds2.name }
  };
  return withTargets(panel2, [...targets, q]);
}
function changeQueryDatasource(panel2, targets, activeIndex, ds2) {
  const cur = targets[activeIndex];
  if (!cur) return panel2;
  const nextQ = switchQueryDatasource(cur, ds2);
  const next = [...targets];
  next[activeIndex] = nextQ;
  const allSame = next.every(
    (q) => normalizeDsType(q.datasource?.type) === normalizeDsType(ds2.type)
  );
  const panelDs = next.length === 1 || allSame || !panel2.datasource?.type ? { type: normalizeDsType(ds2.type) || ds2.type, uid: ds2.uid } : panel2.datasource?.type === "mixed" ? panel2.datasource : next.length > 1 && !allSame ? { type: "mixed", uid: "mixed" } : panel2.datasource;
  return { ...withTargets(panel2, next), datasource: panelDs };
}
function bumpQueryRev(panel2) {
  const rev = Number(panel2.__queryRev ?? 0) + 1;
  return { ...panel2, __queryRev: rev };
}
function duplicateQueryAt(panel2, targets, i) {
  const t2 = targets[i];
  if (!t2) return panel2;
  const used = new Set(targets.map((x) => x.refId));
  const copy = { ...t2, refId: nextRefId$1(used) };
  const next = [...targets];
  next.splice(i + 1, 0, copy);
  return withTargets(panel2, next);
}
function removeQueryAt(panel2, targets, i, activeIndex) {
  if (targets.length <= 1) return { panel: panel2, activeIndex };
  const next = targets.filter((_, idx) => idx !== i);
  const ai = Math.min(activeIndex, next.length - 1);
  return { panel: withTargets(panel2, next), activeIndex: ai };
}
function toggleQueryHide(panel2, targets, i) {
  const next = targets.map(
    (t2, idx) => idx === i ? { ...t2, hide: !t2.hide } : t2
  );
  return withTargets(panel2, next);
}
function moveQueryAt(panel2, targets, i, dir) {
  const j = i + dir;
  if (j < 0 || j >= targets.length) return { panel: panel2, activeIndex: i };
  const next = [...targets];
  const tmp = next[i];
  next[i] = next[j];
  next[j] = tmp;
  return { panel: withTargets(panel2, next), activeIndex: j };
}
function addTransform(panel2, transforms, id) {
  const options = id === "reduce" ? { reducers: ["lastNotNull"] } : id === "limit" ? { limitValue: 10 } : {};
  return withTransforms(panel2, [...transforms, { id, options }]);
}
function updateTransformAt(panel2, transforms, i, patch) {
  const next = transforms.map((t2, idx) => {
    if (idx !== i) return t2;
    const merged = {
      ...t2,
      ...patch,
      options: patch.options ?? t2.options
    };
    if ("filter" in patch) merged.filter = patch.filter;
    if ("topic" in patch) merged.topic = patch.topic;
    return merged;
  });
  return withTransforms(panel2, next);
}
function clearTransforms(panel2) {
  return withTransforms(panel2, []);
}
function removeTransformAt(panel2, transforms, i) {
  return withTransforms(
    panel2,
    transforms.filter((_, idx) => idx !== i)
  );
}
function toggleTransformAt(panel2, transforms, i) {
  return withTransforms(
    panel2,
    transforms.map(
      (t2, idx) => idx === i ? { ...t2, disabled: !t2.disabled } : t2
    )
  );
}
function moveTransformAt(panel2, transforms, i, dir) {
  const j = i + dir;
  if (j < 0 || j >= transforms.length) return panel2;
  const next = [...transforms];
  const tmp = next[i];
  next[i] = next[j];
  next[j] = tmp;
  return withTransforms(panel2, next);
}
function addFieldOverride(panel2, overrides) {
  return withOverrides(panel2, [
    ...overrides,
    {
      matcher: { id: "byName", options: "" },
      properties: [{ id: "unit", value: "short" }]
    }
  ]);
}
function updateOverrideMatcherAt(panel2, overrides, i, id, options) {
  return withOverrides(
    panel2,
    overrides.map(
      (o, idx) => idx === i ? { ...o, matcher: { id, options } } : o
    )
  );
}
function addOverridePropAt(panel2, overrides, i) {
  return withOverrides(
    panel2,
    overrides.map(
      (o, idx) => idx === i ? {
        ...o,
        properties: [
          ...o.properties ?? [],
          { id: "displayName", value: "" }
        ]
      } : o
    )
  );
}
function removeOverridePropAt(panel2, overrides, i, pi) {
  return withOverrides(
    panel2,
    overrides.map(
      (o, idx) => idx === i ? { ...o, properties: (o.properties ?? []).filter((_, j) => j !== pi) } : o
    )
  );
}
function setOverridePropIdAt(panel2, overrides, i, pi, id) {
  return withOverrides(
    panel2,
    overrides.map((o, idx) => {
      if (idx !== i) return o;
      const properties = [...o.properties ?? []];
      properties[pi] = { ...properties[pi], id };
      return { ...o, properties };
    })
  );
}
function setOverridePropValueAt(panel2, overrides, i, pi, raw) {
  let value = raw;
  try {
    if (raw.trim().startsWith("{") || raw.trim().startsWith("["))
      value = JSON.parse(raw);
    else if (raw === "true" || raw === "false") value = raw === "true";
    else if (raw !== "" && !Number.isNaN(Number(raw))) value = Number(raw);
  } catch {
    value = raw;
  }
  return withOverrides(
    panel2,
    overrides.map((o, idx) => {
      if (idx !== i) return o;
      const properties = [...o.properties ?? []];
      properties[pi] = { ...properties[pi], value };
      return { ...o, properties };
    })
  );
}
function removeOverrideAt(panel2, overrides, i) {
  return withOverrides(
    panel2,
    overrides.filter((_, idx) => idx !== i)
  );
}
const POPULAR_BY_NAME = {
  unit: 2,
  单位: 2,
  min: 3,
  最小值: 3,
  max: 4,
  最大值: 4,
  "display name": 5,
  显示名称: 5,
  displayname: 5,
  "show legend": 6,
  显示图例: 6,
  thresholds: 7,
  阈值: 7,
  color: 8,
  颜色: 8
};
function popularRank(d) {
  const name = String(d.name || "").toLowerCase().trim();
  const path = String(d.path || "").toLowerCase();
  if (POPULAR_BY_NAME[name] != null) return POPULAR_BY_NAME[name];
  if (path === "unit" || path.endsWith(".unit")) return 2;
  if (path === "min" || path.endsWith(".min")) return 3;
  if (path === "max" || path.endsWith(".max")) return 4;
  if (path === "displayname" || path.endsWith("displayname") || path === "displayName")
    return 5;
  if (path.includes("legend.showlegend") || path.endsWith("showlegend"))
    return 6;
  if (path === "thresholds" || path.endsWith("thresholds")) return 7;
  if (path === "color" || path.endsWith(".color") || path === "color.mode")
    return 8;
  return void 0;
}
function getRecentOptions(descriptors) {
  const ranked = descriptors.map((d) => ({ d, rank: popularRank(d) })).filter((x) => x.rank != null).sort((a, b) => a.rank - b.rank);
  const seen = /* @__PURE__ */ new Set();
  const out = [];
  for (const { d } of ranked) {
    if (seen.has(d.path)) continue;
    seen.add(d.path);
    out.push(d);
  }
  return out;
}
function categoryTitle(d) {
  return (d.category ?? [])[0] ?? "";
}
function compareHit(left, right) {
  return left.rank - right.rank;
}
class OptionSearchEngine {
  constructor(descriptors) {
    this.descriptors = descriptors;
  }
  descriptors;
  search(query) {
    const q = query.trim();
    if (!q) {
      return {
        optionHits: [...this.descriptors],
        totalCount: this.descriptors.length
      };
    }
    let searchRegex;
    try {
      searchRegex = new RegExp(q, "i");
    } catch {
      searchRegex = new RegExp(q.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "i");
    }
    const hits = [];
    for (const item of this.descriptors) {
      const title = item.name ?? "";
      const description = String(item.description ?? "");
      const cat = categoryTitle(item);
      const path = item.path ?? "";
      const id = String(item.id ?? "");
      if (searchRegex.test(title)) {
        hits.push({ item, rank: 1 });
        continue;
      }
      if (description && searchRegex.test(description)) {
        hits.push({ item, rank: 2 });
        continue;
      }
      if (cat && searchRegex.test(cat)) {
        hits.push({ item, rank: 3 });
        continue;
      }
      if (searchRegex.test(path) || searchRegex.test(id)) {
        hits.push({ item, rank: 3 });
      }
    }
    const sorted = hits.sort(compareHit).map((h2) => h2.item);
    return { optionHits: sorted, totalCount: this.descriptors.length };
  }
  getAllOptionsCount() {
    return this.descriptors.length;
  }
}
const _hoisted_1$1w = {
  class: "options-pane",
  "data-testid": "options-pane"
};
const _hoisted_2$1d = { class: "search-row" };
const _hoisted_3$12 = {
  key: 0,
  class: "search-count",
  "data-testid": "options-search-count"
};
const _hoisted_4$R = {
  key: 0,
  class: "list-mode",
  "data-testid": "options-list-mode",
  role: "radiogroup",
  "aria-label": "选项列表模式"
};
const _hoisted_5$K = {
  key: 1,
  class: "recent-banner",
  "data-testid": "options-recent-banner"
};
const _hoisted_6$D = ["data-category"];
const _hoisted_7$v = ["onClick"];
const _hoisted_8$o = { class: "count" };
const _hoisted_9$n = { class: "cat-body" };
const _hoisted_10$j = ["data-testid", "data-editor", "data-path", "data-unknown-editor", "data-disabled"];
const _hoisted_11$h = { class: "label" };
const _hoisted_12$g = {
  key: 0,
  class: "desc"
};
const _hoisted_13$g = {
  key: 4,
  class: "slider-row",
  "data-testid": "opt-slider"
};
const _hoisted_14$g = { class: "slider-val" };
const _hoisted_15$d = ["value", "onInput"];
const _hoisted_16$b = {
  key: 19,
  class: "unknown-editor",
  "data-testid": "unknown-editor"
};
const _hoisted_17$9 = { class: "unknown-label" };
const _hoisted_18$9 = {
  key: 2,
  class: "empty",
  "data-testid": "options-empty"
};
const _sfc_main$1B = /* @__PURE__ */ defineComponent({
  __name: "OptionsPane",
  props: {
    options: {},
    descriptors: {},
    mode: {},
    fieldMode: { type: Boolean },
    fieldNames: {},
    fieldNameOptions: {},
    dataFrames: {},
    templateVars: {},
    templateVarProperties: {}
  },
  emits: ["change", "replace"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const search = ref("");
    const listMode = ref("all");
    const collapsed = ref({});
    const baseDescriptors = computed(() => {
      let list = props.descriptors ?? [];
      if (props.mode === "overrides" || listMode.value === "overrides") {
        list = list.filter(
          (d) => d.allowOverride || d.override
        );
      }
      if (listMode.value === "recent" && !search.value.trim()) {
        list = getRecentOptions(list);
      }
      return list;
    });
    const filtered = computed(() => {
      let list = baseDescriptors.value.filter((d) => {
        if (props.mode === "overrides" && !d.allowOverride && !d.override) {
          return false;
        }
        const od = d;
        if (od.hideFromDefaults && props.mode !== "overrides" && listMode.value !== "overrides")
          return false;
        if (od.hideFromOverrides && (props.mode === "overrides" || listMode.value === "overrides"))
          return false;
        const showIf = od.showIf;
        if (showIf && showIf(props.options, props.dataFrames, void 0) === false)
          return false;
        od.disableIf;
        return true;
      });
      const q = search.value.trim();
      if (!q) return list;
      return new OptionSearchEngine(list).search(q).optionHits;
    });
    const searchMatchCount = computed(() => filtered.value.length);
    const searchActive = computed(() => search.value.trim().length > 0);
    const showListMode = computed(
      () => !searchActive.value && !(props.mode === "overrides")
    );
    const byCategory = computed(() => {
      const map = /* @__PURE__ */ new Map();
      for (const d of filtered.value) {
        const cat = d.category?.[0] ?? (props.fieldMode ? "标准选项" : "选项");
        if (!map.has(cat)) map.set(cat, []);
        map.get(cat).push(d);
      }
      return [...map.entries()];
    });
    function val(d) {
      return getOptionPath(props.options, d.path);
    }
    function set(d, value) {
      const prev = getOptionPath(props.options, d.path);
      const next = coerceFieldConfigEditorValue(d.path, value, prev);
      emit("change", d.path, next);
    }
    function isKnownEditor(editor) {
      return isKnownEditorKey(String(editor ?? ""));
    }
    function isDisabled2(d) {
      const od = d;
      const disableIf = od.disableIf;
      return disableIf?.(props.options, props.dataFrames) === true;
    }
    function onNative(d, ev) {
      const el = ev.target;
      let value = el.value;
      if (d.editor === "number" || d.editor === "slider")
        value = el.value === "" ? void 0 : Number(el.value);
      set(d, value);
    }
    function toggle(cat) {
      collapsed.value = { ...collapsed.value, [cat]: !collapsed.value[cat] };
    }
    function opts(d) {
      return d.settings?.options ?? [];
    }
    function selectOptions(d) {
      return opts(d).map((o) => ({
        label: String(o.label),
        value: o.value
      }));
    }
    function onSelectValue(d, value) {
      if (d.editor === "multi-select") {
        const arr = Array.isArray(value) ? value : value != null && value !== "" ? [value] : [];
        set(d, arr);
        return;
      }
      set(d, value);
    }
    function fieldNamePickerOptions() {
      if (props.fieldNameOptions?.length) return props.fieldNameOptions;
      return (props.fieldNames ?? []).map((n) => ({ label: n, value: n }));
    }
    function fieldNameFilterFn(d) {
      const filter2 = d.settings?.filter;
      if (typeof filter2 !== "function") return void 0;
      return (opt) => {
        try {
          return !!filter2({
            name: opt.rawName || opt.value,
            type: opt.type,
            config: {}
          });
        } catch {
          return true;
        }
      };
    }
    function selectValue(d) {
      const v = val(d);
      if (d.editor === "multi-select" && v && typeof v === "object" && !Array.isArray(v)) {
        if (d.path === "custom.hideFrom" || d.path.endsWith(".hideFrom")) {
          return Object.entries(v).filter(([, on]) => !!on).map(([k]) => k);
        }
      }
      if (d.editor === "select") {
        return radioDisplayValue(d.path, v);
      }
      return v;
    }
    function radioValue(d) {
      const v = val(d);
      if (v === void 0 || v === null) return void 0;
      return radioDisplayValue(d.path, v);
    }
    function sliderMin(d) {
      return Number(d.settings?.min ?? 0);
    }
    function sliderMax(d) {
      return Number(d.settings?.max ?? 100);
    }
    function sliderStep(d) {
      return Number(d.settings?.step ?? 1);
    }
    const CATEGORY_ZH = {
      Options: "选项",
      "Standard options": "标准选项",
      "Value mappings": "值映射",
      "Data links": "数据链接",
      "Data links and actions": "数据链接与动作",
      "Graph styles": "图形样式",
      图形样式: "图形样式",
      Thresholds: "阈值",
      Legend: "图例",
      Tooltip: "提示",
      Graph: "图形",
      Axis: "坐标轴",
      Axes: "坐标轴",
      Display: "显示",
      Gauge: "仪表",
      Stat: "统计",
      Table: "表格",
      Text: "文本",
      Logs: "日志",
      Heatmap: "热图",
      Canvas: "画布",
      Geomap: "地理地图",
      Histogram: "直方图",
      BarChart: "柱状图",
      "Bar chart": "柱状图",
      PieChart: "饼图",
      "Pie chart": "饼图",
      Timeseries: "时序",
      "Time series": "时序",
      Candlestick: "K线",
      NodeGraph: "节点图",
      "Node graph": "节点图",
      Traces: "链路",
      Debug: "调试",
      News: "新闻",
      Links: "链接",
      Markers: "标记",
      Style: "样式",
      Layout: "布局",
      Behavior: "行为",
      "Field config": "字段配置",
      Overrides: "覆盖",
      Panel: "面板",
      Visualization: "可视化",
      "Reduce options": "归约选项",
      "Stacking and nulls": "堆叠与空值",
      "Connect null values": "连接空值",
      数值选项: "数值选项",
      Series: "序列"
    };
    function categoryLabel(cat) {
      return CATEGORY_ZH[cat] || cat;
    }
    __expose({
      filtered,
      byCategory,
      listMode,
      getRecentOptions,
      isKnownEditor
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1w, [
        createElementVNode("div", _hoisted_2$1d, [
          createVNode(unref(GInput), {
            value: search.value,
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => search.value = $event),
            "test-id": "options-search",
            class: "search",
            placeholder: "搜索选项…"
          }, null, 8, ["value"]),
          searchActive.value ? (openBlock(), createElementBlock(
            "span",
            _hoisted_3$12,
            toDisplayString(searchMatchCount.value) + " 项",
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true)
        ]),
        showListMode.value ? (openBlock(), createElementBlock("div", _hoisted_4$R, [
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: listMode.value === "all" }),
              "data-testid": "options-mode-all",
              onClick: _cache[1] || (_cache[1] = ($event) => listMode.value = "all")
            },
            " 全部 ",
            2
            /* CLASS */
          ),
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: listMode.value === "overrides" }),
              "data-testid": "options-mode-overrides",
              onClick: _cache[2] || (_cache[2] = ($event) => listMode.value = "overrides")
            },
            " 覆盖 ",
            2
            /* CLASS */
          ),
          createElementVNode(
            "button",
            {
              type: "button",
              class: normalizeClass({ active: listMode.value === "recent" }),
              "data-testid": "options-mode-recent",
              onClick: _cache[3] || (_cache[3] = ($event) => listMode.value = "recent")
            },
            " 最近 ",
            2
            /* CLASS */
          )
        ])) : createCommentVNode("v-if", true),
        listMode.value === "recent" && !searchActive.value ? (openBlock(), createElementBlock("div", _hoisted_5$K, " 最近常用选项（Unit / Min / Max / Display name…） ")) : createCommentVNode("v-if", true),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(byCategory.value, ([cat, items]) => {
            return openBlock(), createElementBlock("section", {
              key: cat,
              class: "cat",
              "data-category": cat
            }, [
              createElementVNode("button", {
                type: "button",
                class: "cat-head",
                onClick: ($event) => toggle(cat)
              }, [
                createElementVNode(
                  "span",
                  null,
                  toDisplayString(collapsed.value[cat] ? "▸" : "▾"),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "h4",
                  null,
                  toDisplayString(categoryLabel(cat)),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "span",
                  _hoisted_8$o,
                  toDisplayString(items.length),
                  1
                  /* TEXT */
                )
              ], 8, _hoisted_7$v),
              withDirectives(createElementVNode(
                "div",
                _hoisted_9$n,
                [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(items, (d) => {
                      return openBlock(), createElementBlock("div", {
                        key: d.id,
                        class: "field",
                        "data-testid": `option-${d.id}`,
                        "data-editor": d.editor,
                        "data-path": d.path,
                        "data-unknown-editor": isKnownEditor(d.editor) ? void 0 : "true",
                        "data-disabled": isDisabled2(d) ? "true" : void 0
                      }, [
                        createElementVNode("span", _hoisted_11$h, [
                          createTextVNode(
                            toDisplayString(d.name) + " ",
                            1
                            /* TEXT */
                          ),
                          d.description ? (openBlock(), createElementBlock(
                            "small",
                            _hoisted_12$g,
                            toDisplayString(d.description),
                            1
                            /* TEXT */
                          )) : createCommentVNode("v-if", true)
                        ]),
                        d.editor === "boolean" ? (openBlock(), createBlock(unref(_sfc_main$4v), {
                          key: 0,
                          checked: Boolean(val(d)),
                          "test-id": "opt-boolean",
                          "onUpdate:checked": ($event) => set(d, $event)
                        }, null, 8, ["checked", "onUpdate:checked"])) : d.editor === "radio" ? (openBlock(), createBlock(unref(Radio).Group, {
                          key: 1,
                          class: "radio-group",
                          size: "small",
                          "button-style": "solid",
                          value: radioValue(d),
                          "data-testid": "opt-radio",
                          "onUpdate:value": ($event) => set(d, $event)
                        }, {
                          default: withCtx(() => [
                            (openBlock(true), createElementBlock(
                              Fragment,
                              null,
                              renderList(opts(d), (o) => {
                                return openBlock(), createBlock(unref(Radio).Button, {
                                  key: String(o.value),
                                  value: o.value,
                                  title: o.description
                                }, {
                                  default: withCtx(() => [
                                    createTextVNode(
                                      toDisplayString(o.label),
                                      1
                                      /* TEXT */
                                    )
                                  ]),
                                  _: 2
                                  /* DYNAMIC */
                                }, 1032, ["value", "title"]);
                              }),
                              128
                              /* KEYED_FRAGMENT */
                            ))
                          ]),
                          _: 2
                          /* DYNAMIC */
                        }, 1032, ["value", "onUpdate:value"])) : d.editor === "select" ? (openBlock(), createBlock(unref(GSelect), {
                          key: 2,
                          class: "ctrl",
                          "data-testid": "opt-select",
                          value: selectValue(d),
                          options: selectOptions(d),
                          "allow-clear": "",
                          onChange: ($event) => onSelectValue(d, $event)
                        }, null, 8, ["value", "options", "onChange"])) : d.editor === "multi-select" ? (openBlock(), createBlock(unref(GSelect), {
                          key: 3,
                          class: "ctrl",
                          mode: "multiple",
                          "data-testid": "opt-multi-select",
                          value: Array.isArray(selectValue(d)) ? selectValue(d) : [],
                          options: selectOptions(d),
                          onChange: ($event) => onSelectValue(d, $event)
                        }, null, 8, ["value", "options", "onChange"])) : d.editor === "slider" ? (openBlock(), createElementBlock("div", _hoisted_13$g, [
                          createVNode(unref(Slider), {
                            class: "slider",
                            min: sliderMin(d),
                            max: sliderMax(d),
                            step: sliderStep(d),
                            value: Number(val(d) ?? sliderMin(d)),
                            "onUpdate:value": ($event) => set(d, $event)
                          }, null, 8, ["min", "max", "step", "value", "onUpdate:value"]),
                          createElementVNode(
                            "span",
                            _hoisted_14$g,
                            toDisplayString(val(d) ?? sliderMin(d)),
                            1
                            /* TEXT */
                          )
                        ])) : d.editor === "unit" ? (openBlock(), createBlock(unref(UnitPicker), {
                          key: 5,
                          "data-testid": "opt-unit",
                          "model-value": String(val(d) ?? ""),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "color" ? (openBlock(), createBlock(unref(ColorPicker), {
                          key: 6,
                          "data-testid": "opt-color",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "thresholds" ? (openBlock(), createBlock(unref(ThresholdsEditor), {
                          key: 7,
                          "data-testid": "opt-thresholds",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "mappings" ? (openBlock(), createBlock(unref(ValueMappingsEditor), {
                          key: 8,
                          "data-testid": "opt-mappings",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "fieldColor" ? (openBlock(), createBlock(unref(FieldColorEditor), {
                          key: 9,
                          "data-testid": "opt-field-color",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "links" ? (openBlock(), createBlock(unref(DataLinksEditor), {
                          key: 10,
                          "data-testid": "opt-links",
                          "model-value": val(d),
                          "data-frames": __props.dataFrames,
                          "template-vars": __props.templateVars,
                          "template-var-properties": __props.templateVarProperties,
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "data-frames", "template-vars", "template-var-properties", "onUpdate:modelValue"])) : d.editor === "actions" ? (openBlock(), createBlock(unref(ActionsEditor), {
                          key: 11,
                          "data-testid": "opt-actions",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "stats-picker" ? (openBlock(), createBlock(unref(StatsPicker), {
                          key: 12,
                          "data-testid": "opt-stats-picker",
                          "model-value": val(d),
                          "allow-multiple": d.settings?.allowMultiple !== false,
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "allow-multiple", "onUpdate:modelValue"])) : d.editor === "strings" ? (openBlock(), createBlock(unref(StringArrayEditor), {
                          key: 13,
                          "data-testid": "opt-strings",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "timezone" ? (openBlock(), createBlock(unref(_sfc_main$4f), {
                          key: 14,
                          "data-testid": "opt-timezone",
                          "model-value": val(d),
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "onUpdate:modelValue"])) : d.editor === "dashboard-uid" ? (openBlock(), createBlock(unref(GSelect), {
                          key: 15,
                          class: "ctrl",
                          "data-testid": "opt-dashboard-uid",
                          value: val(d),
                          options: d.settings?.options ?? [],
                          "allow-clear": "",
                          "show-search": "",
                          placeholder: "选择仪表盘",
                          onChange: ($event) => set(d, $event)
                        }, null, 8, ["value", "options", "onChange"])) : d.editor === "field-name" ? (openBlock(), createBlock(unref(_sfc_main$4i), {
                          key: 16,
                          class: "ctrl",
                          "data-testid": "opt-field-name",
                          "model-value": val(d) ?? void 0,
                          options: fieldNamePickerOptions(),
                          "filter-types": d.settings?.filterTypes,
                          "filter-fn": fieldNameFilterFn(d),
                          placeholder: d.settings?.placeholderText || "选择字段",
                          "onUpdate:modelValue": ($event) => set(d, $event)
                        }, null, 8, ["model-value", "options", "filter-types", "filter-fn", "placeholder", "onUpdate:modelValue"])) : d.editor === "textarea" ? (openBlock(), createElementBlock("textarea", {
                          key: 17,
                          class: "ctrl",
                          "data-testid": "opt-textarea",
                          rows: "4",
                          value: String(val(d) ?? ""),
                          onInput: ($event) => onNative(d, $event)
                        }, null, 40, _hoisted_15$d)) : d.editor === "number" ? (openBlock(), createBlock(unref(GInput), {
                          key: 18,
                          class: "ctrl",
                          "data-testid": "opt-number",
                          type: "number",
                          value: val(d) == null ? "" : String(val(d)),
                          "onUpdate:value": ($event) => set(d, $event === "" ? void 0 : Number($event))
                        }, null, 8, ["value", "onUpdate:value"])) : !isKnownEditor(d.editor) ? (openBlock(), createElementBlock("div", _hoisted_16$b, [
                          createElementVNode(
                            "span",
                            _hoisted_17$9,
                            "未知编辑器: " + toDisplayString(d.editor),
                            1
                            /* TEXT */
                          ),
                          createVNode(unref(GInput), {
                            class: "ctrl",
                            "data-testid": "opt-text",
                            type: "text",
                            value: val(d) == null ? "" : typeof val(d) === "object" ? JSON.stringify(val(d)) : String(val(d)),
                            "onUpdate:value": ($event) => set(d, $event)
                          }, null, 8, ["value", "onUpdate:value"])
                        ])) : (openBlock(), createBlock(unref(GInput), {
                          key: 20,
                          class: "ctrl",
                          "data-testid": "opt-text",
                          type: "text",
                          disabled: isDisabled2(d),
                          value: val(d) == null ? "" : typeof val(d) === "object" ? JSON.stringify(val(d)) : String(val(d)),
                          "onUpdate:value": ($event) => set(d, $event)
                        }, null, 8, ["disabled", "value", "onUpdate:value"]))
                      ], 8, _hoisted_10$j);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ],
                512
                /* NEED_PATCH */
              ), [
                [vShow, !collapsed.value[cat]]
              ])
            ], 8, _hoisted_6$D);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        !filtered.value.length ? (openBlock(), createElementBlock("p", _hoisted_18$9, " 无匹配的选项 ")) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const OptionsPane = /* @__PURE__ */ _export_sfc(_sfc_main$1B, [["__scopeId", "data-v-f3d7ccdf"]]);
const FRAME_CAT = ["面板选项"];
const LINKS_CAT = ["面板链接"];
const REPEAT_CAT = ["重复选项"];
const TIME_CAT = ["面板时间"];
const LIBRARY_CAT = ["库面板"];
const MAX_PER_ROW_OPTIONS = [2, 3, 4, 6, 8, 12].map((value) => ({
  label: String(value),
  value
}));
function getPanelFrameDescriptors(panel2 = {}) {
  const hasRepeat = Boolean(panel2.repeat);
  const isHorizontal = hasRepeat && String(panel2.repeatDirection || "h") === "h";
  const isLibrary = Boolean(panel2.libraryPanel);
  const items = [
    {
      id: "panel-frame-title",
      path: "title",
      name: "标题",
      category: FRAME_CAT,
      editor: "text",
      editorKey: "text",
      defaultValue: "",
      order: 1
    },
    {
      id: "panel-frame-description",
      path: "description",
      name: "描述",
      category: FRAME_CAT,
      editor: "textarea",
      editorKey: "textarea",
      defaultValue: "",
      order: 2
    },
    {
      id: "panel-frame-transparent-bg",
      path: "transparent",
      name: "透明背景",
      category: FRAME_CAT,
      editor: "boolean",
      editorKey: "boolean",
      defaultValue: false,
      order: 3
    },
    {
      id: "panel-frame-links",
      path: "links",
      name: "面板链接",
      category: LINKS_CAT,
      editor: "links",
      editorKey: "links",
      defaultValue: [],
      order: 10,
      getItemsCount: (v) => Array.isArray(v) ? v.length : 0
    },
    {
      id: "panel-frame-repeat-by-variable",
      path: "repeat",
      name: "按变量重复",
      description: "按所选变量的每个值重复此面板。编辑模式下不可见；需返回仪表盘并更新变量或重新加载后生效。",
      category: REPEAT_CAT,
      editor: "select",
      editorKey: "select",
      order: 20
    },
    {
      id: "panel-frame-repeat-direction",
      path: "repeatDirection",
      name: "重复方向",
      category: REPEAT_CAT,
      editor: "radio",
      editorKey: "radio",
      defaultValue: "h",
      order: 21,
      showIf: () => hasRepeat,
      settings: {
        options: [
          { label: "水平", value: "h" },
          { label: "垂直", value: "v" }
        ]
      }
    },
    {
      id: "panel-frame-repeat-max-per-row",
      path: "maxPerRow",
      name: "每行最大",
      category: REPEAT_CAT,
      editor: "select",
      editorKey: "select",
      defaultValue: 4,
      order: 22,
      showIf: () => isHorizontal,
      settings: {
        options: MAX_PER_ROW_OPTIONS
      }
    },
    {
      id: "panel-frame-time-from",
      path: "timeFrom",
      name: "时间范围覆盖",
      description: "相对或绝对时间范围（例如 now-1h / now）",
      category: TIME_CAT,
      editor: "text",
      editorKey: "text",
      order: 30
    },
    {
      id: "panel-frame-time-shift",
      path: "timeShift",
      name: "时间偏移",
      description: "相对时间偏移（例如 1h）",
      category: TIME_CAT,
      editor: "text",
      editorKey: "text",
      order: 31
    },
    {
      id: "panel-frame-hide-time-override",
      path: "hideTimeOverride",
      name: "隐藏时间覆盖",
      category: TIME_CAT,
      editor: "boolean",
      editorKey: "boolean",
      defaultValue: false,
      order: 32
    },
    {
      id: "panel-frame-max-data-points",
      path: "maxDataPoints",
      name: "最大数据点数",
      description: "覆盖面板查询的 maxDataPoints",
      category: TIME_CAT,
      editor: "number",
      editorKey: "number",
      order: 33
    },
    {
      id: "panel-frame-interval",
      path: "interval",
      name: "最小间隔",
      description: "覆盖查询间隔，例如 1m",
      category: TIME_CAT,
      editor: "text",
      editorKey: "text",
      order: 34
    },
    {
      id: "panel-frame-cache-timeout",
      path: "cacheTimeout",
      name: "缓存超时",
      description: "查询缓存超时",
      category: TIME_CAT,
      editor: "text",
      editorKey: "text",
      order: 35
    },
    {
      id: "panel-frame-query-caching-ttl",
      path: "queryCachingTTL",
      name: "查询缓存 TTL",
      description: "查询缓存 TTL（毫秒）",
      category: TIME_CAT,
      editor: "number",
      editorKey: "number",
      order: 36
    }
  ];
  if (isLibrary) {
    items.push({
      id: "panel-frame-library",
      path: "libraryPanel",
      name: "库面板",
      description: "此面板绑定到库面板定义",
      category: LIBRARY_CAT,
      editor: "text",
      editorKey: "text",
      order: 40,
      // host metadata — read-only in UI via disableIf
      disableIf: () => true
    });
  }
  return items;
}
const PANEL_FRAME_CATEGORY_DEFAULT_OPEN = {
  面板选项: true,
  面板链接: false,
  重复选项: false,
  面板时间: false,
  库面板: false
};
const _hoisted_1$1v = {
  class: "panel-frame-options",
  "data-testid": "panel-frame-options"
};
const _hoisted_2$1c = ["data-testid", "data-category"];
const _hoisted_3$11 = ["data-testid", "onClick"];
const _hoisted_4$Q = { class: "caret" };
const _hoisted_5$J = { class: "cat-title" };
const _hoisted_6$C = {
  class: "cat-count",
  "data-testid": "panel-frame-cat-count"
};
const _hoisted_7$u = { class: "cat-body" };
const _hoisted_8$n = ["data-testid", "data-path", "data-editor"];
const _hoisted_9$m = { class: "frame-label" };
const _hoisted_10$i = { class: "name" };
const _hoisted_11$g = {
  key: 0,
  class: "desc"
};
const _hoisted_12$f = ["value", "onChange"];
const _hoisted_13$f = {
  key: 5,
  class: "radio-row",
  "data-testid": "panel-repeat-direction"
};
const _hoisted_14$f = ["value", "checked", "onChange"];
const _hoisted_15$c = {
  key: 9,
  class: "readonly",
  "data-testid": "panel-library-readonly"
};
const _sfc_main$1A = /* @__PURE__ */ defineComponent({
  __name: "PanelFrameOptions",
  props: {
    panel: {},
    repeatVariableOptions: {},
    templateVars: {},
    templateVarProperties: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const collapsed = ref({});
    const descriptors = computed(() => getPanelFrameDescriptors(props.panel));
    const byCategory = computed(() => {
      const map = /* @__PURE__ */ new Map();
      for (const d of descriptors.value) {
        const showIf = d.showIf;
        if (showIf && showIf(props.panel) === false) continue;
        const cat = d.category?.[0] ?? "面板选项";
        if (!map.has(cat)) map.set(cat, []);
        map.get(cat).push(d);
      }
      return [...map.entries()];
    });
    function isOpen(cat) {
      if (cat in collapsed.value) return !collapsed.value[cat];
      return PANEL_FRAME_CATEGORY_DEFAULT_OPEN[cat] ?? true;
    }
    function toggle(cat) {
      const open = isOpen(cat);
      collapsed.value = { ...collapsed.value, [cat]: open };
    }
    function val(path) {
      return props.panel[path];
    }
    function set(path, value) {
      emit("change", path, value);
    }
    const repeatOptions = computed(() => {
      const base = props.repeatVariableOptions ?? [];
      return [{ label: "禁用", value: "" }, ...base];
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1v, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(byCategory.value, ([cat, items]) => {
            return openBlock(), createElementBlock("div", {
              key: cat,
              class: "frame-cat",
              "data-testid": `panel-frame-cat-${cat}`,
              "data-category": cat
            }, [
              createElementVNode("button", {
                type: "button",
                class: "cat-head",
                "data-testid": `panel-frame-cat-toggle-${cat}`,
                onClick: ($event) => toggle(cat)
              }, [
                createElementVNode(
                  "span",
                  _hoisted_4$Q,
                  toDisplayString(isOpen(cat) ? "▾" : "▸"),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "span",
                  _hoisted_5$J,
                  toDisplayString(cat),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "span",
                  _hoisted_6$C,
                  toDisplayString(items.length),
                  1
                  /* TEXT */
                )
              ], 8, _hoisted_3$11),
              withDirectives(createElementVNode(
                "div",
                _hoisted_7$u,
                [
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(items, (d) => {
                      return openBlock(), createElementBlock("div", {
                        key: d.id,
                        class: "frame-row",
                        "data-testid": `panel-frame-${d.path}`,
                        "data-path": d.path,
                        "data-editor": d.editor
                      }, [
                        createElementVNode("label", _hoisted_9$m, [
                          createElementVNode(
                            "span",
                            _hoisted_10$i,
                            toDisplayString(d.name),
                            1
                            /* TEXT */
                          ),
                          d.description ? (openBlock(), createElementBlock(
                            "span",
                            _hoisted_11$g,
                            toDisplayString(d.description),
                            1
                            /* TEXT */
                          )) : createCommentVNode("v-if", true)
                        ]),
                        d.editor === "boolean" ? (openBlock(), createBlock(unref(_sfc_main$4v), {
                          key: 0,
                          checked: !!val(d.path),
                          disabled: d.disableIf?.(props.panel) === true,
                          "onUpdate:checked": ($event) => set(d.path, $event)
                        }, null, 8, ["checked", "disabled", "onUpdate:checked"])) : d.editor === "text" && d.path !== "libraryPanel" ? (openBlock(), createBlock(unref(GInput), {
                          key: 1,
                          "test-id": d.path === "title" ? "panel-title-input" : void 0,
                          value: String(val(d.path) ?? ""),
                          disabled: d.disableIf?.(props.panel) === true,
                          "onUpdate:value": ($event) => set(d.path, $event === "" ? void 0 : $event)
                        }, null, 8, ["test-id", "value", "disabled", "onUpdate:value"])) : d.editor === "textarea" ? (openBlock(), createElementBlock("textarea", {
                          key: 2,
                          rows: "2",
                          class: "frame-textarea",
                          "data-testid": "panel-frame-description-input",
                          value: String(val(d.path) ?? ""),
                          onChange: ($event) => set(d.path, $event.target.value)
                        }, null, 40, _hoisted_12$f)) : d.editor === "links" ? (openBlock(), createBlock(unref(DataLinksEditor), {
                          key: 3,
                          "model-value": val(d.path) ?? [],
                          "template-vars": __props.templateVars,
                          "template-var-properties": __props.templateVarProperties,
                          "onUpdate:modelValue": ($event) => set(d.path, $event)
                        }, null, 8, ["model-value", "template-vars", "template-var-properties", "onUpdate:modelValue"])) : d.path === "repeat" ? (openBlock(), createBlock(unref(GSelect), {
                          key: 4,
                          "test-id": "panel-repeat",
                          value: String(val("repeat") ?? ""),
                          options: repeatOptions.value,
                          placeholder: "选择变量",
                          onChange: _cache[0] || (_cache[0] = ($event) => set("repeat", $event ? String($event) : void 0))
                        }, null, 8, ["value", "options"])) : d.path === "repeatDirection" ? (openBlock(), createElementBlock("div", _hoisted_13$f, [
                          (openBlock(true), createElementBlock(
                            Fragment,
                            null,
                            renderList(d.settings?.options ?? [], (opt) => {
                              return openBlock(), createElementBlock("label", {
                                key: String(opt.value),
                                class: "radio"
                              }, [
                                createElementVNode("input", {
                                  type: "radio",
                                  name: "repeatDirection",
                                  value: opt.value,
                                  checked: String(val("repeatDirection") || "h") === String(opt.value),
                                  onChange: ($event) => set("repeatDirection", opt.value)
                                }, null, 40, _hoisted_14$f),
                                createTextVNode(
                                  " " + toDisplayString(opt.label),
                                  1
                                  /* TEXT */
                                )
                              ]);
                            }),
                            128
                            /* KEYED_FRAGMENT */
                          ))
                        ])) : d.path === "maxPerRow" ? (openBlock(), createBlock(unref(GSelect), {
                          key: 6,
                          "test-id": "panel-max-per-row",
                          value: Number(val("maxPerRow") ?? 4),
                          options: unref(MAX_PER_ROW_OPTIONS),
                          onChange: _cache[1] || (_cache[1] = ($event) => set("maxPerRow", Number($event ?? 4)))
                        }, null, 8, ["value", "options"])) : d.path === "timeFrom" ? (openBlock(), createBlock(unref(GInput), {
                          key: 7,
                          "test-id": "panel-time-from",
                          value: String(val("timeFrom") ?? ""),
                          "onUpdate:value": _cache[2] || (_cache[2] = ($event) => set("timeFrom", $event === "" ? void 0 : $event))
                        }, null, 8, ["value"])) : d.path === "timeShift" ? (openBlock(), createBlock(unref(GInput), {
                          key: 8,
                          "test-id": "panel-time-shift",
                          value: String(val("timeShift") ?? ""),
                          "onUpdate:value": _cache[3] || (_cache[3] = ($event) => set("timeShift", $event === "" ? void 0 : $event))
                        }, null, 8, ["value"])) : d.path === "libraryPanel" ? (openBlock(), createElementBlock("span", _hoisted_15$c, " 库面板（只读） ")) : createCommentVNode("v-if", true)
                      ], 8, _hoisted_8$n);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ],
                512
                /* NEED_PATCH */
              ), [
                [vShow, isOpen(cat)]
              ])
            ], 8, _hoisted_2$1c);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const PanelFrameOptions = /* @__PURE__ */ _export_sfc(_sfc_main$1A, [["__scopeId", "data-v-1147ebcf"]]);
const _hoisted_1$1u = { class: "panel-editor__header" };
const _hoisted_2$1b = { class: "title-row" };
const _hoisted_3$10 = ["title"];
const _hoisted_4$P = {
  key: 0,
  class: "draft-dirty",
  "data-testid": "panel-editor-dirty",
  title: "未应用的更改"
};
const _hoisted_5$I = { class: "header-tools" };
const _hoisted_6$B = {
  class: "mode-group",
  "data-testid": "display-mode"
};
const _sfc_main$1z = /* @__PURE__ */ defineComponent({
  __name: "PanelEditorHeader",
  props: {
    title: {},
    dirty: { type: Boolean },
    mode: {},
    tableViewEnabled: { type: Boolean },
    optionsVisible: { type: Boolean }
  },
  emits: ["back", "set-mode", "toggle-table", "toggle-options"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("header", _hoisted_1$1u, [
        createElementVNode("div", _hoisted_2$1b, [
          renderSlot(_ctx.$slots, "back", {}, () => [
            createElementVNode("button", {
              type: "button",
              "data-testid": "panel-editor-back",
              class: "back-btn",
              onClick: _cache[0] || (_cache[0] = ($event) => emit("back"))
            }, " ← 返回仪表盘 ")
          ], true),
          createElementVNode("span", {
            class: "title-display",
            "data-testid": "panel-title-display",
            title: __props.title || "面板标题"
          }, toDisplayString(__props.title || "未命名面板"), 9, _hoisted_3$10),
          __props.dirty ? (openBlock(), createElementBlock("span", _hoisted_4$P, "●")) : createCommentVNode("v-if", true),
          createElementVNode("div", _hoisted_5$I, [
            createElementVNode("div", _hoisted_6$B, [
              createElementVNode(
                "button",
                {
                  type: "button",
                  class: normalizeClass({ active: __props.mode === 0 }),
                  "data-testid": "display-fill",
                  title: "Fill",
                  onClick: _cache[1] || (_cache[1] = ($event) => emit("set-mode", 0))
                },
                " 填充 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  class: normalizeClass({ active: __props.mode === 1 }),
                  "data-testid": "display-fit",
                  title: "Fit",
                  onClick: _cache[2] || (_cache[2] = ($event) => emit("set-mode", 1))
                },
                " 适应 ",
                2
                /* CLASS */
              ),
              createElementVNode(
                "button",
                {
                  type: "button",
                  class: normalizeClass({ active: __props.mode === 2 }),
                  "data-testid": "display-exact",
                  title: "Exact",
                  onClick: _cache[3] || (_cache[3] = ($event) => emit("set-mode", 2))
                },
                " 原始 ",
                2
                /* CLASS */
              )
            ]),
            renderSlot(_ctx.$slots, "tools", {
              tableViewEnabled: __props.tableViewEnabled,
              optionsVisible: __props.optionsVisible
            }, void 0, true)
          ])
        ])
      ]);
    };
  }
});
const PanelEditorHeader = /* @__PURE__ */ _export_sfc(_sfc_main$1z, [["__scopeId", "data-v-91d8a8bb"]]);
const _hoisted_1$1t = ["data-testid"];
const _hoisted_2$1a = ["data-testid", "aria-expanded"];
const _hoisted_3$$ = { class: "qr-id" };
const _hoisted_4$O = { class: "qr-dstype" };
const _hoisted_5$H = ["data-testid"];
const _hoisted_6$A = ["data-testid"];
const _sfc_main$1y = /* @__PURE__ */ defineComponent({
  __name: "QueryEditorRow",
  props: {
    index: {},
    refId: {},
    target: {},
    dsType: {},
    hide: { type: Boolean },
    collapsed: { type: Boolean },
    queryEditor: {},
    dsInstance: {},
    dsApi: {},
    dsOptions: {},
    total: {}
  },
  emits: ["toggle-collapse", "activate", "duplicate", "toggle-hide", "move", "remove", "change", "change-datasource", "run-query"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["query-row", { hidden: __props.hide }]),
        "data-testid": `query-row-${__props.refId}`
      }, [
        createElementVNode("header", {
          class: "qr-head",
          onClick: _cache[10] || (_cache[10] = ($event) => emit("activate"))
        }, [
          createElementVNode("button", {
            type: "button",
            class: "qr-collapse",
            "data-testid": `query-row-toggle-${__props.refId}`,
            "aria-expanded": !__props.collapsed,
            onClick: _cache[0] || (_cache[0] = withModifiers(($event) => emit("toggle-collapse"), ["stop"]))
          }, toDisplayString(__props.collapsed ? "▸" : "▾"), 9, _hoisted_2$1a),
          createElementVNode(
            "span",
            _hoisted_3$$,
            toDisplayString(__props.refId),
            1
            /* TEXT */
          ),
          createElementVNode("label", {
            class: "qr-ds",
            onClick: _cache[2] || (_cache[2] = withModifiers(() => {
            }, ["stop"]))
          }, [
            createVNode(unref(GSelect), {
              value: __props.dsInstance.uid,
              options: __props.dsOptions,
              "test-id": `query-row-ds-${__props.refId}`,
              "aria-label": "选择数据源",
              "onUpdate:value": _cache[1] || (_cache[1] = ($event) => emit("change-datasource", String($event ?? "")))
            }, null, 8, ["value", "options", "test-id"])
          ]),
          createElementVNode(
            "span",
            _hoisted_4$O,
            toDisplayString(unref(dsTypeLabel)(__props.dsType)),
            1
            /* TEXT */
          ),
          _cache[16] || (_cache[16] = createElementVNode(
            "span",
            { class: "qr-spacer" },
            null,
            -1
            /* CACHED */
          )),
          createElementVNode("div", {
            class: "qr-actions",
            onClick: _cache[9] || (_cache[9] = withModifiers(() => {
            }, ["stop"]))
          }, [
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": `query-row-dup-${__props.refId}`,
              onClick: _cache[3] || (_cache[3] = ($event) => emit("duplicate"))
            }, {
              default: withCtx(() => [..._cache[11] || (_cache[11] = [
                createTextVNode(
                  "复制",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["test-id"]),
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": `query-row-hide-${__props.refId}`,
              onClick: _cache[4] || (_cache[4] = ($event) => emit("toggle-hide"))
            }, {
              default: withCtx(() => [
                createTextVNode(
                  toDisplayString(__props.hide ? "显示" : "隐藏"),
                  1
                  /* TEXT */
                )
              ]),
              _: 1
              /* STABLE */
            }, 8, ["test-id"]),
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": `query-row-up-${__props.refId}`,
              disabled: __props.index === 0,
              onClick: _cache[5] || (_cache[5] = ($event) => emit("move", -1))
            }, {
              default: withCtx(() => [..._cache[12] || (_cache[12] = [
                createTextVNode(
                  "↑",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["test-id", "disabled"]),
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": `query-row-down-${__props.refId}`,
              disabled: __props.index >= __props.total - 1,
              onClick: _cache[6] || (_cache[6] = ($event) => emit("move", 1))
            }, {
              default: withCtx(() => [..._cache[13] || (_cache[13] = [
                createTextVNode(
                  "↓",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["test-id", "disabled"]),
            createVNode(unref(GButton), {
              size: "sm",
              variant: "destructive",
              "test-id": `query-row-remove-${__props.refId}`,
              disabled: __props.total <= 1,
              onClick: _cache[7] || (_cache[7] = ($event) => emit("remove"))
            }, {
              default: withCtx(() => [..._cache[14] || (_cache[14] = [
                createTextVNode(
                  "删除",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["test-id", "disabled"]),
            createVNode(unref(GButton), {
              size: "sm",
              variant: "primary",
              "test-id": `query-row-run-${__props.refId}`,
              onClick: _cache[8] || (_cache[8] = ($event) => emit("run-query"))
            }, {
              default: withCtx(() => [..._cache[15] || (_cache[15] = [
                createTextVNode(
                  "运行",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["test-id"])
          ])
        ]),
        withDirectives(createElementVNode("div", {
          class: "qr-body",
          "data-testid": `query-row-body-${__props.refId}`
        }, [
          __props.queryEditor ? (openBlock(), createBlock(resolveDynamicComponent(__props.queryEditor), {
            key: 0,
            query: __props.target,
            datasource: __props.dsInstance,
            "datasource-api": __props.dsApi,
            "on-change": (q) => emit("change", q),
            "on-run-query": () => emit("run-query")
          }, null, 40, ["query", "datasource", "datasource-api", "on-change", "on-run-query"])) : (openBlock(), createElementBlock("div", {
            key: 1,
            class: "qr-empty",
            "data-testid": `query-row-empty-${__props.refId}`
          }, " 暂无查询编辑器：" + toDisplayString(unref(dsTypeLabel)(__props.dsType) || __props.dsType || "未选择"), 9, _hoisted_6$A))
        ], 8, _hoisted_5$H), [
          [vShow, !__props.collapsed]
        ])
      ], 10, _hoisted_1$1t);
    };
  }
});
const QueryEditorRow = /* @__PURE__ */ _export_sfc(_sfc_main$1y, [["__scopeId", "data-v-7a9079af"]]);
const _hoisted_1$1s = {
  class: "section query-section",
  "data-testid": "query-section"
};
const _hoisted_2$19 = {
  class: "query-rows",
  "data-testid": "query-rows"
};
const _hoisted_3$_ = { class: "query-add-row" };
const _hoisted_4$N = ["disabled"];
const _sfc_main$1x = /* @__PURE__ */ defineComponent({
  __name: "QueryEditorTab",
  props: {
    targets: {},
    activeQuery: {},
    rows: {},
    activeTarget: {},
    queryEditor: {},
    dsType: {},
    dsInstance: {},
    dsApi: {}
  },
  emits: ["update:activeQuery", "activate", "add", "duplicate", "toggle-hide", "move", "remove", "change", "change-at", "change-datasource", "change-datasource-at", "run-query"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const catalog = ref([]);
    const loadingDs = ref(false);
    const collapsedMap = reactive({});
    const VISIBLE_DS_TYPES = /* @__PURE__ */ new Set([
      "alexanderzobnin-zabbix-datasource",
      "signoz"
    ]);
    function pluginsAsCatalog() {
      return listDataSourcePlugins().filter((p) => VISIBLE_DS_TYPES.has(p.meta.id)).map((p) => ({
        uid: p.meta.id,
        name: p.meta.name,
        type: p.meta.id
      }));
    }
    function mergeDsCatalog(listed) {
      const byUid2 = /* @__PURE__ */ new Map();
      const byType = /* @__PURE__ */ new Set();
      for (const d of listed) {
        if (!d?.uid) continue;
        byUid2.set(d.uid, d);
        if (d.type) byType.add(d.type);
      }
      for (const p of pluginsAsCatalog()) {
        if (byUid2.has(p.uid)) continue;
        if (p.type && byType.has(p.type)) continue;
        byUid2.set(p.uid, p);
        if (p.type) byType.add(p.type);
      }
      return [...byUid2.values()];
    }
    onMounted(async () => {
      loadingDs.value = true;
      try {
        const listed = await listDataSources();
        catalog.value = mergeDsCatalog(listed);
      } catch {
        catalog.value = mergeDsCatalog([]);
      } finally {
        loadingDs.value = false;
      }
    });
    const dsOptions = computed(() => {
      const opts = catalog.value.map((d) => ({
        label: `${d.name} · ${dsTypeLabel(d.type)}`,
        value: d.uid
      }));
      for (const r of props.rows ?? []) {
        const curUid = r.dsInstance?.uid;
        if (curUid && !opts.some((o) => o.value === curUid)) {
          opts.unshift({
            label: `${r.dsInstance.name || curUid} · ${dsTypeLabel(r.dsType)}`,
            value: curUid
          });
        }
      }
      const legacyUid = props.dsInstance?.uid;
      if (legacyUid && !opts.some((o) => o.value === legacyUid)) {
        opts.unshift({
          label: `${props.dsInstance.name || legacyUid} · ${dsTypeLabel(props.dsType)}`,
          value: legacyUid
        });
      }
      return opts;
    });
    function toggleCollapse(refId) {
      collapsedMap[refId] = !collapsedMap[refId];
    }
    function idxOf(refId) {
      if (props.rows?.length) {
        return props.rows.findIndex((t2) => t2.refId === refId);
      }
      return props.targets.findIndex((t2) => t2.refId === refId);
    }
    function onRowChangeDs(refId, uid) {
      const id = String(uid ?? "");
      const i = idxOf(refId);
      if (i < 0) return;
      const found = catalog.value.find((d) => d.uid === id);
      if (found) {
        emit("change-datasource-at", i, {
          type: found.type,
          uid: found.uid,
          name: found.name
        });
        return;
      }
      const plugin2 = listDataSourcePlugins().find((p) => p.meta.id === id);
      if (plugin2) {
        emit("change-datasource-at", i, {
          type: plugin2.meta.id,
          uid: plugin2.meta.id,
          name: plugin2.meta.name
        });
      }
    }
    const resolvedRows = computed(() => {
      if (props.rows?.length) return props.rows;
      return (props.targets ?? []).map((t2, i) => {
        const q = t2;
        const type = normalizeDsType(q?.datasource?.type) || normalizeDsType(props.dsType) || "grafana-testdata-datasource";
        const active = i === props.activeQuery;
        return {
          refId: t2.refId,
          target: t2,
          dsType: type,
          hide: !!q?.hide,
          queryEditor: active ? props.queryEditor : null,
          dsInstance: active ? props.dsInstance : {
            uid: q?.datasource?.uid ?? type,
            type,
            name: q?.datasource?.name ?? type,
            jsonData: {},
            meta: { id: type, name: type }
          },
          dsApi: active ? props.dsApi : null
        };
      });
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("section", _hoisted_1$1s, [
        createElementVNode("div", _hoisted_2$19, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(resolvedRows.value, (r, i) => {
              return openBlock(), createBlock(QueryEditorRow, {
                key: r.refId,
                index: i,
                "ref-id": r.refId,
                target: r.target,
                "ds-type": r.dsType,
                hide: r.hide,
                collapsed: !!collapsedMap[r.refId],
                "query-editor": r.queryEditor,
                "ds-instance": r.dsInstance,
                "ds-api": r.dsApi,
                "ds-options": dsOptions.value,
                total: resolvedRows.value.length,
                onToggleCollapse: ($event) => toggleCollapse(r.refId),
                onActivate: ($event) => {
                  emit("activate", i);
                  emit("update:activeQuery", i);
                },
                onDuplicate: ($event) => emit("duplicate", i),
                onToggleHide: ($event) => emit("toggle-hide", i),
                onMove: (dir) => emit("move", i, dir),
                onRemove: ($event) => emit("remove", i),
                onChange: (q) => emit("change-at", i, q),
                onChangeDatasource: (uid) => onRowChangeDs(r.refId, uid),
                onRunQuery: _cache[0] || (_cache[0] = ($event) => emit("run-query"))
              }, null, 8, ["index", "ref-id", "target", "ds-type", "hide", "collapsed", "query-editor", "ds-instance", "ds-api", "ds-options", "total", "onToggleCollapse", "onActivate", "onDuplicate", "onToggleHide", "onMove", "onRemove", "onChange", "onChangeDatasource"]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ]),
        createElementVNode("div", _hoisted_3$_, [
          createElementVNode("button", {
            type: "button",
            class: "q-add-btn",
            "data-testid": "add-query-btn",
            disabled: loadingDs.value,
            onClick: _cache[1] || (_cache[1] = ($event) => emit("add"))
          }, " + 查询 ", 8, _hoisted_4$N)
        ])
      ]);
    };
  }
});
const QueryEditorTab = /* @__PURE__ */ _export_sfc(_sfc_main$1x, [["__scopeId", "data-v-e689f08d"]]);
const TRANSFORM_LABELS = {
  filterByName: "按名称过滤字段",
  filterByRefId: "按查询过滤",
  filterByValue: "按值过滤",
  organize: "整理字段",
  sortBy: "排序",
  limit: "限制行数",
  reduce: "归约",
  groupBy: "分组",
  labelsToFields: "标签转字段",
  merge: "合并",
  concatenate: "串联",
  calculateField: "计算字段",
  formatString: "格式化字符串",
  seriesToRows: "系列转行",
  renameByRegex: "正则重命名",
  convertFieldType: "转换字段类型",
  joinByField: "按字段连接",
  groupingToMatrix: "分组矩阵",
  histogram: "直方图",
  transpose: "转置",
  formatTime: "格式化时间",
  extractFields: "提取字段",
  prepareTimeSeries: "准备时序",
  order: "字段排序",
  rename: "重命名",
  noop: "无操作",
  partitionByValues: "按值分区",
  rowsToFields: "行转字段",
  ensureColumns: "确保列",
  convertFrameType: "转换帧类型",
  joinByLabels: "按标签连接",
  groupToNestedTable: "嵌套表",
  configFromData: "从数据配置",
  fieldLookup: "字段查找",
  heatmap: "热图转换",
  spatial: "空间",
  regression: "回归",
  smoothing: "平滑",
  timeSeriesTable: "时序表",
  append: "追加",
  filterFields: "过滤字段",
  filterFieldsByName: "按名称过滤字段",
  filterFrames: "过滤帧",
  seriesToColumns: "系列转列"
};
function transformLabel(id) {
  return TRANSFORM_LABELS[id] ?? id;
}
const FALLBACK_TRANSFORMER_IDS = [
  "filterByName",
  "filterFieldsByName",
  "organize",
  "sortBy",
  "limit",
  "reduce",
  "groupBy",
  "labelsToFields",
  "merge",
  "concatenate",
  "seriesToRows",
  "filterByValue",
  "renameByRegex",
  "convertFieldType",
  "joinByField",
  "groupingToMatrix",
  "calculateField"
];
const commonMatchers = [
  {
    path: "include",
    label: "包含",
    type: "string",
    description: "正则或名称"
  },
  { path: "exclude", label: "排除", type: "string" }
];
const reducerOpts = [
  { label: "最后非空", value: "lastNotNull" },
  { label: "最后", value: "last" },
  { label: "第一个非空", value: "firstNotNull" },
  { label: "第一个", value: "first" },
  { label: "平均", value: "mean" },
  { label: "合计", value: "sum" },
  { label: "最小", value: "min" },
  { label: "最大", value: "max" },
  { label: "计数", value: "count" },
  { label: "方差", value: "variance" },
  { label: "标准差", value: "stdDev" }
];
const transformerRegistry = [
  {
    id: "limit",
    image: "limit",
    name: "限制",
    description: "限制行数",
    defaultOptions: { limitField: 10 },
    fields: [{ path: "limitField", label: "行数", type: "number" }],
    dedicatedEditor: true,
    categories: ["filter"],
    tags: ["限制", "行数"]
  },
  {
    id: "sortBy",
    image: "sortBy",
    name: "排序",
    description: "按字段排序",
    defaultOptions: { sort: [{ field: "", desc: false }] },
    fields: [
      { path: "sort.0.field", label: "字段", type: "string" },
      { path: "sort.0.desc", label: "降序", type: "boolean" }
    ],
    dedicatedEditor: true,
    categories: ["reorderAndRename"],
    tags: ["排序", "sort"]
  },
  {
    id: "filterFieldsByName",
    name: "按名称过滤字段",
    description: "include/exclude 字段",
    defaultOptions: {},
    fields: commonMatchers,
    dedicatedEditor: true,
    categories: ["filter"],
    tags: ["字段", "过滤", "名称"]
  },
  {
    id: "filterByName",
    name: "按名称过滤字段(别名)",
    description: "内部别名",
    defaultOptions: {},
    fields: commonMatchers,
    hidden: true,
    aliasOf: "filterFieldsByName"
  },
  {
    id: "filterByRefId",
    image: "filterByRefId",
    name: "按查询过滤",
    description: "按 refId",
    defaultOptions: { include: ".*" },
    fields: [{ path: "include", label: "refId 正则", type: "string" }],
    dedicatedEditor: true
  },
  {
    id: "organize",
    image: "organize",
    name: "组织字段",
    description: "排除/重命名/排序",
    defaultOptions: { excludeByName: {}, renameByName: {}, indexByName: {} },
    fields: [
      { path: "renameByName", label: "重命名映射（name=显示名）", type: "map" },
      { path: "excludeByName", label: "排除字段（name=true）", type: "map" },
      { path: "indexByName", label: "顺序映射（name=index）", type: "map" }
    ],
    dedicatedEditor: true,
    categories: ["reorderAndRename"],
    tags: ["整理", "列", "排序", "rename", "organize"]
  },
  {
    id: "reduce",
    name: "归约",
    description: "计算 reducer",
    defaultOptions: { reducers: ["lastNotNull"], mode: "seriesToRows" },
    fields: [
      {
        path: "reducers",
        label: "计算方式",
        type: "multi-select",
        options: reducerOpts
      },
      {
        path: "mode",
        label: "模式",
        type: "select",
        options: [
          { label: "序列到行", value: "seriesToRows" },
          { label: "归约字段", value: "reduceFields" }
        ]
      }
    ],
    categories: ["calculateNewFields"],
    tags: ["归约", "reduce"],
    dedicatedEditor: true
  },
  {
    id: "groupBy",
    image: "groupBy",
    name: "分组",
    description: "分组聚合",
    defaultOptions: { fields: {} },
    fields: [{ path: "fields", label: "字段操作（name=op）", type: "map" }],
    dedicatedEditor: true,
    categories: ["combine"],
    tags: ["分组", "聚合", "group"]
  },
  {
    id: "joinByField",
    image: "joinByField",
    name: "按字段连接",
    description: "join frames",
    defaultOptions: { byField: "Time", mode: "outer" },
    fields: [
      { path: "byField", label: "连接字段", type: "string" },
      {
        path: "mode",
        label: "模式",
        type: "select",
        options: [
          { label: "outer", value: "outer" },
          { label: "inner", value: "inner" },
          { label: "outerTabular", value: "outerTabular" }
        ]
      }
    ],
    categories: ["combine"],
    tags: ["连接", "join"],
    dedicatedEditor: true
  },
  {
    id: "seriesToColumns",
    name: "序列转列",
    description: "joinByField 别名",
    defaultOptions: {},
    fields: [],
    aliasOf: "joinByField"
  },
  {
    id: "seriesToRows",
    name: "序列转行",
    description: "Time/Metric/Value",
    defaultOptions: {},
    fields: [],
    dedicatedEditor: true,
    categories: ["reformat"],
    tags: ["行"]
  },
  {
    id: "labelsToFields",
    image: "labelsToFields",
    name: "标签转字段",
    description: "labels → fields",
    defaultOptions: { mode: "columns" },
    fields: [
      {
        path: "mode",
        label: "模式",
        type: "select",
        options: [
          { label: "columns", value: "columns" },
          { label: "rows", value: "rows" }
        ]
      },
      { path: "keepLabels", label: "保留标签（每行）", type: "string[]" }
    ],
    categories: ["reformat"],
    tags: ["标签"],
    dedicatedEditor: true
  },
  {
    id: "renameByRegex",
    name: "正则重命名",
    description: "regex rename",
    defaultOptions: { regex: "(.*)", renamePattern: "$1" },
    fields: [
      { path: "regex", label: "正则", type: "string" },
      { path: "renamePattern", label: "替换", type: "string" }
    ],
    dedicatedEditor: true,
    categories: ["reorderAndRename"],
    tags: ["重命名", "regex"]
  },
  {
    id: "calculateField",
    image: "calculateField",
    name: "计算字段",
    description: "binary/reduce/index/unary",
    defaultOptions: { mode: "binary", alias: "计算" },
    fields: [
      {
        path: "mode",
        label: "模式",
        type: "select",
        options: [
          { label: "binary", value: "binary" },
          { label: "reduceRow", value: "reduceRow" },
          { label: "index", value: "index" },
          { label: "unary", value: "unary" }
        ]
      },
      { path: "alias", label: "别名", type: "string" },
      { path: "binary.left", label: "左操作数", type: "string" },
      { path: "binary.operator", label: "运算符", type: "string" },
      { path: "binary.right", label: "右操作数", type: "string" }
    ],
    categories: ["calculateNewFields"],
    tags: ["计算", "字段", "calculate"],
    dedicatedEditor: true
  },
  {
    id: "histogram",
    name: "直方图",
    description: "value buckets",
    defaultOptions: { bucketCount: 10 },
    fields: [
      { path: "bucketCount", label: "桶数", type: "number" },
      { path: "bucketSize", label: "桶大小", type: "number" },
      { path: "bucketOffset", label: "偏移", type: "number" }
    ],
    dedicatedEditor: true,
    categories: ["createNewVisualization"],
    tags: ["直方"]
  },
  {
    id: "heatmap",
    image: "heatmap",
    name: "热力图",
    description: "x/y buckets",
    defaultOptions: { xBuckets: { value: 10 }, yBuckets: { value: 8 } },
    fields: [
      { path: "xBuckets.value", label: "X 桶", type: "number" },
      { path: "yBuckets.value", label: "Y 桶", type: "number" }
    ],
    dedicatedEditor: true,
    categories: ["createNewVisualization"],
    tags: ["热力"]
  },
  {
    id: "spatial",
    image: "spatial",
    name: "空间",
    description: "距离/坐标",
    defaultOptions: { action: "prepare", source: {} },
    fields: [
      {
        path: "action",
        label: "动作",
        type: "select",
        options: [
          { label: "prepare", value: "prepare" },
          { label: "calculate", value: "calculate" }
        ]
      },
      { path: "source.latField", label: "纬度字段", type: "string" },
      { path: "source.lngField", label: "经度字段", type: "string" }
    ],
    categories: ["performSpatialOperations"],
    tags: ["空间", "geo"],
    dedicatedEditor: true
  },
  {
    id: "timeSeriesTable",
    name: "时间序列表格",
    description: "Metric/Trend 表",
    defaultOptions: {},
    fields: [{ path: "refIdToStat", label: "refId→stat 映射", type: "map" }],
    dedicatedEditor: true
  },
  {
    id: "merge",
    name: "合并",
    description: "merge frames",
    defaultOptions: {},
    fields: [],
    dedicatedEditor: true,
    categories: ["combine"],
    tags: ["合并"]
  },
  {
    id: "concatenate",
    image: "concatenate",
    name: "串接",
    description: "concat fields",
    defaultOptions: { frameNameMode: "label" },
    fields: [
      {
        path: "frameNameMode",
        label: "帧名模式",
        type: "select",
        options: [
          { label: "label", value: "label" },
          { label: "drop", value: "drop" }
        ]
      },
      { path: "frameNameLabel", label: "帧名标签", type: "string" }
    ],
    categories: ["combine"],
    tags: ["拼接"],
    dedicatedEditor: true
  },
  {
    id: "noop",
    name: "空操作",
    description: "no-op",
    defaultOptions: {},
    fields: [],
    hidden: true
  },
  {
    id: "prepareTimeSeries",
    name: "准备时间序列",
    description: "wide/long/multi",
    defaultOptions: { format: "multi" },
    fields: [
      {
        path: "format",
        label: "格式",
        type: "select",
        options: [
          { label: "multi", value: "multi" },
          { label: "wide", value: "wide" },
          { label: "long", value: "long" }
        ]
      }
    ],
    categories: ["reformat"],
    tags: ["时序"],
    dedicatedEditor: true
  },
  {
    id: "convertFieldType",
    image: "convertFieldType",
    name: "转换字段类型",
    description: "type cast",
    defaultOptions: { conversions: [] },
    fields: [
      { path: "conversions.0.targetField", label: "目标字段", type: "string" },
      {
        path: "conversions.0.destinationType",
        label: "目标类型",
        type: "select",
        options: [
          { label: "number", value: "number" },
          { label: "string", value: "string" },
          { label: "time", value: "time" },
          { label: "boolean", value: "boolean" },
          { label: "enum", value: "enum" },
          { label: "other", value: "other" }
        ]
      }
    ],
    categories: ["reformat"],
    tags: ["类型", "转换"],
    dedicatedEditor: true
  },
  {
    id: "formatTime",
    image: "formatTime",
    name: "格式化时间",
    description: "time → string",
    defaultOptions: {
      outputFormat: "YYYY-MM-DD HH:mm:ss",
      timezone: "browser",
      useTimezone: true
    },
    fields: [
      { path: "timeField", label: "时间字段", type: "string" },
      { path: "outputFormat", label: "输出格式", type: "string" },
      { path: "timezone", label: "时区", type: "string" },
      { path: "useTimezone", label: "使用时区", type: "boolean" }
    ],
    dedicatedEditor: true
  },
  {
    id: "formatString",
    name: "格式化字符串",
    description: "string ops",
    defaultOptions: { substring: "toUpperCase" },
    fields: [
      { path: "stringField", label: "字符串字段", type: "string" },
      {
        path: "substring",
        label: "操作",
        type: "select",
        options: [
          { label: "toUpperCase", value: "toUpperCase" },
          { label: "toLowerCase", value: "toLowerCase" },
          { label: "substring", value: "substring" },
          { label: "trim", value: "trim" }
        ]
      },
      { path: "alias", label: "别名", type: "string" }
    ],
    dedicatedEditor: true
  },
  {
    id: "filterByValue",
    image: "filterByValue",
    name: "按值过滤",
    description: "row filter",
    defaultOptions: { type: "include", match: "any", filters: [] },
    fields: [
      {
        path: "type",
        label: "类型",
        type: "select",
        options: [
          { label: "include", value: "include" },
          { label: "exclude", value: "exclude" }
        ]
      },
      {
        path: "match",
        label: "匹配",
        type: "select",
        options: [
          { label: "any", value: "any" },
          { label: "all", value: "all" }
        ]
      },
      { path: "filters.0.fieldName", label: "字段", type: "string" },
      {
        path: "filters.0.config.id",
        label: "比较",
        type: "select",
        options: [
          { label: "equal", value: "equal" },
          { label: "notEqual", value: "notEqual" },
          { label: "greater", value: "greater" },
          { label: "lower", value: "lower" },
          { label: "regex", value: "regex" },
          { label: "isNull", value: "isNull" },
          { label: "isNotNull", value: "isNotNull" }
        ]
      },
      { path: "filters.0.config.options.value", label: "值", type: "string" }
    ],
    categories: ["filter"],
    tags: ["值", "过滤", "filter"],
    dedicatedEditor: true
  },
  {
    id: "partitionByValues",
    image: "partitionByValues",
    name: "按值分区",
    description: "split frames",
    defaultOptions: { fields: [], keepFields: false },
    fields: [
      { path: "fields", label: "字段（每行）", type: "string[]" },
      { path: "keepFields", label: "保留字段", type: "boolean" }
    ],
    dedicatedEditor: true,
    categories: ["reformat"],
    tags: ["分区", "partition"]
  },
  {
    id: "groupToNestedTable",
    name: "分组嵌套表",
    description: "nested table",
    defaultOptions: { fields: {} },
    fields: [{ path: "fields", label: "字段操作（name=op）", type: "map" }],
    dedicatedEditor: true,
    categories: ["createNewVisualization"],
    tags: ["嵌套", "表格"]
  },
  {
    id: "groupingToMatrix",
    name: "分组矩阵",
    description: "matrix",
    defaultOptions: {},
    fields: [
      { path: "columnField", label: "列字段", type: "string" },
      { path: "rowField", label: "行字段", type: "string" },
      { path: "valueField", label: "值字段", type: "string" }
    ],
    dedicatedEditor: true,
    categories: ["createNewVisualization"],
    tags: ["矩阵", "分组"]
  },
  {
    id: "extractFields",
    image: "extractFields",
    name: "提取字段",
    description: "json/regex extract",
    defaultOptions: { format: "auto", replace: true },
    fields: [
      { path: "source", label: "源字段", type: "string" },
      {
        path: "format",
        label: "格式",
        type: "select",
        options: [
          { label: "auto", value: "auto" },
          { label: "json", value: "json" },
          { label: "kvp", value: "kvp" },
          { label: "regexp", value: "regexp" }
        ]
      },
      { path: "replace", label: "替换", type: "boolean" },
      { path: "keepTime", label: "保留时间", type: "boolean" }
    ],
    categories: ["reformat"],
    tags: ["提取", "json", "regexp"],
    dedicatedEditor: true
  },
  {
    id: "joinByLabels",
    name: "按标签连接",
    description: "join labels",
    defaultOptions: {},
    fields: [
      { path: "value", label: "值字段", type: "string" },
      { path: "join", label: "连接标签（每行）", type: "string[]" }
    ],
    dedicatedEditor: true,
    categories: ["combine"],
    tags: ["标签", "join"]
  },
  {
    id: "rowsToFields",
    name: "行转字段",
    description: "rows → fields",
    defaultOptions: { mappings: [] },
    fields: [
      { path: "nameField", label: "名称字段", type: "string" },
      { path: "valueField", label: "值字段", type: "string" },
      { path: "mappings", label: "映射列表", type: "string[]" }
    ],
    dedicatedEditor: true,
    categories: ["reformat"],
    tags: ["字段"]
  },
  {
    id: "configFromData",
    image: "configFromData",
    name: "从数据配置",
    description: "config frame",
    defaultOptions: { configRefId: "config", mappings: [] },
    fields: [
      { path: "configRefId", label: "配置 refId", type: "string" },
      {
        path: "applyTo",
        label: "应用到",
        type: "select",
        options: [
          { label: "all fields", value: "field" },
          { label: "frame", value: "frame" }
        ]
      },
      { path: "mappings", label: "映射列表", type: "string[]" }
    ],
    dedicatedEditor: true
  },
  {
    id: "fieldLookup",
    image: "fieldLookup",
    name: "字段查找",
    description: "gazetteer lookup",
    defaultOptions: {},
    fields: [
      { path: "lookupField", label: "查找字段", type: "string" },
      { path: "gazetteer", label: "地名表", type: "string" }
    ],
    dedicatedEditor: true
  },
  {
    id: "convertFrameType",
    name: "转换 Frame 类型",
    description: "frame type",
    defaultOptions: {},
    fields: [
      {
        path: "targetType",
        label: "目标类型",
        type: "select",
        options: [
          { label: "timeseries-multi", value: "timeseries-multi" },
          { label: "timeseries-wide", value: "timeseries-wide" },
          { label: "timeseries-long", value: "timeseries-long" }
        ]
      }
    ],
    dedicatedEditor: true
  },
  {
    id: "order",
    name: "字段排序",
    description: "order fields",
    defaultOptions: { indexByName: {} },
    fields: [
      { path: "indexByName", label: "字段顺序（name=index）", type: "map" }
    ],
    hidden: true
  },
  {
    id: "rename",
    name: "重命名",
    description: "rename fields",
    defaultOptions: { renameByName: {} },
    fields: [
      { path: "renameByName", label: "重命名映射（name=显示名）", type: "map" }
    ],
    hidden: true
  },
  {
    id: "append",
    name: "追加",
    description: "append frames",
    defaultOptions: {},
    fields: [],
    hidden: true
  },
  {
    id: "filterFields",
    name: "过滤字段",
    description: "matcher filter fields",
    defaultOptions: {},
    fields: [
      { path: "include.names", label: "包含名称（每行）", type: "string[]" }
    ],
    hidden: true
  },
  {
    id: "filterFrames",
    name: "过滤 Frame",
    description: "matcher filter frames",
    defaultOptions: {},
    fields: [{ path: "include.pattern", label: "包含模式", type: "string" }],
    hidden: true
  },
  {
    id: "ensureColumns",
    name: "确保列式",
    description: "wide normalize",
    defaultOptions: {},
    fields: [],
    dedicatedEditor: true
  },
  {
    id: "regression",
    image: "regression",
    name: "回归",
    description: "linear/polynomial regression",
    defaultOptions: { modelType: "linear", predictionCount: 0 },
    fields: [
      {
        path: "modelType",
        label: "模型",
        type: "select",
        options: [
          { label: "linear", value: "linear" },
          { label: "polynomial", value: "polynomial" }
        ]
      },
      { path: "xFieldName", label: "X 字段", type: "string" },
      { path: "yFieldName", label: "Y 字段", type: "string" },
      { path: "predictionCount", label: "预测点数", type: "number" }
    ],
    dedicatedEditor: true
  },
  {
    id: "smoothing",
    image: "smoothing",
    name: "平滑",
    description: "moving average",
    defaultOptions: { windowSize: 3 },
    fields: [
      { path: "windowSize", label: "窗口", type: "number" },
      { path: "field", label: "字段", type: "string" }
    ],
    dedicatedEditor: true
  },
  {
    id: "transpose",
    image: "transpose",
    name: "转置",
    description: "transpose",
    defaultOptions: { firstFieldName: "Field" },
    fields: [{ path: "firstFieldName", label: "首列名称", type: "string" }],
    dedicatedEditor: true
  }
];
function getTransformerMeta(id) {
  return transformerRegistry.find((t2) => t2.id === id);
}
const TRANSFORMER_CATEGORY_LABELS = {
  all: "查看全部",
  combine: "组合",
  calculateNewFields: "计算新字段",
  createNewVisualization: "生成新可视化",
  filter: "过滤",
  performSpatialOperations: "空间操作",
  reformat: "重整格式",
  reorderAndRename: "重排与重命名"
};
function filterTransformers(opts) {
  const q = (opts.query || "").trim().toLowerCase();
  const cat = opts.category || "all";
  return transformerRegistry.filter((t2) => {
    if (!opts.includeHidden && (t2.hidden || t2.aliasOf)) return false;
    if (cat !== "all" && !(t2.categories || []).includes(cat)) return false;
    if (!q) return true;
    const hay = [t2.id, t2.name, t2.description, ...t2.tags || []].join(" ").toLowerCase();
    return hay.includes(q);
  });
}
const _hoisted_1$1r = {
  class: "registry-fields",
  "data-testid": "transform-registry-fields",
  "data-editor-mode": "registry"
};
const _hoisted_2$18 = {
  key: 0,
  class: "no-opts",
  "data-testid": "transform-no-options"
};
const _hoisted_3$Z = ["data-field-path", "data-field-type"];
const _hoisted_4$M = {
  key: 0,
  class: "desc"
};
const _hoisted_5$G = ["value", "onChange"];
const _hoisted_6$z = ["value", "onChange"];
const _sfc_main$1w = /* @__PURE__ */ defineComponent({
  __name: "RegistryFieldsEditor",
  props: {
    fields: {},
    options: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function optionVal(path) {
      const parts = path.split(".");
      let cur = props.options ?? {};
      for (const p of parts) {
        if (cur == null) return void 0;
        cur = cur[p];
      }
      return cur;
    }
    function mapToLines(v) {
      if (!v || typeof v !== "object" || Array.isArray(v)) return "";
      return Object.entries(v).map(([k, val]) => `${k}=${val}`).join("\n");
    }
    function linesToMap(raw) {
      const out = {};
      for (const line of raw.split("\n")) {
        const s = line.trim();
        if (!s) continue;
        const eq = s.indexOf("=");
        if (eq < 0) out[s] = "";
        else out[s.slice(0, eq).trim()] = s.slice(eq + 1).trim();
      }
      return out;
    }
    function listToLines(v) {
      if (Array.isArray(v)) return v.map(String).join("\n");
      if (typeof v === "string") return v;
      return "";
    }
    function linesToList(raw) {
      return raw.split("\n").map((s) => s.trim()).filter(Boolean);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1r, [
        !__props.fields.length ? (openBlock(), createElementBlock("p", _hoisted_2$18, " 此转换无需额外选项 ")) : createCommentVNode("v-if", true),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.fields, (f) => {
            return openBlock(), createElementBlock("label", {
              key: f.path,
              "data-field-path": f.path,
              "data-field-type": f.type
            }, [
              createTextVNode(
                toDisplayString(f.label) + " ",
                1
                /* TEXT */
              ),
              f.description ? (openBlock(), createElementBlock(
                "small",
                _hoisted_4$M,
                toDisplayString(f.description),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              f.type === "boolean" ? (openBlock(), createBlock(unref(_sfc_main$4v), {
                key: 1,
                checked: Boolean(optionVal(f.path)),
                "onUpdate:checked": ($event) => emit("change", f.path, $event)
              }, null, 8, ["checked", "onUpdate:checked"])) : f.type === "select" ? (openBlock(), createBlock(unref(GSelect), {
                key: 2,
                value: optionVal(f.path),
                options: f.options ?? [],
                onChange: ($event) => emit("change", f.path, $event)
              }, null, 8, ["value", "options", "onChange"])) : f.type === "multi-select" ? (openBlock(), createBlock(unref(GSelect), {
                key: 3,
                mode: "multiple",
                value: Array.isArray(optionVal(f.path)) ? optionVal(f.path) : optionVal(f.path) != null ? [optionVal(f.path)] : [],
                options: f.options ?? [],
                onChange: ($event) => emit("change", f.path, $event)
              }, null, 8, ["value", "options", "onChange"])) : f.type === "number" ? (openBlock(), createBlock(unref(GInput), {
                key: 4,
                type: "number",
                value: optionVal(f.path) == null ? "" : String(optionVal(f.path)),
                "onUpdate:value": ($event) => emit("change", f.path, $event === "" ? void 0 : Number($event))
              }, null, 8, ["value", "onUpdate:value"])) : f.type === "string[]" ? (openBlock(), createElementBlock("textarea", {
                key: 5,
                class: "map-lines",
                rows: "3",
                value: listToLines(optionVal(f.path)),
                onChange: ($event) => emit(
                  "change",
                  f.path,
                  linesToList($event.target.value)
                )
              }, null, 40, _hoisted_5$G)) : f.type === "map" ? (openBlock(), createElementBlock("textarea", {
                key: 6,
                class: "map-lines",
                rows: "4",
                "data-testid": "transform-map-field",
                value: mapToLines(optionVal(f.path)),
                onChange: ($event) => emit(
                  "change",
                  f.path,
                  linesToMap($event.target.value)
                )
              }, null, 40, _hoisted_6$z)) : (openBlock(), createBlock(unref(GInput), {
                key: 7,
                value: optionVal(f.path) == null ? "" : String(optionVal(f.path)),
                "onUpdate:value": ($event) => emit("change", f.path, $event)
              }, null, 8, ["value", "onUpdate:value"]))
            ], 8, _hoisted_3$Z);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const RegistryFieldsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1w, [["__scopeId", "data-v-f5255e41"]]);
const _hoisted_1$1q = {
  class: "organize-editor",
  "data-testid": "transform-editor-organize",
  "data-dedicated": "true"
};
const _hoisted_2$17 = { class: "ex" };
const _sfc_main$1v = /* @__PURE__ */ defineComponent({
  __name: "OrganizeFieldsEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const rows = ref([]);
    function syncFromOptions() {
      const rename = props.options?.renameByName || {};
      const exclude = props.options?.excludeByName || {};
      const index2 = props.options?.indexByName || {};
      const names = /* @__PURE__ */ new Set([
        ...Object.keys(rename),
        ...Object.keys(exclude),
        ...Object.keys(index2)
      ]);
      if (!names.size) names.add("");
      const list = [...names].map((n) => ({
        name: n,
        rename: rename[n] || "",
        exclude: !!exclude[n]
      }));
      list.sort((a, b) => (index2[a.name] ?? 999) - (index2[b.name] ?? 999));
      rows.value = list;
    }
    watch(() => props.options, syncFromOptions, { immediate: true, deep: true });
    function emitAll() {
      const renameByName = {};
      const excludeByName = {};
      const indexByName = {};
      rows.value.forEach((r, i) => {
        if (!r.name) return;
        if (r.rename) renameByName[r.name] = r.rename;
        if (r.exclude) excludeByName[r.name] = true;
        indexByName[r.name] = i;
      });
      emit("change", "renameByName", renameByName);
      emit("change", "excludeByName", excludeByName);
      emit("change", "indexByName", indexByName);
    }
    function addRow() {
      rows.value.push({ name: "", rename: "", exclude: false });
    }
    function removeRow(i) {
      rows.value.splice(i, 1);
      emitAll();
    }
    function move(i, dir) {
      const j = i + dir;
      if (j < 0 || j >= rows.value.length) return;
      const tmp = rows.value[i];
      rows.value[i] = rows.value[j];
      rows.value[j] = tmp;
      emitAll();
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1q, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (r, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row"
            }, [
              createVNode(unref(GInput), {
                value: r.name,
                placeholder: "字段名",
                "onUpdate:value": (v) => {
                  r.name = String(v);
                  emitAll();
                }
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GInput), {
                value: r.rename,
                placeholder: "重命名",
                "onUpdate:value": (v) => {
                  r.rename = String(v);
                  emitAll();
                }
              }, null, 8, ["value", "onUpdate:value"]),
              createElementVNode("label", _hoisted_2$17, [
                createVNode(unref(_sfc_main$4v), {
                  checked: r.exclude,
                  "onUpdate:checked": (v) => {
                    r.exclude = v;
                    emitAll();
                  }
                }, null, 8, ["checked", "onUpdate:checked"]),
                _cache[0] || (_cache[0] = createTextVNode(
                  " 隐藏",
                  -1
                  /* CACHED */
                ))
              ]),
              createVNode(unref(GButton), {
                size: "sm",
                disabled: i === 0,
                onClick: ($event) => move(i, -1)
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "↑",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["disabled", "onClick"]),
              createVNode(unref(GButton), {
                size: "sm",
                disabled: i === rows.value.length - 1,
                onClick: ($event) => move(i, 1)
              }, {
                default: withCtx(() => [..._cache[2] || (_cache[2] = [
                  createTextVNode(
                    "↓",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["disabled", "onClick"]),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "destructive",
                onClick: ($event) => removeRow(i)
              }, {
                default: withCtx(() => [..._cache[3] || (_cache[3] = [
                  createTextVNode(
                    "删",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          onClick: addRow
        }, {
          default: withCtx(() => [..._cache[4] || (_cache[4] = [
            createTextVNode(
              "添加字段",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const OrganizeFieldsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1v, [["__scopeId", "data-v-ad181d15"]]);
const _hoisted_1$1p = {
  class: "fbv-editor",
  "data-testid": "transform-editor-filterByValue",
  "data-dedicated": "true"
};
const _hoisted_2$16 = { class: "row" };
const _sfc_main$1u = /* @__PURE__ */ defineComponent({
  __name: "FilterByValueEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const typeOpts = [
      { label: "包含", value: "include" },
      { label: "排除", value: "exclude" }
    ];
    const matchOpts = [
      { label: "任一", value: "any" },
      { label: "全部", value: "all" }
    ];
    const cmpOpts = [
      { label: "等于", value: "equal" },
      { label: "不等于", value: "notEqual" },
      { label: "大于", value: "greater" },
      { label: "小于", value: "lower" },
      { label: "正则", value: "regex" },
      { label: "为空", value: "isNull" },
      { label: "非空", value: "isNotNull" }
    ];
    const filters = computed(() => {
      const f = props.options?.filters;
      return Array.isArray(f) ? f : [];
    });
    function setType(v) {
      emit("change", "type", v);
    }
    function setMatch(v) {
      emit("change", "match", v);
    }
    function updateFilter(i, patch) {
      const next = filters.value.map(
        (x, idx) => idx === i ? { ...x, ...patch } : { ...x }
      );
      if (patch.config) {
        next[i] = {
          ...next[i],
          config: {
            ...filters.value[i]?.config || {},
            ...patch.config
          }
        };
      }
      emit("change", "filters", next);
    }
    function addFilter() {
      emit("change", "filters", [
        ...filters.value,
        { fieldName: "", config: { id: "equal", options: { value: "" } } }
      ]);
    }
    function removeFilter(i) {
      emit(
        "change",
        "filters",
        filters.value.filter((_, idx) => idx !== i)
      );
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1p, [
        createElementVNode("div", _hoisted_2$16, [
          createElementVNode("label", null, [
            _cache[0] || (_cache[0] = createTextVNode(
              "类型 ",
              -1
              /* CACHED */
            )),
            createVNode(unref(GSelect), {
              value: __props.options.type || "include",
              options: typeOpts,
              onChange: setType
            }, null, 8, ["value"])
          ]),
          createElementVNode("label", null, [
            _cache[1] || (_cache[1] = createTextVNode(
              "匹配 ",
              -1
              /* CACHED */
            )),
            createVNode(unref(GSelect), {
              value: __props.options.match || "any",
              options: matchOpts,
              onChange: setMatch
            }, null, 8, ["value"])
          ])
        ]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(filters.value, (f, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "filter"
            }, [
              createVNode(unref(GInput), {
                value: f.fieldName || "",
                placeholder: "字段",
                "onUpdate:value": (v) => updateFilter(i, { fieldName: String(v) })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GSelect), {
                value: f.config?.id || "equal",
                options: cmpOpts,
                onChange: (v) => updateFilter(i, {
                  config: { id: v, options: f.config?.options || {} }
                })
              }, null, 8, ["value", "onChange"]),
              createVNode(unref(GInput), {
                value: f.config?.options?.value ?? "",
                placeholder: "值",
                "onUpdate:value": (v) => updateFilter(i, {
                  config: { id: f.config?.id || "equal", options: { value: v } }
                })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "destructive",
                onClick: ($event) => removeFilter(i)
              }, {
                default: withCtx(() => [..._cache[2] || (_cache[2] = [
                  createTextVNode(
                    "删",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          onClick: addFilter
        }, {
          default: withCtx(() => [..._cache[3] || (_cache[3] = [
            createTextVNode(
              "添加条件",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const FilterByValueEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1u, [["__scopeId", "data-v-723ec2af"]]);
const _hoisted_1$1o = {
  class: "calc-editor",
  "data-testid": "transform-editor-calculateField",
  "data-dedicated": "true"
};
const _hoisted_2$15 = { class: "row" };
const _hoisted_3$Y = { key: 2 };
const _hoisted_4$L = { key: 4 };
const _hoisted_5$F = {
  key: 5,
  class: "hint"
};
const _sfc_main$1t = /* @__PURE__ */ defineComponent({
  __name: "CalculateFieldEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const modes = [
      { label: "两字段运算", value: "binary" },
      { label: "一元运算", value: "unary" },
      { label: "行归约", value: "reduceRow" },
      { label: "累计", value: "cumulative" },
      { label: "窗口", value: "window" },
      { label: "行索引", value: "index" }
    ];
    const ops = [
      { label: "+", value: "+" },
      { label: "-", value: "-" },
      { label: "*", value: "*" },
      { label: "/", value: "/" }
    ];
    const unaryOps = [
      { label: "abs", value: "abs" },
      { label: "exp", value: "exp" },
      { label: "ln", value: "ln" },
      { label: "floor", value: "floor" },
      { label: "ceil", value: "ceil" }
    ];
    const mode2 = computed(() => String(props.options.mode || "binary"));
    const binary = computed(() => props.options.binary || {});
    const unary = computed(() => props.options.unary || {});
    function set(path, v) {
      emit("change", path, v);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1o, [
        createElementVNode("label", null, [
          _cache[12] || (_cache[12] = createTextVNode(
            "模式 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: mode2.value,
            options: modes,
            onChange: _cache[0] || (_cache[0] = (v) => set("mode", v))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", null, [
          _cache[13] || (_cache[13] = createTextVNode(
            "别名 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.options.alias ?? ""),
            "onUpdate:value": _cache[1] || (_cache[1] = (v) => set("alias", v))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_2$15, [
          createVNode(unref(_sfc_main$4v), {
            checked: !!__props.options.replaceFields,
            "onUpdate:checked": _cache[2] || (_cache[2] = (v) => set("replaceFields", v))
          }, null, 8, ["checked"]),
          _cache[14] || (_cache[14] = createTextVNode(
            " 替换所有字段",
            -1
            /* CACHED */
          ))
        ]),
        mode2.value === "binary" ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createElementVNode("label", null, [
              _cache[15] || (_cache[15] = createTextVNode(
                "左 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                value: String(binary.value.left ?? ""),
                "onUpdate:value": _cache[3] || (_cache[3] = (v) => set("binary.left", v))
              }, null, 8, ["value"])
            ]),
            createElementVNode("label", null, [
              _cache[16] || (_cache[16] = createTextVNode(
                "运算符 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                value: String(binary.value.operator ?? "+"),
                options: ops,
                onChange: _cache[4] || (_cache[4] = (v) => set("binary.operator", v))
              }, null, 8, ["value"])
            ]),
            createElementVNode("label", null, [
              _cache[17] || (_cache[17] = createTextVNode(
                "右 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                value: String(binary.value.right ?? ""),
                "onUpdate:value": _cache[5] || (_cache[5] = (v) => set("binary.right", v))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : mode2.value === "unary" ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createElementVNode("label", null, [
              _cache[18] || (_cache[18] = createTextVNode(
                "字段 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                value: String(unary.value.fieldName ?? ""),
                "onUpdate:value": _cache[6] || (_cache[6] = (v) => set("unary.fieldName", v))
              }, null, 8, ["value"])
            ]),
            createElementVNode("label", null, [
              _cache[19] || (_cache[19] = createTextVNode(
                "运算符 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                value: String(unary.value.operator ?? "abs"),
                options: unaryOps,
                onChange: _cache[7] || (_cache[7] = (v) => set("unary.operator", v))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : mode2.value === "reduceRow" ? (openBlock(), createElementBlock("label", _hoisted_3$Y, [
          _cache[20] || (_cache[20] = createTextVNode(
            "归约器 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.options.reduce?.reducer ?? "sum"),
            "onUpdate:value": _cache[8] || (_cache[8] = (v) => set("reduce.reducer", v))
          }, null, 8, ["value"])
        ])) : mode2.value === "cumulative" ? (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            createElementVNode("label", null, [
              _cache[21] || (_cache[21] = createTextVNode(
                "字段 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                value: String(__props.options.cumulative?.fieldName ?? ""),
                "onUpdate:value": _cache[9] || (_cache[9] = (v) => set("cumulative.fieldName", v))
              }, null, 8, ["value"])
            ]),
            createElementVNode("label", null, [
              _cache[22] || (_cache[22] = createTextVNode(
                "归约器 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                value: String(__props.options.cumulative?.reducer ?? "sum"),
                options: [
                  { label: "sum", value: "sum" },
                  { label: "mean", value: "mean" },
                  { label: "max", value: "max" },
                  { label: "min", value: "min" }
                ],
                onChange: _cache[10] || (_cache[10] = (v) => set("cumulative.reducer", v))
              }, null, 8, ["value"])
            ])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : mode2.value === "window" ? (openBlock(), createElementBlock("label", _hoisted_4$L, [
          _cache[23] || (_cache[23] = createTextVNode(
            "窗口大小 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            type: "number",
            value: Number(__props.options.window?.windowSize ?? 10),
            "onUpdate:value": _cache[11] || (_cache[11] = (v) => set("window.windowSize", Number(v)))
          }, null, 8, ["value"])
        ])) : mode2.value === "index" ? (openBlock(), createElementBlock("p", _hoisted_5$F, "生成从 0 开始的行索引列")) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const CalculateFieldEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1t, [["__scopeId", "data-v-17eb62e4"]]);
const _hoisted_1$1n = {
  class: "groupby-editor",
  "data-testid": "transform-editor-groupBy",
  "data-dedicated": "true"
};
const _sfc_main$1s = /* @__PURE__ */ defineComponent({
  __name: "GroupByEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const calcOpts = [
      { label: "最后非空", value: "lastNotNull" },
      { label: "平均", value: "mean" },
      { label: "合计", value: "sum" },
      { label: "最小", value: "min" },
      { label: "最大", value: "max" },
      { label: "计数", value: "count" }
    ];
    const opOpts = [
      { label: "分组依据", value: "groupby" },
      { label: "计算", value: "aggregate" },
      { label: "忽略", value: "ignore" }
    ];
    const rows = ref([]);
    function sync() {
      const fields = props.options.fields || {};
      const keys = Object.keys(fields);
      rows.value = keys.length ? keys.map((n) => ({
        name: n,
        op: fields[n]?.operation || fields[n] || "ignore",
        calcs: Array.isArray(fields[n]?.aggregations) ? fields[n].aggregations : []
      })) : [{ name: "", op: "groupby", calcs: [] }];
    }
    watch(() => props.options, sync, { immediate: true, deep: true });
    function emitAll() {
      const fields = {};
      for (const r of rows.value) {
        if (!r.name) continue;
        if (r.op === "aggregate")
          fields[r.name] = { operation: "aggregate", aggregations: r.calcs };
        else fields[r.name] = { operation: r.op };
      }
      emit("change", "fields", fields);
    }
    function add() {
      rows.value.push({ name: "", op: "ignore", calcs: [] });
    }
    function remove(i) {
      rows.value.splice(i, 1);
      emitAll();
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1n, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (r, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row"
            }, [
              createVNode(unref(GInput), {
                value: r.name,
                placeholder: "字段名",
                "onUpdate:value": (v) => {
                  r.name = String(v);
                  emitAll();
                }
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GSelect), {
                value: r.op,
                options: opOpts,
                onChange: (v) => {
                  r.op = v;
                  emitAll();
                }
              }, null, 8, ["value", "onChange"]),
              r.op === "aggregate" ? (openBlock(), createBlock(unref(GSelect), {
                key: 0,
                mode: "multiple",
                value: r.calcs,
                options: calcOpts,
                onChange: (v) => {
                  r.calcs = (Array.isArray(v) ? v : [v]).map(String);
                  emitAll();
                }
              }, null, 8, ["value", "onChange"])) : createCommentVNode("v-if", true),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "destructive",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[0] || (_cache[0] = [
                  createTextVNode(
                    "删",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              "添加字段",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const GroupByEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$1s, [["__scopeId", "data-v-fe0022e9"]]);
const _hoisted_1$1m = {
  class: "join-editor",
  "data-testid": "transform-editor-joinByField",
  "data-dedicated": "true"
};
const _sfc_main$1r = /* @__PURE__ */ defineComponent({
  __name: "JoinByFieldEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const modes = [
      { label: "outer", value: "outer" },
      { label: "outerTabular", value: "outerTabular" },
      { label: "inner", value: "inner" }
    ];
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1m, [
        createElementVNode("label", null, [
          _cache[2] || (_cache[2] = createTextVNode(
            "连接字段 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.options.byField ?? "Time"),
            "onUpdate:value": _cache[0] || (_cache[0] = (v) => emit("change", "byField", v))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", null, [
          _cache[3] || (_cache[3] = createTextVNode(
            "模式 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: String(__props.options.mode ?? "outer"),
            options: modes,
            onChange: _cache[1] || (_cache[1] = (v) => emit("change", "mode", v))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const JoinByFieldEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1r, [["__scopeId", "data-v-6c5fb035"]]);
const _hoisted_1$1l = {
  class: "extract-editor",
  "data-testid": "transform-editor-extractFields",
  "data-dedicated": "true"
};
const _hoisted_2$14 = { key: 0 };
const _hoisted_3$X = { class: "row" };
const _hoisted_4$K = { class: "row" };
const _sfc_main$1q = /* @__PURE__ */ defineComponent({
  __name: "ExtractFieldsEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const formats = [
      { label: "auto", value: "auto" },
      { label: "json", value: "json" },
      { label: "kvp", value: "kvp" },
      { label: "regexp", value: "regexp" }
    ];
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1l, [
        createElementVNode("label", null, [
          _cache[5] || (_cache[5] = createTextVNode(
            "源字段 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.options.source ?? ""),
            "onUpdate:value": _cache[0] || (_cache[0] = (v) => emit("change", "source", v))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", null, [
          _cache[6] || (_cache[6] = createTextVNode(
            "格式 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: String(__props.options.format ?? "auto"),
            options: formats,
            onChange: _cache[1] || (_cache[1] = (v) => emit("change", "format", v))
          }, null, 8, ["value"])
        ]),
        String(__props.options.format) === "regexp" ? (openBlock(), createElementBlock("label", _hoisted_2$14, [
          _cache[7] || (_cache[7] = createTextVNode(
            "正则 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.options.regExp ?? __props.options.regexp ?? ""),
            "onUpdate:value": _cache[2] || (_cache[2] = (v) => emit("change", "regExp", v))
          }, null, 8, ["value"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("label", _hoisted_3$X, [
          createVNode(unref(_sfc_main$4v), {
            checked: __props.options.replace !== false,
            "onUpdate:checked": _cache[3] || (_cache[3] = (v) => emit("change", "replace", v))
          }, null, 8, ["checked"]),
          _cache[8] || (_cache[8] = createTextVNode(
            " 替换",
            -1
            /* CACHED */
          ))
        ]),
        createElementVNode("label", _hoisted_4$K, [
          createVNode(unref(_sfc_main$4v), {
            checked: !!__props.options.keepTime,
            "onUpdate:checked": _cache[4] || (_cache[4] = (v) => emit("change", "keepTime", v))
          }, null, 8, ["checked"]),
          _cache[9] || (_cache[9] = createTextVNode(
            " 保留时间",
            -1
            /* CACHED */
          ))
        ])
      ]);
    };
  }
});
const ExtractFieldsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1q, [["__scopeId", "data-v-067a686d"]]);
const _hoisted_1$1k = {
  class: "cft-editor",
  "data-testid": "transform-editor-convertFieldType",
  "data-dedicated": "true"
};
const _sfc_main$1p = /* @__PURE__ */ defineComponent({
  __name: "ConvertFieldTypeEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const typeOpts = [
      { label: "number", value: "number" },
      { label: "string", value: "string" },
      { label: "time", value: "time" },
      { label: "boolean", value: "boolean" },
      { label: "enum", value: "enum" },
      { label: "other", value: "other" }
    ];
    const rows = ref([]);
    function sync() {
      const c = props.options.conversions;
      rows.value = Array.isArray(c) && c.length ? c.map((x) => ({ ...x })) : [{ targetField: "", destinationType: "string" }];
    }
    watch(() => props.options, sync, { immediate: true, deep: true });
    function emitAll() {
      emit(
        "change",
        "conversions",
        rows.value.map((r) => ({ ...r }))
      );
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1k, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (r, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "row"
            }, [
              createVNode(unref(GInput), {
                value: r.targetField,
                placeholder: "字段",
                "onUpdate:value": (v) => {
                  r.targetField = String(v);
                  emitAll();
                }
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GSelect), {
                value: r.destinationType,
                options: typeOpts,
                onChange: (v) => {
                  r.destinationType = String(v);
                  emitAll();
                }
              }, null, 8, ["value", "onChange"]),
              r.destinationType === "time" ? (openBlock(), createBlock(unref(GInput), {
                key: 0,
                value: r.dateFormat || "",
                placeholder: "时间格式",
                "onUpdate:value": (v) => {
                  r.dateFormat = String(v);
                  emitAll();
                }
              }, null, 8, ["value", "onUpdate:value"])) : createCommentVNode("v-if", true),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "destructive",
                onClick: ($event) => {
                  rows.value.splice(i, 1);
                  emitAll();
                }
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "删",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          onClick: _cache[0] || (_cache[0] = ($event) => rows.value.push({ targetField: "", destinationType: "string" }))
        }, {
          default: withCtx(() => [..._cache[2] || (_cache[2] = [
            createTextVNode(
              "添加转换",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ConvertFieldTypeEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1p, [["__scopeId", "data-v-f7483de3"]]);
const _hoisted_1$1j = {
  class: "part-editor",
  "data-testid": "transform-editor-partitionByValues",
  "data-dedicated": "true"
};
const _hoisted_2$13 = { class: "row" };
const _sfc_main$1o = /* @__PURE__ */ defineComponent({
  __name: "PartitionByValuesEditor",
  props: {
    options: {},
    fields: {},
    transformId: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const fieldsStr = computed(() => {
      const f = props.options.fields;
      return Array.isArray(f) ? f.join(", ") : String(f ?? "");
    });
    const naming = [
      { label: "asLabels", value: "asLabels" },
      { label: "frameName", value: "frameName" }
    ];
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1j, [
        createElementVNode("label", null, [
          _cache[3] || (_cache[3] = createTextVNode(
            "字段（逗号分隔） ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: fieldsStr.value,
            placeholder: "fieldA, fieldB",
            "onUpdate:value": _cache[0] || (_cache[0] = (v) => emit(
              "change",
              "fields",
              String(v).split(",").map((s) => s.trim()).filter(Boolean)
            ))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", null, [
          _cache[4] || (_cache[4] = createTextVNode(
            "命名方式 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: String(
              __props.options.naming?.asLabels !== false ? "asLabels" : "frameName"
            ),
            options: naming,
            onChange: _cache[1] || (_cache[1] = (v) => emit("change", "naming", { asLabels: v === "asLabels" }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_2$13, [
          createVNode(unref(_sfc_main$4v), {
            checked: !!__props.options.keepFields,
            "onUpdate:checked": _cache[2] || (_cache[2] = (v) => emit("change", "keepFields", v))
          }, null, 8, ["checked"]),
          _cache[5] || (_cache[5] = createTextVNode(
            " 保留字段 ",
            -1
            /* CACHED */
          ))
        ])
      ]);
    };
  }
});
const PartitionByValuesEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1o, [["__scopeId", "data-v-0d825e8b"]]);
function makeDedicated(id) {
  return defineComponent({
    name: `TransformEditor_${id}`,
    props: {
      options: { type: Object, required: true },
      fields: { type: Array, required: true },
      transformId: { type: String, required: true }
    },
    emits: ["change"],
    setup(props, { emit }) {
      return () => h(
        "div",
        {
          class: "dedicated-transform-editor",
          "data-testid": `transform-editor-${id}`,
          "data-dedicated": "true",
          "data-transform-id": id
        },
        [
          h(RegistryFieldsEditor, {
            fields: props.fields,
            options: props.options,
            onChange: (path, value) => emit("change", path, value)
          })
        ]
      );
    }
  });
}
const cache = /* @__PURE__ */ new Map();
const SPECIAL = {
  organize: OrganizeFieldsEditor,
  filterByValue: FilterByValueEditor,
  calculateField: CalculateFieldEditor,
  groupBy: GroupByEditor$1,
  joinByField: JoinByFieldEditor,
  extractFields: ExtractFieldsEditor,
  convertFieldType: ConvertFieldTypeEditor,
  partitionByValues: PartitionByValuesEditor
};
function loadTransformEditor(id) {
  const meta2 = getTransformerMeta(id);
  const resolved = meta2?.aliasOf || id;
  if (cache.has(resolved)) return cache.get(resolved);
  const comp = SPECIAL[resolved] || makeDedicated(resolved);
  cache.set(resolved, comp);
  cache.set(id, comp);
  return comp;
}
const __vite_glob_0_0 = "data:image/svg+xml,%3csvg%20width='101'%20height='48'%20viewBox='0%200%20101%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H31V0H1.29545C0.951872%200%200.62237%200.109659%200.379427%200.304853C0.136484%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162225)'/%3e%3cpath%20d='M31%2017H0V48H31V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M17%2029.5H15.0954L13%2030.7266V32.3984L14.9004%2031.3047H14.9502V37.5H17V29.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M66%200H35V13H66V0Z'%20fill='url(%23paint1_linear_1144_162225)'/%3e%3cpath%20d='M66%2017H35V48H66V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48.1164%2037.5H54V35.9624H50.7788V35.9123L51.7296%2035.0414C53.4528%2033.5501%2053.903%2032.7909%2053.903%2031.8854C53.903%2030.4634%2052.7348%2029.5%2050.9301%2029.5C49.1721%2029.5%2047.9961%2030.5058%2048%2032.1127H49.8202C49.8202%2031.3998%2050.2626%2030.9875%2050.9224%2030.9875C51.5705%2030.9875%2052.0401%2031.3844%2052.0401%2032.0356C52.0401%2032.6252%2051.6675%2033.026%2051.0155%2033.6079L48.1164%2036.1281V37.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M70%2013H101V1.04083C101%200.764787%20100.864%200.500047%20100.621%200.304853C100.378%200.109659%20100.048%200%2099.7046%200L70%200V13Z'%20fill='url(%23paint2_linear_1144_162225)'/%3e%3cpath%20d='M101%2017H70V48H101V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M78%2029H76.0954L74%2030.2266V31.8984L75.9004%2030.8047H75.9502V37H78V29Z'%20fill='%2324292E'/%3e%3cpath%20d='M90.1164%2037H96V35.4624H92.7788V35.4123L93.7296%2034.5414C95.4528%2033.0501%2095.903%2032.2909%2095.903%2031.3854C95.903%2029.9634%2094.7348%2029%2092.9301%2029C91.1721%2029%2089.9961%2030.0058%2090%2031.6127H91.8202C91.8202%2030.8998%2092.2626%2030.4875%2092.9224%2030.4875C93.5705%2030.4875%2094.0401%2030.8844%2094.0401%2031.5356C94.0401%2032.1252%2093.6675%2032.526%2093.0155%2033.1079L90.1164%2035.6281V37Z'%20fill='%2324292E'/%3e%3cpath%20d='M83.7432%2036H85.2568V34.2568H87V32.7432H85.2568V31H83.7432V32.7432H82V34.2568H83.7432V36Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162225'%20x1='0'%20y1='6.5052'%20x2='31'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162225'%20x1='35'%20y1='6.5052'%20x2='66.013'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162225'%20x1='70'%20y1='6.5052'%20x2='101'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_1 = "data:image/svg+xml,%3csvg%20width='158'%20height='48'%20viewBox='0%200%20158%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_161721)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200%200%200%200C0%200%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_161721)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M27.3343%2030H30.674V25.674H35V22.3343H30.674V18H27.3343V22.3343H23V25.674H27.3343V30Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1144_161721)'%3e%3cpath%20d='M58%2026.5H43V39.5H58V26.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M43%2010.0408V22H58V9H43.6268C43.4606%209%2043.3011%209.10966%2043.1836%209.30485C43.066%209.50005%2043%209.76479%2043%2010.0408Z'%20fill='url(%23paint1_linear_1144_161721)'/%3e%3cpath%20d='M51.5%2030H50.0716L48.5%2030.9199V32.1738L49.9253%2031.3535H49.9627V36H51.5V30Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1144_161721)'%3e%3cpath%20d='M77%2026.5H62V39.5H77V26.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%2022H77V10.0408C77%209.76479%2076.934%209.50005%2076.8164%209.30485C76.6989%209.10966%2076.5394%209%2076.3732%209H62V22Z'%20fill='url(%23paint2_linear_1144_161721)'/%3e%3cpath%20d='M67.3373%2036H71.75V34.8468H69.3341V34.8092L70.0472%2034.1561C71.3396%2033.0376%2071.6772%2032.4682%2071.6772%2031.789C71.6772%2030.7225%2070.8011%2030%2069.4476%2030C68.129%2030%2067.2471%2030.7543%2067.25%2031.9595H68.6151C68.6151%2031.4249%2068.947%2031.1156%2069.4418%2031.1156C69.9279%2031.1156%2070.2801%2031.4133%2070.2801%2031.9017C70.2801%2032.3439%2070.0006%2032.6445%2069.5116%2033.0809L67.3373%2034.9711V36Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M85%2028.566H97V25.2034H85V28.566ZM85%2022.7966H97V19.434H85V22.7966Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip3_1144_161721)'%3e%3cpath%20d='M105%201.04083V13H120V0H105.627C105.461%200%20105.301%200.109659%20105.184%200.304853C105.066%200.500047%20105%200.764787%20105%201.04083Z'%20fill='url(%23paint3_linear_1144_161721)'/%3e%3cpath%20d='M120%2017.5H105V30.5H120V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M120%2035H105V48H120V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110.337%2044.5H114.75V43.3468H112.334V43.3092L113.047%2042.6561C114.34%2041.5376%20114.677%2040.9682%20114.677%2040.289C114.677%2039.2225%20113.801%2038.5%20112.448%2038.5C111.129%2038.5%20110.247%2039.2543%20110.25%2040.4595H111.615C111.615%2039.9249%20111.947%2039.6156%20112.442%2039.6156C112.928%2039.6156%20113.28%2039.9133%20113.28%2040.4017C113.28%2040.8439%20113.001%2041.1445%20112.512%2041.5809L110.337%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2021H112.072L110.5%2021.9199V23.1738L111.925%2022.3535H111.963V27H113.5V21Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1144_161721)'%3e%3cpath%20d='M139%2035H124V48H139V35Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M124.5%2035.5H138.5V47.5H124.5V35.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M124%201.04083V13H139V0H124.627C124.461%200%20124%200%20124%200C124%200%20124%200.764787%20124%201.04083Z'%20fill='url(%23paint4_linear_1144_161721)'/%3e%3cpath%20d='M139%2017.5H124V30.5H139V17.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M132.5%2021H131.072L129.5%2021.9199V23.1738L130.925%2022.3535H130.963V27H132.5V21Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip5_1144_161721)'%3e%3cpath%20d='M158%2017.5H143V30.5H158V17.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M143%2013H158V1.04083C158%200.764787%20157.934%200.500047%20157.816%200.304853C157.699%200.109659%20157.539%200%20157.373%200L143%200V13Z'%20fill='url(%23paint5_linear_1144_161721)'/%3e%3cpath%20d='M148.337%2027H152.75V25.8468H150.334V25.8092L151.047%2025.1561C152.34%2024.0376%20152.677%2023.4682%20152.677%2022.789C152.677%2021.7225%20151.801%2021%20150.448%2021C149.129%2021%20148.247%2021.7543%20148.25%2022.9595H149.615C149.615%2022.4249%20149.947%2022.1156%20150.442%2022.1156C150.928%2022.1156%20151.28%2022.4133%20151.28%2022.9017C151.28%2023.3439%20151.001%2023.6445%20150.512%2024.0809L148.337%2025.9711V27Z'%20fill='white'/%3e%3cpath%20d='M158%2035H143V48H158V35Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M143.5%2035.5H157.5V47.5H143.5V35.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161721'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161721'%20x1='43'%20y1='15.5052'%20x2='58'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161721'%20x1='62'%20y1='15.5052'%20x2='77'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161721'%20x1='105'%20y1='6.5052'%20x2='120'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_161721'%20x1='124'%20y1='6.5052'%20x2='139'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1144_161721'%20x1='143'%20y1='6.5052'%20x2='158'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161721'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161721'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(43%209)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_161721'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%209)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_161721'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(105)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1144_161721'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(124)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_1144_161721'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(143)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_2 = "data:image/svg+xml,%3csvg%20width='129'%20height='50'%20viewBox='0%200%20129%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162522)'%3e%3cpath%20d='M0%202.04083V14H24V1H1.00293C0.736933%201%200%201%200%201C0%201%200%201.76479%200%202.04083Z'%20fill='url(%23paint0_linear_1144_162522)'/%3e%3cpath%20d='M24%2018.5H0V31.5H24V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2036H0V49H24V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M3%2027.3182H4.56818V24.7727C4.56818%2024.392%204.76705%2024.1591%205.09091%2024.1591C5.41477%2024.1591%205.625%2024.392%205.625%2024.7727V27.3182H7.125V24.7727C7.125%2024.392%207.32386%2024.1591%207.64773%2024.1591C7.97159%2024.1591%208.18182%2024.392%208.18182%2024.7727V27.3182H9.75V24.375C9.75%2023.4801%209.17614%2022.8977%208.34091%2022.8977C7.69318%2022.8977%207.17045%2023.25%207.02273%2023.7841H6.97727C6.88636%2023.25%206.39773%2022.8977%205.78409%2022.8977C5.17898%2022.8977%204.71591%2023.2386%204.53409%2023.7841H4.48864V22.9545H3V27.3182Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.5234%2028.9545H12.0916V26.6023H12.1143C12.2962%2027.0455%2012.7166%2027.375%2013.3303%2027.375C14.2621%2027.375%2015.0462%2026.6477%2015.0462%2025.1364C15.0462%2023.5568%2014.2053%2022.8977%2013.3416%2022.8977C12.6939%2022.8977%2012.2848%2023.2727%2012.1143%2023.7159H12.0803V22.9545H10.5234V28.9545ZM12.0575%2025.1364C12.0575%2024.4886%2012.3189%2024.1023%2012.7507%2024.1023C13.1825%2024.1023%2013.4325%2024.4886%2013.4325%2025.1364C13.4325%2025.7841%2013.1825%2026.1705%2012.7507%2026.1705C12.3189%2026.1705%2012.0575%2025.7727%2012.0575%2025.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M17.2713%2024.8636C17.2741%2024.4318%2017.5241%2024.1705%2017.9077%2024.1705C18.3082%2024.1705%2018.5355%2024.4318%2018.5327%2024.8636V27.3182H20.1009V24.5341C20.1037%2023.5795%2019.5014%2022.8977%2018.5781%2022.8977C17.9332%2022.8977%2017.456%2023.2273%2017.2599%2023.7841H17.2145V21.5H15.7031V27.3182H17.2713V24.8636Z'%20fill='%2324292E'/%3e%3cpath%20d='M3%2044.8182H4.56818V42.2727C4.56818%2041.892%204.76705%2041.6591%205.09091%2041.6591C5.41477%2041.6591%205.625%2041.892%205.625%2042.2727V44.8182H7.125V42.2727C7.125%2041.892%207.32386%2041.6591%207.64773%2041.6591C7.97159%2041.6591%208.18182%2041.892%208.18182%2042.2727V44.8182H9.75V41.875C9.75%2040.9801%209.17614%2040.3977%208.34091%2040.3977C7.69318%2040.3977%207.17045%2040.75%207.02273%2041.2841H6.97727C6.88636%2040.75%206.39773%2040.3977%205.78409%2040.3977C5.17898%2040.3977%204.71591%2040.7386%204.53409%2041.2841H4.48864V40.4545H3V44.8182Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.5234%2046.4545H12.0916V44.1023H12.1143C12.2962%2044.5455%2012.7166%2044.875%2013.3303%2044.875C14.2621%2044.875%2015.0462%2044.1477%2015.0462%2042.6364C15.0462%2041.0568%2014.2053%2040.3977%2013.3416%2040.3977C12.6939%2040.3977%2012.2848%2040.7727%2012.1143%2041.2159H12.0803V40.4545H10.5234V46.4545ZM12.0575%2042.6364C12.0575%2041.9886%2012.3189%2041.6023%2012.7507%2041.6023C13.1825%2041.6023%2013.4325%2041.9886%2013.4325%2042.6364C13.4325%2043.2841%2013.1825%2043.6705%2012.7507%2043.6705C12.3189%2043.6705%2012.0575%2043.2727%2012.0575%2042.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M17.2713%2042.3636C17.2741%2041.9318%2017.5241%2041.6705%2017.9077%2041.6705C18.3082%2041.6705%2018.5355%2041.9318%2018.5327%2042.3636V44.8182H20.1009V42.0341C20.1037%2041.0795%2019.5014%2040.3977%2018.5781%2040.3977C17.9332%2040.3977%2017.456%2040.7273%2017.2599%2041.2841H17.2145V39H15.7031V44.8182H17.2713V42.3636Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162522)'%3e%3cpath%20d='M28%202.04083V14H43V1H28.6268C28.4606%201%2028%201%2028%201C28%201%2028%201.76479%2028%202.04083Z'%20fill='url(%23paint1_linear_1144_162522)'/%3e%3cpath%20d='M43%2018.5H28V31.5H43V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M43%2036H28V49H43V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M36.5%2022H35.0716L33.5%2022.9199V24.1738L34.9253%2023.3535H34.9627V28H36.5V22Z'%20fill='%2324292E'/%3e%3cpath%20d='M33.0873%2045.5H37.5V44.3468H35.0841V44.3092L35.7972%2043.6561C37.0896%2042.5376%2037.4272%2041.9682%2037.4272%2041.289C37.4272%2040.2225%2036.5511%2039.5%2035.1976%2039.5C33.879%2039.5%2032.9971%2040.2543%2033%2041.4595H34.3651C34.3651%2040.9249%2034.697%2040.6156%2035.1918%2040.6156C35.6779%2040.6156%2036.0301%2040.9133%2036.0301%2041.4017C36.0301%2041.8439%2035.7506%2042.1445%2035.2616%2042.5809L33.0873%2044.4711V45.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3crect%20x='27.5'%20y='0.5'%20width='16'%20height='49'%20stroke='white'/%3e%3cpath%20d='M56.9067%2031C57.6011%2031%2062.9327%2027%2062.9327%2025C62.9327%2023%2057.7357%2019%2056.9067%2019C56.0777%2019%2055.4023%2019.5%2055.4023%2020.4756C55.4023%2021.4512%2058.9067%2023.9206%2058.9067%2023.9206C58.9067%2023.9206%2051.2539%2023.25%2051%2023.9206C50.7461%2024.5911%2050.7461%2025.4089%2051%2026.0794C51.2539%2026.75%2058.9067%2026.0794%2058.9067%2026.0794C58.9067%2026.0794%2055.4023%2028.75%2055.4023%2029.5301C55.4023%2030.3103%2056.2123%2031%2056.9067%2031Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip2_1144_162522)'%3e%3cpath%20d='M71%202.04083V14H95V1H72.0029C71.7369%201%2071%201%2071%201C71%201%2071%201.76479%2071%202.04083Z'%20fill='url(%23paint2_linear_1144_162522)'/%3e%3cpath%20d='M95%2018.5H71V31.5H95V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M95%2036H71V49H95V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M75%2027.3182H76.5682V24.7727C76.5682%2024.392%2076.767%2024.1591%2077.0909%2024.1591C77.4148%2024.1591%2077.625%2024.392%2077.625%2024.7727V27.3182H79.125V24.7727C79.125%2024.392%2079.3239%2024.1591%2079.6477%2024.1591C79.9716%2024.1591%2080.1818%2024.392%2080.1818%2024.7727V27.3182H81.75V24.375C81.75%2023.4801%2081.1761%2022.8977%2080.3409%2022.8977C79.6932%2022.8977%2079.1705%2023.25%2079.0227%2023.7841H78.9773C78.8864%2023.25%2078.3977%2022.8977%2077.7841%2022.8977C77.179%2022.8977%2076.7159%2023.2386%2076.5341%2023.7841H76.4886V22.9545H75V27.3182Z'%20fill='%2324292E'/%3e%3cpath%20d='M82.5234%2028.9545H84.0916V26.6023H84.1143C84.2962%2027.0455%2084.7166%2027.375%2085.3303%2027.375C86.2621%2027.375%2087.0462%2026.6477%2087.0462%2025.1364C87.0462%2023.5568%2086.2053%2022.8977%2085.3416%2022.8977C84.6939%2022.8977%2084.2848%2023.2727%2084.1143%2023.7159H84.0803V22.9545H82.5234V28.9545ZM84.0575%2025.1364C84.0575%2024.4886%2084.3189%2024.1023%2084.7507%2024.1023C85.1825%2024.1023%2085.4325%2024.4886%2085.4325%2025.1364C85.4325%2025.7841%2085.1825%2026.1705%2084.7507%2026.1705C84.3189%2026.1705%2084.0575%2025.7727%2084.0575%2025.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M89.2713%2024.8636C89.2741%2024.4318%2089.5241%2024.1705%2089.9077%2024.1705C90.3082%2024.1705%2090.5355%2024.4318%2090.5327%2024.8636V27.3182H92.1009V24.5341C92.1037%2023.5795%2091.5014%2022.8977%2090.5781%2022.8977C89.9332%2022.8977%2089.456%2023.2273%2089.2599%2023.7841H89.2145V21.5H87.7031V27.3182H89.2713V24.8636Z'%20fill='%2324292E'/%3e%3cpath%20d='M74%2044.8182H75.5682V42.2727C75.5682%2041.892%2075.767%2041.6591%2076.0909%2041.6591C76.4148%2041.6591%2076.625%2041.892%2076.625%2042.2727V44.8182H78.125V42.2727C78.125%2041.892%2078.3239%2041.6591%2078.6477%2041.6591C78.9716%2041.6591%2079.1818%2041.892%2079.1818%2042.2727V44.8182H80.75V41.875C80.75%2040.9801%2080.1761%2040.3977%2079.3409%2040.3977C78.6932%2040.3977%2078.1705%2040.75%2078.0227%2041.2841H77.9773C77.8864%2040.75%2077.3977%2040.3977%2076.7841%2040.3977C76.179%2040.3977%2075.7159%2040.7386%2075.5341%2041.2841H75.4886V40.4545H74V44.8182Z'%20fill='%2324292E'/%3e%3cpath%20d='M81.5234%2046.4545H83.0916V44.1023H83.1143C83.2962%2044.5455%2083.7166%2044.875%2084.3303%2044.875C85.2621%2044.875%2086.0462%2044.1477%2086.0462%2042.6364C86.0462%2041.0568%2085.2053%2040.3977%2084.3416%2040.3977C83.6939%2040.3977%2083.2848%2040.7727%2083.1143%2041.2159H83.0803V40.4545H81.5234V46.4545ZM83.0575%2042.6364C83.0575%2041.9886%2083.3189%2041.6023%2083.7507%2041.6023C84.1825%2041.6023%2084.4325%2041.9886%2084.4325%2042.6364C84.4325%2043.2841%2084.1825%2043.6705%2083.7507%2043.6705C83.3189%2043.6705%2083.0575%2043.2727%2083.0575%2042.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M88.2713%2042.3636C88.2741%2041.9318%2088.5241%2041.6705%2088.9077%2041.6705C89.3082%2041.6705%2089.5355%2041.9318%2089.5327%2042.3636V44.8182H91.1009V42.0341C91.1037%2041.0795%2090.5014%2040.3977%2089.5781%2040.3977C88.9332%2040.3977%2088.456%2040.7273%2088.2599%2041.2841H88.2145V39H86.7031V44.8182H88.2713V42.3636Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_162522)'%3e%3cpath%20d='M99%202.04083V14H129V1H100.254C99.9212%201%2099%201%2099%201C99%201%2099%201.76479%2099%202.04083Z'%20fill='url(%23paint3_linear_1144_162522)'/%3e%3cpath%20d='M129%2018.5H99V31.5H129V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M129%2036H99V49H129V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M109%2027.3182H110.568V24.7727C110.568%2024.392%20110.767%2024.1591%20111.091%2024.1591C111.415%2024.1591%20111.625%2024.392%20111.625%2024.7727V27.3182H113.125V24.7727C113.125%2024.392%20113.324%2024.1591%20113.648%2024.1591C113.972%2024.1591%20114.182%2024.392%20114.182%2024.7727V27.3182H115.75V24.375C115.75%2023.4801%20115.176%2022.8977%20114.341%2022.8977C113.693%2022.8977%20113.17%2023.25%20113.023%2023.7841H112.977C112.886%2023.25%20112.398%2022.8977%20111.784%2022.8977C111.179%2022.8977%20110.716%2023.2386%20110.534%2023.7841H110.489V22.9545H109V27.3182Z'%20fill='%2324292E'/%3e%3cpath%20d='M116.523%2028.9545H118.092V26.6023H118.114C118.296%2027.0455%20118.717%2027.375%20119.33%2027.375C120.262%2027.375%20121.046%2026.6477%20121.046%2025.1364C121.046%2023.5568%20120.205%2022.8977%20119.342%2022.8977C118.694%2022.8977%20118.285%2023.2727%20118.114%2023.7159H118.08V22.9545H116.523V28.9545ZM118.058%2025.1364C118.058%2024.4886%20118.319%2024.1023%20118.751%2024.1023C119.183%2024.1023%20119.433%2024.4886%20119.433%2025.1364C119.433%2025.7841%20119.183%2026.1705%20118.751%2026.1705C118.319%2026.1705%20118.058%2025.7727%20118.058%2025.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M123.271%2024.8636C123.274%2024.4318%20123.524%2024.1705%20123.908%2024.1705C124.308%2024.1705%20124.536%2024.4318%20124.533%2024.8636V27.3182H126.101V24.5341C126.104%2023.5795%20125.501%2022.8977%20124.578%2022.8977C123.933%2022.8977%20123.456%2023.2273%20123.26%2023.7841H123.214V21.5H121.703V27.3182H123.271V24.8636Z'%20fill='%2324292E'/%3e%3cpath%20d='M109%2044.8182H110.568V42.2727C110.568%2041.892%20110.767%2041.6591%20111.091%2041.6591C111.415%2041.6591%20111.625%2041.892%20111.625%2042.2727V44.8182H113.125V42.2727C113.125%2041.892%20113.324%2041.6591%20113.648%2041.6591C113.972%2041.6591%20114.182%2041.892%20114.182%2042.2727V44.8182H115.75V41.875C115.75%2040.9801%20115.176%2040.3977%20114.341%2040.3977C113.693%2040.3977%20113.17%2040.75%20113.023%2041.2841H112.977C112.886%2040.75%20112.398%2040.3977%20111.784%2040.3977C111.179%2040.3977%20110.716%2040.7386%20110.534%2041.2841H110.489V40.4545H109V44.8182Z'%20fill='%2324292E'/%3e%3cpath%20d='M116.523%2046.4545H118.092V44.1023H118.114C118.296%2044.5455%20118.717%2044.875%20119.33%2044.875C120.262%2044.875%20121.046%2044.1477%20121.046%2042.6364C121.046%2041.0568%20120.205%2040.3977%20119.342%2040.3977C118.694%2040.3977%20118.285%2040.7727%20118.114%2041.2159H118.08V40.4545H116.523V46.4545ZM118.058%2042.6364C118.058%2041.9886%20118.319%2041.6023%20118.751%2041.6023C119.183%2041.6023%20119.433%2041.9886%20119.433%2042.6364C119.433%2043.2841%20119.183%2043.6705%20118.751%2043.6705C118.319%2043.6705%20118.058%2043.2727%20118.058%2042.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M123.271%2042.3636C123.274%2041.9318%20123.524%2041.6705%20123.908%2041.6705C124.308%2041.6705%20124.536%2041.9318%20124.533%2042.3636V44.8182H126.101V42.0341C126.104%2041.0795%20125.501%2040.3977%20124.578%2040.3977C123.933%2040.3977%20123.456%2040.7273%20123.26%2041.2841H123.214V39H121.703V44.8182H123.271V42.3636Z'%20fill='%2324292E'/%3e%3cpath%20d='M106%2021.5H104.572L103%2022.4199V23.6738L104.425%2022.8535H104.463V27.5H106V21.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M102.087%2045H106.5V43.8468H104.084V43.8092L104.797%2043.1561C106.09%2042.0376%20106.427%2041.4682%20106.427%2040.789C106.427%2039.7225%20105.551%2039%20104.198%2039C102.879%2039%20101.997%2039.7543%20102%2040.9595H103.365C103.365%2040.4249%20103.697%2040.1156%20104.192%2040.1156C104.678%2040.1156%20105.03%2040.4133%20105.03%2040.9017C105.03%2041.3439%20104.751%2041.6445%20104.262%2042.0809L102.087%2043.9711V45Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162522'%20x1='0'%20y1='7.5052'%20x2='24'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162522'%20x1='28'%20y1='7.5052'%20x2='43'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162522'%20x1='71'%20y1='7.5052'%20x2='95'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162522'%20x1='99'%20y1='7.5052'%20x2='129'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162522'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(0%201)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162522'%3e%3crect%20x='28'%20y='1'%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162522'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(71%201)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_162522'%3e%3crect%20width='30'%20height='48'%20fill='white'%20transform='translate(99%201)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_3 = "data:image/svg+xml,%3csvg%20width='140'%20height='48'%20viewBox='0%200%20140%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162561)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.65%209.3H9.3V3.35C9.3%203.25717%209.26313%203.16815%209.19749%203.10251C9.13185%203.03687%209.04283%203%208.95%203H7.725C7.66392%203.00037%207.604%203.01672%207.5512%203.04742C7.49839%203.07812%207.45454%203.1221%207.424%203.175L3.8505%209.3H3.35C3.25717%209.3%203.16815%209.33687%203.10251%209.40251C3.03687%209.46815%203%209.55717%203%209.65C3%209.74283%203.03687%209.83185%203.10251%209.89749C3.16815%209.96313%203.25717%2010%203.35%2010H4.75C4.84283%2010%204.93185%209.96313%204.99749%209.89749C5.06313%209.83185%205.1%209.74283%205.1%209.65C5.1%209.55717%205.06313%209.46815%204.99749%209.40251C4.93185%209.33687%204.84283%209.3%204.75%209.3H4.659L5.884%207.2H8.6V9.3H8.25C8.15717%209.3%208.06815%209.33687%208.00251%209.40251C7.93687%209.46815%207.9%209.55717%207.9%209.65C7.9%209.74283%207.93687%209.83185%208.00251%209.89749C8.06815%209.96313%208.15717%2010%208.25%2010H9.65C9.74283%2010%209.83185%209.96313%209.89749%209.89749C9.96313%209.83185%2010%209.74283%2010%209.65C10%209.55717%209.96313%209.46815%209.89749%209.40251C9.83185%209.33687%209.74283%209.3%209.65%209.3ZM8.6%206.5H6.2935L7.9245%203.7H8.6V6.5Z'%20fill='white'/%3e%3cpath%20d='M23%2015.5H22.5V16V32V32.5H23H50H50.5V32V16V15.5H50H23Z'%20stroke='%23CCCCDC'/%3e%3cpath%20d='M30.3747%2024.4872C30.3426%2023.7927%2029.7236%2023.3761%2028.7057%2023.3761C27.6992%2023.3761%2027.0779%2023.7607%2027.0825%2024.4444C27.0779%2024.9615%2027.4379%2025.2927%2028.1555%2025.4103L28.7791%2025.5128C29.0542%2025.5598%2029.178%2025.6282%2029.1826%2025.7521C29.178%2025.8889%2029.0106%2025.9658%2028.7791%2025.9658C28.4925%2025.9658%2028.2907%2025.8504%2028.2564%2025.641H27C27.0688%2026.3141%2027.6924%2026.7607%2028.7699%2026.7607C29.7443%2026.7607%2030.4618%2026.3184%2030.4664%2025.6154C30.4618%2025.1303%2030.1134%2024.8483%2029.3935%2024.7265L28.6782%2024.6068C28.41%2024.562%2028.3343%2024.4722%2028.3389%2024.3761C28.3343%2024.2393%2028.5154%2024.1624%2028.7332%2024.1624C28.9831%2024.1624%2029.1917%2024.2863%2029.2101%2024.4872H30.3747Z'%20fill='white'/%3e%3cpath%20d='M33.0513%2023.4188H32.4461V22.6325H31.1806V23.4188H30.7312V24.2735H31.1806V25.7564C31.1714%2026.4444%2031.6276%2026.7927%2032.5011%2026.7479C32.7877%2026.7329%2033.0009%2026.6773%2033.1155%2026.6453L32.9321%2025.8162C32.884%2025.8269%2032.7602%2025.8504%2032.6845%2025.8504C32.5195%2025.8504%2032.4461%2025.7821%2032.4461%2025.6453V24.2735H33.0513V23.4188Z'%20fill='white'/%3e%3cpath%20d='M33.5678%2026.7009H34.8333V24.9915C34.8333%2024.6154%2035.1107%2024.3675%2035.4844%2024.3675C35.6151%2024.3675%2035.826%2024.3868%2035.9521%2024.4274V23.4209C35.8512%2023.3932%2035.7411%2023.3761%2035.6311%2023.3761C35.2551%2023.3761%2034.9617%2023.5812%2034.8333%2024.0427H34.7966V23.4188H33.5678V26.7009Z'%20fill='white'/%3e%3cpath%20d='M36.367%2026.7009H37.6326V23.4188H36.367V26.7009ZM36.9998%2023.0769C37.3437%2023.0769%2037.6234%2022.8355%2037.6234%2022.5385C37.6234%2022.2415%2037.3437%2022%2036.9998%2022C36.6559%2022%2036.3762%2022.2415%2036.3762%2022.5385C36.3762%2022.8355%2036.6559%2023.0769%2036.9998%2023.0769Z'%20fill='white'/%3e%3cpath%20d='M39.5429%2024.8547C39.5452%2024.5299%2039.7423%2024.3333%2040.0564%2024.3333C40.3751%2024.3333%2040.5631%2024.5299%2040.5608%2024.8547V26.7009H41.8263V24.6068C41.8286%2023.8932%2041.3449%2023.3761%2040.5975%2023.3761C40.0793%2023.3761%2039.669%2023.6282%2039.5154%2024.0427H39.4787V23.4188H38.2773V26.7009H39.5429V24.8547Z'%20fill='white'/%3e%3cpath%20d='M44.1476%2028C45.2618%2028%2046%2027.5256%2046%2026.6923V23.4188H44.7345V23.9915H44.707C44.5694%2023.6581%2044.2393%2023.3761%2043.7166%2023.3761C43.0196%2023.3761%2042.341%2023.8718%2042.341%2025.0598C42.341%2026.1966%2042.9738%2026.6581%2043.7257%2026.6581C44.2026%2026.6581%2044.5786%2026.4701%2044.7161%2026.1368H44.7528V26.6923C44.7528%2027.0791%2044.5121%2027.2051%2044.1843%2027.2051C43.8931%2027.2051%2043.6799%2027.1239%2043.6432%2026.9145H42.4235C42.4717%2027.547%2043.0884%2028%2044.1476%2028ZM44.1934%2025.8205C43.8449%2025.8205%2043.6432%2025.547%2043.6432%2025.0598C43.6432%2024.5726%2043.8449%2024.2821%2044.1934%2024.2821C44.5419%2024.2821%2044.7528%2024.5726%2044.7528%2025.0598C44.7528%2025.5385%2044.5419%2025.8205%2044.1934%2025.8205Z'%20fill='white'/%3e%3cpath%20d='M63.9067%2030C64.6011%2030%2069.9327%2026%2069.9327%2024C69.9327%2022%2064.7357%2018%2063.9067%2018C63.0777%2018%2062.4023%2018.5%2062.4023%2019.4756C62.4023%2020.4512%2065.9067%2022.9206%2065.9067%2022.9206C65.9067%2022.9206%2058.2539%2022.25%2058%2022.9206C57.7461%2023.5911%2057.7461%2024.4089%2058%2025.0794C58.2539%2025.75%2065.9067%2025.0794%2065.9067%2025.0794C65.9067%2025.0794%2062.4023%2027.75%2062.4023%2028.5301C62.4023%2029.3103%2063.2123%2030%2063.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M78%201.04083V13H93V0H78.6268C78.4606%200%2078.3011%200.109659%2078.1836%200.304853C78.066%200.500047%2078%200.764787%2078%201.04083Z'%20fill='url(%23paint1_linear_1144_162561)'/%3e%3cpath%20d='M93%2017.5H78V30.5H93V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M93%2035H78V48H93V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M86.5%2021H85.0716L83.5%2021.9199V23.1738L84.9253%2022.3535H84.9627V27H86.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M83.3373%2044.5H87.75V43.3468H85.3341V43.3092L86.0472%2042.6561C87.3396%2041.5376%2087.6772%2040.9682%2087.6772%2040.289C87.6772%2039.2225%2086.8011%2038.5%2085.4476%2038.5C84.129%2038.5%2083.2471%2039.2543%2083.25%2040.4595H84.6151C84.6151%2039.9249%2084.947%2039.6156%2085.4418%2039.6156C85.9279%2039.6156%2086.2801%2039.9133%2086.2801%2040.4017C86.2801%2040.8439%2086.0006%2041.1445%2085.5116%2041.5809L83.3373%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1144_162561)'%3e%3cpath%20d='M83.1733%205.06818H83.3523V5.24716C83.3523%205.3421%2083.39%205.43314%2083.4571%205.50027C83.5242%205.5674%2083.6153%205.60511%2083.7102%205.60511C83.8052%205.60511%2083.8962%205.5674%2083.9633%205.50027C84.0305%205.43314%2084.0682%205.3421%2084.0682%205.24716V5.06818H84.2472C84.3421%205.06818%2084.4331%205.03047%2084.5003%204.96334C84.5674%204.89621%2084.6051%204.80516%2084.6051%204.71023C84.6051%204.61529%2084.5674%204.52425%2084.5003%204.45712C84.4331%204.38999%2084.3421%204.35227%2084.2472%204.35227H84.0682V4.1733C84.0682%204.07836%2084.0305%203.98731%2083.9633%203.92018C83.8962%203.85305%2083.8052%203.81534%2083.7102%203.81534C83.6153%203.81534%2083.5242%203.85305%2083.4571%203.92018C83.39%203.98731%2083.3523%204.07836%2083.3523%204.1733V4.35227H83.1733C83.0784%204.35227%2082.9873%204.38999%2082.9202%204.45712C82.8531%204.52425%2082.8153%204.61529%2082.8153%204.71023C82.8153%204.80516%2082.8531%204.89621%2082.9202%204.96334C82.9873%205.03047%2083.0784%205.06818%2083.1733%205.06818ZM82.9514%209.04864C83.0184%209.11531%2083.1092%209.15273%2083.2037%209.15273C83.2983%209.15273%2083.389%209.11531%2083.4561%209.04864L83.7102%208.79449L83.9644%209.04864C84.0314%209.11531%2084.1222%209.15273%2084.2167%209.15273C84.3113%209.15273%2084.402%209.11531%2084.4691%209.04864C84.5358%208.98157%2084.5732%208.89085%2084.5732%208.79628C84.5732%208.70171%2084.5358%208.61099%2084.4691%208.54392L84.2149%208.28977L84.4691%208.03563C84.5277%207.96715%2084.5584%207.87906%2084.5549%207.78898C84.5514%207.69889%2084.5141%207.61343%2084.4503%207.54968C84.3866%207.48593%2084.3011%207.44858%2084.211%207.4451C84.1209%207.44162%2084.0329%207.47227%2083.9644%207.53091L83.7102%207.78506L83.4561%207.53091C83.3876%207.47227%2083.2995%207.44162%2083.2094%207.4451C83.1193%207.44858%2083.0339%207.48593%2082.9701%207.54968C82.9064%207.61343%2082.869%207.69889%2082.8656%207.78898C82.8621%207.87906%2082.8927%207.96715%2082.9514%208.03563L83.2055%208.28977L82.9514%208.54392C82.8847%208.61099%2082.8473%208.70171%2082.8473%208.79628C82.8473%208.89085%2082.8847%208.98157%2082.9514%209.04864V9.04864ZM88.3636%202.5625H82.6364C82.3516%202.5625%2082.0784%202.67564%2081.877%202.87703C81.6756%203.07842%2081.5625%203.35156%2081.5625%203.63636V9.36364C81.5625%209.64844%2081.6756%209.92159%2081.877%2010.123C82.0784%2010.3244%2082.3516%2010.4375%2082.6364%2010.4375H88.3636C88.6484%2010.4375%2088.9216%2010.3244%2089.123%2010.123C89.3244%209.92159%2089.4375%209.64844%2089.4375%209.36364V3.63636C89.4375%203.35156%2089.3244%203.07842%2089.123%202.87703C88.9216%202.67564%2088.6484%202.5625%2088.3636%202.5625V2.5625ZM85.142%209.72159H82.6364C82.5414%209.72159%2082.4504%209.68388%2082.3833%209.61675C82.3161%209.54962%2082.2784%209.45857%2082.2784%209.36364V6.85796H85.142V9.72159ZM85.142%206.14205H82.2784V3.63636C82.2784%203.54143%2082.3161%203.45038%2082.3833%203.38325C82.4504%203.31612%2082.5414%203.27841%2082.6364%203.27841H85.142V6.14205ZM88.7216%209.36364C88.7216%209.45857%2088.6839%209.54962%2088.6167%209.61675C88.5496%209.68388%2088.4586%209.72159%2088.3636%209.72159H85.858V6.85796H88.7216V9.36364ZM88.7216%206.14205H85.858V3.27841H88.3636C88.4586%203.27841%2088.5496%203.31612%2088.6167%203.38325C88.6839%203.45038%2088.7216%203.54143%2088.7216%203.63636V6.14205ZM86.7528%208.1108H87.8267C87.9216%208.1108%2088.0127%208.07308%2088.0798%208.00595C88.1469%207.93882%2088.1847%207.84778%2088.1847%207.75284C88.1847%207.65791%2088.1469%207.56686%2088.0798%207.49973C88.0127%207.4326%2087.9216%207.39489%2087.8267%207.39489H86.7528C86.6579%207.39489%2086.5669%207.4326%2086.4997%207.49973C86.4326%207.56686%2086.3949%207.65791%2086.3949%207.75284C86.3949%207.84778%2086.4326%207.93882%2086.4997%208.00595C86.5669%208.07308%2086.6579%208.1108%2086.7528%208.1108V8.1108ZM87.8267%204.35227H86.7528C86.6579%204.35227%2086.5669%204.38999%2086.4997%204.45712C86.4326%204.52425%2086.3949%204.61529%2086.3949%204.71023C86.3949%204.80516%2086.4326%204.89621%2086.4997%204.96334C86.5669%205.03047%2086.6579%205.06818%2086.7528%205.06818H87.8267C87.9216%205.06818%2088.0127%205.03047%2088.0798%204.96334C88.1469%204.89621%2088.1847%204.80516%2088.1847%204.71023C88.1847%204.61529%2088.1469%204.52425%2088.0798%204.45712C88.0127%204.38999%2087.9216%204.35227%2087.8267%204.35227ZM86.7528%209.18466H87.8267C87.9216%209.18466%2088.0127%209.14695%2088.0798%209.07982C88.1469%209.01269%2088.1847%208.92164%2088.1847%208.82671C88.1847%208.73177%2088.1469%208.64072%2088.0798%208.57359C88.0127%208.50646%2087.9216%208.46875%2087.8267%208.46875H86.7528C86.6579%208.46875%2086.5669%208.50646%2086.4997%208.57359C86.4326%208.64072%2086.3949%208.73177%2086.3949%208.82671C86.3949%208.92164%2086.4326%209.01269%2086.4997%209.07982C86.5669%209.14695%2086.6579%209.18466%2086.7528%209.18466V9.18466Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M101%2015.5H100.5V16V32V32.5H101H137H137.5V32V16V15.5H137H101Z'%20stroke='%23CCCCDC'/%3e%3cpath%20d='M106.339%2024.4629C106.341%2024.1258%20106.55%2023.9218%20106.882%2023.9218C107.219%2023.9218%20107.418%2024.1258%20107.416%2024.4629V26.3791H108.754V24.2057C108.757%2023.4649%20108.245%2022.9282%20107.454%2022.9282C106.906%2022.9282%20106.472%2023.1899%20106.31%2023.6202H106.271V22.9726H105V26.3791H106.339V24.4629Z'%20fill='white'/%3e%3cpath%20d='M111.831%2024.8887C111.833%2025.2258%20111.62%2025.4299%20111.288%2025.4299C110.95%2025.4299%20110.756%2025.2258%20110.754%2024.8887V22.9726H109.415V25.146C109.418%2025.8912%20109.932%2026.4234%20110.715%2026.4234C111.271%2026.4234%20111.697%2026.1662%20111.86%2025.7315H111.899V26.3791H113.17V22.9726H111.831V24.8887Z'%20fill='white'/%3e%3cpath%20d='M113.85%2026.3791H115.189V24.392C115.189%2024.0948%20115.359%2023.9129%20115.636%2023.9129C115.912%2023.9129%20116.091%2024.0948%20116.091%2024.392V26.3791H117.372V24.392C117.372%2024.0948%20117.542%2023.9129%20117.818%2023.9129C118.095%2023.9129%20118.274%2024.0948%20118.274%2024.392V26.3791H119.613V24.0815C119.613%2023.3829%20119.123%2022.9282%20118.41%2022.9282C117.857%2022.9282%20117.411%2023.2032%20117.285%2023.6202H117.246C117.168%2023.2032%20116.751%2022.9282%20116.227%2022.9282C115.711%2022.9282%20115.315%2023.1944%20115.16%2023.6202H115.121V22.9726H113.85V26.3791Z'%20fill='white'/%3e%3cpath%20d='M122.058%2026.4412C123.091%2026.4412%20123.756%2025.9888%20123.882%2025.2791H122.66C122.582%2025.472%20122.361%2025.5807%20122.087%2025.5807C121.69%2025.5807%20121.457%2025.3412%20121.457%2025.0129V24.9597H123.882V24.6758C123.882%2023.5914%20123.155%2022.9282%20122.029%2022.9282C120.875%2022.9282%20120.137%2023.6291%20120.137%2024.6847C120.137%2025.7869%20120.865%2026.4412%20122.058%2026.4412ZM121.457%2024.2855C121.464%2023.9905%20121.731%2023.7887%20122.058%2023.7887C122.391%2023.7887%20122.643%2023.9928%20122.65%2024.2855H121.457Z'%20fill='white'/%3e%3cpath%20d='M124.428%2026.3791H125.767V24.6049C125.767%2024.2145%20126.061%2023.9573%20126.456%2023.9573C126.594%2023.9573%20126.817%2023.9772%20126.951%2024.0194V22.9748C126.844%2022.946%20126.728%2022.9282%20126.611%2022.9282C126.213%2022.9282%20125.903%2023.1411%20125.767%2023.6202H125.728V22.9726H124.428V26.3791Z'%20fill='white'/%3e%3cpath%20d='M127.39%2026.3791H128.728V22.9726H127.39V26.3791ZM128.059%2022.6178C128.423%2022.6178%20128.719%2022.3671%20128.719%2022.0589C128.719%2021.7506%20128.423%2021.5%20128.059%2021.5C127.695%2021.5%20127.399%2021.7506%20127.399%2022.0589C127.399%2022.3671%20127.695%2022.6178%20128.059%2022.6178Z'%20fill='white'/%3e%3cpath%20d='M131.205%2026.4412C132.309%2026.4412%20132.985%2025.8623%20133%2024.9597H131.758C131.729%2025.3168%20131.518%2025.5097%20131.225%2025.5097C130.873%2025.5097%20130.643%2025.2347%20130.643%2024.6758C130.643%2024.117%20130.873%2023.842%20131.225%2023.842C131.521%2023.842%20131.722%2024.0349%20131.758%2024.392H133C132.993%2023.5049%20132.302%2022.9282%20131.205%2022.9282C129.993%2022.9282%20129.275%2023.6379%20129.275%2024.6847C129.275%2025.7315%20129.993%2026.4412%20131.205%2026.4412Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162561'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162561'%20x1='78'%20y1='6.5052'%20x2='93'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162561'%3e%3crect%20width='9'%20height='9'%20fill='white'%20transform='translate(81%202)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_4 = "data:image/svg+xml,%3csvg%20width='102'%20height='48'%20viewBox='0%200%20102%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162492)'%3e%3cpath%20d='M0%201.04083V13H40V0H1.67154C1.22822%200%200%200%200%200C0%200%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162492)'/%3e%3cpath%20d='M40%2017.5H0V30.5H40V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M40%2035H0V48H40V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13.75%205.45455H12.1023L11.3977%208.34091H11.3523L10.6477%205.45455H9L10.4659%209.81818H12.2841L13.75%205.45455Z'%20fill='%2324292E'/%3e%3cpath%20d='M15.2947%209.88636C15.8629%209.88636%2016.2919%209.69318%2016.5561%209.20455H16.5902V9.81818H18.0561V6.82955C18.0561%206.02273%2017.2919%205.39773%2016.0447%205.39773C14.7408%205.39773%2014.0987%206.07955%2014.0447%206.875H15.4879C15.5249%206.60511%2015.7237%206.47727%2016.022%206.47727C16.2947%206.47727%2016.4879%206.60227%2016.4879%206.82955V6.84091C16.4879%207.09375%2016.2095%207.1733%2015.4766%207.22727C14.576%207.29261%2013.8743%207.65625%2013.8743%208.61364C13.8743%209.48295%2014.4595%209.88636%2015.2947%209.88636ZM15.8061%208.89773C15.5391%208.89773%2015.3516%208.76705%2015.3516%208.52273C15.3516%208.2983%2015.5107%208.125%2015.8743%208.06818C16.1243%208.02841%2016.3345%207.97727%2016.4993%207.90909V8.27273C16.4993%208.67045%2016.1612%208.89773%2015.8061%208.89773Z'%20fill='%2324292E'/%3e%3cpath%20d='M20.3736%204H18.8054V9.81818H20.3736V4Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.0021%207.90909C24.005%208.34091%2023.755%208.60227%2023.3658%208.60227C22.9709%208.60227%2022.7436%208.34091%2022.7408%207.90909V5.45455H21.1726V8.23864C21.1754%209.19318%2021.7777%209.875%2022.6953%209.875C23.3459%209.875%2023.8459%209.54545%2024.0362%208.98864H24.0817V9.81818H25.5703V5.45455H24.0021V7.90909Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.4588%209.89773C29.669%209.89773%2030.4474%209.31818%2030.5952%208.40909H29.1634C29.0724%208.65625%2028.8139%208.79545%2028.4929%208.79545C28.027%208.79545%2027.7543%208.48864%2027.7543%208.06818V8H30.5952V7.63636C30.5952%206.24716%2029.7429%205.39773%2028.4247%205.39773C27.0724%205.39773%2026.2088%206.29545%2026.2088%207.64773C26.2088%209.05966%2027.0611%209.89773%2028.4588%209.89773ZM27.7543%207.13636C27.7628%206.75852%2028.0753%206.5%2028.4588%206.5C28.848%206.5%2029.1435%206.76136%2029.152%207.13636H27.7543Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.18182%2027.7955V26.6591C5.5%2026.6591%205.40909%2026.429%205.40909%2025.9545V25.3295C5.40909%2024.9063%205.19318%2024.483%204.25%2024.2955V24.1591C5.19318%2023.9716%205.40909%2023.5483%205.40909%2023.125V22.5C5.40909%2022.0256%205.5%2021.7955%206.18182%2021.7955V20.6591C5.01136%2020.6591%203.88636%2020.6591%203.88636%2022.2955V22.7386C3.88636%2023.2955%203.66477%2023.5455%203%2023.5455V24.9091C3.66477%2024.9091%203.88636%2025.1591%203.88636%2025.7159V26.1591C3.88636%2027.7955%205.01136%2027.7955%206.18182%2027.7955Z'%20fill='%2324292E'/%3e%3cpath%20d='M7.92116%2026.5455C8.48935%2026.5455%208.91832%2026.3523%209.18253%2025.8636H9.21662V26.4773H10.6825V23.4886C10.6825%2022.6818%209.91832%2022.0568%208.67116%2022.0568C7.36719%2022.0568%206.72514%2022.7386%206.67116%2023.5341H8.11435C8.15128%2023.2642%208.35014%2023.1364%208.64844%2023.1364C8.92116%2023.1364%209.11435%2023.2614%209.11435%2023.4886V23.5C9.11435%2023.7528%208.83594%2023.8324%208.10298%2023.8864C7.20241%2023.9517%206.50071%2024.3153%206.50071%2025.2727C6.50071%2026.142%207.08594%2026.5455%207.92116%2026.5455ZM8.43253%2025.5568C8.16548%2025.5568%207.97798%2025.4261%207.97798%2025.1818C7.97798%2024.9574%208.13707%2024.7841%208.50071%2024.7273C8.75071%2024.6875%208.96094%2024.6364%209.12571%2024.5682V24.9318C9.12571%2025.3295%208.78764%2025.5568%208.43253%2025.5568Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.2841%2026.5682C12.7017%2026.5682%2013.0739%2026.2159%2013.0795%2025.7727C13.0739%2025.3409%2012.7017%2024.9886%2012.2841%2024.9886C11.8438%2024.9886%2011.483%2025.3409%2011.4886%2025.7727C11.483%2026.2159%2011.8438%2026.5682%2012.2841%2026.5682ZM12.2841%2023.6364C12.7017%2023.6364%2013.0739%2023.2841%2013.0795%2022.8409C13.0739%2022.4091%2012.7017%2022.0568%2012.2841%2022.0568C11.8438%2022.0568%2011.483%2022.4091%2011.4886%2022.8409C11.483%2023.2841%2011.8438%2023.6364%2012.2841%2023.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M16.7727%2020.6591H15.3182L13.8864%2021.5341V22.875L15.1591%2022.1136H15.1932V26.4773H16.7727V20.6591Z'%20fill='%2324292E'/%3e%3cpath%20d='M19.2202%2025.6818H18.0384V26C18.0384%2026.7727%2017.777%2027.5824%2017.6861%2027.8977H18.652C18.7884%2027.5824%2019.1378%2026.821%2019.1974%2026L19.2202%2025.6818Z'%20fill='%2324292E'/%3e%3cpath%20d='M21.3622%2026.4773H22.919V25.7614H22.9531C23.1349%2026.2045%2023.5554%2026.5341%2024.169%2026.5341C25.1009%2026.5341%2025.8849%2025.8068%2025.8849%2024.2955C25.8849%2022.7159%2025.044%2022.0568%2024.1804%2022.0568C23.5327%2022.0568%2023.1236%2022.4318%2022.9531%2022.875H22.9304V20.6591H21.3622V26.4773ZM22.8963%2024.2955C22.8963%2023.6477%2023.1577%2023.2614%2023.5895%2023.2614C24.0213%2023.2614%2024.2713%2023.6477%2024.2713%2024.2955C24.2713%2024.9432%2024.0213%2025.3295%2023.5895%2025.3295C23.1577%2025.3295%2022.8963%2024.9318%2022.8963%2024.2955Z'%20fill='%2324292E'/%3e%3cpath%20d='M27.3935%2026.5682C27.8111%2026.5682%2028.1832%2026.2159%2028.1889%2025.7727C28.1832%2025.3409%2027.8111%2024.9886%2027.3935%2024.9886C26.9531%2024.9886%2026.5923%2025.3409%2026.598%2025.7727C26.5923%2026.2159%2026.9531%2026.5682%2027.3935%2026.5682ZM27.3935%2023.6364C27.8111%2023.6364%2028.1832%2023.2841%2028.1889%2022.8409C28.1832%2022.4091%2027.8111%2022.0568%2027.3935%2022.0568C26.9531%2022.0568%2026.5923%2022.4091%2026.598%2022.8409C26.5923%2023.2841%2026.9531%2023.6364%2027.3935%2023.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M29.0298%2026.4773H33.4957V25.2159H31.223V25.1818L31.7685%2024.7273C33.0952%2023.6222%2033.4332%2023.0483%2033.4332%2022.375C33.4332%2021.2898%2032.544%2020.5795%2031.1491%2020.5795C29.794%2020.5795%2028.9134%2021.3324%2028.9162%2022.5568H30.4162C30.4134%2022.0682%2030.7116%2021.7955%2031.1491%2021.7955C31.5838%2021.7955%2031.8935%2022.0653%2031.8935%2022.5114C31.8935%2022.9233%2031.6293%2023.1903%2031.2003%2023.5455L29.0298%2025.3409V26.4773Z'%20fill='%2324292E'/%3e%3cpath%20d='M33.9403%2020V21.1364C34.6222%2021.1364%2034.7131%2021.3665%2034.7131%2021.8409V22.4659C34.7131%2022.8892%2034.929%2023.3125%2035.8722%2023.5V23.6364C34.929%2023.8239%2034.7131%2024.2472%2034.7131%2024.6705V25.2955C34.7131%2025.7699%2034.6222%2026%2033.9403%2026V27.1364C35.1108%2027.1364%2036.2358%2027.1364%2036.2358%2025.5V25.0568C36.2358%2024.5%2036.4574%2024.25%2037.1222%2024.25V22.8864C36.4574%2022.8864%2036.2358%2022.6364%2036.2358%2022.0795V21.6364C36.2358%2020%2035.1108%2020%2033.9403%2020Z'%20fill='%2324292E'/%3e%3cpath%20d='M13.1818%2045.1364V44C12.5%2044%2012.4091%2043.7699%2012.4091%2043.2955V42.6705C12.4091%2042.2472%2012.1932%2041.8239%2011.25%2041.6364V41.5C12.1932%2041.3125%2012.4091%2040.8892%2012.4091%2040.4659V39.8409C12.4091%2039.3665%2012.5%2039.1364%2013.1818%2039.1364V38C12.0114%2038%2010.8864%2038%2010.8864%2039.6364V40.0795C10.8864%2040.6364%2010.6648%2040.8864%2010%2040.8864V42.25C10.6648%2042.25%2010.8864%2042.5%2010.8864%2043.0568V43.5C10.8864%2045.1364%2012.0114%2045.1364%2013.1818%2045.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M14.9212%2044.0117C15.4893%2044.0117%2015.9183%2043.8185%2016.1825%2043.3298H16.2166V43.9435H17.6825V40.9548C17.6825%2040.148%2016.9183%2039.523%2015.6712%2039.523C14.3672%2039.523%2013.7251%2040.2048%2013.6712%2041.0003H15.1143C15.1513%2040.7304%2015.3501%2040.6026%2015.6484%2040.6026C15.9212%2040.6026%2016.1143%2040.7276%2016.1143%2040.9548V40.9662C16.1143%2041.219%2015.8359%2041.2986%2015.103%2041.3526C14.2024%2041.4179%2013.5007%2041.7815%2013.5007%2042.7389C13.5007%2043.6082%2014.0859%2044.0117%2014.9212%2044.0117ZM15.4325%2043.023C15.1655%2043.023%2014.978%2042.8923%2014.978%2042.648C14.978%2042.4236%2015.1371%2042.2503%2015.5007%2042.1935C15.7507%2042.1537%2015.9609%2042.1026%2016.1257%2042.0344V42.398C16.1257%2042.7957%2015.7876%2043.023%2015.4325%2043.023Z'%20fill='%2324292E'/%3e%3cpath%20d='M19.2955%2043.9321C19.7131%2043.9321%2020.0852%2043.5798%2020.0909%2043.1367C20.0852%2042.7048%2019.7131%2042.3526%2019.2955%2042.3526C18.8551%2042.3526%2018.4943%2042.7048%2018.5%2043.1367C18.4943%2043.5798%2018.8551%2043.9321%2019.2955%2043.9321ZM19.2955%2041.0003C19.7131%2041.0003%2020.0852%2040.648%2020.0909%2040.2048C20.0852%2039.773%2019.7131%2039.4207%2019.2955%2039.4207C18.8551%2039.4207%2018.4943%2039.773%2018.5%2040.2048C18.4943%2040.648%2018.8551%2041.0003%2019.2955%2041.0003Z'%20fill='%2324292E'/%3e%3cpath%20d='M23.1932%2044.6139C24.6165%2044.6139%2025.6193%2043.8895%2025.6136%2042.8639C25.6193%2042.1509%2025.142%2041.648%2024.2045%2041.5457V41.5003C24.8977%2041.4264%2025.4034%2040.9804%2025.3977%2040.3298C25.4034%2039.3497%2024.4943%2038.6367%2023.2045%2038.6367C21.8864%2038.6367%2020.9489%2039.3895%2020.9432%2040.4548H22.4545C22.4602%2040.1026%2022.7699%2039.8526%2023.2045%2039.8526C23.6023%2039.8526%2023.8807%2040.094%2023.875%2040.4321C23.8807%2040.7844%2023.5511%2041.0344%2023.0795%2041.0344H22.4886V42.1253H23.0795C23.5909%2042.1253%2023.9489%2042.3753%2023.9432%2042.7276C23.9489%2043.0884%2023.642%2043.3412%2023.2045%2043.3412C22.75%2043.3412%2022.4261%2043.0997%2022.4205%2042.7617H20.8295C20.8352%2043.8469%2021.8153%2044.6139%2023.1932%2044.6139Z'%20fill='%2324292E'/%3e%3cpath%20d='M26%2038.0003V39.1366C26.6818%2039.1366%2026.7727%2039.3667%2026.7727%2039.8412V40.4662C26.7727%2040.8895%2026.9886%2041.3128%2027.9318%2041.5003V41.6366C26.9886%2041.8241%2026.7727%2042.2474%2026.7727%2042.6707V43.2957C26.7727%2043.7702%2026.6818%2044.0003%2026%2044.0003V45.1366C27.1705%2045.1366%2028.2955%2045.1366%2028.2955%2043.5003V43.0571C28.2955%2042.5003%2028.517%2042.2503%2029.1818%2042.2503V40.8866C28.517%2040.8866%2028.2955%2040.6366%2028.2955%2040.0798V39.6366C28.2955%2038.0003%2027.1705%2038.0003%2026%2038.0003Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M53.9067%2030C54.6011%2030%2059.9327%2026%2059.9327%2024C59.9327%2022%2054.7357%2018%2053.9067%2018C53.0777%2018%2052.4023%2018.5%2052.4023%2019.4756C52.4023%2020.4512%2055.9067%2022.9206%2055.9067%2022.9206C55.9067%2022.9206%2048.2539%2022.25%2048%2022.9206C47.7461%2023.5911%2047.7461%2024.4089%2048%2025.0794C48.2539%2025.75%2055.9067%2025.0794%2055.9067%2025.0794C55.9067%2025.0794%2052.4023%2027.75%2052.4023%2028.5301C52.4023%2029.3103%2053.2123%2030%2053.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M68%201.04083V13H83V0H68.6268C68.4606%200%2068.3011%200.109659%2068.1836%200.304853C68.066%200.500047%2068%200.764787%2068%201.04083Z'%20fill='url(%23paint1_linear_1144_162492)'/%3e%3cpath%20d='M83%2017.5H68V30.5H83V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M83%2035H68V48H83V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M76.5%2021H75.0716L73.5%2021.9199V23.1738L74.9253%2022.3535H74.9627V27H76.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M74.7744%209.5C75.5264%209.5%2076.0464%209.23767%2076.3415%208.74147H76.3837V9.41783H78V6.1182C78%205.09102%2076.9845%204.5%2075.6107%204.5C74.1595%204.5%2073.3373%205.1574%2073.2003%206.04235L74.785%206.09292C74.8587%205.78319%2075.1434%205.59355%2075.5966%205.59355C76.0183%205.59355%2076.2853%205.77686%2076.2853%206.1024V6.1182C76.2853%206.4153%2075.9269%206.47851%2075.0063%206.5512C73.9136%206.63338%2073%206.99684%2073%208.07143C73%209.03224%2073.7414%209.5%2074.7744%209.5ZM75.305%208.48862C74.9079%208.48862%2074.6268%208.31795%2074.6268%207.99558C74.6268%207.68268%2074.9009%207.49305%2075.3893%207.42668C75.7091%207.38559%2076.1026%207.32238%2076.2959%207.23072V7.69216C76.2959%208.16625%2075.8531%208.48862%2075.305%208.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M75.4792%2044.5C76.8085%2044.5%2077.7528%2043.7757%2077.75%2042.7605C77.7528%2042.0418%2077.2958%2041.5285%2076.4208%2041.423V41.3774C77.0771%2041.2804%2077.5423%2040.827%2077.5395%2040.1711C77.5423%2039.2186%2076.706%2038.5%2075.4903%2038.5C74.2663%2038.5%2073.3746%2039.23%2073.3635%2040.2681H74.6734C74.6845%2039.8688%2075.0334%2039.6008%2075.4903%2039.6008C75.9251%2039.6008%2076.2214%2039.8717%2076.2186%2040.2624C76.2214%2040.6673%2075.8725%2040.9468%2075.3685%2040.9468H74.8174V41.9506H75.3685C75.9417%2041.9506%2076.3155%2042.2414%2076.31%2042.6521C76.3155%2043.0656%2075.9721%2043.3536%2075.4848%2043.3536C75.0001%2043.3536%2074.6429%2043.0884%2074.6291%2042.7034H73.25C73.2611%2043.7586%2074.1832%2044.5%2075.4792%2044.5Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1144_162492)'%3e%3cpath%20d='M87%2013H102V1.04083C102%200.764787%20101.934%200.500047%20101.816%200.304853C101.699%200.109659%20101.539%200%20101.373%200L87%200V13Z'%20fill='url(%23paint2_linear_1144_162492)'/%3e%3cpath%20d='M102%2017.5H87V30.5H102V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M102%2035H87V48H102V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M92%209.68623H93.5663V8.96449H93.6149C93.8155%209.37609%2094.2621%209.75%2095.0129%209.75C96.1133%209.75%2097%208.97898%2097%207.46304C97%205.89203%2096.0615%205.17609%2095.0227%205.17609C94.2362%205.17609%2093.8058%205.58768%2093.6149%205.99638H93.5825V3.75H92V9.68623ZM93.5502%207.46015C93.5502%206.73261%2093.8867%206.28333%2094.466%206.28333C95.0518%206.28333%2095.3754%206.7442%2095.3754%207.46015C95.3754%208.17899%2095.0518%208.64565%2094.466%208.64565C93.8867%208.64565%2093.5502%208.18188%2093.5502%207.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M92%2043.4453V42.4463L94.5893%2038.5H96.2308V42.4287H97V43.4453H96.2308V44.5H94.977V43.4453H92ZM95.0012%2042.4287V39.8828H94.9528L93.3204%2042.3818V42.4287H95.0012Z'%20fill='%2324292E'/%3e%3cpath%20d='M92.3373%2027H96.75V25.8468H94.3341V25.8092L95.0472%2025.1561C96.3396%2024.0376%2096.6772%2023.4682%2096.6772%2022.789C96.6772%2021.7225%2095.8011%2021%2094.4476%2021C93.129%2021%2092.2471%2021.7543%2092.25%2022.9595H93.6151C93.6151%2022.4249%2093.947%2022.1156%2094.4418%2022.1156C94.9279%2022.1156%2095.2801%2022.4133%2095.2801%2022.9017C95.2801%2023.3439%2095.0006%2023.6445%2094.5116%2024.0809L92.3373%2025.9711V27Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162492'%20x1='0'%20y1='6.5052'%20x2='40'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162492'%20x1='68'%20y1='6.5052'%20x2='83'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162492'%20x1='87'%20y1='6.5052'%20x2='102'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162492'%3e%3crect%20width='40'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162492'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(87)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_5 = "data:image/svg+xml,%3csvg%20width='50'%20height='48'%20viewBox='0%200%2050%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%200.611699V7.64012H14V0H0.58504C0.429878%200%200.28107%200.0644467%200.171354%200.179162C0.0616379%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1144_162206)'/%3e%3cpath%20d='M14%2010.0869H0V17.727H14V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14%2020.1799H0V27.8262H14V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14%2030.2668H0V37.907H14V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14%2048V40.3721H0V47.3883C0%2047.5505%200.0616379%2047.7061%200.171354%2047.8209C0.28107%2047.9356%200.429878%2048%200.58504%2048H14Z'%20fill='%233865AB'/%3e%3cpath%20d='M47.5651%2035.5782L42.3742%2030.4293C44.3891%2027.9169%2045.3649%2024.7281%2045.1009%2021.5184C44.8369%2018.3087%2043.3531%2015.3222%2040.9548%2013.1728C38.5564%2011.0235%2035.4256%209.87482%2032.2063%209.96291C28.987%2010.051%2025.9238%2011.3692%2023.6465%2013.6465C21.3693%2015.9237%2020.0511%2018.9869%2019.963%2022.2063C19.8749%2025.4256%2021.0236%2028.5563%2023.1729%2030.9547C25.3222%2033.3531%2028.3088%2034.8368%2031.5185%2035.1008C34.7281%2035.3649%2037.917%2034.3891%2040.4293%2032.3741L45.5783%2037.5231C45.7084%2037.6542%2045.8631%2037.7583%2046.0336%2037.8293C46.2041%2037.9004%2046.387%2037.9369%2046.5717%2037.9369C46.7564%2037.9369%2046.9393%2037.9004%2047.1098%2037.8293C47.2803%2037.7583%2047.435%2037.6542%2047.5651%2037.5231C47.8173%2037.2622%2047.9583%2036.9135%2047.9583%2036.5506C47.9583%2036.1878%2047.8173%2035.8391%2047.5651%2035.5782V35.5782ZM32.58%2032.3741C30.6429%2032.3741%2028.7493%2031.7997%2027.1387%2030.7235C25.528%2029.6473%2024.2727%2028.1177%2023.5314%2026.328C22.7901%2024.5384%2022.5961%2022.5691%2022.974%2020.6692C23.3519%2018.7693%2024.2847%2017.0242%2025.6545%2015.6544C27.0242%2014.2847%2028.7694%2013.3519%2030.6693%2012.974C32.5691%2012.5961%2034.5384%2012.79%2036.3281%2013.5313C38.1177%2014.2726%2039.6474%2015.528%2040.7236%2017.1386C41.7998%2018.7492%2042.3742%2020.6428%2042.3742%2022.5799C42.3742%2025.1775%2041.3423%2027.6687%2039.5055%2029.5055C37.6688%2031.3422%2035.1776%2032.3741%2032.58%2032.3741V32.3741Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M32.5%2016C31.0413%2016%2029.6424%2016.5479%2028.6109%2017.523C27.5795%2018.4982%2027%2019.8209%2027%2021.2C27%2024.71%2031.8469%2028.675%2032.0531%2028.844C32.1777%2028.9447%2032.3361%2029%2032.5%2029C32.6639%2029%2032.8223%2028.9447%2032.9469%2028.844C33.1875%2028.675%2038%2024.71%2038%2021.2C38%2019.8209%2037.4205%2018.4982%2036.3891%2017.523C35.3576%2016.5479%2033.9587%2016%2032.5%2016Z'%20fill='%23FF0000'/%3e%3cpath%20d='M35%2021.5C35%2022.8807%2033.8807%2024%2032.5%2024C31.1193%2024%2030%2022.8807%2030%2021.5C30%2020.1193%2031.1193%2019%2032.5%2019C33.8807%2019%2035%2020.1193%2035%2021.5Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162206'%20x1='0'%20y1='3.82312'%20x2='14'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_6 = "data:image/svg+xml,%3csvg%20width='158'%20height='49'%20viewBox='0%200%20158%2049'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19%2014H34V2.04083C34%201.76479%2033.934%201.50005%2033.8164%201.30485C33.6989%201.10966%2033.5394%201%2033.3732%201H19V14Z'%20fill='url(%23paint0_linear_1144_161961)'/%3e%3cpath%20d='M34%2018.5H19V31.5H34V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2036H19V49H34V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M0%202.03583V13.995H15V0.994995H0.626828C0.460583%200.994995%200.301147%201.10465%200.183594%201.29985C0.0660407%201.49504%200%201.75978%200%202.03583Z'%20fill='url(%23paint1_linear_1144_161961)'/%3e%3cpath%20d='M15%2018.495H0V31.495H15V18.495Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035.995H0V48.995H15V35.995Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M46.3343%2031H49.674V26.674H54V23.3343H49.674V19H46.3343V23.3343H42V26.674H46.3343V31Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M82.675%202.5H75.325C74.9073%202.5%2074.5067%202.66594%2074.2113%202.96131C73.9159%203.25668%2073.75%203.65728%2073.75%204.075V4.68925C73.7499%204.90604%2073.7946%205.12052%2073.8813%205.31925V5.35075C73.9554%205.51926%2074.0605%205.6724%2074.191%205.80225L77.425%209.01525V12.475C77.4248%2012.5642%2077.4474%2012.652%2077.4906%2012.7301C77.5337%2012.8082%2077.5961%2012.874%2077.6717%2012.9212C77.7553%2012.973%2077.8517%2013.0003%2077.95%2013C78.0322%2012.9995%2078.1131%2012.9797%2078.1862%2012.9422L80.2862%2011.8922C80.3728%2011.8486%2080.4456%2011.7819%2080.4966%2011.6994C80.5476%2011.6169%2080.5747%2011.5219%2080.575%2011.425V9.01525L83.788%205.80225C83.9185%205.6724%2084.0236%205.51926%2084.0977%205.35075V5.31925C84.1916%205.12208%2084.2435%204.90753%2084.25%204.68925V4.075C84.25%203.65728%2084.0841%203.25668%2083.7887%202.96131C83.4933%202.66594%2083.0927%202.5%2082.675%202.5ZM79.6772%208.42725C79.6286%208.47631%2079.5901%208.53448%2079.564%208.59845C79.5378%208.66241%2079.5246%208.73091%2079.525%208.8V11.0995L78.475%2011.6245V8.8C78.4754%208.73091%2078.4622%208.66241%2078.436%208.59845C78.4099%208.53448%2078.3714%208.47631%2078.3227%208.42725L75.5402%205.65H82.4597L79.6772%208.42725ZM83.2%204.6H74.8V4.075C74.8%203.93576%2074.8553%203.80223%2074.9538%203.70377C75.0522%203.60531%2075.1858%203.55%2075.325%203.55H82.675C82.8142%203.55%2082.9478%203.60531%2083.0462%203.70377C83.1447%203.80223%2083.2%203.93576%2083.2%204.075V4.6Z'%20fill='%23CCCCDC'%20fill-opacity='0.65'/%3e%3cg%20clip-path='url(%23clip0_1144_161961)'%3e%3cpath%20d='M62%2018.7908V30.75H76.9563V17.75H62.625C62.4592%2017.75%2062.3003%2017.8597%2062.1831%2018.0549C62.0658%2018.25%2062%2018.5148%2062%2018.7908Z'%20fill='url(%23paint2_linear_1144_161961)'/%3e%3cpath%20d='M77%2035.25H62V48.25H77V35.25Z'%20fill='%233865AB'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_161961)'%3e%3cpath%20d='M81%2030.75H96V18.7908C96%2018.5148%2095.934%2018.25%2095.8164%2018.0549C95.6989%2017.8597%2095.5394%2017.75%2095.3732%2017.75H81V30.75Z'%20fill='url(%23paint3_linear_1144_161961)'/%3e%3cpath%20d='M96%2035.25H81V48.25H96V35.25Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M109.907%2031C110.601%2031%20115.933%2027%20115.933%2025C115.933%2023%20110.736%2019%20109.907%2019C109.078%2019%20108.402%2019.5%20108.402%2020.4756C108.402%2021.4512%20111.907%2023.9206%20111.907%2023.9206C111.907%2023.9206%20104.254%2023.25%20104%2023.9206C103.746%2024.5911%20103.746%2025.4089%20104%2026.0794C104.254%2026.75%20111.907%2026.0794%20111.907%2026.0794C111.907%2026.0794%20108.402%2028.75%20108.402%2029.5301C108.402%2030.3103%20109.212%2031%20109.907%2031Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M143%2014H158V2.04083C158%201.76479%20157.934%201.50005%20157.816%201.30485C157.699%201.10966%20157.539%201%20157.373%201H143V14Z'%20fill='url(%23paint4_linear_1144_161961)'/%3e%3cpath%20d='M158%2018.5H143V31.5H158V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2036H143V49H158V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%202.03583V13.995H139V0.994995H124.627C124.461%200.994995%20124.301%201.10465%20124.184%201.29985C124.066%201.49504%20124%201.75978%20124%202.03583Z'%20fill='url(%23paint5_linear_1144_161961)'/%3e%3cpath%20d='M139%2018.495H124V31.495H139V18.495Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2035.995H124V48.995H139V35.995Z'%20fill='%2384AFF1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161961'%20x1='19'%20y1='7.5052'%20x2='34'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161961'%20x1='0'%20y1='7.5002'%20x2='15'%20y2='7.5002'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161961'%20x1='62'%20y1='24.2552'%20x2='76.9563'%20y2='24.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161961'%20x1='81'%20y1='24.2552'%20x2='96'%20y2='24.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_161961'%20x1='143'%20y1='7.5052'%20x2='158'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1144_161961'%20x1='124'%20y1='7.5002'%20x2='139'%20y2='7.5002'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161961'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%2017.75)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161961'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%2017.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_7 = "data:image/svg+xml,%3csvg%20width='140'%20height='48'%20viewBox='0%200%20140%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162032)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1144_162032)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1144_162032)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M26.4792%2027C27.8085%2027%2028.7528%2026.2757%2028.75%2025.2605C28.7528%2024.5418%2028.2958%2024.0285%2027.4208%2023.923V23.8774C28.0771%2023.7804%2028.5423%2023.327%2028.5395%2022.6711C28.5423%2021.7186%2027.706%2021%2026.4903%2021C25.2663%2021%2024.3746%2021.73%2024.3635%2022.7681H25.6734C25.6845%2022.3688%2026.0334%2022.1008%2026.4903%2022.1008C26.9251%2022.1008%2027.2214%2022.3717%2027.2186%2022.7624C27.2214%2023.1673%2026.8725%2023.4468%2026.3685%2023.4468H25.8174V24.4506H26.3685C26.9417%2024.4506%2027.3155%2024.7414%2027.31%2025.1521C27.3155%2025.5656%2026.9721%2025.8536%2026.4848%2025.8536C26.0001%2025.8536%2025.6429%2025.5884%2025.6291%2025.2034H24.25C24.2611%2026.2586%2025.1832%2027%2026.4792%2027Z'%20fill='%2324292E'/%3e%3cpath%20d='M24%2043.4453V42.4463L26.5893%2038.5H28.2308V42.4287H29V43.4453H28.2308V44.5H26.977V43.4453H24ZM27.0012%2042.4287V39.8828H26.9528L25.3204%2042.3818V42.4287H27.0012Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162032)'%3e%3cpath%20d='M51.675%2018.75H44.325C43.9073%2018.75%2043.5067%2018.9159%2043.2113%2019.2113C42.9159%2019.5067%2042.75%2019.9073%2042.75%2020.325V20.9392C42.7499%2021.156%2042.7946%2021.3705%2042.8813%2021.5692V21.6007C42.9554%2021.7693%2043.0605%2021.9224%2043.191%2022.0522L46.425%2025.2652V28.725C46.4248%2028.8142%2046.4474%2028.902%2046.4906%2028.9801C46.5337%2029.0582%2046.5961%2029.124%2046.6717%2029.1712C46.7553%2029.223%2046.8517%2029.2503%2046.95%2029.25C47.0322%2029.2495%2047.1131%2029.2297%2047.1862%2029.1922L49.2862%2028.1422C49.3728%2028.0986%2049.4456%2028.0319%2049.4966%2027.9494C49.5476%2027.8669%2049.5747%2027.7719%2049.575%2027.675V25.2652L52.788%2022.0522C52.9185%2021.9224%2053.0236%2021.7693%2053.0977%2021.6007V21.5692C53.1916%2021.3721%2053.2435%2021.1575%2053.25%2020.9392V20.325C53.25%2019.9073%2053.0841%2019.5067%2052.7887%2019.2113C52.4933%2018.9159%2052.0927%2018.75%2051.675%2018.75ZM48.6772%2024.6772C48.6286%2024.7263%2048.5901%2024.7845%2048.564%2024.8484C48.5378%2024.9124%2048.5246%2024.9809%2048.525%2025.05V27.3495L47.475%2027.8745V25.05C47.4754%2024.9809%2047.4622%2024.9124%2047.436%2024.8484C47.4099%2024.7845%2047.3714%2024.7263%2047.3227%2024.6772L44.5402%2021.9H51.4597L48.6772%2024.6772ZM52.2%2020.85H43.8V20.325C43.8%2020.1858%2043.8553%2020.0522%2043.9538%2019.9538C44.0522%2019.8553%2044.1858%2019.8%2044.325%2019.8H51.675C51.8142%2019.8%2051.9478%2019.8553%2052.0462%2019.9538C52.1447%2020.0522%2052.2%2020.1858%2052.2%2020.325V20.85Z'%20fill='%23CCCCDC'%20fill-opacity='0.65'/%3e%3c/g%3e%3cpath%20d='M56.8087%2027C55.7696%2027%2055%2026.4879%2055%2025.477C55%2024.3364%2055.9682%2023.9972%2057.0463%2023.9041C57.9932%2023.8176%2058.3656%2023.7744%2058.3656%2023.4452V23.4252C58.3656%2023.0062%2058.0712%2022.7635%2057.557%2022.7635C57.0144%2022.7635%2056.6917%2023.0129%2056.5888%2023.3521L55.1915%2023.2456C55.4007%2022.3145%2056.259%2021.7292%2057.5641%2021.7292C58.777%2021.7292%2059.8764%2022.2414%2059.8764%2023.4585V26.9036H58.4436V26.1953H58.401C58.1351%2026.6708%2057.6137%2027%2056.8087%2027ZM57.2414%2026.0224C57.9045%2026.0224%2058.3762%2025.6133%2058.3762%2025.0779V24.5359C58.1954%2024.649%2057.6563%2024.7221%2057.3265%2024.7654C56.7945%2024.8352%2056.4434%2025.0314%2056.4434%2025.4304C56.4434%2025.8195%2056.7768%2026.0224%2057.2414%2026.0224Z'%20fill='%23CCCCDC'%20fill-opacity='0.65'/%3e%3cpath%20d='M61.3889%2026.3727V25.1922H66.2866V26.3727H61.3889ZM61.3889%2024.1646V22.9841H66.2866V24.1646H61.3889Z'%20fill='%23CCCCDC'%20fill-opacity='0.65'/%3e%3cpath%20d='M67.0676%2027V26.0983L69.5304%2024.1474C70.1588%2023.6301%2070.4966%2023.3064%2070.4966%2022.8353C70.4966%2022.315%2070.0439%2021.9913%2069.4358%2021.9913C68.8041%2021.9913%2068.3851%2022.3381%2068.3885%2022.9046H67C66.9966%2021.7428%2067.9933%2021%2069.446%2021C70.9291%2021%2071.9088%2021.7254%2071.9088%2022.7514C71.9088%2023.4249%2071.527%2023.9798%2070.1047%2025.0896L69.0946%2025.9364V25.9769H72V27H67.0676Z'%20fill='%23CCCCDC'%20fill-opacity='0.65'/%3e%3cpath%20d='M87.9067%2030C88.6011%2030%2093.9327%2026%2093.9327%2024C93.9327%2022%2088.7357%2018%2087.9067%2018C87.0777%2018%2086.4023%2018.5%2086.4023%2019.4756C86.4023%2020.4512%2089.9067%2022.9206%2089.9067%2022.9206C89.9067%2022.9206%2082.2539%2022.25%2082%2022.9206C81.7461%2023.5911%2081.7461%2024.4089%2082%2025.0794C82.2539%2025.75%2089.9067%2025.0794%2089.9067%2025.0794C89.9067%2025.0794%2086.4023%2027.75%2086.4023%2028.5301C86.4023%2029.3103%2087.2123%2030%2087.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M102%209.79083V21.75H117V8.75H102.627C102.461%208.75%20102.301%208.85966%20102.184%209.05485C102.066%209.25005%20102%209.51479%20102%209.79083Z'%20fill='url(%23paint2_linear_1144_162032)'/%3e%3cpath%20d='M117%2026.25H102V39.25H117V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110.5%2029.75H109.072L107.5%2030.6699V31.9238L108.925%2031.1035H108.963V35.75H110.5V29.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M108.774%2018.25C109.526%2018.25%20110.046%2017.9877%20110.342%2017.4915H110.384V18.1678H112V14.8682C112%2013.841%20110.985%2013.25%20109.611%2013.25C108.16%2013.25%20107.337%2013.9074%20107.2%2014.7924L108.785%2014.8429C108.859%2014.5332%20109.143%2014.3436%20109.597%2014.3436C110.018%2014.3436%20110.285%2014.5269%20110.285%2014.8524V14.8682C110.285%2015.1653%20109.927%2015.2285%20109.006%2015.3012C107.914%2015.3834%20107%2015.7468%20107%2016.8214C107%2017.7822%20107.741%2018.25%20108.774%2018.25ZM109.305%2017.2386C108.908%2017.2386%20108.627%2017.068%20108.627%2016.7456C108.627%2016.4327%20108.901%2016.243%20109.389%2016.1767C109.709%2016.1356%20110.103%2016.0724%20110.296%2015.9807V16.4422C110.296%2016.9162%20109.853%2017.2386%20109.305%2017.2386Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1144_162032)'%3e%3cpath%20d='M121%2021.75H136V9.79083C136%209.51479%20135.934%209.25005%20135.816%209.05485C135.699%208.85966%20135.539%208.75%20135.373%208.75H121V21.75Z'%20fill='url(%23paint3_linear_1144_162032)'/%3e%3cpath%20d='M136%2026.25H121V39.25H136V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M126%2018.4362H127.566V17.7145H127.615C127.816%2018.1261%20128.262%2018.5%20129.013%2018.5C130.113%2018.5%20131%2017.729%20131%2016.213C131%2014.642%20130.061%2013.9261%20129.023%2013.9261C128.236%2013.9261%20127.806%2014.3377%20127.615%2014.7464H127.583V12.5H126V18.4362ZM127.55%2016.2101C127.55%2015.4826%20127.887%2015.0333%20128.466%2015.0333C129.052%2015.0333%20129.375%2015.4942%20129.375%2016.2101C129.375%2016.929%20129.052%2017.3957%20128.466%2017.3957C127.887%2017.3957%20127.55%2016.9319%20127.55%2016.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M128.479%2035.75C129.808%2035.75%20130.753%2035.0257%20130.75%2034.0105C130.753%2033.2918%20130.296%2032.7785%20129.421%2032.673V32.6274C130.077%2032.5304%20130.542%2032.077%20130.54%2031.4211C130.542%2030.4686%20129.706%2029.75%20128.49%2029.75C127.266%2029.75%20126.375%2030.48%20126.364%2031.5181H127.673C127.684%2031.1188%20128.033%2030.8508%20128.49%2030.8508C128.925%2030.8508%20129.221%2031.1217%20129.219%2031.5124C129.221%2031.9173%20128.872%2032.1968%20128.368%2032.1968H127.817V33.2006H128.368C128.942%2033.2006%20129.316%2033.4914%20129.31%2033.9021C129.316%2034.3156%20128.972%2034.6036%20128.485%2034.6036C128%2034.6036%20127.643%2034.3384%20127.629%2033.9534H126.25C126.261%2035.0086%20127.183%2035.75%20128.479%2035.75Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162032'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162032'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162032'%20x1='102'%20y1='15.2552'%20x2='117'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162032'%20x1='121'%20y1='15.2552'%20x2='136'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162032'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162032'%3e%3crect%20width='12'%20height='12'%20fill='white'%20transform='translate(42%2018)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162032'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(121%208.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_8 = "data:image/svg+xml,%3csvg%20width='77'%20height='48'%20viewBox='0%200%2077%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162003)'%3e%3cpath%20d='M19%2023H34V13.8006C34%2013.5883%2033.934%2013.3847%2033.8164%2013.2345C33.6989%2013.0844%2033.5394%2013%2033.3732%2013H19V23Z'%20fill='url(%23paint0_linear_1144_162003)'/%3e%3cpath%20d='M43%2026H19V35.5H43V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2026H19V35.5H34V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2039H19V48.5H34V39Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2020.9362H25.5663V20.2145H25.6149C25.8155%2020.6261%2026.2621%2021%2027.0129%2021C28.1133%2021%2029%2020.229%2029%2018.713C29%2017.142%2028.0615%2016.4261%2027.0227%2016.4261C26.2362%2016.4261%2025.8058%2016.8377%2025.6149%2017.2464H25.5825V15H24V20.9362ZM25.5502%2018.7101C25.5502%2017.9826%2025.8867%2017.5333%2026.466%2017.5333C27.0518%2017.5333%2027.3754%2017.9942%2027.3754%2018.7101C27.3754%2019.429%2027.0518%2019.8957%2026.466%2019.8957C25.8867%2019.8957%2025.5502%2019.4319%2025.5502%2018.7101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162003)'%3e%3cpath%20d='M0%2013.8006V23H15V13H0.626828C0.460583%2013%200.301147%2013.0844%200.183594%2013.2345C0.0660407%2013.3847%200%2013.5883%200%2013.8006Z'%20fill='url(%23paint1_linear_1144_162003)'/%3e%3cpath%20d='M24%2026H0V35.5H24V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2026H0V35.5H15V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2039H0V48.5H15V39Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2028H7.07158L5.5%2028.9199V30.1738L6.92531%2029.3535H6.96266V34H8.5V28Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2046.5H9.75V45.3468H7.33409V45.3092L8.04722%2044.6561C9.33959%2043.5376%209.67723%2042.9682%209.67723%2042.289C9.67723%2041.2225%208.8011%2040.5%207.44761%2040.5C6.12905%2040.5%205.2471%2041.2543%205.25001%2042.4595H6.61514C6.61514%2041.9249%206.94696%2041.6156%207.44179%2041.6156C7.92788%2041.6156%208.28008%2041.9133%208.28008%2042.4017C8.28008%2042.8439%208.00065%2043.1445%207.51165%2043.5809L5.33733%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%2020.5C7.52635%2020.5%208.04638%2020.2377%208.34153%2019.7415H8.3837V20.4178H10V17.1182C10%2016.091%208.98454%2015.5%207.61068%2015.5C6.15952%2015.5%205.33732%2016.1574%205.20028%2017.0424L6.78496%2017.0929C6.85875%2016.7832%207.14336%2016.5936%207.59663%2016.5936C8.01827%2016.5936%208.28531%2016.7769%208.28531%2017.1024V17.1182C8.28531%2017.4153%207.92692%2017.4785%207.00633%2017.5512C5.91356%2017.6334%205%2017.9968%205%2019.0714C5%2020.0322%205.74139%2020.5%206.77442%2020.5ZM7.30499%2019.4886C6.90794%2019.4886%206.62684%2019.318%206.62684%2018.9956C6.62684%2018.6827%206.90091%2018.493%207.38932%2018.4267C7.70907%2018.3856%208.1026%2018.3224%208.29585%2018.2307V18.6922C8.29585%2019.1662%207.85313%2019.4886%207.30499%2019.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2036.5C48.6011%2036.5%2053.9327%2032.5%2053.9327%2030.5C53.9327%2028.5%2048.7357%2024.5%2047.9067%2024.5C47.0777%2024.5%2046.4023%2025%2046.4023%2025.9756C46.4023%2026.9512%2049.9067%2029.4206%2049.9067%2029.4206C49.9067%2029.4206%2042.2539%2028.75%2042%2029.4206C41.7461%2030.0911%2041.7461%2030.9089%2042%2031.5794C42.2539%2032.25%2049.9067%2031.5794%2049.9067%2031.5794C49.9067%2031.5794%2046.4023%2034.25%2046.4023%2035.0301C46.4023%2035.8103%2047.2123%2036.5%2047.9067%2036.5Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip2_1144_162003)'%3e%3cpath%20d='M62%2013.8006V23H77V13H62.6268C62.4606%2013%2062.3011%2013.0844%2062.1836%2013.2345C62.066%2013.3847%2062%2013.5883%2062%2013.8006Z'%20fill='url(%23paint2_linear_1144_162003)'/%3e%3cpath%20d='M86%2026H62V35.5H86V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2026H62V35.5H77V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2039H62V48.5H77V39Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M70.5%2028H69.0716L67.5%2028.9199V30.1738L68.9253%2029.3535H68.9627V34H70.5V28Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.3373%2046.5H71.75V45.3468H69.3341V45.3092L70.0472%2044.6561C71.3396%2043.5376%2071.6772%2042.9682%2071.6772%2042.289C71.6772%2041.2225%2070.8011%2040.5%2069.4476%2040.5C68.129%2040.5%2067.2471%2041.2543%2067.25%2042.4595H68.6151C68.6151%2041.9249%2068.947%2041.6156%2069.4418%2041.6156C69.9279%2041.6156%2070.2801%2041.9133%2070.2801%2042.4017C70.2801%2042.8439%2070.0006%2043.1445%2069.5116%2043.5809L67.3373%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7744%2020.5C69.5264%2020.5%2070.0464%2020.2377%2070.3415%2019.7415H70.3837V20.4178H72V17.1182C72%2016.091%2070.9845%2015.5%2069.6107%2015.5C68.1595%2015.5%2067.3373%2016.1574%2067.2003%2017.0424L68.785%2017.0929C68.8587%2016.7832%2069.1434%2016.5936%2069.5966%2016.5936C70.0183%2016.5936%2070.2853%2016.7769%2070.2853%2017.1024V17.1182C70.2853%2017.4153%2069.9269%2017.4785%2069.0063%2017.5512C67.9136%2017.6334%2067%2017.9968%2067%2019.0714C67%2020.0322%2067.7414%2020.5%2068.7744%2020.5ZM69.305%2019.4886C68.9079%2019.4886%2068.6268%2019.318%2068.6268%2018.9956C68.6268%2018.6827%2068.9009%2018.493%2069.3893%2018.4267C69.7091%2018.3856%2070.1026%2018.3224%2070.2959%2018.2307V18.6922C70.2959%2019.1662%2069.8531%2019.4886%2069.305%2019.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_162003)'%3e%3cpath%20d='M29.675%200.75H22.325C21.9073%200.75%2021.5067%200.915937%2021.2113%201.21131C20.9159%201.50668%2020.75%201.90728%2020.75%202.325V2.93925C20.7499%203.15604%2020.7946%203.37052%2020.8813%203.56925V3.60075C20.9554%203.76926%2021.0605%203.9224%2021.191%204.05225L24.425%207.26525V10.725C24.4248%2010.8142%2024.4474%2010.902%2024.4906%2010.9801C24.5337%2011.0582%2024.5961%2011.124%2024.6717%2011.1712C24.7553%2011.223%2024.8517%2011.2503%2024.95%2011.25C25.0322%2011.2495%2025.1131%2011.2297%2025.1862%2011.1922L27.2862%2010.1422C27.3728%2010.0986%2027.4456%2010.0319%2027.4966%209.9494C27.5476%209.86693%2027.5747%209.77195%2027.575%209.675V7.26525L30.788%204.05225C30.9185%203.9224%2031.0236%203.76926%2031.0977%203.60075V3.56925C31.1916%203.37208%2031.2435%203.15753%2031.25%202.93925V2.325C31.25%201.90728%2031.0841%201.50668%2030.7887%201.21131C30.4933%200.915937%2030.0927%200.75%2029.675%200.75ZM26.6772%206.67725C26.6286%206.72631%2026.5901%206.78448%2026.564%206.84845C26.5378%206.91241%2026.5246%206.98091%2026.525%207.05V9.3495L25.475%209.8745V7.05C25.4754%206.98091%2025.4622%206.91241%2025.436%206.84845C25.4099%206.78448%2025.3714%206.72631%2025.3227%206.67725L22.5402%203.9H29.4597L26.6772%206.67725ZM30.2%202.85H21.8V2.325C21.8%202.18576%2021.8553%202.05223%2021.9538%201.95377C22.0522%201.85531%2022.1858%201.8%2022.325%201.8H29.675C29.8142%201.8%2029.9478%201.85531%2030.0462%201.95377C30.1447%202.05223%2030.2%202.18576%2030.2%202.325V2.85Z'%20fill='%23CCCCDC'%20fill-opacity='0.65'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162003'%20x1='19'%20y1='18.004'%20x2='34'%20y2='18.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162003'%20x1='0'%20y1='18.004'%20x2='15'%20y2='18.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162003'%20x1='62'%20y1='18.004'%20x2='77'%20y2='18.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162003'%3e%3crect%20width='15'%20height='35'%20fill='white'%20transform='translate(19%2013)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162003'%3e%3crect%20width='15'%20height='35'%20fill='white'%20transform='translate(0%2013)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162003'%3e%3crect%20width='15'%20height='35'%20fill='white'%20transform='translate(62%2013)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_162003'%3e%3crect%20width='12'%20height='12'%20fill='white'%20transform='translate(20)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_9 = "data:image/svg+xml,%3csvg%20width='58'%20height='48'%20viewBox='0%200%2058%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1810_47693)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M9.65%209.3H9.3V3.35C9.3%203.25717%209.26313%203.16815%209.19749%203.10251C9.13185%203.03687%209.04283%203%208.95%203H7.725C7.66392%203.00037%207.604%203.01672%207.5512%203.04742C7.49839%203.07812%207.45454%203.1221%207.424%203.175L3.8505%209.3H3.35C3.25717%209.3%203.16815%209.33687%203.10251%209.40251C3.03687%209.46815%203%209.55717%203%209.65C3%209.74283%203.03687%209.83185%203.10251%209.89749C3.16815%209.96313%203.25717%2010%203.35%2010H4.75C4.84283%2010%204.93185%209.96313%204.99749%209.89749C5.06313%209.83185%205.1%209.74283%205.1%209.65C5.1%209.55717%205.06313%209.46815%204.99749%209.40251C4.93185%209.33687%204.84283%209.3%204.75%209.3H4.659L5.884%207.2H8.6V9.3H8.25C8.15717%209.3%208.06815%209.33687%208.00251%209.40251C7.93687%209.46815%207.9%209.55717%207.9%209.65C7.9%209.74283%207.93687%209.83185%208.00251%209.89749C8.06815%209.96313%208.15717%2010%208.25%2010H9.65C9.74283%2010%209.83185%209.96313%209.89749%209.89749C9.96313%209.83185%2010%209.74283%2010%209.65C10%209.55717%209.96313%209.46815%209.89749%209.40251C9.83185%209.33687%209.74283%209.3%209.65%209.3ZM8.6%206.5H6.2935L7.9245%203.7H8.6V6.5Z'%20fill='white'/%3e%3cpath%20d='M6.84608%2027C7.52244%2027%207.9902%2026.7377%208.25569%2026.2415H8.29362V26.9178H9.74747V23.6182C9.74747%2022.591%208.83407%2022%207.59829%2022C6.29298%2022%205.55341%2022.6574%205.43015%2023.5424L6.85556%2023.5929C6.92193%2023.2832%207.17794%2023.0936%207.58565%2023.0936C7.96492%2023.0936%208.20512%2023.2769%208.20512%2023.6024V23.6182C8.20512%2023.9153%207.88274%2023.9785%207.05468%2024.0512C6.07174%2024.1334%205.25%2024.4968%205.25%2025.5714C5.25%2026.5322%205.91688%2027%206.84608%2027ZM7.32333%2025.9886C6.96618%2025.9886%206.71334%2025.818%206.71334%2025.4956C6.71334%2025.1827%206.95986%2024.993%207.39918%2024.9267C7.68679%2024.8856%208.04077%2024.8224%208.2146%2024.7307V25.1922C8.2146%2025.6662%207.81637%2025.9886%207.32333%2025.9886Z'%20fill='%2324292E'/%3e%3cpath%20d='M5%2044.4362H6.56634V43.7145H6.61489C6.81553%2044.1261%207.26214%2044.5%208.01294%2044.5C9.11327%2044.5%2010%2043.729%2010%2042.213C10%2040.642%209.06149%2039.9261%208.02265%2039.9261C7.23625%2039.9261%206.80583%2040.3377%206.61489%2040.7464H6.58252V38.5H5V44.4362ZM6.55016%2042.2101C6.55016%2041.4826%206.88673%2041.0333%207.46602%2041.0333C8.05178%2041.0333%208.3754%2041.4942%208.3754%2042.2101C8.3754%2042.929%208.05178%2043.3957%207.46602%2043.3957C6.88673%2043.3957%206.55016%2042.9319%206.55016%2042.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.9067%2030C29.6011%2030%2034.9327%2026%2034.9327%2024C34.9327%2022%2029.7357%2018%2028.9067%2018C28.0777%2018%2027.4023%2018.5%2027.4023%2019.4756C27.4023%2020.4512%2030.9067%2022.9206%2030.9067%2022.9206C30.9067%2022.9206%2023.2539%2022.25%2023%2022.9206C22.7461%2023.5911%2022.7461%2024.4089%2023%2025.0794C23.2539%2025.75%2030.9067%2025.0794%2030.9067%2025.0794C30.9067%2025.0794%2027.4023%2027.75%2027.4023%2028.5301C27.4023%2029.3103%2028.2123%2030%2028.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M43%201.04083V13H58V0H43.6268C43.4606%200%2043.3011%200.109659%2043.1836%200.304853C43.066%200.500047%2043%200.764787%2043%201.04083Z'%20fill='url(%23paint1_linear_1810_47693)'/%3e%3cpath%20d='M58%2017.5H43V30.5H58V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M58%2035H43V48H58V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52.65%209.3H52.3V3.35C52.3%203.25717%2052.2631%203.16815%2052.1975%203.10251C52.1318%203.03687%2052.0428%203%2051.95%203H50.725C50.6639%203.00037%2050.604%203.01672%2050.5512%203.04742C50.4984%203.07812%2050.4545%203.1221%2050.424%203.175L46.8505%209.3H46.35C46.2572%209.3%2046.1682%209.33687%2046.1025%209.40251C46.0369%209.46815%2046%209.55717%2046%209.65C46%209.74283%2046.0369%209.83185%2046.1025%209.89749C46.1682%209.96313%2046.2572%2010%2046.35%2010H47.75C47.8428%2010%2047.9318%209.96313%2047.9975%209.89749C48.0631%209.83185%2048.1%209.74283%2048.1%209.65C48.1%209.55717%2048.0631%209.46815%2047.9975%209.40251C47.9318%209.33687%2047.8428%209.3%2047.75%209.3H47.659L48.884%207.2H51.6V9.3H51.25C51.1572%209.3%2051.0682%209.33687%2051.0025%209.40251C50.9369%209.46815%2050.9%209.55717%2050.9%209.65C50.9%209.74283%2050.9369%209.83185%2051.0025%209.89749C51.0682%209.96313%2051.1572%2010%2051.25%2010H52.65C52.7428%2010%2052.8318%209.96313%2052.8975%209.89749C52.9631%209.83185%2053%209.74283%2053%209.65C53%209.55717%2052.9631%209.46815%2052.8975%209.40251C52.8318%209.33687%2052.7428%209.3%2052.65%209.3ZM51.6%206.5H49.2935L50.9245%203.7H51.6V6.5Z'%20fill='white'/%3e%3cpath%20d='M49.0114%2026.8182H47.5L49.4631%2021H51.3352L53.2983%2026.8182H51.7869L51.4034%2025.5966H49.3949L49.0114%2026.8182ZM49.7301%2024.5284H51.0682L50.4205%2022.4659H50.375L49.7301%2024.5284Z'%20fill='black'/%3e%3cpath%20d='M48.5%2044.8182V39H50.9261C52.233%2039%2052.9091%2039.5938%2052.9091%2040.4716C52.9091%2041.1364%2052.4602%2041.5994%2051.821%2041.733V41.7898C52.5256%2041.821%2053.1364%2042.3494%2053.1364%2043.1903C53.1364%2044.1307%2052.3977%2044.8182%2051.1108%2044.8182H48.5ZM49.9062%2043.6847H50.7756C51.3835%2043.6847%2051.6676%2043.4403%2051.6676%2043.0284C51.6676%2042.5824%2051.3381%2042.2983%2050.8011%2042.2983H49.9062V43.6847ZM49.9062%2041.392H50.6847C51.1449%2041.392%2051.4744%2041.1534%2051.4744%2040.7443C51.4744%2040.358%2051.1761%2040.1165%2050.7074%2040.1165H49.9062V41.392Z'%20fill='black'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1810_47693'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1810_47693'%20x1='43'%20y1='6.5052'%20x2='58'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_10 = "data:image/svg+xml,%3csvg%20width='122'%20height='48'%20viewBox='0%200%20122%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1702_26101)'%3e%3cpath%20d='M0%201.04083V13H54V0H2.25658C1.6581%200%200%200%200%200C0%200%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1702_26101)'/%3e%3cpath%20d='M54%2018H0V31H54V18Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M4.28977%2028.6364C3.95739%2028.6364%203.64773%2028.5824%203.4375%2028.4972L3.74432%2027.4886C4.15341%2027.6222%204.45455%2027.6165%204.58807%2027.2898L4.64205%2027.1591L3.09091%2022.6364H4.54545L5.34943%2025.75H5.39489L6.21023%2022.6364H7.6733L6.02841%2027.4176C5.78693%2028.1307%205.28977%2028.6364%204.28977%2028.6364ZM9.0554%2028.6364C8.72301%2028.6364%208.41335%2028.5824%208.20312%2028.4972L8.50994%2027.4886C8.91903%2027.6222%209.22017%2027.6165%209.35369%2027.2898L9.40767%2027.1591L7.85653%2022.6364H9.31108L10.1151%2025.75H10.1605L10.9759%2022.6364H12.4389L10.794%2027.4176C10.5526%2028.1307%2010.0554%2028.6364%209.0554%2028.6364ZM13.821%2028.6364C13.4886%2028.6364%2013.179%2028.5824%2012.9688%2028.4972L13.2756%2027.4886C13.6847%2027.6222%2013.9858%2027.6165%2014.1193%2027.2898L14.1733%2027.1591L12.6222%2022.6364H14.0767L14.8807%2025.75H14.9261L15.7415%2022.6364H17.2045L15.5597%2027.4176C15.3182%2028.1307%2014.821%2028.6364%2013.821%2028.6364ZM18.5866%2028.6364C18.2543%2028.6364%2017.9446%2028.5824%2017.7344%2028.4972L18.0412%2027.4886C18.4503%2027.6222%2018.7514%2027.6165%2018.8849%2027.2898L18.9389%2027.1591L17.3878%2022.6364H18.8423L19.6463%2025.75H19.6918L20.5071%2022.6364H21.9702L20.3253%2027.4176C20.0838%2028.1307%2019.5866%2028.6364%2018.5866%2028.6364ZM25.2955%2024.1108V25.1818H22.6023V24.1108H25.2955ZM26.2763%2027V22.6364H27.5973V23.4375H27.6456C27.8274%2022.9062%2028.282%2022.5795%2028.8786%2022.5795C29.4837%2022.5795%2029.9524%2022.9148%2030.0689%2023.4375H30.1143C30.2763%2022.9176%2030.7848%2022.5795%2031.4297%2022.5795C32.2536%2022.5795%2032.8217%2023.1392%2032.8217%2024.0625V27H31.4325V24.3807C31.4325%2023.946%2031.1825%2023.7102%2030.8303%2023.7102C30.4467%2023.7102%2030.2166%2023.9773%2030.2166%2024.3949V27H28.8814V24.3665C28.8814%2023.9631%2028.6428%2023.7102%2028.282%2023.7102C27.9183%2023.7102%2027.6655%2023.9858%2027.6655%2024.4176V27H26.2763ZM33.6825%2027V22.6364H35.0036V23.4375H35.0518C35.2337%2022.9062%2035.6882%2022.5795%2036.2848%2022.5795C36.8899%2022.5795%2037.3587%2022.9148%2037.4751%2023.4375H37.5206C37.6825%2022.9176%2038.1911%2022.5795%2038.8359%2022.5795C39.6598%2022.5795%2040.228%2023.1392%2040.228%2024.0625V27H38.8388V24.3807C38.8388%2023.946%2038.5888%2023.7102%2038.2365%2023.7102C37.853%2023.7102%2037.6229%2023.9773%2037.6229%2024.3949V27H36.2876V24.3665C36.2876%2023.9631%2036.049%2023.7102%2035.6882%2023.7102C35.3246%2023.7102%2035.0717%2023.9858%2035.0717%2024.4176V27H33.6825ZM43.8814%2024.1108V25.1818H41.1882V24.1108H43.8814ZM46.456%2027.0625C45.4929%2027.0625%2044.7116%2026.3068%2044.7116%2024.821C44.7116%2023.2812%2045.5384%2022.5795%2046.4503%2022.5795C47.1378%2022.5795%2047.5185%2022.983%2047.6832%2023.3835H47.7116V21.1818H49.1009V27H47.7259V26.2926H47.6832C47.5071%2026.696%2047.1151%2027.0625%2046.456%2027.0625ZM46.9389%2025.9801C47.4446%2025.9801%2047.7429%2025.5256%2047.7429%2024.8182C47.7429%2024.1051%2047.4474%2023.6648%2046.9389%2023.6648C46.4219%2023.6648%2046.1378%2024.1165%2046.1378%2024.8182C46.1378%2025.5227%2046.4247%2025.9801%2046.9389%2025.9801Z'%20fill='%2324292E'/%3e%3cpath%20d='M54%2035H0V48H54V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M5.28977%2045.6364C4.95739%2045.6364%204.64773%2045.5824%204.4375%2045.4972L4.74432%2044.4886C5.15341%2044.6222%205.45455%2044.6165%205.58807%2044.2898L5.64205%2044.1591L4.09091%2039.6364H5.54545L6.34943%2042.75H6.39489L7.21023%2039.6364H8.6733L7.02841%2044.4176C6.78693%2045.1307%206.28977%2045.6364%205.28977%2045.6364ZM10.0554%2045.6364C9.72301%2045.6364%209.41335%2045.5824%209.20312%2045.4972L9.50994%2044.4886C9.91903%2044.6222%2010.2202%2044.6165%2010.3537%2044.2898L10.4077%2044.1591L8.85653%2039.6364H10.3111L11.1151%2042.75H11.1605L11.9759%2039.6364H13.4389L11.794%2044.4176C11.5526%2045.1307%2011.0554%2045.6364%2010.0554%2045.6364ZM14.821%2045.6364C14.4886%2045.6364%2014.179%2045.5824%2013.9688%2045.4972L14.2756%2044.4886C14.6847%2044.6222%2014.9858%2044.6165%2015.1193%2044.2898L15.1733%2044.1591L13.6222%2039.6364H15.0767L15.8807%2042.75H15.9261L16.7415%2039.6364H18.2045L16.5597%2044.4176C16.3182%2045.1307%2015.821%2045.6364%2014.821%2045.6364ZM19.5866%2045.6364C19.2543%2045.6364%2018.9446%2045.5824%2018.7344%2045.4972L19.0412%2044.4886C19.4503%2044.6222%2019.7514%2044.6165%2019.8849%2044.2898L19.9389%2044.1591L18.3878%2039.6364H19.8423L20.6463%2042.75H20.6918L21.5071%2039.6364H22.9702L21.3253%2044.4176C21.0838%2045.1307%2020.5866%2045.6364%2019.5866%2045.6364ZM26.2955%2041.1108V42.1818H23.6023V41.1108H26.2955ZM27.2763%2044V39.6364H28.5973V40.4375H28.6456C28.8274%2039.9062%2029.282%2039.5795%2029.8786%2039.5795C30.4837%2039.5795%2030.9524%2039.9148%2031.0689%2040.4375H31.1143C31.2763%2039.9176%2031.7848%2039.5795%2032.4297%2039.5795C33.2536%2039.5795%2033.8217%2040.1392%2033.8217%2041.0625V44H32.4325V41.3807C32.4325%2040.946%2032.1825%2040.7102%2031.8303%2040.7102C31.4467%2040.7102%2031.2166%2040.9773%2031.2166%2041.3949V44H29.8814V41.3665C29.8814%2040.9631%2029.6428%2040.7102%2029.282%2040.7102C28.9183%2040.7102%2028.6655%2040.9858%2028.6655%2041.4176V44H27.2763ZM34.6825%2044V39.6364H36.0036V40.4375H36.0518C36.2337%2039.9062%2036.6882%2039.5795%2037.2848%2039.5795C37.8899%2039.5795%2038.3587%2039.9148%2038.4751%2040.4375H38.5206C38.6825%2039.9176%2039.1911%2039.5795%2039.8359%2039.5795C40.6598%2039.5795%2041.228%2040.1392%2041.228%2041.0625V44H39.8388V41.3807C39.8388%2040.946%2039.5888%2040.7102%2039.2365%2040.7102C38.853%2040.7102%2038.6229%2040.9773%2038.6229%2041.3949V44H37.2876V41.3665C37.2876%2040.9631%2037.049%2040.7102%2036.6882%2040.7102C36.3246%2040.7102%2036.0717%2040.9858%2036.0717%2041.4176V44H34.6825ZM44.8814%2041.1108V42.1818H42.1882V41.1108H44.8814ZM47.456%2044.0625C46.4929%2044.0625%2045.7116%2043.3068%2045.7116%2041.821C45.7116%2040.2812%2046.5384%2039.5795%2047.4503%2039.5795C48.1378%2039.5795%2048.5185%2039.983%2048.6832%2040.3835H48.7116V38.1818H50.1009V44H48.7259V43.2926H48.6832C48.5071%2043.696%2048.1151%2044.0625%2047.456%2044.0625ZM47.9389%2042.9801C48.4446%2042.9801%2048.7429%2042.5256%2048.7429%2041.8182C48.7429%2041.1051%2048.4474%2040.6648%2047.9389%2040.6648C47.4219%2040.6648%2047.1378%2041.1165%2047.1378%2041.8182C47.1378%2042.5227%2047.4247%2042.9801%2047.9389%2042.9801Z'%20fill='%2324292E'/%3e%3cpath%20d='M27%203C26.3078%203%2025.6311%203.20527%2025.0555%203.58986C24.4799%203.97444%2024.0313%204.52107%2023.7664%205.16061C23.5015%205.80015%2023.4322%206.50388%2023.5673%207.18282C23.7023%207.86175%2024.0356%208.48539%2024.5251%208.97487C25.0146%209.46436%2025.6383%209.7977%2026.3172%209.93275C26.9961%2010.0678%2027.6999%209.99848%2028.3394%209.73358C28.9789%209.46867%2029.5256%209.02007%2029.9101%208.44449C30.2947%207.86892%2030.5%207.19223%2030.5%206.5C30.5%206.04037%2030.4095%205.58525%2030.2336%205.16061C30.0577%204.73597%2029.7999%204.35013%2029.4749%204.02513C29.1499%203.70012%2028.764%203.44231%2028.3394%203.26642C27.9148%203.09053%2027.4596%203%2027%203V3ZM27%209.3C26.4462%209.3%2025.9049%209.13578%2025.4444%208.82811C24.9839%208.52045%2024.6251%208.08315%2024.4131%207.57151C24.2012%207.05988%2024.1458%206.49689%2024.2538%205.95375C24.3618%205.4106%2024.6285%204.91169%2025.0201%204.5201C25.4117%204.12851%2025.9106%203.86184%2026.4537%203.7538C26.9969%203.64576%2027.5599%203.70121%2028.0715%203.91314C28.5831%204.12506%2029.0204%204.48395%2029.3281%204.9444C29.6358%205.40486%2029.8%205.94621%2029.8%206.5C29.8%207.24261%2029.505%207.9548%2028.9799%208.4799C28.4548%209.005%2027.7426%209.3%2027%209.3V9.3ZM27%204.4C26.9072%204.4%2026.8182%204.43687%2026.7525%204.50251C26.6869%204.56815%2026.65%204.65717%2026.65%204.75V6.15H25.95C25.8572%206.15%2025.7682%206.18687%2025.7025%206.25251C25.6369%206.31815%2025.6%206.40717%2025.6%206.5C25.6%206.59283%2025.6369%206.68185%2025.7025%206.74749C25.7682%206.81312%2025.8572%206.85%2025.95%206.85H27C27.0928%206.85%2027.1819%206.81312%2027.2475%206.74749C27.3131%206.68185%2027.35%206.59283%2027.35%206.5V4.75C27.35%204.65717%2027.3131%204.56815%2027.2475%204.50251C27.1819%204.43687%2027.0928%204.4%2027%204.4Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M67.9067%2030C68.6011%2030%2073.9327%2026%2073.9327%2024C73.9327%2022%2068.7357%2018%2067.9067%2018C67.0777%2018%2066.4023%2018.5%2066.4023%2019.4756C66.4023%2020.4512%2069.9067%2022.9206%2069.9067%2022.9206C69.9067%2022.9206%2062.2539%2022.25%2062%2022.9206C61.7461%2023.5911%2061.7461%2024.4089%2062%2025.0794C62.2539%2025.75%2069.9067%2025.0794%2069.9067%2025.0794C69.9067%2025.0794%2066.4023%2027.75%2066.4023%2028.5301C66.4023%2029.3103%2067.2123%2030%2067.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M82%201.04083V13H122V0H83.6715H82V1.04083Z'%20fill='url(%23paint1_linear_1702_26101)'/%3e%3cpath%20d='M122%2018H82V31H122V18Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M88.4403%2027.5V23.1364H89.7614V23.9375H89.8097C89.9915%2023.4062%2090.446%2023.0795%2091.0426%2023.0795C91.6477%2023.0795%2092.1165%2023.4148%2092.233%2023.9375H92.2784C92.4403%2023.4176%2092.9489%2023.0795%2093.5938%2023.0795C94.4176%2023.0795%2094.9858%2023.6392%2094.9858%2024.5625V27.5H93.5966V24.8807C93.5966%2024.446%2093.3466%2024.2102%2092.9943%2024.2102C92.6108%2024.2102%2092.3807%2024.4773%2092.3807%2024.8949V27.5H91.0455V24.8665C91.0455%2024.4631%2090.8068%2024.2102%2090.446%2024.2102C90.0824%2024.2102%2089.8295%2024.4858%2089.8295%2024.9176V27.5H88.4403ZM95.8466%2027.5V23.1364H97.1676V23.9375H97.2159C97.3977%2023.4062%2097.8523%2023.0795%2098.4489%2023.0795C99.054%2023.0795%2099.5227%2023.4148%2099.6392%2023.9375H99.6847C99.8466%2023.4176%20100.355%2023.0795%20101%2023.0795C101.824%2023.0795%20102.392%2023.6392%20102.392%2024.5625V27.5H101.003V24.8807C101.003%2024.446%20100.753%2024.2102%20100.401%2024.2102C100.017%2024.2102%2099.7869%2024.4773%2099.7869%2024.8949V27.5H98.4517V24.8665C98.4517%2024.4631%2098.2131%2024.2102%2097.8523%2024.2102C97.4886%2024.2102%2097.2358%2024.4858%2097.2358%2024.9176V27.5H95.8466ZM106.045%2024.6108V25.6818H103.352V24.6108H106.045ZM108.62%2027.5625C107.657%2027.5625%20106.876%2026.8068%20106.876%2025.321C106.876%2023.7812%20107.702%2023.0795%20108.614%2023.0795C109.302%2023.0795%20109.683%2023.483%20109.847%2023.8835H109.876V21.6818H111.265V27.5H109.89V26.7926H109.847C109.671%2027.196%20109.279%2027.5625%20108.62%2027.5625ZM109.103%2026.4801C109.609%2026.4801%20109.907%2026.0256%20109.907%2025.3182C109.907%2024.6051%20109.612%2024.1648%20109.103%2024.1648C108.586%2024.1648%20108.302%2024.6165%20108.302%2025.3182C108.302%2026.0227%20108.589%2026.4801%20109.103%2026.4801ZM113.737%2027.5625C112.774%2027.5625%20111.993%2026.8068%20111.993%2025.321C111.993%2023.7812%20112.82%2023.0795%20113.732%2023.0795C114.419%2023.0795%20114.8%2023.483%20114.964%2023.8835H114.993V21.6818H116.382V27.5H115.007V26.7926H114.964C114.788%2027.196%20114.396%2027.5625%20113.737%2027.5625ZM114.22%2026.4801C114.726%2026.4801%20115.024%2026.0256%20115.024%2025.3182C115.024%2024.6051%20114.729%2024.1648%20114.22%2024.1648C113.703%2024.1648%20113.419%2024.6165%20113.419%2025.3182C113.419%2026.0227%20113.706%2026.4801%20114.22%2026.4801Z'%20fill='%2324292E'/%3e%3cpath%20d='M122%2035H82V48H122V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M102%203C101.308%203%20100.631%203.20527%20100.056%203.58986C99.4799%203.97444%2099.0313%204.52107%2098.7664%205.16061C98.5015%205.80015%2098.4322%206.50388%2098.5673%207.18282C98.7023%207.86175%2099.0356%208.48539%2099.5251%208.97487C100.015%209.46436%20100.638%209.7977%20101.317%209.93275C101.996%2010.0678%20102.7%209.99848%20103.339%209.73358C103.979%209.46867%20104.526%209.02007%20104.91%208.44449C105.295%207.86892%20105.5%207.19223%20105.5%206.5C105.5%206.04037%20105.409%205.58525%20105.234%205.16061C105.058%204.73597%20104.8%204.35013%20104.475%204.02513C104.15%203.70012%20103.764%203.44231%20103.339%203.26642C102.915%203.09053%20102.46%203%20102%203V3ZM102%209.3C101.446%209.3%20100.905%209.13578%20100.444%208.82811C99.9839%208.52045%2099.6251%208.08315%2099.4131%207.57151C99.2012%207.05988%2099.1458%206.49689%2099.2538%205.95375C99.3618%205.4106%2099.6285%204.91169%20100.02%204.5201C100.412%204.12851%20100.911%203.86184%20101.454%203.7538C101.997%203.64576%20102.56%203.70121%20103.072%203.91314C103.583%204.12506%20104.02%204.48395%20104.328%204.9444C104.636%205.40486%20104.8%205.94621%20104.8%206.5C104.8%207.24261%20104.505%207.9548%20103.98%208.4799C103.455%209.005%20102.743%209.3%20102%209.3V9.3ZM102%204.4C101.907%204.4%20101.818%204.43687%20101.753%204.50251C101.687%204.56815%20101.65%204.65717%20101.65%204.75V6.15H100.95C100.857%206.15%20100.768%206.18687%20100.703%206.25251C100.637%206.31815%20100.6%206.40717%20100.6%206.5C100.6%206.59283%20100.637%206.68185%20100.703%206.74749C100.768%206.81312%20100.857%206.85%20100.95%206.85H102C102.093%206.85%20102.182%206.81312%20102.247%206.74749C102.313%206.68185%20102.35%206.59283%20102.35%206.5V4.75C102.35%204.65717%20102.313%204.56815%20102.247%204.50251C102.182%204.43687%20102.093%204.4%20102%204.4Z'%20fill='white'/%3e%3cpath%20d='M93.2898%2045.6364C92.9574%2045.6364%2092.6477%2045.5824%2092.4375%2045.4972L92.7443%2044.4886C93.1534%2044.6222%2093.4545%2044.6165%2093.5881%2044.2898L93.642%2044.1591L92.0909%2039.6364H93.5455L94.3494%2042.75H94.3949L95.2102%2039.6364H96.6733L95.0284%2044.4176C94.7869%2045.1307%2094.2898%2045.6364%2093.2898%2045.6364ZM98.0554%2045.6364C97.723%2045.6364%2097.4134%2045.5824%2097.2031%2045.4972L97.5099%2044.4886C97.919%2044.6222%2098.2202%2044.6165%2098.3537%2044.2898L98.4077%2044.1591L96.8565%2039.6364H98.3111L99.1151%2042.75H99.1605L99.9759%2039.6364H101.439L99.794%2044.4176C99.5526%2045.1307%2099.0554%2045.6364%2098.0554%2045.6364ZM102.821%2045.6364C102.489%2045.6364%20102.179%2045.5824%20101.969%2045.4972L102.276%2044.4886C102.685%2044.6222%20102.986%2044.6165%20103.119%2044.2898L103.173%2044.1591L101.622%2039.6364H103.077L103.881%2042.75H103.926L104.741%2039.6364H106.205L104.56%2044.4176C104.318%2045.1307%20103.821%2045.6364%20102.821%2045.6364ZM107.587%2045.6364C107.254%2045.6364%20106.945%2045.5824%20106.734%2045.4972L107.041%2044.4886C107.45%2044.6222%20107.751%2044.6165%20107.885%2044.2898L107.939%2044.1591L106.388%2039.6364H107.842L108.646%2042.75H108.692L109.507%2039.6364H110.97L109.325%2044.4176C109.084%2045.1307%20108.587%2045.6364%20107.587%2045.6364Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1702_26101'%20x1='0'%20y1='6.5052'%20x2='54'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1702_26101'%20x1='82'%20y1='6.5052'%20x2='122'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1702_26101'%3e%3crect%20width='54'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_11 = "data:image/svg+xml,%3csvg%20width='78'%20height='51'%20viewBox='0%200%2078%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162243)'%3e%3cpath%20d='M2%200.800642V10H26V1.05456e-06H3.00292L2.0002%200L2%200.800642Z'%20fill='url(%23paint0_linear_1144_162243)'/%3e%3cpath%20d='M26%2013H2V22.5H26V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2025.75H2V35.25H26V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2038.5H2V48H26V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15.5%2014.75H14.0716L12.5%2015.6699V16.9238L13.9253%2016.1035H13.9627V20.75H15.5V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2033.5H16.5V32.3468H14.0841V32.3092L14.7972%2031.6561C16.0896%2030.5376%2016.4272%2029.9682%2016.4272%2029.289C16.4272%2028.2225%2015.5511%2027.5%2014.1976%2027.5C12.879%2027.5%2011.9971%2028.2543%2012%2029.4595H13.3651C13.3651%2028.9249%2013.697%2028.6156%2014.1918%2028.6156C14.6779%2028.6156%2015.0301%2028.9133%2015.0301%2029.4017C15.0301%2029.8439%2014.7506%2030.1445%2014.2616%2030.5809L12.0873%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2046.5H16.5V45.3468H14.0841V45.3092L14.7972%2044.6561C16.0896%2043.5376%2016.4272%2042.9682%2016.4272%2042.289C16.4272%2041.2225%2015.5511%2040.5%2014.1976%2040.5C12.879%2040.5%2011.9971%2041.2543%2012%2042.4595H13.3651C13.3651%2041.9249%2013.697%2041.6156%2014.1918%2041.6156C14.6779%2041.6156%2015.0301%2041.9133%2015.0301%2042.4017C15.0301%2042.8439%2014.7506%2043.1445%2014.2616%2043.5809L12.0873%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M39.9067%2030C40.6011%2030%2045.9327%2026%2045.9327%2024C45.9327%2022%2040.7357%2018%2039.9067%2018C39.0777%2018%2038.4023%2018.5%2038.4023%2019.4756C38.4023%2020.4512%2041.9067%2022.9206%2041.9067%2022.9206C41.9067%2022.9206%2034.2539%2022.25%2034%2022.9206C33.7461%2023.5911%2033.7461%2024.4089%2034%2025.0794C34.2539%2025.75%2041.9067%2025.0794%2041.9067%2025.0794C41.9067%2025.0794%2038.4023%2027.75%2038.4023%2028.5301C38.4023%2029.3103%2039.2123%2030%2039.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1144_162243)'%3e%3cpath%20d='M54%200.800642V10H78V1.13097e-06H55.0029C54.7369%201.13097e-06%2054.0001%200%2054.0001%200C54.0001%200%2054%200.588299%2054%200.800642Z'%20fill='url(%23paint1_linear_1144_162243)'/%3e%3cpath%20d='M78%2013H54V29H78V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M78%2032H54V48H78V32Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M67.5%2018H66.0716L64.5%2018.9199V20.1738L65.9253%2019.3535H65.9627V24H67.5V18Z'%20fill='%2324292E'/%3e%3cpath%20d='M64.0873%2043H68.5V41.8468H66.0841V41.8092L66.7972%2041.1561C68.0896%2040.0376%2068.4272%2039.4682%2068.4272%2038.789C68.4272%2037.7225%2067.5511%2037%2066.1976%2037C64.879%2037%2063.9971%2037.7543%2064%2038.9595H65.3651C65.3651%2038.4249%2065.697%2038.1156%2066.1918%2038.1156C66.6779%2038.1156%2067.0301%2038.4133%2067.0301%2038.9017C67.0301%2039.3439%2066.7506%2039.6445%2066.2616%2040.0809L64.0873%2041.9711V43Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26%2025.7421H2V48H26V25.7421ZM0%2023.6179V50H28V23.6179L0%2023.6179Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162243'%20x1='2.00781'%20y1='5.004'%20x2='26.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162243'%20x1='54.001'%20y1='5.004'%20x2='78.001'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162243'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162243'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(54)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_12 = "data:image/svg+xml,%3csvg%20width='77'%20height='50'%20viewBox='0%200%2077%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162268)'%3e%3cpath%20d='M2%200.800642V10H26V1.05456e-06H3.00292L2.0002%200L2%200.800642Z'%20fill='url(%23paint0_linear_1144_162268)'/%3e%3cpath%20d='M26%2013H2V22.5H26V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2025.75H2V35.25H26V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2038.5H2V48H26V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15.5%2014.75H14.0716L12.5%2015.6699V16.9238L13.9253%2016.1035H13.9627V20.75H15.5V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2033.5H16.5V32.3468H14.0841V32.3092L14.7972%2031.6561C16.0896%2030.5376%2016.4272%2029.9682%2016.4272%2029.289C16.4272%2028.2225%2015.5511%2027.5%2014.1976%2027.5C12.879%2027.5%2011.9971%2028.2543%2012%2029.4595H13.3651C13.3651%2028.9249%2013.697%2028.6156%2014.1918%2028.6156C14.6779%2028.6156%2015.0301%2028.9133%2015.0301%2029.4017C15.0301%2029.8439%2014.7506%2030.1445%2014.2616%2030.5809L12.0873%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2046.5H16.5V45.3468H14.0841V45.3092L14.7972%2044.6561C16.0896%2043.5376%2016.4272%2042.9682%2016.4272%2042.289C16.4272%2041.2225%2015.5511%2040.5%2014.1976%2040.5C12.879%2040.5%2011.9971%2041.2543%2012%2042.4595H13.3651C13.3651%2041.9249%2013.697%2041.6156%2014.1918%2041.6156C14.6779%2041.6156%2015.0301%2041.9133%2015.0301%2042.4017C15.0301%2042.8439%2014.7506%2043.1445%2014.2616%2043.5809L12.0873%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M38.9067%2030C39.6011%2030%2044.9327%2026%2044.9327%2024C44.9327%2022%2039.7357%2018%2038.9067%2018C38.0777%2018%2037.4023%2018.5%2037.4023%2019.4756C37.4023%2020.4512%2040.9067%2022.9206%2040.9067%2022.9206C40.9067%2022.9206%2033.2539%2022.25%2033%2022.9206C32.7461%2023.5911%2032.7461%2024.4089%2033%2025.0794C33.2539%2025.75%2040.9067%2025.0794%2040.9067%2025.0794C40.9067%2025.0794%2037.4023%2027.75%2037.4023%2028.5301C37.4023%2029.3103%2038.2123%2030%2038.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1144_162268)'%3e%3cpath%20d='M63.7933%207.6179C64.5533%207.6179%2065.0788%207.32315%2065.3771%206.76562H65.4197V7.52557H67.0533V3.81818C67.0533%202.66406%2066.027%202%2064.6385%202C63.1719%202%2062.3409%202.73864%2062.2024%203.73295L63.804%203.78977C63.8786%203.44176%2064.1662%203.22869%2064.6243%203.22869C65.0504%203.22869%2065.3203%203.43466%2065.3203%203.80043V3.81818C65.3203%204.15199%2064.9581%204.22301%2064.0277%204.30469C62.9233%204.39702%2062%204.8054%2062%206.01278C62%207.09233%2062.7493%207.6179%2063.7933%207.6179ZM64.3295%206.48153C63.9283%206.48153%2063.6442%206.28977%2063.6442%205.92756C63.6442%205.57599%2063.9212%205.36293%2064.4148%205.28835C64.7379%205.24219%2065.1357%205.17116%2065.331%205.06818V5.58665C65.331%206.11932%2064.8835%206.48153%2064.3295%206.48153Z'%20fill='%2324292E'/%3e%3cpath%20d='M53%200.800642V10H77V1.13097e-06H54.0029C53.7369%201.13097e-06%2053.0001%200%2053.0001%200C53.0001%200%2053%200.588299%2053%200.800642Z'%20fill='url(%23paint1_linear_1144_162268)'/%3e%3cpath%20d='M77%2013H53V29H77V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2032H53V48H77V32Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M67%2017H65.0954L63%2018.2266V19.8984L64.9004%2018.8047H64.9502V25H67V17Z'%20fill='%2324292E'/%3e%3cpath%20d='M61.6524%2038.202H61.2683C61.0645%2038.202%2060.8691%2038.1207%2060.725%2037.9759C60.5809%2037.8311%2060.5%2037.6347%2060.5%2037.43C60.5%2037.2253%2060.5809%2037.0289%2060.725%2036.8841C60.8691%2036.7393%2061.0645%2036.658%2061.2683%2036.658H61.6524V36.272C61.6524%2036.0673%2061.7334%2035.8709%2061.8775%2035.7261C62.0216%2035.5813%2062.217%2035.5%2062.4207%2035.5C62.6245%2035.5%2062.8199%2035.5813%2062.964%2035.7261C63.1081%2035.8709%2063.189%2036.0673%2063.189%2036.272V36.658H63.5732C63.7769%2036.658%2063.9724%2036.7393%2064.1164%2036.8841C64.2605%2037.0289%2064.3415%2037.2253%2064.3415%2037.43C64.3415%2037.6347%2064.2605%2037.8311%2064.1164%2037.9759C63.9724%2038.1207%2063.7769%2038.202%2063.5732%2038.202H63.189V38.588C63.189%2038.7927%2063.1081%2038.9891%2062.964%2039.1339C62.8199%2039.2787%2062.6245%2039.36%2062.4207%2039.36C62.217%2039.36%2062.0216%2039.2787%2061.8775%2039.1339C61.7334%2038.9891%2061.6524%2038.7927%2061.6524%2038.588V38.202Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7317%2042.184H66.4268C66.2231%2042.184%2066.0276%2042.1027%2065.8836%2041.9579C65.7395%2041.8131%2065.6585%2041.6167%2065.6585%2041.412C65.6585%2041.2073%2065.7395%2041.0109%2065.8836%2040.8661C66.0276%2040.7213%2066.2231%2040.64%2066.4268%2040.64H68.7317C68.9355%2040.64%2069.1309%2040.7213%2069.275%2040.8661C69.4191%2041.0109%2069.5%2041.2073%2069.5%2041.412C69.5%2041.6167%2069.4191%2041.8131%2069.275%2041.9579C69.1309%2042.1027%2068.9355%2042.184%2068.7317%2042.184Z'%20fill='%2324292E'/%3e%3cpath%20d='M66.4268%2036.658H68.7317C68.9355%2036.658%2069.1309%2036.7393%2069.275%2036.8841C69.4191%2037.0289%2069.5%2037.2253%2069.5%2037.43C69.5%2037.6347%2069.4191%2037.8311%2069.275%2037.9759C69.1309%2038.1207%2068.9355%2038.202%2068.7317%2038.202H66.4268C66.2231%2038.202%2066.0276%2038.1207%2065.8836%2037.9759C65.7395%2037.8311%2065.6585%2037.6347%2065.6585%2037.43C65.6585%2037.2253%2065.7395%2037.0289%2065.8836%2036.8841C66.0276%2036.7393%2066.2231%2036.658%2066.4268%2036.658Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7317%2044.5H66.4268C66.2231%2044.5%2066.0276%2044.4187%2065.8836%2044.2739C65.7395%2044.1291%2065.6585%2043.9328%2065.6585%2043.728C65.6585%2043.5233%2065.7395%2043.3269%2065.8836%2043.1821C66.0276%2043.0373%2066.2231%2042.956%2066.4268%2042.956H68.7317C68.9355%2042.956%2069.1309%2043.0373%2069.275%2043.1821C69.4191%2043.3269%2069.5%2043.5233%2069.5%2043.728C69.5%2043.9328%2069.4191%2044.1291%2069.275%2044.2739C69.1309%2044.4187%2068.9355%2044.5%2068.7317%2044.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M61.2651%2044.5C61.0621%2044.5%2060.8674%2044.4193%2060.7234%2044.2755C60.5803%2044.1309%2060.5%2043.9352%2060.5%2043.7312C60.5%2043.5273%2060.5803%2043.3316%2060.7234%2043.187L61.2689%2042.6389L60.7234%2042.0907C60.5975%2041.9431%2060.5318%2041.7531%2060.5392%2041.5588C60.5467%2041.3645%2060.6269%2041.1802%2060.7637%2041.0427C60.9005%2040.9052%2061.084%2040.8247%2061.2773%2040.8172C61.4707%2040.8097%2061.6597%2040.8758%2061.8067%2041.0022L62.3522%2041.5503L62.8977%2041.0022C63.0447%2040.8758%2063.2337%2040.8097%2063.4271%2040.8172C63.6204%2040.8247%2063.8039%2040.9052%2063.9407%2041.0427C64.0775%2041.1802%2064.1577%2041.3645%2064.1652%2041.5588C64.1726%2041.7531%2064.1069%2041.9431%2063.981%2042.0907L63.4355%2042.6389L63.981%2043.187C64.1241%2043.3316%2064.2044%2043.5273%2064.2044%2043.7312C64.2044%2043.9352%2064.1241%2044.1309%2063.981%2044.2755C63.837%2044.4193%2063.6423%2044.5%2063.4393%2044.5C63.2364%2044.5%2063.0416%2044.4193%2062.8977%2044.2755L62.3522%2043.7274L61.8067%2044.2755C61.6628%2044.4193%2061.468%2044.5%2061.2651%2044.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26%2025.75H2V47.9532H26V25.75ZM0%2023.7887V50H28V23.7887L0%2023.7887Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162268'%20x1='2.00781'%20y1='5.004'%20x2='26.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162268'%20x1='53.001'%20y1='5.004'%20x2='77.001'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162268'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162268'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(53)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_13 = "data:image/svg+xml,%3csvg%20width='106'%20height='50'%20viewBox='0%200%20106%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1899_468)'%3e%3cpath%20d='M0%200.800641V10H24V1.05456e-06H1.00292L0.000198677%200L0%200.800641Z'%20fill='url(%23paint0_linear_1899_468)'/%3e%3cpath%20d='M24%2013H0V22.5H24V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2025.75H0V35.25H24V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2038.5H0V48H24V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13%2014.6179H11.5716L10%2015.5378V16.7917L11.4253%2015.9714H11.4627V20.6179H13V14.6179Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2033.5H14.25V32.3468H11.8341V32.3092L12.5472%2031.6561C13.8396%2030.5376%2014.1772%2029.9682%2014.1772%2029.289C14.1772%2028.2225%2013.3011%2027.5%2011.9476%2027.5C10.629%2027.5%209.7471%2028.2543%209.75001%2029.4595H11.1151C11.1151%2028.9249%2011.447%2028.6156%2011.9418%2028.6156C12.4279%2028.6156%2012.7801%2028.9133%2012.7801%2029.4017C12.7801%2029.8439%2012.5006%2030.1445%2012.0116%2030.5809L9.83733%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2046.25H14.25V45.0968H11.8341V45.0592L12.5472%2044.4061C13.8396%2043.2876%2014.1772%2042.7182%2014.1772%2042.039C14.1772%2040.9725%2013.3011%2040.25%2011.9476%2040.25C10.629%2040.25%209.7471%2041.0043%209.75001%2042.2095H11.1151C11.1151%2041.6749%2011.447%2041.3656%2011.9418%2041.3656C12.4279%2041.3656%2012.7801%2041.6633%2012.7801%2042.1517C12.7801%2042.5939%2012.5006%2042.8945%2012.0116%2043.3309L9.83733%2045.2211V46.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1899_468)'%3e%3cpath%20d='M28%200.800641V10H52V1.05456e-06H29.0029L28.0002%200L28%200.800641Z'%20fill='url(%23paint1_linear_1899_468)'/%3e%3cpath%20d='M52%2013H28V22.5H52V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2025.75H28V35.25H52V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2038.5H28V48H52V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M39.9792%2020.875C41.3085%2020.875%2042.2528%2020.1507%2042.25%2019.1355C42.2528%2018.4168%2041.7958%2017.9035%2040.9208%2017.798V17.7524C41.5771%2017.6554%2042.0423%2017.202%2042.0395%2016.5461C42.0423%2015.5936%2041.206%2014.875%2039.9903%2014.875C38.7663%2014.875%2037.8746%2015.605%2037.8635%2016.6431H39.1734C39.1845%2016.2438%2039.5334%2015.9758%2039.9903%2015.9758C40.4251%2015.9758%2040.7214%2016.2467%2040.7186%2016.6374C40.7214%2017.0423%2040.3725%2017.3218%2039.8685%2017.3218H39.3174V18.3256H39.8685C40.4417%2018.3256%2040.8155%2018.6164%2040.81%2019.0271C40.8155%2019.4406%2040.4721%2019.7286%2039.9848%2019.7286C39.5001%2019.7286%2039.1429%2019.4634%2039.1291%2019.0784H37.75C37.7611%2020.1336%2038.6832%2020.875%2039.9792%2020.875Z'%20fill='%2324292E'/%3e%3cpath%20d='M37.5%2032.4453V31.4463L40.0893%2027.5H41.7308V31.4287H42.5V32.4453H41.7308V33.5H40.477V32.4453H37.5ZM40.5012%2031.4287V28.8828H40.4528L38.8204%2031.3818V31.4287H40.5012Z'%20fill='%2324292E'/%3e%3cpath%20d='M40.2102%2046.25C38.8025%2046.25%2037.7766%2045.5188%2037.75%2044.4957H39.1444C39.1776%2044.9552%2039.6391%2045.2673%2040.2102%2045.2673C40.8841%2045.2673%2041.3655%2044.8425%2041.3655%2044.2269C41.3655%2043.6055%2040.8742%2043.1749%2040.1902%2043.172C39.7885%2043.172%2039.3835%2043.3251%2039.1743%2043.5708L37.8961%2043.3714L38.2181%2040.25H42.3748V41.2731H39.4034L39.2274%2042.7558H39.2673C39.5063%2042.4639%2040.0209%2042.2471%2040.6185%2042.2471C41.8436%2042.2471%2042.7533%2043.0621%2042.75%2044.1951C42.7533%2045.3916%2041.7241%2046.25%2040.2102%2046.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M80%200.800641V10H104V1.05456e-06H81.0029L80.0002%200L80%200.800641Z'%20fill='url(%23paint2_linear_1899_468)'/%3e%3cpath%20d='M104%2017H80V24H104V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M104%2033H80V40H104V33Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M104%2041H80V48H104V41Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M91.8577%2023C92.9654%2023%2093.7523%2022.3964%2093.75%2021.5504C93.7523%2020.9515%2093.3715%2020.5238%2092.6423%2020.4358V20.3978C93.1892%2020.317%2093.5769%2019.9392%2093.5746%2019.3926C93.5769%2018.5989%2092.88%2018%2091.8669%2018C90.8469%2018%2090.1038%2018.6084%2090.0946%2019.4734H91.1862C91.1954%2019.1407%2091.4861%2018.9173%2091.8669%2018.9173C92.2292%2018.9173%2092.4761%2019.1431%2092.4738%2019.4686C92.4761%2019.8061%2092.1854%2020.039%2091.7654%2020.039H91.3062V20.8755H91.7654C92.2431%2020.8755%2092.5546%2021.1179%2092.55%2021.4601C92.5546%2021.8047%2092.2685%2022.0447%2091.8623%2022.0447C91.4585%2022.0447%2091.1608%2021.8237%2091.1492%2021.5029H90C90.0092%2022.3821%2090.7777%2023%2091.8577%2023Z'%20fill='%2324292E'/%3e%3cpath%20d='M90%2038.1211V37.2886L92.1578%2034H93.5256V37.2739H94.1667V38.1211H93.5256V39H92.4808V38.1211H90ZM92.501%2037.2739V35.1523H92.4606L91.1003%2037.2349V37.2739H92.501Z'%20fill='%2324292E'/%3e%3cpath%20d='M92.0501%2047C90.877%2047%2090.0221%2046.3907%2090%2045.5381H91.162C91.1897%2045.921%2091.5743%2046.1811%2092.0501%2046.1811C92.6118%2046.1811%2093.0129%2045.8271%2093.0129%2045.3141C93.0129%2044.7962%2092.6035%2044.4374%2092.0335%2044.435C91.6988%2044.435%2091.3612%2044.5626%2091.1869%2044.7673L90.1217%2044.6012L90.3901%2042H93.854V42.8526H91.3778L91.2312%2044.0881H91.2644C91.4636%2043.8449%2091.8924%2043.6643%2092.3904%2043.6643C93.4113%2043.6643%2094.1694%2044.3434%2094.1667%2045.2876C94.1694%2046.2847%2093.3117%2047%2092.0501%2047Z'%20fill='%2324292E'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M104%2033H80V47.579H104V33ZM78%2028V50H106V28L78%2028Z'%20fill='%23CCCCDC'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M104%2017H80V24H104V17ZM78%2012V26H106V12H78Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M65.9067%2031.75C66.6011%2031.75%2071.9327%2027.75%2071.9327%2025.75C71.9327%2023.75%2066.7357%2019.75%2065.9067%2019.75C65.0777%2019.75%2064.4023%2020.25%2064.4023%2021.2256C64.4023%2022.2012%2067.9067%2024.6706%2067.9067%2024.6706C67.9067%2024.6706%2060.2539%2024%2060%2024.6706C59.7461%2025.3411%2059.7461%2026.1589%2060%2026.8294C60.2539%2027.5%2067.9067%2026.8294%2067.9067%2026.8294C67.9067%2026.8294%2064.4023%2029.5%2064.4023%2030.2801C64.4023%2031.0603%2065.2123%2031.75%2065.9067%2031.75Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M81.25%2013H80.1787L79%2013.6899V14.6304L80.069%2014.0151H80.097V17.5H81.25V13Z'%20fill='%2324292E'/%3e%3cpath%20d='M79.0655%2033.5H82.375V32.6351H80.5631V32.6069L81.0979%2032.1171C82.0672%2031.2782%2082.3204%2030.8512%2082.3204%2030.3418C82.3204%2029.5419%2081.6633%2029%2080.6482%2029C79.6593%2029%2078.9978%2029.5658%2079%2030.4697H80.0239C80.0239%2030.0686%2080.2727%2029.8367%2080.6438%2029.8367C81.0084%2029.8367%2081.2726%2030.06%2081.2726%2030.4263C81.2726%2030.7579%2081.063%2030.9834%2080.6962%2031.3107L79.0655%2032.7283V33.5Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1899_468'%20x1='0.00781255'%20y1='5.004'%20x2='24.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1899_468'%20x1='28.0078'%20y1='5.004'%20x2='52.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1899_468'%20x1='80.0078'%20y1='5.004'%20x2='104.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1899_468'%3e%3crect%20width='24'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1899_468'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(28)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_14 = "data:image/svg+xml,%3csvg%20width='188'%20height='48'%20viewBox='0%200%20188%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_161826)'%3e%3cpath%20d='M0%200.800641V10H24V1.05456e-06H1.00292L0.000198677%200L0%200.800641Z'%20fill='url(%23paint0_linear_1144_161826)'/%3e%3cpath%20d='M24%2013H0V22.5H24V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2025.75H0V35.25H24V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2038.5H0V48H24V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13%2014.6179H11.5716L10%2015.5378V16.7917L11.4253%2015.9714H11.4627V20.6179H13V14.6179Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2033.5H14.25V32.3468H11.8341V32.3092L12.5472%2031.6561C13.8396%2030.5376%2014.1772%2029.9682%2014.1772%2029.289C14.1772%2028.2225%2013.3011%2027.5%2011.9476%2027.5C10.629%2027.5%209.7471%2028.2543%209.75001%2029.4595H11.1151C11.1151%2028.9249%2011.447%2028.6156%2011.9418%2028.6156C12.4279%2028.6156%2012.7801%2028.9133%2012.7801%2029.4017C12.7801%2029.8439%2012.5006%2030.1445%2012.0116%2030.5809L9.83733%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2046.25H14.25V45.0968H11.8341V45.0592L12.5472%2044.4061C13.8396%2043.2876%2014.1772%2042.7182%2014.1772%2042.039C14.1772%2040.9725%2013.3011%2040.25%2011.9476%2040.25C10.629%2040.25%209.7471%2041.0043%209.75001%2042.2095H11.1151C11.1151%2041.6749%2011.447%2041.3656%2011.9418%2041.3656C12.4279%2041.3656%2012.7801%2041.6633%2012.7801%2042.1517C12.7801%2042.5939%2012.5006%2042.8945%2012.0116%2043.3309L9.83733%2045.2211V46.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_161826)'%3e%3cpath%20d='M28%200.800641V10H52V1.05456e-06H29.0029L28.0002%200L28%200.800641Z'%20fill='url(%23paint1_linear_1144_161826)'/%3e%3cpath%20d='M52%2013H28V22.5H52V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2025.75H28V35.25H52V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2038.5H28V48H52V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M40.1058%2046.25C41.5564%2046.25%2042.4563%2045.4582%2042.5%2044.2595H40.9654C40.905%2044.7737%2040.5759%2045.0544%2040.1259%2045.0544C39.5484%2045.0544%2039.1723%2044.597%2039.1723%2043.7358C39.1723%2042.8809%2039.5517%2042.4235%2040.1259%2042.4235C40.596%2042.4235%2040.9016%2042.7232%2040.9654%2043.2185H42.5C42.4631%2042.026%2041.5363%2041.25%2040.1024%2041.25C38.4805%2041.25%2037.5%2042.2658%2037.5%2043.7516C37.5%2045.2311%2038.4738%2046.25%2040.1058%2046.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1144_161826)'%3e%3cpath%20d='M56%200.800641V10H80V1.05456e-06H57.0029L56.0002%200L56%200.800641Z'%20fill='url(%23paint2_linear_1144_161826)'/%3e%3cpath%20d='M80%2013H56V22.5H80V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M80%2025.75H56V35.25H80V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M80%2038.5H56V48H80V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M67.5383%2020.75C68.2141%2020.75%2068.616%2020.3761%2068.7966%2019.9645H68.8403V20.6862H70.25V14.75H68.8257V16.9964H68.7966C68.6277%2016.5877%2068.2374%2016.1761%2067.5325%2016.1761C66.5976%2016.1761%2065.75%2016.892%2065.75%2018.463C65.75%2019.979%2066.551%2020.75%2067.5383%2020.75ZM68.0335%2019.6457C67.5063%2019.6457%2067.2121%2019.179%2067.2121%2018.4601C67.2121%2017.7442%2067.5034%2017.2833%2068.0335%2017.2833C68.5549%2017.2833%2068.8578%2017.7326%2068.8578%2018.4601C68.8578%2019.1819%2068.5519%2019.6457%2068.0335%2019.6457Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.0797%2033C69.4177%2033%2070.2975%2032.3849%2070.4834%2031.4322L68.9927%2031.3912C68.8665%2031.7129%2068.5345%2031.8864%2068.1096%2031.8864C67.4854%2031.8864%2067.1003%2031.4921%2067.1003%2030.8991V30.858H70.5V30.4732C70.5%2028.877%2069.4774%2028%2068.0299%2028C66.4894%2028%2065.5%2029.0032%2065.5%2030.5047C65.5%2032.0568%2066.4761%2033%2068.0797%2033ZM67.1003%2029.9621C67.1235%2029.4795%2067.5252%2029.1136%2068.0631%2029.1136C68.5976%2029.1136%2068.9827%2029.4669%2068.9894%2029.9621H67.1003Z'%20fill='%2324292E'/%3e%3cpath%20d='M69.2936%2041.9515H68.4651V41.7108C68.4651%2041.4646%2068.5669%2041.3134%2068.8893%2041.3134C69.0193%2041.3134%2069.1777%2041.3414%2069.2795%2041.3722L69.5%2040.3703C69.336%2040.3256%2068.9599%2040.25%2068.5782%2040.25C67.6932%2040.25%2067.0853%2040.7369%2067.0853%2041.7332V41.9515H66.5V42.959H67.0853V46.25H68.4651V42.959H69.2936V41.9515Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M93.9067%2030C94.6011%2030%2099.9327%2026%2099.9327%2024C99.9327%2022%2094.7357%2018%2093.9067%2018C93.0777%2018%2092.4023%2018.5%2092.4023%2019.4756C92.4023%2020.4512%2095.9067%2022.9206%2095.9067%2022.9206C95.9067%2022.9206%2088.2539%2022.25%2088%2022.9206C87.7461%2023.5911%2087.7461%2024.4089%2088%2025.0794C88.2539%2025.75%2095.9067%2025.0794%2095.9067%2025.0794C95.9067%2025.0794%2092.4023%2027.75%2092.4023%2028.5301C92.4023%2029.3103%2093.2123%2030%2093.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip3_1144_161826)'%3e%3cpath%20d='M108%200.800641V10H132V1.05456e-06H109.003L108%200L108%200.800641Z'%20fill='url(%23paint3_linear_1144_161826)'/%3e%3cpath%20d='M132%2013H108V22.5H132V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M132%2025.75H108V35.25H132V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M132%2038.5H108V48H132V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M120.106%2046.25C121.556%2046.25%20122.456%2045.4582%20122.5%2044.2595H120.965C120.905%2044.7737%20120.576%2045.0544%20120.126%2045.0544C119.548%2045.0544%20119.172%2044.597%20119.172%2043.7358C119.172%2042.8809%20119.552%2042.4235%20120.126%2042.4235C120.596%2042.4235%20120.902%2042.7232%20120.965%2043.2185H122.5C122.463%2042.026%20121.536%2041.25%20120.102%2041.25C118.481%2041.25%20117.5%2042.2658%20117.5%2043.7516C117.5%2045.2311%20118.474%2046.25%20120.106%2046.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M117.75%2033.4362H119.16V32.7145H119.203C119.384%2033.1261%20119.786%2033.5%20120.462%2033.5C121.452%2033.5%20122.25%2032.729%20122.25%2031.213C122.25%2029.642%20121.405%2028.9261%20120.47%2028.9261C119.763%2028.9261%20119.375%2029.3377%20119.203%2029.7464H119.174V27.5H117.75V33.4362ZM119.145%2031.2101C119.145%2030.4826%20119.448%2030.0333%20119.969%2030.0333C120.497%2030.0333%20120.788%2030.4942%20120.788%2031.2101C120.788%2031.929%20120.497%2032.3957%20119.969%2032.3957C119.448%2032.3957%20119.145%2031.9319%20119.145%2031.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M119.346%2020.25C120.022%2020.25%20120.49%2019.9877%20120.756%2019.4915H120.794V20.1678H122.247V16.8682C122.247%2015.841%20121.334%2015.25%20120.098%2015.25C118.793%2015.25%20118.053%2015.9074%20117.93%2016.7924L119.356%2016.8429C119.422%2016.5332%20119.678%2016.3436%20120.086%2016.3436C120.465%2016.3436%20120.705%2016.5269%20120.705%2016.8524V16.8682C120.705%2017.1653%20120.383%2017.2285%20119.555%2017.3012C118.572%2017.3834%20117.75%2017.7468%20117.75%2018.8214C117.75%2019.7822%20118.417%2020.25%20119.346%2020.25ZM119.823%2019.2386C119.466%2019.2386%20119.213%2019.068%20119.213%2018.7456C119.213%2018.4327%20119.46%2018.243%20119.899%2018.1767C120.187%2018.1356%20120.541%2018.0724%20120.715%2017.9807V18.4422C120.715%2018.9162%20120.316%2019.2386%20119.823%2019.2386Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1144_161826)'%3e%3cpath%20d='M136%200.800641V10H160V1.05456e-06H137.003L136%200L136%200.800641Z'%20fill='url(%23paint4_linear_1144_161826)'/%3e%3cpath%20d='M160%2013H136V22.5H160V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M160%2025.75H136V35.25H160V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M160%2038.5H136V48H160V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M149.5%202H148.072L146.5%202.91992V4.17383L147.925%203.35352H147.963V8H149.5V2Z'%20fill='%2324292E'/%3e%3cpath%20d='M147.538%2021C148.214%2021%20148.616%2020.6261%20148.797%2020.2145H148.84V20.9362H150.25V15H148.826V17.2464H148.797C148.628%2016.8377%20148.237%2016.4261%20147.533%2016.4261C146.598%2016.4261%20145.75%2017.142%20145.75%2018.713C145.75%2020.229%20146.551%2021%20147.538%2021ZM148.033%2019.8957C147.506%2019.8957%20147.212%2019.429%20147.212%2018.7101C147.212%2017.9942%20147.503%2017.5333%20148.033%2017.5333C148.555%2017.5333%20148.858%2017.9826%20148.858%2018.7101C148.858%2019.4319%20148.552%2019.8957%20148.033%2019.8957Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip5_1144_161826)'%3e%3cpath%20d='M164%200.800641V10H188V1.05456e-06H165.003L164%200L164%200.800641Z'%20fill='url(%23paint5_linear_1144_161826)'/%3e%3cpath%20d='M188%2013H164V22.5H188V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M188%2025.75H164V35.25H188V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M188%2038.5H164V48H188V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M173.837%208H178.25V6.84682H175.834V6.80925L176.547%206.15607C177.84%205.03757%20178.177%204.46821%20178.177%203.78902C178.177%202.72254%20177.301%202%20175.948%202C174.629%202%20173.747%202.75434%20173.75%203.95954H175.115C175.115%203.42486%20175.447%203.11561%20175.942%203.11561C176.428%203.11561%20176.78%203.41329%20176.78%203.90173C176.78%204.34393%20176.501%204.64451%20176.012%205.08093L173.837%206.9711V8Z'%20fill='%2324292E'/%3e%3cpath%20d='M176.08%2033C177.418%2033%20178.297%2032.3849%20178.483%2031.4322L176.993%2031.3912C176.867%2031.7129%20176.535%2031.8864%20176.11%2031.8864C175.485%2031.8864%20175.1%2031.4921%20175.1%2030.8991V30.858H178.5V30.4732C178.5%2028.877%20177.477%2028%20176.03%2028C174.489%2028%20173.5%2029.0032%20173.5%2030.5047C173.5%2032.0568%20174.476%2033%20176.08%2033ZM175.1%2029.9621C175.124%2029.4795%20175.525%2029.1136%20176.063%2029.1136C176.598%2029.1136%20176.983%2029.4669%20176.989%2029.9621H175.1Z'%20fill='%2324292E'/%3e%3cpath%20d='M177.294%2041.7015H176.465V41.4608C176.465%2041.2146%20176.567%2041.0634%20176.889%2041.0634C177.019%2041.0634%20177.178%2041.0914%20177.279%2041.1222L177.5%2040.1203C177.336%2040.0756%20176.96%2040%20176.578%2040C175.693%2040%20175.085%2040.4869%20175.085%2041.4832V41.7015H174.5V42.709H175.085V46H176.465V42.709H177.294V41.7015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161826'%20x1='0.00781255'%20y1='5.004'%20x2='24.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161826'%20x1='28.0078'%20y1='5.004'%20x2='52.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161826'%20x1='56.0078'%20y1='5.004'%20x2='80.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161826'%20x1='108.008'%20y1='5.004'%20x2='132.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_161826'%20x1='136.008'%20y1='5.004'%20x2='160.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1144_161826'%20x1='164.008'%20y1='5.004'%20x2='188.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161826'%3e%3crect%20width='24'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161826'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(28)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_161826'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(56)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_161826'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(108)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1144_161826'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(136)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_1144_161826'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(164)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_15 = "data:image/svg+xml,%3csvg%20width='124'%20height='48'%20viewBox='0%200%20124%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_161649)'%3e%3cpath%20d='M0%200.611699V7.64012H14.394V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1144_161649)'/%3e%3cpath%20d='M33.606%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200L33.606%200V7.64012Z'%20fill='url(%23paint1_linear_1144_161649)'/%3e%3cpath%20d='M31.194%200H16.8V7.64012H31.194V0Z'%20fill='url(%23paint2_linear_1144_161649)'/%3e%3cpath%20d='M31.194%2010.0869H16.8V17.727H31.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2010.0869H0V17.727H14.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2010.0869H33.606V17.727H48V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2020.1799H33.606V27.8262H48V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2020.1799H16.8V27.8262H31.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2020.1799H0V27.8262H14.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2030.2668H16.8V37.907H31.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2030.2668H33.606V37.907H48V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2030.2668H0V37.907H14.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M31.194%2040.3599H16.8V48H31.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M48%2047.3883V40.3721H33.606V48H47.3985C47.558%2048%2047.711%2047.9356%2047.8238%2047.8209C47.9366%2047.7061%2048%2047.5505%2048%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2048V40.3721H0V47.3883C0%2047.5505%200.0633725%2047.7061%200.176176%2047.8209C0.28898%2047.9356%200.441975%2048%200.601504%2048H14.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030.4C62.6011%2030.4%2067.9327%2026.1333%2067.9327%2024C67.9327%2021.8666%2062.7357%2017.6%2061.9067%2017.6C61.0777%2017.6%2060.4023%2018.1333%2060.4023%2019.1739C60.4023%2020.2146%2063.9067%2022.8486%2063.9067%2022.8486C63.9067%2022.8486%2056.2539%2022.1333%2056%2022.8486C55.7461%2023.5639%2055.7461%2024.4361%2056%2025.1514C56.2539%2025.8666%2063.9067%2025.1514%2063.9067%2025.1514C63.9067%2025.1514%2060.4023%2028%2060.4023%2028.8321C60.4023%2029.6643%2061.2123%2030.4%2061.9067%2030.4Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1144_161649)'%3e%3cpath%20d='M81.4059%200H76.5993C76.2683%200%2076%200.268327%2076%200.599326V5.40592C76%205.73692%2076.2683%206.00524%2076.5993%206.00524H81.4059C81.7369%206.00524%2082.0052%205.73692%2082.0052%205.40592V0.599326C82.0052%200.268327%2081.7369%200%2081.4059%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%200H93.3984C93.0674%200%2092.7991%200.268327%2092.7991%200.599326V5.40592C92.7991%205.73692%2093.0674%206.00524%2093.3984%206.00524H98.205C98.536%206.00524%2098.8043%205.73692%2098.8043%205.40592V0.599326C98.8043%200.268327%2098.536%200%2098.205%200Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.608%200H101.801C101.47%200%20101.202%200.268327%20101.202%200.599326V5.40592C101.202%205.73692%20101.47%206.00524%20101.801%206.00524H106.608C106.939%206.00524%20107.207%205.73692%20107.207%205.40592V0.599326C107.207%200.268327%20106.939%200%20106.608%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M115.004%200H110.198C109.867%200%20109.598%200.268327%20109.598%200.599326V5.40592C109.598%205.73692%20109.867%206.00524%20110.198%206.00524H115.004C115.335%206.00524%20115.603%205.73692%20115.603%205.40592V0.599326C115.603%200.268327%20115.335%200%20115.004%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M123.407%208.40253H118.6C118.269%208.40253%20118.001%208.67085%20118.001%209.00185V13.8084C118.001%2014.1394%20118.269%2014.4078%20118.6%2014.4078H123.407C123.738%2014.4078%20124.006%2014.1394%20124.006%2013.8084V9.00185C124.006%208.67085%20123.738%208.40253%20123.407%208.40253Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%2016.7991H93.3984C93.0674%2016.7991%2092.7991%2017.0674%2092.7991%2017.3984V22.205C92.7991%2022.536%2093.0674%2022.8043%2093.3984%2022.8043H98.205C98.536%2022.8043%2098.8043%2022.536%2098.8043%2022.205V17.3984C98.8043%2017.0674%2098.536%2016.7991%2098.205%2016.7991Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.608%2016.7991H101.801C101.47%2016.7991%20101.202%2017.0674%20101.202%2017.3984V22.205C101.202%2022.536%20101.47%2022.8043%20101.801%2022.8043H106.608C106.939%2022.8043%20107.207%2022.536%20107.207%2022.205V17.3984C107.207%2017.0674%20106.939%2016.7991%20106.608%2016.7991Z'%20fill='%233865AB'/%3e%3cpath%20d='M115.004%2016.7991H110.198C109.867%2016.7991%20109.598%2017.0674%20109.598%2017.3984V22.205C109.598%2022.536%20109.867%2022.8043%20110.198%2022.8043H115.004C115.335%2022.8043%20115.603%2022.536%20115.603%2022.205V17.3984C115.603%2017.0674%20115.335%2016.7991%20115.004%2016.7991Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M123.407%2016.7991H118.6C118.269%2016.7991%20118.001%2017.0674%20118.001%2017.3984V22.205C118.001%2022.536%20118.269%2022.8043%20118.6%2022.8043H123.407C123.738%2022.8043%20124.006%2022.536%20124.006%2022.205V17.3984C124.006%2017.0674%20123.738%2016.7991%20123.407%2016.7991Z'%20fill='%233865AB'/%3e%3cpath%20d='M81.4059%2025.2017H76.5993C76.2683%2025.2017%2076%2025.47%2076%2025.801V30.6076C76%2030.9386%2076.2683%2031.2069%2076.5993%2031.2069H81.4059C81.7369%2031.2069%2082.0052%2030.9386%2082.0052%2030.6076V25.801C82.0052%2025.47%2081.7369%2025.2017%2081.4059%2025.2017Z'%20fill='%233865AB'/%3e%3cpath%20d='M106.608%2025.2017H101.801C101.47%2025.2017%20101.202%2025.47%20101.202%2025.801V30.6076C101.202%2030.9386%20101.47%2031.2069%20101.801%2031.2069H106.608C106.939%2031.2069%20107.207%2030.9386%20107.207%2030.6076V25.801C107.207%2025.47%20106.939%2025.2017%20106.608%2025.2017Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M115.004%2025.2017H110.198C109.867%2025.2017%20109.598%2025.47%20109.598%2025.801V30.6076C109.598%2030.9386%20109.867%2031.2069%20110.198%2031.2069H115.004C115.335%2031.2069%20115.603%2030.9386%20115.603%2030.6076V25.801C115.603%2025.47%20115.335%2025.2017%20115.004%2025.2017Z'%20fill='%233865AB'/%3e%3cpath%20d='M123.407%2025.2017H118.6C118.269%2025.2017%20118.001%2025.47%20118.001%2025.801V30.6076C118.001%2030.9386%20118.269%2031.2069%20118.6%2031.2069H123.407C123.738%2031.2069%20124.006%2030.9386%20124.006%2030.6076V25.801C124.006%2025.47%20123.738%2025.2017%20123.407%2025.2017Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M89.8084%2033.5982H85.0019C84.6709%2033.5982%2084.4025%2033.8665%2084.4025%2034.1975V39.0041C84.4025%2039.3351%2084.6709%2039.6035%2085.0019%2039.6035H89.8084C90.1394%2039.6035%2090.4078%2039.3351%2090.4078%2039.0041V34.1975C90.4078%2033.8665%2090.1394%2033.5982%2089.8084%2033.5982Z'%20fill='%233865AB'/%3e%3cpath%20d='M89.8084%2042.0007H85.0019C84.6709%2042.0007%2084.4025%2042.2691%2084.4025%2042.6001V47.4066C84.4025%2047.7376%2084.6709%2048.006%2085.0019%2048.006H89.8084C90.1394%2048.006%2090.4078%2047.7376%2090.4078%2047.4066V42.6001C90.4078%2042.2691%2090.1394%2042.0007%2089.8084%2042.0007Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%2042.0007H93.3984C93.0674%2042.0007%2092.7991%2042.2691%2092.7991%2042.6001V47.4066C92.7991%2047.7376%2093.0674%2048.006%2093.3984%2048.006H98.205C98.536%2048.006%2098.8043%2047.7376%2098.8043%2047.4066V42.6001C98.8043%2042.2691%2098.536%2042.0007%2098.205%2042.0007Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.608%2042.0007H101.801C101.47%2042.0007%20101.202%2042.2691%20101.202%2042.6001V47.4066C101.202%2047.7376%20101.47%2048.006%20101.801%2048.006H106.608C106.939%2048.006%20107.207%2047.7376%20107.207%2047.4066V42.6001C107.207%2042.2691%20106.939%2042.0007%20106.608%2042.0007Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M89.8084%200H85.0019C84.6709%200%2084.4025%200.268327%2084.4025%200.599326V5.40592C84.4025%205.73692%2084.6709%206.00524%2085.0019%206.00524H89.8084C90.1394%206.00524%2090.4078%205.73692%2090.4078%205.40592V0.599326C90.4078%200.268327%2090.1394%200%2089.8084%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M82.0052%2022.205V17.3984C82.0052%2017.0674%2081.7369%2016.7991%2081.4059%2016.7991H76.5993C76.2683%2016.7991%2076%2017.0674%2076%2017.3984V22.205C76%2022.536%2076.2683%2022.8043%2076.5993%2022.8043H81.4059C81.7369%2022.8043%2082.0052%2022.536%2082.0052%2022.205Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124.006%2039.0041V34.1975C124.006%2033.8665%20123.738%2033.5982%20123.407%2033.5982H118.6C118.269%2033.5982%20118.001%2033.8665%20118.001%2034.1975V39.0041C118.001%2039.3351%20118.269%2039.6034%20118.6%2039.6034H123.407C123.738%2039.6034%20124.006%2039.3351%20124.006%2039.0041Z'%20fill='%233865AB'/%3e%3cpath%20d='M124%205.40592V0.599326C124%200.268327%20123.732%200%20123.401%200L118.594%200C118.263%200%20117.995%200.268327%20117.995%200.599326V5.40592C117.995%205.73692%20118.263%206.00524%20118.594%206.00524H123.401C123.732%206.00524%20124%205.73692%20124%205.40592Z'%20fill='%233865AB'/%3e%3cpath%20d='M81.3939%2014.3838H76.5993C76.4404%2014.3838%2076.2879%2014.3207%2076.1755%2014.2083C76.0631%2014.0959%2076%2013.9434%2076%2013.7845V8.98989C76%208.83094%2076.0631%208.6785%2076.1755%208.5661C76.2879%208.45371%2076.4404%208.39056%2076.5993%208.39056H81.3939C81.5529%208.39056%2081.7053%208.45371%2081.8177%208.5661C81.9301%208.6785%2081.9933%208.83094%2081.9933%208.98989V13.7845C81.9933%2013.9434%2081.9301%2014.0959%2081.8177%2014.2083C81.7053%2014.3207%2081.5529%2014.3838%2081.3939%2014.3838ZM90.3838%2013.7845V8.98989C90.3838%208.83094%2090.3207%208.6785%2090.2083%208.5661C90.0959%208.45371%2089.9434%208.39056%2089.7845%208.39056H84.9899C84.8309%208.39056%2084.6785%208.45371%2084.5661%208.5661C84.4537%208.6785%2084.3906%208.83094%2084.3906%208.98989V13.7845C84.3906%2013.9434%2084.4537%2014.0959%2084.5661%2014.2083C84.6785%2014.3207%2084.8309%2014.3838%2084.9899%2014.3838H89.7845C89.9434%2014.3838%2090.0959%2014.3207%2090.2083%2014.2083C90.3207%2014.0959%2090.3838%2013.9434%2090.3838%2013.7845ZM98.7744%2013.7845V8.98989C98.7744%208.83094%2098.7112%208.6785%2098.5988%208.5661C98.4864%208.45371%2098.334%208.39056%2098.1751%208.39056H93.3804C93.2215%208.39056%2093.0691%208.45371%2092.9567%208.5661C92.8443%208.6785%2092.7811%208.83094%2092.7811%208.98989V13.7845C92.7811%2013.9434%2092.8443%2014.0959%2092.9567%2014.2083C93.0691%2014.3207%2093.2215%2014.3838%2093.3804%2014.3838H98.1751C98.2562%2014.3879%2098.3374%2014.3754%2098.4136%2014.3471C98.4898%2014.3188%2098.5595%2014.2753%2098.6183%2014.2192C98.6772%2014.1632%2098.7241%2014.0957%2098.756%2014.021C98.788%2013.9462%2098.8044%2013.8658%2098.8043%2013.7845H98.7744ZM115.556%2013.7845V8.98989C115.556%208.83094%20115.492%208.6785%20115.38%208.5661C115.268%208.45371%20115.115%208.39056%20114.956%208.39056H110.162C110.003%208.39056%20109.85%208.45371%20109.738%208.5661C109.625%208.6785%20109.562%208.83094%20109.562%208.98989V13.7845C109.562%2013.9434%20109.625%2014.0959%20109.738%2014.2083C109.85%2014.3207%20110.003%2014.3838%20110.162%2014.3838H114.956C115.039%2014.3905%20115.122%2014.3799%20115.2%2014.3527C115.279%2014.3256%20115.35%2014.2825%20115.411%2014.2262C115.472%2014.1699%20115.521%2014.1015%20115.554%2014.0255C115.587%2013.9495%20115.604%2013.8674%20115.603%2013.7845H115.556ZM106.566%2014.3838H101.771C101.612%2014.3838%20101.46%2014.3207%20101.347%2014.2083C101.235%2014.0959%20101.172%2013.9434%20101.172%2013.7845V8.98989C101.172%208.83094%20101.235%208.6785%20101.347%208.5661C101.46%208.45371%20101.612%208.39056%20101.771%208.39056H106.566C106.725%208.39056%20106.877%208.45371%20106.989%208.5661C107.102%208.6785%20107.165%208.83094%20107.165%208.98989V13.7845C107.165%2013.9374%20107.107%2014.0846%20107.002%2014.1961C106.898%2014.3075%20106.754%2014.3746%20106.602%2014.3838H106.566Z'%20fill='url(%23paint3_linear_1144_161649)'/%3e%3cpath%20d='M89.8084%2016.7991H85.0019C84.6709%2016.7991%2084.4025%2017.0674%2084.4025%2017.3984V22.205C84.4025%2022.536%2084.6709%2022.8043%2085.0019%2022.8043H89.8084C90.1394%2022.8043%2090.4078%2022.536%2090.4078%2022.205V17.3984C90.4078%2017.0674%2090.1394%2016.7991%2089.8084%2016.7991Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%2033.5982H93.3984C93.0674%2033.5982%2092.7991%2033.8665%2092.7991%2034.1975V39.0041C92.7991%2039.3351%2093.0674%2039.6035%2093.3984%2039.6035H98.205C98.536%2039.6035%2098.8043%2039.3351%2098.8043%2039.0041V34.1975C98.8043%2033.8665%2098.536%2033.5982%2098.205%2033.5982Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M98.205%2031.2009H93.3804C93.2215%2031.2009%2093.0691%2031.1378%2092.9567%2031.0254C92.8443%2030.913%2092.7811%2030.7605%2092.7811%2030.6016V25.807C92.7811%2025.648%2092.8443%2025.4956%2092.9567%2025.3832C93.0691%2025.2708%2093.2215%2025.2076%2093.3804%2025.2076H98.1751C98.334%2025.2076%2098.4864%2025.2708%2098.5988%2025.3832C98.7112%2025.4956%2098.7744%2025.648%2098.7744%2025.807V30.6016C98.7746%2030.7555%2098.7156%2030.9035%2098.6096%2031.0151C98.5036%2031.1267%2098.3587%2031.1932%2098.205%2031.2009ZM89.8145%2031.2009H84.9899C84.8309%2031.2009%2084.6785%2031.1378%2084.5661%2031.0254C84.4537%2030.913%2084.3906%2030.7605%2084.3906%2030.6016V25.807C84.3906%2025.648%2084.4537%2025.4956%2084.5661%2025.3832C84.6785%2025.2708%2084.8309%2025.2076%2084.9899%2025.2076H89.7845C89.9434%2025.2076%2090.0959%2025.2708%2090.2083%2025.3832C90.3207%2025.4956%2090.3838%2025.648%2090.3838%2025.807V30.6016C90.3838%2030.7605%2090.3207%2030.913%2090.2083%2031.0254C90.0959%2031.1378%2089.9434%2031.2009%2089.7845%2031.2009H89.8145ZM82.0232%2038.9921V34.1975C82.0232%2034.0386%2081.9601%2033.8861%2081.8477%2033.7737C81.7353%2033.6613%2081.5829%2033.5982%2081.4239%2033.5982H76.5993C76.4404%2033.5982%2076.2879%2033.6613%2076.1755%2033.7737C76.0631%2033.8861%2076%2034.0386%2076%2034.1975V38.9921C76%2039.1511%2076.0631%2039.3035%2076.1755%2039.4159C76.2879%2039.5283%2076.4404%2039.5915%2076.5993%2039.5915H81.3939C81.5508%2039.5915%2081.7015%2039.53%2081.8135%2039.4202C81.9256%2039.3104%2081.9901%2039.161%2081.9933%2039.0041L82.0232%2038.9921ZM107.195%2038.9921V34.1975C107.195%2034.0386%20107.132%2033.8861%20107.019%2033.7737C106.907%2033.6613%20106.755%2033.5982%20106.596%2033.5982H101.801C101.642%2033.5982%20101.49%2033.6613%20101.377%2033.7737C101.265%2033.8861%20101.202%2034.0386%20101.202%2034.1975V38.9921C101.202%2039.1511%20101.265%2039.3035%20101.377%2039.4159C101.49%2039.5283%20101.642%2039.5915%20101.801%2039.5915H106.596C106.754%2039.5931%20106.906%2039.5323%20107.019%2039.4223C107.132%2039.3123%20107.198%2039.162%20107.201%2039.0041L107.195%2038.9921ZM115.585%2038.9921V34.1975C115.585%2034.0386%20115.522%2033.8861%20115.41%2033.7737C115.298%2033.6613%20115.145%2033.5982%20114.986%2033.5982H110.192C110.033%2033.5982%20109.88%2033.6613%20109.768%2033.7737C109.655%2033.8861%20109.592%2034.0386%20109.592%2034.1975V38.9921C109.592%2039.1511%20109.655%2039.3035%20109.768%2039.4159C109.88%2039.5283%20110.033%2039.5915%20110.192%2039.5915H114.986C115.065%2039.5939%20115.144%2039.5805%20115.218%2039.5522C115.292%2039.5239%20115.36%2039.4812%20115.417%2039.4266C115.475%2039.372%20115.521%2039.3065%20115.553%2039.234C115.585%2039.1615%20115.602%2039.0833%20115.603%2039.0041L115.585%2038.9921Z'%20fill='url(%23paint4_linear_1144_161649)'/%3e%3cpath%20d='M81.4059%2042.0007H76.5993C76.2683%2042.0007%2076%2042.2691%2076%2042.6001V47.4066C76%2047.7376%2076.2683%2048.006%2076.5993%2048.006H81.4059C81.7369%2048.006%2082.0052%2047.7376%2082.0052%2047.4066V42.6001C82.0052%2042.2691%2081.7369%2042.0007%2081.4059%2042.0007Z'%20fill='%233865AB'/%3e%3cpath%20d='M115.004%2042.0007H110.198C109.867%2042.0007%20109.598%2042.2691%20109.598%2042.6001V47.4066C109.598%2047.7376%20109.867%2048.006%20110.198%2048.006H115.004C115.335%2048.006%20115.603%2047.7376%20115.603%2047.4066V42.6001C115.603%2042.2691%20115.335%2042.0007%20115.004%2042.0007Z'%20fill='%233865AB'/%3e%3cpath%20d='M123.407%2042.0007H118.6C118.269%2042.0007%20118.001%2042.2691%20118.001%2042.6001V47.4066C118.001%2047.7376%20118.269%2048.006%20118.6%2048.006H123.407C123.738%2048.006%20124.006%2047.7376%20124.006%2047.4066V42.6001C124.006%2042.2691%20123.738%2042.0007%20123.407%2042.0007Z'%20fill='%2384AFF1'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161649'%20x1='0'%20y1='3.82312'%20x2='14.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161649'%20x1='33.606'%20y1='3.82312'%20x2='48'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161649'%20x1='16.8'%20y1='3.82312'%20x2='31.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161649'%20x1='76'%20y1='11.3992'%20x2='115.603'%20y2='11.3992'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_161649'%20x1='76'%20y1='32.3996'%20x2='115.603'%20y2='32.3996'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161649'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161649'%3e%3crect%20width='48'%20height='48'%20fill='white'%20transform='translate(76)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_16 = "data:image/svg+xml,%3csvg%20width='121'%20height='48'%20viewBox='0%200%20121%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_161622)'%3e%3cpath%20d='M0%200.611699V7.64012H14.394V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1144_161622)'/%3e%3cpath%20d='M33.606%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200L33.606%200V7.64012Z'%20fill='url(%23paint1_linear_1144_161622)'/%3e%3cpath%20d='M31.194%200H16.8V7.64012H31.194V0Z'%20fill='url(%23paint2_linear_1144_161622)'/%3e%3cpath%20d='M31.194%2010.0869H16.8V17.727H31.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2010.0869H0V17.727H14.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2010.0869H33.606V17.727H48V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2020.1799H33.606V27.8262H48V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2020.1799H16.8V27.8262H31.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2020.1799H0V27.8262H14.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2030.2668H16.8V37.907H31.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2030.2668H33.606V37.907H48V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2030.2668H0V37.907H14.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M31.194%2040.3599H16.8V48H31.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M48%2047.3883V40.3721H33.606V48H47.3985C47.558%2048%2047.711%2047.9356%2047.8238%2047.8209C47.9366%2047.7061%2048%2047.5505%2048%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2048V40.3721H0V47.3883C0%2047.5505%200.0633725%2047.7061%200.176176%2047.8209C0.28898%2047.9356%200.441975%2048%200.601504%2048H14.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030C62.6011%2030%2067.9327%2026%2067.9327%2024C67.9327%2022%2062.7357%2018%2061.9067%2018C61.0777%2018%2060.4023%2018.5%2060.4023%2019.4756C60.4023%2020.4512%2063.9067%2022.9206%2063.9067%2022.9206C63.9067%2022.9206%2056.2539%2022.25%2056%2022.9206C55.7461%2023.5911%2055.7461%2024.4089%2056%2025.0794C56.2539%2025.75%2063.9067%2025.0794%2063.9067%2025.0794C63.9067%2025.0794%2060.4023%2027.75%2060.4023%2028.5301C60.4023%2029.3103%2061.2123%2030%2061.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1144_161622)'%3e%3cpath%20d='M87.833%2048H85.4439C85.2855%2048%2085.1336%2047.9371%2085.0216%2047.825C84.9095%2047.7129%2084.8466%2047.5609%2084.8466%2047.4023V28.8144C84.8466%2028.6559%2084.9095%2028.5038%2085.0216%2028.3917C85.1336%2028.2797%2085.2855%2028.2167%2085.4439%2028.2167H87.833C87.9914%2028.2167%2088.1433%2028.2797%2088.2554%2028.3917C88.3674%2028.5038%2088.4303%2028.6559%2088.4303%2028.8144V47.4023C88.4303%2047.5609%2088.3674%2047.7129%2088.2554%2047.825C88.1433%2047.9371%2087.9914%2048%2087.833%2048ZM82.4157%2040.8278H80.0266C79.8682%2040.8278%2079.7162%2040.8908%2079.6042%2041.0029C79.4922%2041.115%2079.4293%2041.267%2079.4293%2041.4255V47.4023C79.4293%2047.5609%2079.4922%2047.7129%2079.6042%2047.825C79.7162%2047.9371%2079.8682%2048%2080.0266%2048H82.4157C82.5741%2048%2082.726%2047.9371%2082.838%2047.825C82.95%2047.7129%2083.013%2047.5609%2083.013%2047.4023V41.4255C83.0114%2041.268%2082.9478%2041.1175%2082.8359%2041.0067C82.7241%2040.8959%2082.5731%2040.8338%2082.4157%2040.8338V40.8278ZM93.2503%209.92756H90.8612C90.7028%209.92756%2090.5509%209.99053%2090.4389%2010.1026C90.3269%2010.2147%2090.2639%2010.3667%2090.2639%2010.5252V47.4023C90.2639%2047.5609%2090.3269%2047.7129%2090.4389%2047.825C90.5509%2047.9371%2090.7028%2048%2090.8612%2048H93.2503C93.4088%2048%2093.5607%2047.9371%2093.6727%2047.825C93.7847%2047.7129%2093.8476%2047.5609%2093.8476%2047.4023V10.5252C93.8476%2010.3667%2093.7847%2010.2147%2093.6727%2010.1026C93.5607%209.99053%2093.4088%209.92756%2093.2503%209.92756ZM98.6677%204.07623H96.2786C96.1202%204.07623%2095.9682%204.1392%2095.8562%204.25129C95.7442%204.36338%2095.6813%204.5154%2095.6813%204.67392V47.4023C95.6813%2047.5609%2095.7442%2047.7129%2095.8562%2047.825C95.9682%2047.9371%2096.1202%2048%2096.2786%2048H98.6677C98.8261%2048%2098.978%2047.9371%2099.09%2047.825C99.202%2047.7129%2099.265%2047.5609%2099.265%2047.4023V4.67392C99.265%204.5154%2099.202%204.36338%2099.09%204.25129C98.978%204.1392%2098.8261%204.07623%2098.6677%204.07623ZM104.085%209.92756H101.696C101.537%209.92756%20101.386%209.99053%20101.274%2010.1026C101.162%2010.2147%20101.099%2010.3667%20101.099%2010.5252V47.4023C101.099%2047.5609%20101.162%2047.7129%20101.274%2047.825C101.386%2047.9371%20101.537%2048%20101.696%2048H104.085C104.243%2048%20104.395%2047.9371%20104.507%2047.825C104.619%2047.7129%20104.682%2047.5609%20104.682%2047.4023V10.5252C104.682%2010.3667%20104.619%2010.2147%20104.507%2010.1026C104.395%209.99053%20104.243%209.92756%20104.085%209.92756ZM109.502%2028.2167H107.113C106.955%2028.2167%20106.803%2028.2797%20106.691%2028.3917C106.579%2028.5038%20106.516%2028.6559%20106.516%2028.8144V47.4023C106.516%2047.5609%20106.579%2047.7129%20106.691%2047.825C106.803%2047.9371%20106.955%2048%20107.113%2048H109.502C109.661%2048%20109.813%2047.9371%20109.925%2047.825C110.037%2047.7129%20110.1%2047.5609%20110.1%2047.4023V28.8144C110.1%2028.6559%20110.037%2028.5038%20109.925%2028.3917C109.813%2028.2797%20109.661%2028.2167%20109.502%2028.2167ZM114.92%2040.8338H112.531C112.372%2040.8338%20112.22%2040.8968%20112.108%2041.0089C111.996%2041.1209%20111.933%2041.273%20111.933%2041.4315V47.4083C111.933%2047.5668%20111.996%2047.7189%20112.108%2047.831C112.22%2047.943%20112.372%2048.006%20112.531%2048.006H114.92C115.078%2048.006%20115.23%2047.943%20115.342%2047.831C115.454%2047.7189%20115.517%2047.5668%20115.517%2047.4083V41.4315C115.517%2041.273%20115.454%2041.1209%20115.342%2041.0089C115.23%2040.8968%20115.078%2040.8338%20114.92%2040.8338ZM120.403%2043.7087H118.014C117.855%2043.7087%20117.703%2043.7716%20117.591%2043.8837C117.479%2043.9958%20117.416%2044.1478%20117.416%2044.3063V47.4023C117.416%2047.5609%20117.479%2047.7129%20117.591%2047.825C117.703%2047.9371%20117.855%2048%20118.014%2048H120.403C120.561%2048%20120.713%2047.9371%20120.825%2047.825C120.937%2047.7129%20121%2047.5609%20121%2047.4023V44.3063C121%2044.1478%20120.937%2043.9958%20120.825%2043.8837C120.713%2043.7716%20120.561%2043.7087%20120.403%2043.7087ZM76.9864%2043.7087H74.5973C74.4389%2043.7087%2074.287%2043.7716%2074.1749%2043.8837C74.0629%2043.9958%2074%2044.1478%2074%2044.3063V47.4023C74%2047.5609%2074.0629%2047.7129%2074.1749%2047.825C74.287%2047.9371%2074.4389%2048%2074.5973%2048H76.9864C77.1448%2048%2077.2967%2047.9371%2077.4087%2047.825C77.5208%2047.7129%2077.5837%2047.5609%2077.5837%2047.4023V44.3063C77.5837%2044.1478%2077.5208%2043.9958%2077.4087%2043.8837C77.2967%2043.7716%2077.1448%2043.7087%2076.9864%2043.7087Z'%20fill='url(%23paint3_linear_1144_161622)'/%3e%3cpath%20d='M74%2042.0231V39.6324C74.4652%2039.6368%2074.9277%2039.562%2075.3678%2039.4113L76.1502%2041.6705C75.4581%2041.907%2074.7314%2042.0262%2074%2042.0231Z'%20fill='%233865AB'/%3e%3cpath%20d='M79.1008%2039.6563L77.309%2038.0486C78.0263%2037.2234%2078.6217%2036.2995%2079.0769%2035.3052L81.2331%2036.3332C80.6874%2037.5387%2079.9691%2038.6582%2079.1008%2039.6563ZM115.863%2039.6145C115.001%2038.6141%20114.287%2037.495%20113.743%2036.2914L115.905%2035.2634C116.349%2036.2573%20116.933%2037.183%20117.637%2038.0127L115.863%2039.6145ZM82.4157%2033.4046L80.1401%2032.6335C80.4805%2031.6414%2080.809%2030.5357%2081.1495%2029.2447L83.4609%2029.8424C83.1026%2031.1991%2082.7621%2032.3646%2082.4038%2033.4046H82.4157ZM112.59%2033.3627C112.238%2032.3227%20111.891%2031.1573%20111.539%2029.8125L113.851%2029.2148C114.191%2030.5058%20114.52%2031.6055%20114.854%2032.6037L112.59%2033.3627ZM84.1896%2026.8958L81.8662%2026.3519C82.135%2025.1984%2082.3918%2024.0209%2082.6546%2022.8315L84.99%2023.3515C84.7511%2024.5469%2084.4584%2025.7363%2084.1896%2026.8958ZM110.798%2026.848C110.53%2025.7004%20110.267%2024.505%20109.998%2023.3097L112.333%2022.7897C112.596%2023.9851%20112.859%2025.1804%20113.122%2026.31L110.798%2026.848ZM85.647%2020.4109L83.3176%2019.879C83.6282%2018.5043%2083.9149%2017.3747%2084.1657%2016.3287L86.4832%2016.9264C86.2204%2017.9305%2085.9456%2019.0542%2085.647%2020.4109ZM109.341%2020.3631C109.025%2018.9765%20108.744%2017.8708%20108.505%2016.8726L110.822%2016.2749C111.079%2017.291%20111.354%2018.4206%20111.671%2019.8252L109.341%2020.3631ZM87.2417%2014.0575L84.9541%2013.3762C85.3424%2012.0672%2085.7306%2010.9197%2086.1487%209.85581L88.3766%2010.7165C88.0063%2011.7206%2087.6359%2012.8143%2087.2656%2014.0575H87.2417ZM107.693%2014.0037C107.322%2012.7665%20106.958%2011.6787%20106.564%2010.6687L108.792%209.80202C109.204%2010.8719%20109.598%2012.0254%20109.986%2013.3224L107.693%2014.0037ZM89.5652%208.08069L87.4388%206.98693C88.0182%205.83371%2088.719%204.74572%2089.5293%203.7415L91.3809%205.27157C90.6776%206.1407%2090.0689%207.08239%2089.5652%208.08069ZM105.411%208.03885C104.905%207.04259%20104.294%206.10294%20103.589%205.23571L105.417%203.69966C106.238%204.69703%20106.947%205.78131%20107.531%206.93313L105.411%208.03885ZM93.328%203.4845L92.008%201.49421C93.1468%200.726757%2094.439%200.216857%2095.7948%200L96.1711%202.39074C95.154%202.53977%2094.1829%202.91339%2093.328%203.4845ZM101.63%203.4845C100.775%202.91445%2099.8039%202.54094%2098.7872%202.39074L99.1455%200C100.502%200.204683%20101.799%200.702305%20102.944%201.45835L101.63%203.4845Z'%20fill='%233865AB'/%3e%3cpath%20d='M121%2042.0231C120.269%2042.0262%20119.542%2041.907%20118.85%2041.6705L119.626%2039.4113C120.069%2039.5586%20120.533%2039.6333%20121%2039.6324V42.0231Z'%20fill='%233865AB'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161622'%20x1='0'%20y1='3.82312'%20x2='14.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161622'%20x1='33.606'%20y1='3.82312'%20x2='48'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161622'%20x1='16.8'%20y1='3.82312'%20x2='31.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161622'%20x1='74'%20y1='26.0411'%20x2='121'%20y2='26.0411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161622'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161622'%3e%3crect%20width='47'%20height='48'%20fill='white'%20transform='translate(74)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_17 = "data:image/svg+xml,%3csvg%20width='177'%20height='52'%20viewBox='0%200%20177%2052'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_161769)'%3e%3cpath%20d='M0%203.04083V15H15V2H0.626828C0.460583%202%200.301147%202.10966%200.183594%202.30485C0.0660407%202.50005%200%202.76479%200%203.04083Z'%20fill='url(%23paint0_linear_1144_161769)'/%3e%3cpath%20d='M15%2019.5H0V32.5H15V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2037H0V50H15V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M6.77442%2011.5C7.52635%2011.5%208.04638%2011.2377%208.34153%2010.7415H8.3837V11.4178H10V8.1182C10%207.09102%208.98454%206.5%207.61068%206.5C6.15952%206.5%205.33732%207.1574%205.20028%208.04235L6.78496%208.09292C6.85875%207.78319%207.14336%207.59355%207.59663%207.59355C8.01827%207.59355%208.28531%207.77686%208.28531%208.1024V8.1182C8.28531%208.4153%207.92692%208.47851%207.00633%208.5512C5.91356%208.63338%205%208.99684%205%2010.0714C5%2011.0322%205.74139%2011.5%206.77442%2011.5ZM7.30499%2010.4886C6.90794%2010.4886%206.62684%2010.318%206.62684%209.99558C6.62684%209.68268%206.90091%209.49305%207.38932%209.42668C7.70907%209.38559%208.1026%209.32238%208.29585%209.23072V9.69216C8.29585%2010.1662%207.85313%2010.4886%207.30499%2010.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_161769)'%3e%3cpath%20d='M19%2015H34V3.04083C34%202.76479%2033.934%202.50005%2033.8164%202.30485C33.6989%202.10966%2033.5394%202%2033.3732%202H19V15Z'%20fill='url(%23paint1_linear_1144_161769)'/%3e%3cpath%20d='M34%2019.5H19V32.5H34V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2037H19V50H34V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M27.5%2023H26.0716L24.5%2023.9199V25.1738L25.9253%2024.3535H25.9627V29H27.5V23Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.3373%2046.5H28.75V45.3468H26.3341V45.3092L27.0472%2044.6561C28.3396%2043.5376%2028.6772%2042.9682%2028.6772%2042.289C28.6772%2041.2225%2027.8011%2040.5%2026.4476%2040.5C25.129%2040.5%2024.2471%2041.2543%2024.25%2042.4595H25.6151C25.6151%2041.9249%2025.947%2041.6156%2026.4418%2041.6156C26.9279%2041.6156%2027.2801%2041.9133%2027.2801%2042.4017C27.2801%2042.8439%2027.0006%2043.1445%2026.5116%2043.5809L24.3373%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M24%2011.6862H25.5663V10.9645H25.6149C25.8155%2011.3761%2026.2621%2011.75%2027.0129%2011.75C28.1133%2011.75%2029%2010.979%2029%209.46304C29%207.89203%2028.0615%207.17609%2027.0227%207.17609C26.2362%207.17609%2025.8058%207.58768%2025.6149%207.99638H25.5825V5.75H24V11.6862ZM25.5502%209.46015C25.5502%208.73261%2025.8867%208.28333%2026.466%208.28333C27.0518%208.28333%2027.3754%208.7442%2027.3754%209.46015C27.3754%2010.179%2027.0518%2010.6457%2026.466%2010.6457C25.8867%2010.6457%2025.5502%2010.1819%2025.5502%209.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M46.3343%2030H49.674V25.3135H54V21.6954H49.674V17H46.3343V21.6954H42V25.3135H46.3343V30Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip2_1144_161769)'%3e%3cpath%20d='M77%2025.5H62V38.5H77V25.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%209.04083V21H77V8H62.6268C62.4606%208%2062.3011%208.10966%2062.1836%208.30485C62.066%208.50005%2062%208.76479%2062%209.04083Z'%20fill='url(%23paint2_linear_1144_161769)'/%3e%3cpath%20d='M70.5%2029H69.0716L67.5%2029.9199V31.1738L68.9253%2030.3535H68.9627V35H70.5V29Z'%20fill='white'/%3e%3cpath%20d='M67%2017.6862H68.5663V16.9645H68.6149C68.8155%2017.3761%2069.2621%2017.75%2070.0129%2017.75C71.1133%2017.75%2072%2016.979%2072%2015.463C72%2013.892%2071.0615%2013.1761%2070.0227%2013.1761C69.2362%2013.1761%2068.8058%2013.5877%2068.6149%2013.9964H68.5825V11.75H67V17.6862ZM68.5502%2015.4601C68.5502%2014.7326%2068.8867%2014.2833%2069.466%2014.2833C70.0518%2014.2833%2070.3754%2014.7442%2070.3754%2015.4601C70.3754%2016.179%2070.0518%2016.6457%2069.466%2016.6457C68.8867%2016.6457%2068.5502%2016.1819%2068.5502%2015.4601Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_161769)'%3e%3cpath%20d='M96%2025.5H81V38.5H96V25.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M81%2021H96V9.04083C96%208.76479%2095.934%208.50005%2095.8164%208.30485C95.6989%208.10966%2095.5394%208%2095.3732%208H81V21Z'%20fill='url(%23paint3_linear_1144_161769)'/%3e%3cpath%20d='M88.6058%2017.5C90.0564%2017.5%2090.9563%2016.7082%2091%2015.5095H89.4654C89.405%2016.0237%2089.0759%2016.3044%2088.6259%2016.3044C88.0484%2016.3044%2087.6723%2015.847%2087.6723%2014.9858C87.6723%2014.1309%2088.0517%2013.6735%2088.6259%2013.6735C89.096%2013.6735%2089.4016%2013.9732%2089.4654%2014.4685H91C90.9631%2013.276%2090.0363%2012.5%2088.6024%2012.5C86.9805%2012.5%2086%2013.5158%2086%2015.0016C86%2016.4811%2086.9738%2017.5%2088.6058%2017.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M104%2028H116V24.686H104V28ZM104%2022.314H116V19H104V22.314Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M124%203.04083V15H139V2H124.627C124.461%202%20124.301%202.10966%20124.184%202.30485C124.066%202.50005%20124%202.76479%20124%203.04083Z'%20fill='url(%23paint4_linear_1144_161769)'/%3e%3cpath%20d='M139%2019.5H124V32.5H139V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2037H124V50H139V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2032.5V19.5L124%2032.5H139Z'%20fill='%233865AB'/%3e%3cpath%20d='M129.337%2046.5H133.75V45.3468H131.334V45.3092L132.047%2044.6561C133.34%2043.5376%20133.677%2042.9682%20133.677%2042.289C133.677%2041.2225%20132.801%2040.5%20131.448%2040.5C130.129%2040.5%20129.247%2041.2543%20129.25%2042.4595H130.615C130.615%2041.9249%20130.947%2041.6156%20131.442%2041.6156C131.928%2041.6156%20132.28%2041.9133%20132.28%2042.4017C132.28%2042.8439%20132.001%2043.1445%20131.512%2043.5809L129.337%2045.4711V46.5Z'%20fill='white'/%3e%3cpath%20d='M132.5%2023H131.072L129.5%2023.9199V25.1738L130.925%2024.3535H130.963V29H132.5V23Z'%20fill='white'/%3e%3cpath%20d='M129%2011.6862H130.566V10.9645H130.615C130.816%2011.3761%20131.262%2011.75%20132.013%2011.75C133.113%2011.75%20134%2010.979%20134%209.46304C134%207.89203%20133.061%207.17609%20132.023%207.17609C131.236%207.17609%20130.806%207.58768%20130.615%207.99638H130.583V5.75H129V11.6862ZM130.55%209.46015C130.55%208.73261%20130.887%208.28333%20131.466%208.28333C132.052%208.28333%20132.375%208.7442%20132.375%209.46015C132.375%2010.179%20132.052%2010.6457%20131.466%2010.6457C130.887%2010.6457%20130.55%2010.1819%20130.55%209.46015Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip4_1144_161769)'%3e%3cpath%20d='M143%203.04083V15H158V2H143.627C143.461%202%20143%202%20143%202C143%202%20143%202.76479%20143%203.04083Z'%20fill='url(%23paint5_linear_1144_161769)'/%3e%3cpath%20d='M158%2019.5H143V32.5H158V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2037H143V50H158V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M149.774%2011.5C150.526%2011.5%20151.046%2011.2377%20151.342%2010.7415H151.384V11.4178H153V8.1182C153%207.09102%20151.985%206.5%20150.611%206.5C149.16%206.5%20148.337%207.1574%20148.2%208.04235L149.785%208.09292C149.859%207.78319%20150.143%207.59355%20150.597%207.59355C151.018%207.59355%20151.285%207.77686%20151.285%208.1024V8.1182C151.285%208.4153%20150.927%208.47851%20150.006%208.5512C148.914%208.63338%20148%208.99684%20148%2010.0714C148%2011.0322%20148.741%2011.5%20149.774%2011.5ZM150.305%2010.4886C149.908%2010.4886%20149.627%2010.318%20149.627%209.99558C149.627%209.68268%20149.901%209.49305%20150.389%209.42668C150.709%209.38559%20151.103%209.32238%20151.296%209.23072V9.69216C151.296%2010.1662%20150.853%2010.4886%20150.305%2010.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip5_1144_161769)'%3e%3cpath%20d='M162%2015.005H177V3.04584C177%202.76979%20176.934%202.50505%20176.816%202.30986C176.699%202.11466%20176.539%202.005%20176.373%202.005H162V15.005Z'%20fill='url(%23paint6_linear_1144_161769)'/%3e%3cpath%20d='M177%2019.505H162V32.505H177V19.505Z'%20fill='%233865AB'/%3e%3cpath%20d='M177%2037.005H162V50.005H177V37.005Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M162.5%2037.505H176.5V49.505H162.5V37.505Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M169.606%2011.5C171.056%2011.5%20171.956%2010.7082%20172%209.50946H170.465C170.405%2010.0237%20170.076%2010.3044%20169.626%2010.3044C169.048%2010.3044%20168.672%209.847%20168.672%208.9858C168.672%208.13092%20169.052%207.6735%20169.626%207.6735C170.096%207.6735%20170.402%207.97319%20170.465%208.46845H172C171.963%207.27602%20171.036%206.5%20169.602%206.5C167.981%206.5%20167%207.51577%20167%209.00158C167%2010.4811%20167.974%2011.5%20169.606%2011.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3crect%20x='18'%20y='1'%20width='17'%20height='50'%20stroke='white'%20stroke-width='2'/%3e%3crect%20x='18'%20y='1'%20width='17'%20height='50'%20stroke='white'%20stroke-width='2'/%3e%3crect%20x='18'%20y='1'%20width='17'%20height='50'%20stroke='white'%20stroke-width='2'/%3e%3crect%20x='61'%20y='7'%20width='17'%20height='32.5'%20stroke='white'%20stroke-width='2'/%3e%3crect%20x='61'%20y='7'%20width='17'%20height='32.5'%20stroke='white'%20stroke-width='2'/%3e%3crect%20x='61'%20y='7'%20width='17'%20height='32.5'%20stroke='white'%20stroke-width='2'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161769'%20x1='0'%20y1='8.5052'%20x2='15'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161769'%20x1='19'%20y1='8.5052'%20x2='34'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161769'%20x1='62'%20y1='14.5052'%20x2='77'%20y2='14.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161769'%20x1='81'%20y1='14.5052'%20x2='96'%20y2='14.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_161769'%20x1='124'%20y1='8.5052'%20x2='139'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1144_161769'%20x1='143'%20y1='8.5052'%20x2='158'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_1144_161769'%20x1='162'%20y1='8.51021'%20x2='177'%20y2='8.51021'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161769'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(0%202)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161769'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19%202)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_161769'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%208)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_161769'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%208)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1144_161769'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(143%202)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_1144_161769'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(162%202)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_18 = "data:image/svg+xml,%3csvg%20width='148'%20height='58'%20viewBox='0%200%20148%2058'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162294)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162294)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162294)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1144_162294)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M6.18549%2052H5V56.9302H6.18549V52Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M7.98978%2056.9928C8.50858%2056.9928%208.86737%2056.793%209.07102%2056.415H9.10011V56.9302H10.2153V54.4169C10.2153%2053.6346%209.51466%2053.1844%208.56676%2053.1844C7.56552%2053.1844%206.99823%2053.6851%206.90369%2054.3592L7.99705%2054.3977C8.04796%2054.1618%208.24433%2054.0173%208.55706%2054.0173C8.84798%2054.0173%209.03223%2054.157%209.03223%2054.4049V54.4169C9.03223%2054.6432%208.78495%2054.6914%208.14978%2054.7468C7.39582%2054.8093%206.7655%2055.0862%206.7655%2055.9047C6.7655%2056.6365%207.27703%2056.9928%207.98978%2056.9928ZM8.35585%2056.2224C8.0819%2056.2224%207.88795%2056.0924%207.88795%2055.8469C7.88795%2055.6086%208.07705%2055.4641%208.41403%2055.4136C8.63464%2055.3823%208.90616%2055.3341%209.0395%2055.2643V55.6158C9.0395%2055.9769%208.73404%2056.2224%208.35585%2056.2224Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M10.9402%2056.9302H12.1135V56.3308H12.1499C12.3002%2056.6726%2012.6347%2056.9831%2013.1972%2056.9831C14.0214%2056.9831%2014.6857%2056.3428%2014.6857%2055.0838C14.6857%2053.779%2013.9827%2053.1844%2013.2045%2053.1844C12.6153%2053.1844%2012.2929%2053.5262%2012.1499%2053.8657H12.1256V52H10.9402V56.9302ZM12.1014%2055.0814C12.1014%2054.4771%2012.3535%2054.104%2012.7875%2054.104C13.2263%2054.104%2013.4687%2054.4868%2013.4687%2055.0814C13.4687%2055.6784%2013.2263%2056.066%2012.7875%2056.066C12.3535%2056.066%2012.1014%2055.6808%2012.1014%2055.0814Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M17.0476%2057C18.0246%2057%2018.667%2056.5306%2018.8028%2055.8036L17.7143%2055.7723C17.6221%2056.0178%2017.3797%2056.1502%2017.0694%2056.1502C16.6136%2056.1502%2016.3324%2055.8493%2016.3324%2055.3967V55.3654H18.8149V55.0717C18.8149%2053.8536%2018.0682%2053.1844%2017.0112%2053.1844C15.8863%2053.1844%2015.1639%2053.9499%2015.1639%2055.0958C15.1639%2056.2802%2015.8766%2057%2017.0476%2057ZM16.3324%2054.6818C16.3494%2054.3134%2016.6427%2054.0342%2017.0355%2054.0342C17.4258%2054.0342%2017.707%2054.3038%2017.7118%2054.6818H16.3324Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M20.6059%2052H19.4204V56.9302H20.6059V52Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M21.5932%2056.2537H25.0623V55.2884H21.5932V56.2537ZM21.5932%2054.5975H25.0623V53.6322H21.5932V54.5975Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M28.3333%2052H27.2206L25.9963%2052.7559V53.7862L27.1066%2053.1122H27.1357V56.9302H28.3333V52Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M46.3343%2035H49.674V30.674H54V27.3343H49.674V23H46.3343V27.3343H42V30.674H46.3343V35Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip2_1144_162294)'%3e%3cpath%20d='M77%2027H62V40H77V27Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%2010.5408V22.5H77V9.5H62.6268C62.4606%209.5%2062.3011%209.60966%2062.1836%209.80485C62.066%2010%2062%2010.2648%2062%2010.5408Z'%20fill='url(%23paint2_linear_1144_162294)'/%3e%3cpath%20d='M69.4792%2036.5C70.8085%2036.5%2071.7528%2035.7757%2071.75%2034.7605C71.7528%2034.0418%2071.2958%2033.5285%2070.4208%2033.423V33.3774C71.0771%2033.2804%2071.5423%2032.827%2071.5395%2032.1711C71.5423%2031.2186%2070.706%2030.5%2069.4903%2030.5C68.2663%2030.5%2067.3746%2031.23%2067.3635%2032.2681H68.6734C68.6845%2031.8688%2069.0334%2031.6008%2069.4903%2031.6008C69.9251%2031.6008%2070.2214%2031.8717%2070.2186%2032.2624C70.2214%2032.6673%2069.8725%2032.9468%2069.3685%2032.9468H68.8174V33.9506H69.3685C69.9417%2033.9506%2070.3155%2034.2414%2070.31%2034.6521C70.3155%2035.0656%2069.9721%2035.3536%2069.4848%2035.3536C69.0001%2035.3536%2068.6429%2035.0884%2068.6291%2034.7034H67.25C67.2611%2035.7586%2068.1832%2036.5%2069.4792%2036.5Z'%20fill='white'/%3e%3cpath%20d='M67%2019.4362H68.5663V18.7145H68.6149C68.8155%2019.1261%2069.2621%2019.5%2070.0129%2019.5C71.1133%2019.5%2072%2018.729%2072%2017.213C72%2015.642%2071.0615%2014.9261%2070.0227%2014.9261C69.2362%2014.9261%2068.8058%2015.3377%2068.6149%2015.7464H68.5825V13.5H67V19.4362ZM68.5502%2017.2101C68.5502%2016.4826%2068.8867%2016.0333%2069.466%2016.0333C70.0518%2016.0333%2070.3754%2016.4942%2070.3754%2017.2101C70.3754%2017.929%2070.0518%2018.3957%2069.466%2018.3957C68.8867%2018.3957%2068.5502%2017.9319%2068.5502%2017.2101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_162294)'%3e%3cpath%20d='M96%2027H81V40H96V27Z'%20fill='%233865AB'/%3e%3cpath%20d='M81%2022.5H96V10.5408C96%2010.2648%2095.934%2010%2095.8164%209.80485C95.6989%209.60966%2095.5394%209.5%2095.3732%209.5H81V22.5Z'%20fill='url(%23paint3_linear_1144_162294)'/%3e%3cpath%20d='M88.6058%2019.5C90.0564%2019.5%2090.9563%2018.7082%2091%2017.5095H89.4654C89.405%2018.0237%2089.0759%2018.3044%2088.6259%2018.3044C88.0484%2018.3044%2087.6723%2017.847%2087.6723%2016.9858C87.6723%2016.1309%2088.0517%2015.6735%2088.6259%2015.6735C89.096%2015.6735%2089.4016%2015.9732%2089.4654%2016.4685H91C90.9631%2015.276%2090.0363%2014.5%2088.6024%2014.5C86.9805%2014.5%2086%2015.5158%2086%2017.0016C86%2018.4811%2086.9738%2019.5%2088.6058%2019.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M68.1855%2043.75H67V48.6802H68.1855V43.75Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M69.9898%2048.7428C70.5086%2048.7428%2070.8674%2048.543%2071.071%2048.165H71.1001V48.6802H72.2153V46.1669C72.2153%2045.3846%2071.5147%2044.9344%2070.5668%2044.9344C69.5655%2044.9344%2068.9982%2045.4351%2068.9037%2046.1092L69.997%2046.1477C70.048%2045.9118%2070.2443%2045.7673%2070.5571%2045.7673C70.848%2045.7673%2071.0322%2045.907%2071.0322%2046.1549V46.1669C71.0322%2046.3932%2070.7849%2046.4414%2070.1498%2046.4968C69.3958%2046.5593%2068.7655%2046.8362%2068.7655%2047.6547C68.7655%2048.3865%2069.277%2048.7428%2069.9898%2048.7428ZM70.3558%2047.9724C70.0819%2047.9724%2069.888%2047.8424%2069.888%2047.5969C69.888%2047.3586%2070.077%2047.2141%2070.414%2047.1636C70.6346%2047.1323%2070.9062%2047.0841%2071.0395%2047.0143V47.3658C71.0395%2047.7269%2070.734%2047.9724%2070.3558%2047.9724Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M72.9402%2048.6802H74.1135V48.0808H74.1499C74.3002%2048.4226%2074.6347%2048.7331%2075.1972%2048.7331C76.0214%2048.7331%2076.6857%2048.0928%2076.6857%2046.8338C76.6857%2045.529%2075.9827%2044.9344%2075.2045%2044.9344C74.6153%2044.9344%2074.2929%2045.2762%2074.1499%2045.6157H74.1256V43.75H72.9402V48.6802ZM74.1014%2046.8314C74.1014%2046.2271%2074.3535%2045.854%2074.7875%2045.854C75.2263%2045.854%2075.4687%2046.2368%2075.4687%2046.8314C75.4687%2047.4284%2075.2263%2047.816%2074.7875%2047.816C74.3535%2047.816%2074.1014%2047.4308%2074.1014%2046.8314Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M79.0476%2048.75C80.0246%2048.75%2080.667%2048.2806%2080.8028%2047.5536L79.7143%2047.5223C79.6221%2047.7678%2079.3797%2047.9002%2079.0694%2047.9002C78.6136%2047.9002%2078.3324%2047.5993%2078.3324%2047.1467V47.1154H80.8149V46.8217C80.8149%2045.6036%2080.0682%2044.9344%2079.0112%2044.9344C77.8863%2044.9344%2077.1639%2045.6999%2077.1639%2046.8458C77.1639%2048.0302%2077.8766%2048.75%2079.0476%2048.75ZM78.3324%2046.4318C78.3494%2046.0634%2078.6427%2045.7842%2079.0355%2045.7842C79.4258%2045.7842%2079.707%2046.0538%2079.7118%2046.4318H78.3324Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M82.6059%2043.75H81.4204V48.6802H82.6059V43.75Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M83.5932%2048.0037H87.0623V47.0384H83.5932V48.0037ZM83.5932%2046.3475H87.0623V45.3822H83.5932V46.3475Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M90.3333%2043.75H89.2206L87.9963%2044.5059V45.5362L89.1066%2044.8622H89.1357V48.6802H90.3333V43.75Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M109.907%2035C110.601%2035%20115.933%2031%20115.933%2029C115.933%2027%20110.736%2023%20109.907%2023C109.078%2023%20108.402%2023.5%20108.402%2024.4756C108.402%2025.4512%20111.907%2027.9206%20111.907%2027.9206C111.907%2027.9206%20104.254%2027.25%20104%2027.9206C103.746%2028.5911%20103.746%2029.4089%20104%2030.0794C104.254%2030.75%20111.907%2030.0794%20111.907%2030.0794C111.907%2030.0794%20108.402%2032.75%20108.402%2033.5301C108.402%2034.3103%20109.212%2035%20109.907%2035Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip4_1144_162294)'%3e%3cpath%20d='M124%205.80064V15H148V5H125.003L124%205L124%205.80064Z'%20fill='url(%23paint4_linear_1144_162294)'/%3e%3cpath%20d='M134.774%2012.5C135.526%2012.5%20136.046%2012.2377%20136.342%2011.7415H136.384V12.4178H138V9.1182C138%208.09102%20136.985%207.5%20135.611%207.5C134.16%207.5%20133.337%208.1574%20133.2%209.04235L134.785%209.09292C134.859%208.78319%20135.143%208.59355%20135.597%208.59355C136.018%208.59355%20136.285%208.77686%20136.285%209.1024V9.1182C136.285%209.4153%20135.927%209.47851%20135.006%209.5512C133.914%209.63338%20133%209.99684%20133%2011.0714C133%2012.0322%20133.741%2012.5%20134.774%2012.5ZM135.305%2011.4886C134.908%2011.4886%20134.627%2011.318%20134.627%2010.9956C134.627%2010.6827%20134.901%2010.493%20135.389%2010.4267C135.709%2010.3856%20136.103%2010.3224%20136.296%2010.2307V10.6922C136.296%2011.1662%20135.853%2011.4886%20135.305%2011.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M148%2018H124V27.5H148V18Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M148%2030.75H124V40.25H148V30.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M148%2043.5H124V53H148V43.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M137%2019.75H135.572L134%2020.6699V21.9238L135.425%2021.1035H135.463V25.75H137V19.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M134.087%2038.5H138.5V37.3468H136.084V37.3092L136.797%2036.6561C138.09%2035.5376%20138.427%2034.9682%20138.427%2034.289C138.427%2033.2225%20137.551%2032.5%20136.198%2032.5C134.879%2032.5%20133.997%2033.2543%20134%2034.4595H135.365C135.365%2033.9249%20135.697%2033.6156%20136.192%2033.6156C136.678%2033.6156%20137.03%2033.9133%20137.03%2034.4017C137.03%2034.8439%20136.751%2035.1445%20136.262%2035.5809L134.087%2037.4711V38.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M135.979%2051.25C137.308%2051.25%20138.253%2050.5257%20138.25%2049.5105C138.253%2048.7918%20137.796%2048.2785%20136.921%2048.173V48.1274C137.577%2048.0304%20138.042%2047.577%20138.04%2046.9211C138.042%2045.9686%20137.206%2045.25%20135.99%2045.25C134.766%2045.25%20133.875%2045.98%20133.864%2047.0181H135.173C135.184%2046.6188%20135.533%2046.3508%20135.99%2046.3508C136.425%2046.3508%20136.721%2046.6217%20136.719%2047.0124C136.721%2047.4173%20136.372%2047.6968%20135.868%2047.6968H135.317V48.7006H135.868C136.442%2048.7006%20136.816%2048.9914%20136.81%2049.4021C136.816%2049.8156%20136.472%2050.1036%20135.985%2050.1036C135.5%2050.1036%20135.143%2049.8384%20135.129%2049.4534H133.75C133.761%2050.5086%20134.683%2051.25%20135.979%2051.25Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162294'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162294'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162294'%20x1='62'%20y1='16.0052'%20x2='77'%20y2='16.0052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162294'%20x1='81'%20y1='16.0052'%20x2='96'%20y2='16.0052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_162294'%20x1='124.008'%20y1='10.004'%20x2='148.008'%20y2='10.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162294'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162294'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162294'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%209.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_162294'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%209.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1144_162294'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(124%205)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_19 = "data:image/svg+xml,%3csvg%20width='125'%20height='58'%20viewBox='0%200%20125%2058'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162685)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162685)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162685)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1144_162685)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0777%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2123%2030%2047.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip2_1144_162685)'%3e%3cpath%20d='M62%201.04083V13H77V0H62.6268C62.4606%200%2062.3011%200.109659%2062.1836%200.304853C62.066%200.500047%2062%200.764787%2062%201.04083Z'%20fill='url(%23paint2_linear_1144_162685)'/%3e%3cpath%20d='M77%2017.5H62V30.5H77V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2035H62V48H77V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M70.5%2021H69.0716L67.5%2021.9199V23.1738L68.9253%2022.3535H68.9627V27H70.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.3373%2044.5H71.75V43.3468H69.3341V43.3092L70.0472%2042.6561C71.3396%2041.5376%2071.6772%2040.9682%2071.6772%2040.289C71.6772%2039.2225%2070.8011%2038.5%2069.4476%2038.5C68.129%2038.5%2067.2471%2039.2543%2067.25%2040.4595H68.6151C68.6151%2039.9249%2068.947%2039.6156%2069.4418%2039.6156C69.9279%2039.6156%2070.2801%2039.9133%2070.2801%2040.4017C70.2801%2040.8439%2070.0006%2041.1445%2069.5116%2041.5809L67.3373%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7744%209.5C69.5264%209.5%2070.0464%209.23767%2070.3415%208.74147H70.3837V9.41783H72V6.1182C72%205.09102%2070.9845%204.5%2069.6107%204.5C68.1595%204.5%2067.3373%205.1574%2067.2003%206.04235L68.785%206.09292C68.8587%205.78319%2069.1434%205.59355%2069.5966%205.59355C70.0183%205.59355%2070.2853%205.77686%2070.2853%206.1024V6.1182C70.2853%206.4153%2069.9269%206.47851%2069.0063%206.5512C67.9136%206.63338%2067%206.99684%2067%208.07143C67%209.03224%2067.7414%209.5%2068.7744%209.5ZM69.305%208.48862C68.9079%208.48862%2068.6268%208.31795%2068.6268%207.99558C68.6268%207.68268%2068.9009%207.49305%2069.3893%207.42668C69.7091%207.38559%2070.1026%207.32238%2070.2959%207.23072V7.69216C70.2959%208.16625%2069.8531%208.48862%2069.305%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_162685)'%3e%3cpath%20d='M96%2017.5H81V30.5H96V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M96%2035H81V48H96V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M81%201.04083V13H96V0H81.6268C81.4606%200%2081%200%2081%200C81%200%2081%200.764787%2081%201.04083Z'%20fill='url(%23paint3_linear_1144_162685)'/%3e%3cpath%20d='M86%209.68623H87.5663V8.96449H87.6149C87.8155%209.37609%2088.2621%209.75%2089.0129%209.75C90.1133%209.75%2091%208.97898%2091%207.46304C91%205.89203%2090.0615%205.17609%2089.0227%205.17609C88.2362%205.17609%2087.8058%205.58768%2087.6149%205.99638H87.5825V3.75H86V9.68623ZM87.5502%207.46015C87.5502%206.73261%2087.8867%206.28333%2088.466%206.28333C89.0518%206.28333%2089.3754%206.7442%2089.3754%207.46015C89.3754%208.17899%2089.0518%208.64565%2088.466%208.64565C87.8867%208.64565%2087.5502%208.18188%2087.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1144_162685)'%3e%3cpath%20d='M100%2013H124V1.04083C124%200.764787%20123.894%200.500047%20123.706%200.304853C123.518%200.109659%20123.263%200%20122.997%200L100%200V13Z'%20fill='url(%23paint4_linear_1144_162685)'/%3e%3cpath%20d='M105.185%204H104V8.93019H105.185V4Z'%20fill='%2324292E'/%3e%3cpath%20d='M106.99%208.99278C107.509%208.99278%20107.867%208.79297%20108.071%208.41502H108.1V8.93019H109.215V6.41695C109.215%205.63457%20108.515%205.1844%20107.567%205.1844C106.566%205.1844%20105.998%205.68512%20105.904%206.35917L106.997%206.39769C107.048%206.16177%20107.244%206.01733%20107.557%206.01733C107.848%206.01733%20108.032%206.15696%20108.032%206.40491V6.41695C108.032%206.64324%20107.785%206.69138%20107.15%206.74675C106.396%206.80934%20105.766%207.08618%20105.766%207.90467C105.766%208.63649%20106.277%208.99278%20106.99%208.99278ZM107.356%208.22244C107.082%208.22244%20106.888%208.09244%20106.888%207.84689C106.888%207.60857%20107.077%207.46413%20107.414%207.41358C107.635%207.38228%20107.906%207.33414%20108.039%207.26432V7.61579C108.039%207.97689%20107.734%208.22244%20107.356%208.22244Z'%20fill='%2324292E'/%3e%3cpath%20d='M109.94%208.93019H111.114V8.33077H111.15C111.3%208.6726%20111.635%208.98315%20112.197%208.98315C113.021%208.98315%20113.686%208.3428%20113.686%207.08377C113.686%205.77901%20112.983%205.1844%20112.204%205.1844C111.615%205.1844%20111.293%205.52624%20111.15%205.86567H111.126V4H109.94V8.93019ZM111.101%207.08137C111.101%206.47713%20111.354%206.104%20111.787%206.104C112.226%206.104%20112.469%206.48676%20112.469%207.08137C112.469%207.67838%20112.226%208.06596%20111.787%208.06596C111.354%208.06596%20111.101%207.68079%20111.101%207.08137Z'%20fill='%2324292E'/%3e%3cpath%20d='M116.048%209C117.025%209%20117.667%208.53057%20117.803%207.80356L116.714%207.77227C116.622%208.01781%20116.38%208.15022%20116.069%208.15022C115.614%208.15022%20115.332%207.8493%20115.332%207.39673V7.36543H117.815V7.07174C117.815%205.85363%20117.068%205.1844%20116.011%205.1844C114.886%205.1844%20114.164%205.94993%20114.164%207.09581C114.164%208.28021%20114.877%209%20116.048%209ZM115.332%206.68175C115.349%206.31343%20115.643%206.03418%20116.035%206.03418C116.426%206.03418%20116.707%206.3038%20116.712%206.68175H115.332Z'%20fill='%2324292E'/%3e%3cpath%20d='M119.606%204H118.42V8.93019H119.606V4Z'%20fill='%2324292E'/%3e%3cpath%20d='M124%2017.5H100V30.5H124V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2035H100V48H124V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M113.5%2021H112.072L110.5%2021.9199V23.1738L111.925%2022.3535H111.963V27H113.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2039H112.072L110.5%2039.9199V41.1738L111.925%2040.3535H111.963V45H113.5V39Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M9.18549%2051H8V55.9302H9.18549V51Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M10.9898%2055.9928C11.5086%2055.9928%2011.8674%2055.793%2012.071%2055.415H12.1001V55.9302H13.2153V53.4169C13.2153%2052.6346%2012.5147%2052.1844%2011.5668%2052.1844C10.5655%2052.1844%209.99823%2052.6851%209.90369%2053.3592L10.997%2053.3977C11.048%2053.1618%2011.2443%2053.0173%2011.5571%2053.0173C11.848%2053.0173%2012.0322%2053.157%2012.0322%2053.4049V53.4169C12.0322%2053.6432%2011.7849%2053.6914%2011.1498%2053.7468C10.3958%2053.8093%209.7655%2054.0862%209.7655%2054.9047C9.7655%2055.6365%2010.277%2055.9928%2010.9898%2055.9928ZM11.3558%2055.2224C11.0819%2055.2224%2010.888%2055.0924%2010.888%2054.8469C10.888%2054.6086%2011.077%2054.4641%2011.414%2054.4136C11.6346%2054.3823%2011.9062%2054.3341%2012.0395%2054.2643V54.6158C12.0395%2054.9769%2011.734%2055.2224%2011.3558%2055.2224Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M13.9402%2055.9302H15.1135V55.3308H15.1499C15.3002%2055.6726%2015.6347%2055.9831%2016.1972%2055.9831C17.0214%2055.9831%2017.6857%2055.3428%2017.6857%2054.0838C17.6857%2052.779%2016.9827%2052.1844%2016.2045%2052.1844C15.6153%2052.1844%2015.2929%2052.5262%2015.1499%2052.8657H15.1256V51H13.9402V55.9302ZM15.1014%2054.0814C15.1014%2053.4771%2015.3535%2053.104%2015.7875%2053.104C16.2263%2053.104%2016.4687%2053.4868%2016.4687%2054.0814C16.4687%2054.6784%2016.2263%2055.066%2015.7875%2055.066C15.3535%2055.066%2015.1014%2054.6808%2015.1014%2054.0814Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M20.0476%2056C21.0246%2056%2021.667%2055.5306%2021.8028%2054.8036L20.7143%2054.7723C20.6221%2055.0178%2020.3797%2055.1502%2020.0694%2055.1502C19.6136%2055.1502%2019.3324%2054.8493%2019.3324%2054.3967V54.3654H21.8149V54.0717C21.8149%2052.8536%2021.0682%2052.1844%2020.0112%2052.1844C18.8863%2052.1844%2018.1639%2052.9499%2018.1639%2054.0958C18.1639%2055.2802%2018.8766%2056%2020.0476%2056ZM19.3324%2053.6818C19.3494%2053.3134%2019.6427%2053.0342%2020.0355%2053.0342C20.4258%2053.0342%2020.707%2053.3038%2020.7118%2053.6818H19.3324Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M23.6059%2051H22.4204V55.9302H23.6059V51Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M24.5932%2055.2537H28.0623V54.2884H24.5932V55.2537ZM24.5932%2053.5975H28.0623V52.6322H24.5932V53.5975Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M31.3333%2051H30.2206L28.9963%2051.7559V52.7862L30.1066%2052.1122H30.1357V55.9302H31.3333V51Z'%20fill='%23CCCCDC'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162685'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162685'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162685'%20x1='62'%20y1='6.5052'%20x2='77'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162685'%20x1='81'%20y1='6.5052'%20x2='96'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_162685'%20x1='100'%20y1='6.5052'%20x2='124'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162685'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162685'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162685'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(62)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_162685'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(81)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1144_162685'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(100)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_20 = "data:image/svg+xml,%3csvg%20width='108'%20height='48'%20viewBox='0%200%20108%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_162397)'%3e%3cpath%20d='M0%200.800642V10H24V1.05456e-06H1.00292L0.000198677%200L0%200.800642Z'%20fill='url(%23paint0_linear_1144_162397)'/%3e%3cpath%20d='M24%2013H0V22.5H24V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2025.75H0V35.25H24V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2038.5H0V48H24V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13%2014.75H11.5716L10%2015.6699V16.9238L11.4253%2016.1035H11.4627V20.75H13V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2033.5H14.25V32.3468H11.8341V32.3092L12.5472%2031.6561C13.8396%2030.5376%2014.1772%2029.9682%2014.1772%2029.289C14.1772%2028.2225%2013.3011%2027.5%2011.9476%2027.5C10.629%2027.5%209.7471%2028.2543%209.75001%2029.4595H11.1151C11.1151%2028.9249%2011.447%2028.6156%2011.9418%2028.6156C12.4279%2028.6156%2012.7801%2028.9133%2012.7801%2029.4017C12.7801%2029.8439%2012.5006%2030.1445%2012.0116%2030.5809L9.83733%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M11.9792%2046.25C13.3085%2046.25%2014.2528%2045.5257%2014.25%2044.5105C14.2528%2043.7918%2013.7958%2043.2785%2012.9208%2043.173V43.1274C13.5771%2043.0304%2014.0423%2042.577%2014.0395%2041.9211C14.0423%2040.9686%2013.206%2040.25%2011.9903%2040.25C10.7663%2040.25%209.87462%2040.98%209.86354%2042.0181H11.1734C11.1845%2041.6188%2011.5334%2041.3508%2011.9903%2041.3508C12.4251%2041.3508%2012.7214%2041.6217%2012.7186%2042.0124C12.7214%2042.4173%2012.3725%2042.6968%2011.8685%2042.6968H11.3174V43.7006H11.8685C12.4417%2043.7006%2012.8155%2043.9914%2012.81%2044.4021C12.8155%2044.8156%2012.4721%2045.1036%2011.9848%2045.1036C11.5001%2045.1036%2011.1429%2044.8384%2011.1291%2044.4534H9.75C9.76108%2045.5086%2010.6832%2046.25%2011.9792%2046.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.7744%207.5C11.5264%207.5%2012.0464%207.23767%2012.3415%206.74147H12.3837V7.41783H14V4.1182C14%203.09102%2012.9845%202.5%2011.6107%202.5C10.1595%202.5%209.33732%203.1574%209.20028%204.04235L10.785%204.09292C10.8587%203.78319%2011.1434%203.59355%2011.5966%203.59355C12.0183%203.59355%2012.2853%203.77686%2012.2853%204.1024V4.1182C12.2853%204.4153%2011.9269%204.47851%2011.0063%204.5512C9.91356%204.63338%209%204.99684%209%206.07143C9%207.03224%209.74139%207.5%2010.7744%207.5ZM11.305%206.48862C10.9079%206.48862%2010.6268%206.31795%2010.6268%205.99558C10.6268%205.68268%2010.9009%205.49305%2011.3893%205.42668C11.7091%205.38559%2012.1026%205.32238%2012.2959%205.23072V5.69216C12.2959%206.16625%2011.8531%206.48862%2011.305%206.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M32.5%2019H55.5V29H32.5V19Z'%20stroke='%23CCCCDC'/%3e%3cpath%20d='M36.0776%2026.5H40V25.539H37.8525V25.5077L38.4864%2024.9634C39.6352%2024.0313%2039.9353%2023.5568%2039.9353%2022.9908C39.9353%2022.1021%2039.1565%2021.5%2037.9534%2021.5C36.7814%2021.5%2035.9974%2022.1286%2036%2023.1329H37.2135C37.2135%2022.6874%2037.5084%2022.4297%2037.9483%2022.4297C38.3803%2022.4297%2038.6934%2022.6777%2038.6934%2023.0848C38.6934%2023.4533%2038.445%2023.7038%2038.0104%2024.0674L36.0776%2025.6426V26.5Z'%20fill='white'/%3e%3cpath%20d='M37.3525%2025.539V26H36.5776V25.8801L38.026%2024.6997L37.5268%2025.1284L37.3525%2025.278V25.5077V25.539ZM39.4353%2022.9908C39.4353%2023.2453%2039.359%2023.5204%2038.6951%2024.1273C38.9687%2023.8557%2039.1934%2023.5298%2039.1934%2023.0848C39.1934%2022.7428%2039.0569%2022.4371%2038.8075%2022.2243C38.7381%2022.1651%2038.6631%2022.1156%2038.5841%2022.0751C38.7959%2022.1308%2038.9657%2022.2137%2039.0935%2022.3106C39.3183%2022.481%2039.4353%2022.7084%2039.4353%2022.9908ZM36.8547%2022.3253C36.9643%2022.2347%2037.1045%2022.1569%2037.275%2022.1C37.2042%2022.1413%2037.137%2022.1906%2037.0748%2022.2487C36.9565%2022.3591%2036.8684%2022.4896%2036.8089%2022.6329H36.6079C36.6683%2022.512%2036.7522%2022.41%2036.8547%2022.3253Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cmask%20id='path-12-inside-1_1144_162397'%20fill='white'%3e%3cpath%20d='M51.8597%2022.6397C51.7708%2022.5502%2051.6506%2022.5%2051.5253%2022.5C51.4%2022.5%2051.2798%2022.5502%2051.1909%2022.6397L49.4881%2024.3398L47.8091%2022.6397C47.7202%2022.5502%2047.6%2022.5%2047.4747%2022.5C47.3494%2022.5%2047.2292%2022.5502%2047.1403%2022.6397C47.0958%2022.6843%2047.0606%2022.7374%2047.0365%2022.7959C47.0124%2022.8545%2047%2022.9172%2047%2022.9806C47%2023.044%2047.0124%2023.1068%2047.0365%2023.1653C47.0606%2023.2239%2047.0958%2023.277%2047.1403%2023.3216L49.1514%2025.3579C49.1955%2025.403%2049.2479%2025.4387%2049.3057%2025.4631C49.3635%2025.4874%2049.4255%2025.5%2049.4881%2025.5C49.5508%2025.5%2049.6128%2025.4874%2049.6706%2025.4631C49.7284%2025.4387%2049.7808%2025.403%2049.8249%2025.3579L51.8597%2023.3216C51.9042%2023.277%2051.9394%2023.2239%2051.9635%2023.1653C51.9876%2023.1068%2052%2023.044%2052%2022.9806C52%2022.9172%2051.9876%2022.8545%2051.9635%2022.7959C51.9394%2022.7374%2051.9042%2022.6843%2051.8597%2022.6397Z'/%3e%3c/mask%3e%3cpath%20d='M51.8597%2022.6397C51.7708%2022.5502%2051.6506%2022.5%2051.5253%2022.5C51.4%2022.5%2051.2798%2022.5502%2051.1909%2022.6397L49.4881%2024.3398L47.8091%2022.6397C47.7202%2022.5502%2047.6%2022.5%2047.4747%2022.5C47.3494%2022.5%2047.2292%2022.5502%2047.1403%2022.6397C47.0958%2022.6843%2047.0606%2022.7374%2047.0365%2022.7959C47.0124%2022.8545%2047%2022.9172%2047%2022.9806C47%2023.044%2047.0124%2023.1068%2047.0365%2023.1653C47.0606%2023.2239%2047.0958%2023.277%2047.1403%2023.3216L49.1514%2025.3579C49.1955%2025.403%2049.2479%2025.4387%2049.3057%2025.4631C49.3635%2025.4874%2049.4255%2025.5%2049.4881%2025.5C49.5508%2025.5%2049.6128%2025.4874%2049.6706%2025.4631C49.7284%2025.4387%2049.7808%2025.403%2049.8249%2025.3579L51.8597%2023.3216C51.9042%2023.277%2051.9394%2023.2239%2051.9635%2023.1653C51.9876%2023.1068%2052%2023.044%2052%2022.9806C52%2022.9172%2051.9876%2022.8545%2051.9635%2022.7959C51.9394%2022.7374%2051.9042%2022.6843%2051.8597%2022.6397Z'%20fill='white'/%3e%3cpath%20d='M51.8597%2022.6397L51.1503%2023.3445L51.1511%2023.3453L51.8597%2022.6397ZM51.5253%2022.5V21.5V22.5ZM51.1909%2022.6397L51.8975%2023.3473L51.9003%2023.3445L51.1909%2022.6397ZM49.4881%2024.3398L48.7766%2025.0425L49.4832%2025.7579L50.1947%2025.0474L49.4881%2024.3398ZM47.8091%2022.6397L48.5206%2021.937L48.5185%2021.9349L47.8091%2022.6397ZM47.1403%2022.6397L47.8489%2023.3453L47.8497%2023.3445L47.1403%2022.6397ZM47.1403%2023.3216L47.8518%2022.6189L47.8489%2022.616L47.1403%2023.3216ZM49.1514%2025.3579L49.8658%2024.6582L49.8629%2024.6553L49.1514%2025.3579ZM49.8249%2025.3579L49.1175%2024.6511L49.1105%2024.6582L49.8249%2025.3579ZM51.8597%2023.3216L52.5671%2024.0285L52.5683%2024.0272L51.8597%2023.3216ZM52.5691%2021.9349C52.2938%2021.6578%2051.9188%2021.5%2051.5253%2021.5V23.5C51.3824%2023.5%2051.2478%2023.4426%2051.1503%2023.3445L52.5691%2021.9349ZM51.5253%2021.5C51.1318%2021.5%2050.7568%2021.6578%2050.4815%2021.9349L51.9003%2023.3445C51.8028%2023.4426%2051.6682%2023.5%2051.5253%2023.5V21.5ZM50.4844%2021.932L48.7816%2023.6321L50.1947%2025.0474L51.8975%2023.3473L50.4844%2021.932ZM50.1996%2023.6371L48.5206%2021.937L47.0976%2023.3423L48.7766%2025.0425L50.1996%2023.6371ZM48.5185%2021.9349C48.2432%2021.6578%2047.8682%2021.5%2047.4747%2021.5V23.5C47.3318%2023.5%2047.1972%2023.4426%2047.0997%2023.3445L48.5185%2021.9349ZM47.4747%2021.5C47.0812%2021.5%2046.7062%2021.6578%2046.4309%2021.9349L47.8497%2023.3445C47.7522%2023.4426%2047.6176%2023.5%2047.4747%2023.5V21.5ZM46.4317%2021.9341C46.2941%2022.0722%2046.1855%2022.236%2046.1117%2022.4154L47.9613%2023.1765C47.9356%2023.2389%2047.8976%2023.2964%2047.8489%2023.3453L46.4317%2021.9341ZM46.1117%2022.4154C46.0379%2022.5949%2046%2022.787%2046%2022.9806H48C48%2023.0475%2047.9869%2023.114%2047.9613%2023.1765L46.1117%2022.4154ZM46%2022.9806C46%2023.1743%2046.0379%2023.3664%2046.1117%2023.5458L47.9613%2022.7848C47.9869%2022.8472%2048%2022.9138%2048%2022.9806H46ZM46.1117%2023.5458C46.1855%2023.7253%2046.2941%2023.889%2046.4317%2024.0272L47.8489%2022.616C47.8976%2022.6649%2047.9356%2022.7224%2047.9613%2022.7848L46.1117%2023.5458ZM46.4288%2024.0243L48.4399%2026.0606L49.8629%2024.6553L47.8518%2022.6189L46.4288%2024.0243ZM48.437%2026.0577C48.5735%2026.197%2048.7365%2026.3083%2048.9171%2026.3844L49.6944%2024.5417C49.7594%2024.5691%2049.8175%2024.6089%2049.8658%2024.6582L48.437%2026.0577ZM48.9171%2026.3844C49.0976%2026.4606%2049.2918%2026.5%2049.4881%2026.5V24.5C49.5593%2024.5%2049.6294%2024.5143%2049.6944%2024.5417L48.9171%2026.3844ZM49.4881%2026.5C49.6845%2026.5%2049.8787%2026.4606%2050.0592%2026.3844L49.2819%2024.5417C49.3468%2024.5143%2049.417%2024.5%2049.4881%2024.5V26.5ZM50.0592%2026.3844C50.2398%2026.3083%2050.4028%2026.197%2050.5393%2026.0577L49.1105%2024.6582C49.1588%2024.6089%2049.2169%2024.5691%2049.2819%2024.5417L50.0592%2026.3844ZM50.5323%2026.0648L52.5671%2024.0285L51.1523%2022.6148L49.1175%2024.6511L50.5323%2026.0648ZM52.5683%2024.0272C52.7059%2023.889%2052.8145%2023.7253%2052.8883%2023.5458L51.0387%2022.7848C51.0644%2022.7224%2051.1024%2022.6649%2051.1511%2022.616L52.5683%2024.0272ZM52.8883%2023.5458C52.9621%2023.3664%2053%2023.1743%2053%2022.9806H51C51%2022.9138%2051.0131%2022.8472%2051.0387%2022.7848L52.8883%2023.5458ZM53%2022.9806C53%2022.787%2052.9621%2022.5949%2052.8883%2022.4154L51.0387%2023.1765C51.0131%2023.114%2051%2023.0475%2051%2022.9806H53ZM52.8883%2022.4154C52.8145%2022.236%2052.7059%2022.0722%2052.5683%2021.9341L51.1511%2023.3453C51.1024%2023.2964%2051.0644%2023.2389%2051.0387%2023.1765L52.8883%2022.4154Z'%20fill='%23CCCCDC'%20fill-opacity='0.25'%20mask='url(%23path-12-inside-1_1144_162397)'/%3e%3cpath%20d='M69.9067%2030C70.6011%2030%2075.9327%2026%2075.9327%2024C75.9327%2022%2070.7357%2018%2069.9067%2018C69.0777%2018%2068.4023%2018.5%2068.4023%2019.4756C68.4023%2020.4512%2071.9067%2022.9206%2071.9067%2022.9206C71.9067%2022.9206%2064.2539%2022.25%2064%2022.9206C63.7461%2023.5911%2063.7461%2024.4089%2064%2025.0794C64.2539%2025.75%2071.9067%2025.0794%2071.9067%2025.0794C71.9067%2025.0794%2068.4023%2027.75%2068.4023%2028.5301C68.4023%2029.3103%2069.2123%2030%2069.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1144_162397)'%3e%3cpath%20d='M84%206.80064V16H108V6H85.0029L84.0002%206L84%206.80064Z'%20fill='url(%23paint1_linear_1144_162397)'/%3e%3cpath%20d='M108%2019H84V28.5H108V19Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M108%2019H84V28.5H108V19Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M108%2031.75H84V41.25H108V31.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M97%2020.75H95.5716L94%2021.6699V22.9238L95.4253%2022.1035H95.4627V26.75H97V20.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M93.8373%2039.5H98.25V38.3468H95.8341V38.3092L96.5472%2037.6561C97.8396%2036.5376%2098.1772%2035.9682%2098.1772%2035.289C98.1772%2034.2225%2097.3011%2033.5%2095.9476%2033.5C94.629%2033.5%2093.7471%2034.2543%2093.75%2035.4595H95.1151C95.1151%2034.9249%2095.447%2034.6156%2095.9418%2034.6156C96.4279%2034.6156%2096.7801%2034.9133%2096.7801%2035.4017C96.7801%2035.8439%2096.5006%2036.1445%2096.0116%2036.5809L93.8373%2038.4711V39.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M94.7744%2013.5C95.5264%2013.5%2096.0464%2013.2377%2096.3415%2012.7415H96.3837V13.4178H98V10.1182C98%209.09102%2096.9845%208.5%2095.6107%208.5C94.1595%208.5%2093.3373%209.1574%2093.2003%2010.0424L94.785%2010.0929C94.8587%209.78319%2095.1434%209.59355%2095.5966%209.59355C96.0183%209.59355%2096.2853%209.77686%2096.2853%2010.1024V10.1182C96.2853%2010.4153%2095.9269%2010.4785%2095.0063%2010.5512C93.9136%2010.6334%2093%2010.9968%2093%2012.0714C93%2013.0322%2093.7414%2013.5%2094.7744%2013.5ZM95.305%2012.4886C94.9079%2012.4886%2094.6268%2012.318%2094.6268%2011.9956C94.6268%2011.6827%2094.9009%2011.493%2095.3893%2011.4267C95.7091%2011.3856%2096.1026%2011.3224%2096.2959%2011.2307V11.6922C96.2959%2012.1662%2095.8531%2012.4886%2095.305%2012.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162397'%20x1='0.00781255'%20y1='5.004'%20x2='24.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162397'%20x1='84.0078'%20y1='11.004'%20x2='108.008'%20y2='11.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162397'%3e%3crect%20width='24'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162397'%3e%3crect%20width='24'%20height='36'%20fill='white'%20transform='translate(84%206)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_21 = "data:image/svg+xml,%3csvg%20width='177'%20height='48'%20viewBox='0%200%20177%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1144_161898)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_161898)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_161898)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1144_161898)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M46.3343%2030H49.674V25.674H54V22.3343H49.674V18H46.3343V22.3343H42V25.674H46.3343V30Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip2_1144_161898)'%3e%3cpath%20d='M77%2026.25H62V39.25H77V26.25Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%209.79083V21.75H77V8.75H62.6268C62.4606%208.75%2062.3011%208.85966%2062.1836%209.05485C62.066%209.25005%2062%209.51479%2062%209.79083Z'%20fill='url(%23paint2_linear_1144_161898)'/%3e%3cpath%20d='M69.4792%2035.75C70.8085%2035.75%2071.7528%2035.0257%2071.75%2034.0105C71.7528%2033.2918%2071.2958%2032.7785%2070.4208%2032.673V32.6274C71.0771%2032.5304%2071.5423%2032.077%2071.5395%2031.4211C71.5423%2030.4686%2070.706%2029.75%2069.4903%2029.75C68.2663%2029.75%2067.3746%2030.48%2067.3635%2031.5181H68.6734C68.6845%2031.1188%2069.0334%2030.8508%2069.4903%2030.8508C69.9251%2030.8508%2070.2214%2031.1217%2070.2186%2031.5124C70.2214%2031.9173%2069.8725%2032.1968%2069.3685%2032.1968H68.8174V33.2006H69.3685C69.9417%2033.2006%2070.3155%2033.4914%2070.31%2033.9021C70.3155%2034.3156%2069.9721%2034.6036%2069.4848%2034.6036C69.0001%2034.6036%2068.6429%2034.3384%2068.6291%2033.9534H67.25C67.2611%2035.0086%2068.1832%2035.75%2069.4792%2035.75Z'%20fill='white'/%3e%3cpath%20d='M67%2018.4362H68.5663V17.7145H68.6149C68.8155%2018.1261%2069.2621%2018.5%2070.0129%2018.5C71.1133%2018.5%2072%2017.729%2072%2016.213C72%2014.642%2071.0615%2013.9261%2070.0227%2013.9261C69.2362%2013.9261%2068.8058%2014.3377%2068.6149%2014.7464H68.5825V12.5H67V18.4362ZM68.5502%2016.2101C68.5502%2015.4826%2068.8867%2015.0333%2069.466%2015.0333C70.0518%2015.0333%2070.3754%2015.4942%2070.3754%2016.2101C70.3754%2016.929%2070.0518%2017.3957%2069.466%2017.3957C68.8867%2017.3957%2068.5502%2016.9319%2068.5502%2016.2101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_161898)'%3e%3cpath%20d='M96%2026.25H81V39.25H96V26.25Z'%20fill='%233865AB'/%3e%3cpath%20d='M81%2021.75H96V9.79083C96%209.51479%2095.934%209.25005%2095.8164%209.05485C95.6989%208.85966%2095.5394%208.75%2095.3732%208.75H81V21.75Z'%20fill='url(%23paint3_linear_1144_161898)'/%3e%3cpath%20d='M88.6058%2018.5C90.0564%2018.5%2090.9563%2017.7082%2091%2016.5095H89.4654C89.405%2017.0237%2089.0759%2017.3044%2088.6259%2017.3044C88.0484%2017.3044%2087.6723%2016.847%2087.6723%2015.9858C87.6723%2015.1309%2088.0517%2014.6735%2088.6259%2014.6735C89.096%2014.6735%2089.4016%2014.9732%2089.4654%2015.4685H91C90.9631%2014.276%2090.0363%2013.5%2088.6024%2013.5C86.9805%2013.5%2086%2014.5158%2086%2016.0016C86%2017.4811%2086.9738%2018.5%2088.6058%2018.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M109.907%2030C110.601%2030%20115.933%2026%20115.933%2024C115.933%2022%20110.736%2018%20109.907%2018C109.078%2018%20108.402%2018.5%20108.402%2019.4756C108.402%2020.4512%20111.907%2022.9206%20111.907%2022.9206C111.907%2022.9206%20104.254%2022.25%20104%2022.9206C103.746%2023.5911%20103.746%2024.4089%20104%2025.0794C104.254%2025.75%20111.907%2025.0794%20111.907%2025.0794C111.907%2025.0794%20108.402%2027.75%20108.402%2028.5301C108.402%2029.3103%20109.212%2030%20109.907%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M124%200.720576V9H139V0H124.627C124.461%200%20124.301%200.0759177%20124.184%200.211052C124.066%200.346186%20124%200.529468%20124%200.720576Z'%20fill='url(%23paint4_linear_1144_161898)'/%3e%3cpath%20d='M139%2013H124V22H139V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2026H124V35H139V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2039H124V48H139V39Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M124.5%2039.5H138.5V47.5H124.5V39.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M132.5%2015H131.31L130%2015.7666V16.8115L131.188%2016.1279H131.219V20H132.5V15Z'%20fill='%2324292E'/%3e%3cpath%20d='M130.072%2033H133.724V32.039H131.724V32.0077L132.315%2031.4634C133.384%2030.5313%20133.663%2030.0568%20133.663%2029.4908C133.663%2028.6021%20132.938%2028%20131.818%2028C130.727%2028%20129.998%2028.6286%20130%2029.6329H131.13C131.13%2029.1874%20131.404%2028.9297%20131.814%2028.9297C132.216%2028.9297%20132.507%2029.1777%20132.507%2029.5848C132.507%2029.9533%20132.276%2030.2038%20131.871%2030.5674L130.072%2032.1426V33Z'%20fill='%2324292E'/%3e%3cpath%20d='M129%207.68623H130.566V6.96449H130.615C130.816%207.37609%20131.262%207.75%20132.013%207.75C133.113%207.75%20134%206.97898%20134%205.46304C134%203.89203%20133.061%203.17609%20132.023%203.17609C131.236%203.17609%20130.806%203.58768%20130.615%203.99638H130.583V1.75H129V7.68623ZM130.55%205.46015C130.55%204.73261%20130.887%204.28333%20131.466%204.28333C132.052%204.28333%20132.375%204.7442%20132.375%205.46015C132.375%206.17899%20132.052%206.64565%20131.466%206.64565C130.887%206.64565%20130.55%206.18188%20130.55%205.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M143%200.720576V9H158V0H143.627C143.461%200%20143.301%200.0759177%20143.184%200.211052C143.066%200.346186%20143%200.529468%20143%200.720576Z'%20fill='url(%23paint5_linear_1144_161898)'/%3e%3cpath%20d='M158%2013H143V22H158V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2026H143V35H158V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2039H143V48H158V39Z'%20fill='%233865AB'/%3e%3cpath%20d='M150.913%2046C152.054%2046%20152.864%2045.3964%20152.862%2044.5504C152.864%2043.9515%20152.472%2043.5238%20151.721%2043.4358V43.3978C152.284%2043.317%20152.683%2042.9392%20152.681%2042.3926C152.683%2041.5989%20151.966%2041%20150.923%2041C149.872%2041%20149.107%2041.6084%20149.097%2042.4734H150.221C150.231%2042.1407%20150.53%2041.9173%20150.923%2041.9173C151.296%2041.9173%20151.55%2042.1431%20151.548%2042.4686C151.55%2042.8061%20151.25%2043.039%20150.818%2043.039H150.345V43.8755H150.818C151.31%2043.8755%20151.631%2044.1179%20151.626%2044.4601C151.631%2044.8047%20151.336%2045.0447%20150.918%2045.0447C150.502%2045.0447%20150.195%2044.8237%20150.183%2044.5029H149C149.01%2045.3821%20149.801%2046%20150.913%2046Z'%20fill='white'/%3e%3cpath%20d='M149.774%207.5C150.526%207.5%20151.046%207.23767%20151.342%206.74147H151.384V7.41783H153V4.1182C153%203.09102%20151.985%202.5%20150.611%202.5C149.16%202.5%20148.337%203.1574%20148.2%204.04235L149.785%204.09292C149.859%203.78319%20150.143%203.59355%20150.597%203.59355C151.018%203.59355%20151.285%203.77686%20151.285%204.1024V4.1182C151.285%204.4153%20150.927%204.47851%20150.006%204.5512C148.914%204.63338%20148%204.99684%20148%206.07143C148%207.03224%20148.741%207.5%20149.774%207.5ZM150.305%206.48862C149.908%206.48862%20149.627%206.31795%20149.627%205.99558C149.627%205.68268%20149.901%205.49305%20150.389%205.42668C150.709%205.38559%20151.103%205.32238%20151.296%205.23072V5.69216C151.296%206.16625%20150.853%206.48862%20150.305%206.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M162%209H177V0.720576C177%200.529468%20176.934%200.346186%20176.816%200.211052C176.699%200.0759177%20176.539%200%20176.373%200L162%200V9Z'%20fill='url(%23paint6_linear_1144_161898)'/%3e%3cpath%20d='M177%2039H162V48H177V39Z'%20fill='%233865AB'/%3e%3cpath%20d='M177%2026H162V35H177V26Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M162.5%2026.5H176.5V34.5H162.5V26.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M177%2013H162V22H177V13Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M162.5%2013.5H176.5V21.5H162.5V13.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M169.606%207.5C171.056%207.5%20171.956%206.7082%20172%205.50946H170.465C170.405%206.02366%20170.076%206.30442%20169.626%206.30442C169.048%206.30442%20168.672%205.847%20168.672%204.9858C168.672%204.13092%20169.052%203.6735%20169.626%203.6735C170.096%203.6735%20170.402%203.97319%20170.465%204.46845H172C171.963%203.27602%20171.036%202.5%20169.602%202.5C167.981%202.5%20167%203.51577%20167%205.00158C167%206.48107%20167.974%207.5%20169.606%207.5Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161898'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161898'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_161898'%20x1='62'%20y1='15.2552'%20x2='77'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_161898'%20x1='81'%20y1='15.2552'%20x2='96'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_161898'%20x1='124'%20y1='4.5036'%20x2='139'%20y2='4.5036'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1144_161898'%20x1='143'%20y1='4.5036'%20x2='158'%20y2='4.5036'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_1144_161898'%20x1='162'%20y1='4.5036'%20x2='177'%20y2='4.5036'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161898'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161898'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_161898'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%208.75)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_161898'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%208.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_22 = "data:image/svg+xml,%3csvg%20width='154'%20height='48'%20viewBox='0%200%20154%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%202.57189C15.0002%202.53241%2014.9927%202.49327%2014.9777%202.45672C14.9628%202.42018%2014.9408%202.38693%2014.913%202.3589L13.641%201.087C13.613%201.0592%2013.5797%201.0372%2013.5432%201.02227C13.5066%201.00734%2013.4675%200.999777%2013.428%201.00001C13.3885%200.999777%2013.3494%201.00734%2013.3128%201.02227C13.2763%201.0372%2013.243%201.0592%2013.215%201.087L12.366%201.93594L9.087%205.21469C9.0592%205.24272%209.0372%205.27596%209.02227%205.31251C9.00734%205.34906%208.99978%205.3882%209.00001%205.42767V6.69958C9.00001%206.77914%209.03161%206.85544%209.08787%206.9117C9.14413%206.96795%209.22044%206.99956%209.3%206.99956H10.572C10.614%207.00184%2010.656%206.99528%2010.6952%206.98029C10.7345%206.9653%2010.7702%206.94223%2010.8%206.91256L14.061%203.63381L14.913%202.79987C14.9404%202.7708%2014.9627%202.73733%2014.979%202.70088C14.9819%202.67697%2014.9819%202.65279%2014.979%202.62888C14.9804%202.61492%2014.9804%202.60085%2014.979%202.58689L15%202.57189ZM10.449%206.3996H9.6V5.55067L12.579%202.57189L13.428%203.42082L10.449%206.3996ZM13.851%202.99786L13.002%202.14892L13.428%201.72595L14.274%202.57189L13.851%202.99786Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip0_1144_162154)'%3e%3cpath%20d='M0%2011.3611V27H24V10H1.00293C0.736933%2010%200.481835%2010.1434%200.29375%2010.3987C0.105665%2010.6539%200%2011.0001%200%2011.3611Z'%20fill='url(%23paint0_linear_1144_162154)'/%3e%3cpath%20d='M24%2031H0V48H24V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M10.7744%2021.5C11.5264%2021.5%2012.0464%2021.2377%2012.3415%2020.7415H12.3837V21.4178H14V18.1182C14%2017.091%2012.9845%2016.5%2011.6107%2016.5C10.1595%2016.5%209.33732%2017.1574%209.20028%2018.0424L10.785%2018.0929C10.8587%2017.7832%2011.1434%2017.5936%2011.5966%2017.5936C12.0183%2017.5936%2012.2853%2017.7769%2012.2853%2018.1024V18.1182C12.2853%2018.4153%2011.9269%2018.4785%2011.0063%2018.5512C9.91356%2018.6334%209%2018.9968%209%2020.0714C9%2021.0322%209.74139%2021.5%2010.7744%2021.5ZM11.305%2020.4886C10.9079%2020.4886%2010.6268%2020.318%2010.6268%2019.9956C10.6268%2019.6827%2010.9009%2019.493%2011.3893%2019.4267C11.7091%2019.3856%2012.1026%2019.3224%2012.2959%2019.2307V19.6922C12.2959%2020.1662%2011.8531%2020.4886%2011.305%2020.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M13%2036.5H11.5716L10%2037.4199V38.6738L11.4253%2037.8535H11.4627V42.5H13V36.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M35.7975%202.10148C35.7643%202.06962%2035.725%202.04465%2035.6821%202.02799C35.5969%201.993%2035.5013%201.993%2035.4161%202.02799C35.3732%202.04465%2035.3339%202.06962%2035.3006%202.10148L34.6008%202.80134C34.5349%202.86723%2034.4979%202.9566%2034.4979%203.04979C34.4979%203.14297%2034.5349%203.23234%2034.6008%203.29823C34.6667%203.36413%2034.756%203.40115%2034.8492%203.40115C34.9424%203.40115%2035.0318%203.36413%2035.0977%203.29823L35.1992%203.19326V5.84921C35.1992%205.94202%2035.236%206.03103%2035.3016%206.09665C35.3673%206.16227%2035.4563%206.19914%2035.5491%206.19914C35.6419%206.19914%2035.7309%206.16227%2035.7965%206.09665C35.8621%206.03103%2035.899%205.94202%2035.899%205.84921V3.19326L36.0005%203.29823C36.033%203.33103%2036.0717%203.35707%2036.1144%203.37483C36.157%203.3926%2036.2027%203.40174%2036.2489%203.40174C36.2951%203.40174%2036.3409%203.3926%2036.3835%203.37483C36.4262%203.35707%2036.4649%203.33103%2036.4974%203.29823C36.5302%203.2657%2036.5562%203.227%2036.574%203.18436C36.5917%203.14172%2036.6009%203.09598%2036.6009%203.04979C36.6009%203.00359%2036.5917%202.95785%2036.574%202.91521C36.5562%202.87257%2036.5302%202.83387%2036.4974%202.80134L35.7975%202.10148ZM37.6487%202.69986H41.1479C41.2407%202.69986%2041.3297%202.66299%2041.3954%202.59737C41.461%202.53174%2041.4979%202.44274%2041.4979%202.34993C41.4979%202.25712%2041.461%202.16812%2041.3954%202.10249C41.3297%202.03687%2041.2407%202%2041.1479%202H37.6487C37.5558%202%2037.4668%202.03687%2037.4012%202.10249C37.3356%202.16812%2037.2987%202.25712%2037.2987%202.34993C37.2987%202.44274%2037.3356%202.53174%2037.4012%202.59737C37.4668%202.66299%2037.5558%202.69986%2037.6487%202.69986V2.69986ZM41.1479%205.49928H37.6487C37.5558%205.49928%2037.4668%205.53615%2037.4012%205.60178C37.3356%205.6674%2037.2987%205.75641%2037.2987%205.84921C37.2987%205.94202%2037.3356%206.03103%2037.4012%206.09665C37.4668%206.16227%2037.5558%206.19914%2037.6487%206.19914H41.1479C41.2407%206.19914%2041.3297%206.16227%2041.3954%206.09665C41.461%206.03103%2041.4979%205.94202%2041.4979%205.84921C41.4979%205.75641%2041.461%205.6674%2041.3954%205.60178C41.3297%205.53615%2041.2407%205.49928%2041.1479%205.49928ZM41.1479%203.74964H37.6487C37.5558%203.74964%2037.4668%203.78651%2037.4012%203.85213C37.3356%203.91776%2037.2987%204.00676%2037.2987%204.09957C37.2987%204.19238%2037.3356%204.28138%2037.4012%204.34701C37.4668%204.41263%2037.5558%204.4495%2037.6487%204.4495H41.1479C41.2407%204.4495%2041.3297%204.41263%2041.3954%204.34701C41.461%204.28138%2041.4979%204.19238%2041.4979%204.09957C41.4979%204.00676%2041.461%203.91776%2041.3954%203.85213C41.3297%203.78651%2041.2407%203.74964%2041.1479%203.74964Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip1_1144_162154)'%3e%3cpath%20d='M26%2027H50V11.3611V10H48.9971H26V27Z'%20fill='url(%23paint1_linear_1144_162154)'/%3e%3cpath%20d='M50%2031H26V48H50V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M35.5%2021.4362H37.0663V20.7145H37.1149C37.3155%2021.1261%2037.7621%2021.5%2038.5129%2021.5C39.6133%2021.5%2040.5%2020.729%2040.5%2019.213C40.5%2017.642%2039.5615%2016.9261%2038.5227%2016.9261C37.7362%2016.9261%2037.3058%2017.3377%2037.1149%2017.7464H37.0825V15.5H35.5V21.4362ZM37.0502%2019.2101C37.0502%2018.4826%2037.3867%2018.0333%2037.966%2018.0333C38.5518%2018.0333%2038.8754%2018.4942%2038.8754%2019.2101C38.8754%2019.929%2038.5518%2020.3957%2037.966%2020.3957C37.3867%2020.3957%2037.0502%2019.9319%2037.0502%2019.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M35.5873%2042.5H40V41.3468H37.5841V41.3092L38.2972%2040.6561C39.5896%2039.5376%2039.9272%2038.9682%2039.9272%2038.289C39.9272%2037.2225%2039.0511%2036.5%2037.6976%2036.5C36.379%2036.5%2035.4971%2037.2543%2035.5%2038.4595H36.8651C36.8651%2037.9249%2037.197%2037.6156%2037.6918%2037.6156C38.1779%2037.6156%2038.5301%2037.9133%2038.5301%2038.4017C38.5301%2038.8439%2038.2506%2039.1445%2037.7616%2039.5809L35.5873%2041.4711V42.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M63.6798%202.22255C63.7849%202.20642%2063.8912%202.19841%2063.9976%202.19856C64.9511%202.19856%2065.8477%202.88522%2066.3694%203.99767C66.2896%204.16696%2066.1995%204.33119%2066.0996%204.48943C66.0678%204.53854%2066.0512%204.59587%2066.0516%204.65434C66.0523%204.71978%2066.0743%204.78321%2066.1144%204.83494C66.1545%204.88667%2066.2104%204.92387%2066.2736%204.94086C66.3368%204.95784%2066.4038%204.95369%2066.4644%204.92903C66.525%204.90437%2066.5759%204.86055%2066.6093%204.80427C66.749%204.58476%2066.8704%204.35409%2066.9721%204.11461C66.9882%204.0772%2066.9965%204.0369%2066.9965%203.99617C66.9965%203.95544%2066.9882%203.91514%2066.9721%203.87773C66.3664%202.47142%2065.227%201.59886%2063.9976%201.59886C63.8569%201.59815%2063.7164%201.61019%2063.5778%201.63484C63.5384%201.64153%2063.5008%201.65592%2063.4669%201.67717C63.4331%201.69842%2063.4038%201.72613%2063.3807%201.75871C63.3576%201.79128%2063.3411%201.82809%2063.3323%201.86704C63.3234%201.90598%2063.3222%201.94629%2063.3289%201.98566C63.3356%202.02504%2063.35%202.06271%2063.3713%202.09653C63.3925%202.13035%2063.4202%202.15965%2063.4528%202.18276C63.4854%202.20587%2063.5222%202.22234%2063.5611%202.23122C63.6001%202.24011%2063.6404%202.24123%2063.6798%202.23454V2.22255ZM61.5118%201.08611C61.4839%201.05815%2061.4507%201.03597%2061.4142%201.02084C61.3776%201.00571%2061.3385%200.997925%2061.2989%200.997925C61.2594%200.997925%2061.2203%201.00571%2061.1837%201.02084C61.1472%201.03597%2061.114%201.05815%2061.086%201.08611C61.0296%201.14257%2060.9979%201.21915%2060.9979%201.299C60.9979%201.37885%2061.0296%201.45543%2061.086%201.5119L62.0156%202.43844C61.5915%202.8467%2061.2539%203.33619%2061.0231%203.87773C61.0066%203.91556%2060.998%203.95639%2060.998%203.99767C60.998%204.03895%2061.0066%204.07978%2061.0231%204.11761C61.6288%205.52391%2062.7682%206.39648%2063.9976%206.39648C64.5365%206.39276%2065.0626%206.23231%2065.5119%205.93471L66.4834%206.90923C66.5113%206.93733%2066.5444%206.95964%2066.581%206.97486C66.6175%206.99009%2066.6567%206.99792%2066.6963%206.99792C66.7359%206.99792%2066.775%206.99009%2066.8116%206.97486C66.8481%206.95964%2066.8813%206.93733%2066.9092%206.90923C66.9373%206.88135%2066.9596%206.84819%2066.9748%206.81165C66.99%206.77511%2066.9979%206.73592%2066.9979%206.69633C66.9979%206.65675%2066.99%206.61756%2066.9748%206.58102C66.9596%206.54448%2066.9373%206.51131%2066.9092%206.48344L61.5118%201.08611ZM63.4189%203.84175L64.1535%204.57638C64.1029%204.59092%2064.0503%204.59799%2063.9976%204.59737C63.8386%204.59737%2063.686%204.53419%2063.5736%204.42172C63.4611%204.30926%2063.3979%204.15672%2063.3979%203.99767C63.3973%203.94495%2063.4044%203.89242%2063.4189%203.84175ZM63.9976%205.79678C63.0441%205.79678%2062.1475%205.11012%2061.6288%203.99767C61.8225%203.57%2062.0975%203.18404%2062.4384%202.86123L62.9691%203.39797C62.8445%203.62549%2062.7969%203.88731%2062.8337%204.14413C62.8704%204.40096%2062.9894%204.63895%2063.1729%204.8224C63.3563%205.00586%2063.5943%205.12488%2063.8511%205.16162C64.108%205.19835%2064.3698%205.15082%2064.5973%205.02616L65.0741%205.49693C64.7476%205.6891%2064.3764%205.79247%2063.9976%205.79678Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip2_1144_162154)'%3e%3cpath%20d='M52%2027H76V11.3611C76%2011.0001%2075.8943%2010.6539%2075.7063%2010.3987C75.5182%2010.1434%2075.2631%2010%2074.9971%2010H52V27Z'%20fill='url(%23paint2_linear_1144_162154)'/%3e%3cpath%20d='M76%2031H52V48H76V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M64.1058%2021.5C65.5564%2021.5%2066.4563%2020.7082%2066.5%2019.5095H64.9654C64.905%2020.0237%2064.5759%2020.3044%2064.1259%2020.3044C63.5484%2020.3044%2063.1723%2019.847%2063.1723%2018.9858C63.1723%2018.1309%2063.5517%2017.6735%2064.1259%2017.6735C64.596%2017.6735%2064.9016%2017.9732%2064.9654%2018.4685H66.5C66.4631%2017.276%2065.5363%2016.5%2064.1024%2016.5C62.4805%2016.5%2061.5%2017.5158%2061.5%2019.0016C61.5%2020.4811%2062.4738%2021.5%2064.1058%2021.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M63.9769%2042.5C65.4538%2042.5%2066.5031%2041.7757%2066.5%2040.7605C66.5031%2040.0418%2065.9954%2039.5285%2065.0231%2039.423V39.3774C65.7523%2039.2804%2066.2692%2038.827%2066.2661%2038.1711C66.2692%2037.2186%2065.34%2036.5%2063.9892%2036.5C62.6292%2036.5%2061.6385%2037.23%2061.6262%2038.2681H63.0815C63.0938%2037.8688%2063.4815%2037.6008%2063.9892%2037.6008C64.4723%2037.6008%2064.8015%2037.8717%2064.7985%2038.2624C64.8015%2038.6673%2064.4138%2038.9468%2063.8538%2038.9468H63.2415V39.9506H63.8538C64.4908%2039.9506%2064.9061%2040.2414%2064.9%2040.6521C64.9061%2041.0656%2064.5246%2041.3536%2063.9831%2041.3536C63.4446%2041.3536%2063.0477%2041.0884%2063.0323%2040.7034H61.5C61.5123%2041.7586%2062.5369%2042.5%2063.9769%2042.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M89.9067%2030C90.6011%2030%2095.9327%2026%2095.9327%2024C95.9327%2022%2090.7357%2018%2089.9067%2018C89.0777%2018%2088.4023%2018.5%2088.4023%2019.4756C88.4023%2020.4512%2091.9067%2022.9206%2091.9067%2022.9206C91.9067%2022.9206%2084.2539%2022.25%2084%2022.9206C83.7461%2023.5911%2083.7461%2024.4089%2084%2025.0794C84.2539%2025.75%2091.9067%2025.0794%2091.9067%2025.0794C91.9067%2025.0794%2088.4023%2027.75%2088.4023%2028.5301C88.4023%2029.3103%2089.2123%2030%2089.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip3_1144_162154)'%3e%3cpath%20d='M130%2027H154V11.3611C154%2011.0001%20153.894%2010.6539%20153.706%2010.3987C153.518%2010.1434%20153.263%2010%20152.997%2010H130V27Z'%20fill='url(%23paint3_linear_1144_162154)'/%3e%3cpath%20d='M154%2031H130V48H154V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M143%2036.5H141.572L140%2037.4199V38.6738L141.425%2037.8535H141.463V42.5H143V36.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M140.987%2021.5C141.738%2021.5%20142.184%2021.1261%20142.385%2020.7145H142.434V21.4362H144V15.5H142.417V17.7464H142.385C142.197%2017.3377%20141.764%2016.9261%20140.981%2016.9261C139.942%2016.9261%20139%2017.642%20139%2019.213C139%2020.729%20139.89%2021.5%20140.987%2021.5ZM141.537%2020.3957C140.951%2020.3957%20140.625%2019.929%20140.625%2019.2101C140.625%2018.4942%20140.948%2018.0333%20141.537%2018.0333C142.117%2018.0333%20142.453%2018.4826%20142.453%2019.2101C142.453%2019.9319%20142.113%2020.3957%20141.537%2020.3957Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1144_162154)'%3e%3cpath%20d='M128%2031H104V48H128V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M104%2011.3611V27H128V10H105.003C104.737%2010%20104.482%2010.1434%20104.294%2010.3987C104.106%2010.6539%20104%2011.0001%20104%2011.3611Z'%20fill='url(%23paint4_linear_1144_162154)'/%3e%3cpath%20d='M113.5%2021.4362H115.066V20.7145H115.115C115.316%2021.1261%20115.762%2021.5%20116.513%2021.5C117.613%2021.5%20118.5%2020.729%20118.5%2019.213C118.5%2017.642%20117.561%2016.9261%20116.523%2016.9261C115.736%2016.9261%20115.306%2017.3377%20115.115%2017.7464H115.083V15.5H113.5V21.4362ZM115.05%2019.2101C115.05%2018.4826%20115.387%2018.0333%20115.966%2018.0333C116.552%2018.0333%20116.875%2018.4942%20116.875%2019.2101C116.875%2019.929%20116.552%2020.3957%20115.966%2020.3957C115.387%2020.3957%20115.05%2019.9319%20115.05%2019.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.587%2042.5H118V41.3468H115.584V41.3092L116.297%2040.6561C117.59%2039.5376%20117.927%2038.9682%20117.927%2038.289C117.927%2037.2225%20117.051%2036.5%20115.698%2036.5C114.379%2036.5%20113.497%2037.2543%20113.5%2038.4595H114.865C114.865%2037.9249%20115.197%2037.6156%20115.692%2037.6156C116.178%2037.6156%20116.53%2037.9133%20116.53%2038.4017C116.53%2038.8439%20116.251%2039.1445%20115.762%2039.5809L113.587%2041.4711V42.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162154'%20x1='0'%20y1='18.5068'%20x2='24'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162154'%20x1='26'%20y1='18.5068'%20x2='50'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162154'%20x1='52'%20y1='18.5068'%20x2='76'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162154'%20x1='130'%20y1='18.5068'%20x2='154'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_162154'%20x1='104'%20y1='18.5068'%20x2='128'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162154'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(0%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162154'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(26%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162154'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(52%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_162154'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(130%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1144_162154'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(104%2010)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_23 = "data:image/svg+xml,%3csvg%20width='101'%20height='48'%20viewBox='0%200%20101%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162587)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.9067%2030C29.6011%2030%2034.9327%2026%2034.9327%2024C34.9327%2022%2029.7357%2018%2028.9067%2018C28.0777%2018%2027.4023%2018.5%2027.4023%2019.4756C27.4023%2020.4512%2030.9067%2022.9206%2030.9067%2022.9206C30.9067%2022.9206%2023.2539%2022.25%2023%2022.9206C22.7461%2023.5911%2022.7461%2024.4089%2023%2025.0794C23.2539%2025.75%2030.9067%2025.0794%2030.9067%2025.0794C30.9067%2025.0794%2027.4023%2027.75%2027.4023%2028.5301C27.4023%2029.3103%2028.2123%2030%2028.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M43%2010.0408V22H58V9H43.6268C43.4606%209%2043.3011%209.10966%2043.1836%209.30485C43.066%209.50005%2043%209.76479%2043%2010.0408Z'%20fill='url(%23paint1_linear_1144_162587)'/%3e%3cpath%20d='M58%2026.5H43V39.5H58V26.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M51.5%2030H50.0716L48.5%2030.9199V32.1738L49.9253%2031.3535H49.9627V36H51.5V30Z'%20fill='%2324292E'/%3e%3cpath%20d='M49.7744%2018.5C50.5264%2018.5%2051.0464%2018.2377%2051.3415%2017.7415H51.3837V18.4178H53V15.1182C53%2014.091%2051.9845%2013.5%2050.6107%2013.5C49.1595%2013.5%2048.3373%2014.1574%2048.2003%2015.0424L49.785%2015.0929C49.8587%2014.7832%2050.1434%2014.5936%2050.5966%2014.5936C51.0183%2014.5936%2051.2853%2014.7769%2051.2853%2015.1024V15.1182C51.2853%2015.4153%2050.9269%2015.4785%2050.0063%2015.5512C48.9136%2015.6334%2048%2015.9968%2048%2017.0714C48%2018.0322%2048.7414%2018.5%2049.7744%2018.5ZM50.305%2017.4886C49.9079%2017.4886%2049.6268%2017.318%2049.6268%2016.9956C49.6268%2016.6827%2049.9009%2016.493%2050.3893%2016.4267C50.7091%2016.3856%2051.1026%2016.3224%2051.2959%2016.2307V16.6922C51.2959%2017.1662%2050.8531%2017.4886%2050.305%2017.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M70.3343%2030H73.674V25.674H78V22.3343H73.674V18H70.3343V22.3343H66V25.674H70.3343V30Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M86%2010.0408V22H101V9H86.6268C86.4606%209%2086.3011%209.10966%2086.1836%209.30485C86.066%209.50005%2086%209.76479%2086%2010.0408Z'%20fill='url(%23paint2_linear_1144_162587)'/%3e%3cpath%20d='M101%2026.5H86V39.5H101V26.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M92.7744%2018.5C93.5264%2018.5%2094.0464%2018.2377%2094.3415%2017.7415H94.3837V18.4178H96V15.1182C96%2014.091%2094.9845%2013.5%2093.6107%2013.5C92.1595%2013.5%2091.3373%2014.1574%2091.2003%2015.0424L92.785%2015.0929C92.8587%2014.7832%2093.1434%2014.5936%2093.5966%2014.5936C94.0183%2014.5936%2094.2853%2014.7769%2094.2853%2015.1024V15.1182C94.2853%2015.4153%2093.9269%2015.4785%2093.0063%2015.5512C91.9136%2015.6334%2091%2015.9968%2091%2017.0714C91%2018.0322%2091.7414%2018.5%2092.7744%2018.5ZM93.305%2017.4886C92.9079%2017.4886%2092.6268%2017.318%2092.6268%2016.9956C92.6268%2016.6827%2092.9009%2016.493%2093.3893%2016.4267C93.7091%2016.3856%2094.1026%2016.3224%2094.2959%2016.2307V16.6922C94.2959%2017.1662%2093.8531%2017.4886%2093.305%2017.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M91.0873%2036H95.5V34.8468H93.0841V34.8092L93.7972%2034.1561C95.0896%2033.0376%2095.4272%2032.4682%2095.4272%2031.789C95.4272%2030.7225%2094.5511%2030%2093.1976%2030C91.879%2030%2090.9971%2030.7543%2091%2031.9595H92.3651C92.3651%2031.4249%2092.697%2031.1156%2093.1918%2031.1156C93.6779%2031.1156%2094.0301%2031.4133%2094.0301%2031.9017C94.0301%2032.3439%2093.7506%2032.6445%2093.2616%2033.0809L91.0873%2034.9711V36Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162587'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162587'%20x1='43'%20y1='15.5052'%20x2='58'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162587'%20x1='86'%20y1='15.5052'%20x2='101'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_24 = "data:image/svg+xml,%3csvg%20width='180'%20height='48'%20viewBox='0%200%20180%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%209.79071V21.7499H15V8.74988H0.626828C0.460583%208.74988%200.301147%208.85954%200.183594%209.05473C0.0660407%209.24992%200%209.51466%200%209.79071Z'%20fill='url(%23paint0_linear_1144_162613)'/%3e%3cpath%20d='M15%2026.2499H0V39.2499H15V26.2499Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2030H7.07158L5.5%2030.9199V32.1738L6.92531%2031.3535H6.96266V36H8.5V30Z'%20fill='%2324292E'/%3e%3cpath%20d='M19%209.79083V21.75H34V8.75H19.6268C19.4606%208.75%2019%208.75%2019%208.75C19%208.75%2019%209.51479%2019%209.79083Z'%20fill='url(%23paint1_linear_1144_162613)'/%3e%3cpath%20d='M34%2026.25H19V39.25H34V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26.5739%2018.25C25.3778%2018.2443%2024.2472%2017.5199%2024.25%2015.3812C24.2557%2013.4192%2025.179%2012.25%2026.6165%2012.25C27.7784%2012.25%2028.5739%2013%2028.6903%2013.961H27.4773C27.3835%2013.5532%2027.0625%2013.308%2026.6165%2013.308C25.858%2013.308%2025.4602%2014.0152%2025.4545%2015.153H25.4943C25.7557%2014.6369%2026.321%2014.3289%2026.9602%2014.3289C27.9915%2014.3289%2028.7528%2015.1188%2028.75%2016.2139C28.7528%2017.403%2027.8693%2018.2557%2026.5739%2018.25ZM26.5682%2017.2804C27.1364%2017.2804%2027.5597%2016.8327%2027.5568%2016.2481C27.5597%2015.6692%2027.1449%2015.2215%2026.5767%2015.2215C26.0114%2015.2215%2025.5824%2015.6834%2025.5795%2016.2509C25.5795%2016.8213%2026%2017.2804%2026.5682%2017.2804Z'%20fill='%2324292E'/%3e%3cpath%20d='M26.2292%2035.75C27.5585%2035.75%2028.5028%2035.0257%2028.5%2034.0105C28.5028%2033.2918%2028.0458%2032.7785%2027.1708%2032.673V32.6274C27.8271%2032.5304%2028.2923%2032.077%2028.2895%2031.4211C28.2923%2030.4686%2027.456%2029.75%2026.2403%2029.75C25.0163%2029.75%2024.1246%2030.48%2024.1135%2031.5181H25.4234C25.4345%2031.1188%2025.7834%2030.8508%2026.2403%2030.8508C26.6751%2030.8508%2026.9714%2031.1217%2026.9686%2031.5124C26.9714%2031.9173%2026.6225%2032.1968%2026.1185%2032.1968H25.5674V33.2006H26.1185C26.6917%2033.2006%2027.0655%2033.4914%2027.06%2033.9021C27.0655%2034.3156%2026.7221%2034.6036%2026.2348%2034.6036C25.7501%2034.6036%2025.3929%2034.3384%2025.3791%2033.9534H24C24.0111%2035.0086%2024.9332%2035.75%2026.2292%2035.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M38%209.79083V21.75H53V8.75H38.6268C38.4606%208.75%2038%208.75%2038%208.75C38%208.75%2038%209.51479%2038%209.79083Z'%20fill='url(%23paint2_linear_1144_162613)'/%3e%3cpath%20d='M53%2026.25H38V39.25H53V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M43.6884%2018.25L46.3471%2013.3281V13.2871H43.25V12.25H47.75V13.3018L45.0882%2018.25H43.6884Z'%20fill='%2324292E'/%3e%3cpath%20d='M43%2034.6953V33.6963L45.5893%2029.75H47.2308V33.6787H48V34.6953H47.2308V35.75H45.977V34.6953H43ZM46.0012%2033.6787V31.1328H45.9528L44.3204%2033.6318V33.6787H46.0012Z'%20fill='%2324292E'/%3e%3cpath%20d='M57%2021.7499H72V9.79071C72%209.51466%2071.934%209.24992%2071.8164%209.05473C71.6989%208.85954%2071.5394%208.74988%2071.3732%208.74988H57V21.7499Z'%20fill='url(%23paint3_linear_1144_162613)'/%3e%3cpath%20d='M72%2026.2499H57V39.2499H72V26.2499Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M64.4602%2035.75C63.0525%2035.75%2062.0266%2035.0188%2062%2033.9957H63.3944C63.4276%2034.4552%2063.8891%2034.7673%2064.4602%2034.7673C65.1341%2034.7673%2065.6155%2034.3425%2065.6155%2033.7269C65.6155%2033.1055%2065.1242%2032.6749%2064.4402%2032.672C64.0385%2032.672%2063.6335%2032.8251%2063.4243%2033.0708L62.1461%2032.8714L62.4681%2029.75H66.6248V30.7731H63.6534L63.4774%2032.2558H63.5173C63.7563%2031.9639%2064.2709%2031.7471%2064.8685%2031.7471C66.0936%2031.7471%2067.0033%2032.5621%2067%2033.6951C67.0033%2034.8916%2065.9741%2035.75%2064.4602%2035.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M64.4986%2018.25C63.1902%2018.25%2062.2472%2017.5456%2062.25%2016.5989C62.2472%2015.8688%2062.7994%2015.2728%2063.5074%2015.1559V15.116C62.89%2014.9905%2062.4624%2014.4601%2062.4652%2013.8213C62.4624%2012.9173%2063.3233%2012.25%2064.4986%2012.25C65.671%2012.25%2066.5319%2012.9173%2066.5348%2013.8213C66.5319%2014.4629%2066.0986%2014.9905%2065.4926%2015.116V15.1559C66.1893%2015.2728%2066.7472%2015.8688%2066.75%2016.5989C66.7472%2017.5456%2065.807%2018.25%2064.4986%2018.25ZM64.4986%2017.3432C65.0791%2017.3432%2065.4728%2016.9981%2065.4728%2016.5019C65.4728%2015.9971%2065.0593%2015.6321%2064.4986%2015.6321C63.935%2015.6321%2063.5244%2015.9971%2063.5244%2016.5019C63.5244%2016.9952%2063.9152%2017.3432%2064.4986%2017.3432ZM64.4986%2014.7338C64.9857%2014.7338%2065.3369%2014.4116%2065.3369%2013.9496C65.3369%2013.4962%2064.9914%2013.1797%2064.4986%2013.1797C64.003%2013.1797%2063.6603%2013.4933%2063.6603%2013.9496C63.6603%2014.4116%2064.0087%2014.7338%2064.4986%2014.7338Z'%20fill='%2324292E'/%3e%3cpath%20d='M85.9067%2030C86.6011%2030%2091.9327%2026%2091.9327%2024C91.9327%2022%2086.7357%2018%2085.9067%2018C85.0777%2018%2084.4023%2018.5%2084.4023%2019.4756C84.4023%2020.4512%2087.9067%2022.9206%2087.9067%2022.9206C87.9067%2022.9206%2080.2539%2022.25%2080%2022.9206C79.7461%2023.5911%2079.7461%2024.4089%2080%2025.0794C80.2539%2025.75%2087.9067%2025.0794%2087.9067%2025.0794C87.9067%2025.0794%2084.4023%2027.75%2084.4023%2028.5301C84.4023%2029.3103%2085.2123%2030%2085.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip0_1144_162613)'%3e%3cpath%20d='M100%200.800641V10H124V0H101.003C100.737%200%20100.482%200.084353%20100.294%200.234502C100.106%200.384651%20100%200.588297%20100%200.800641Z'%20fill='url(%23paint4_linear_1144_162613)'/%3e%3cpath%20d='M124%2013H100V22.5H124V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2025.75H100V35.25H124V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2038.5H100V48H112H124V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M113.5%2040.25H112.072L110.5%2041.1699V42.4238L111.925%2041.6035H111.963V46.25H113.5V40.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2014.75H112.072L110.5%2015.6699V16.9238L111.925%2016.1035H111.963V20.75H113.5V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2027.5H112.072L110.5%2028.4199V29.6738L111.925%2028.8535H111.963V33.5H113.5V27.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162613)'%3e%3cpath%20d='M152%2013H128V22.5H152V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M152%2025.75H128V35.25H152V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M152%2038.5H128V48H140H152V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M128%200.800641V10H152V1.05456e-06H129.003L128%200L128%200.800641Z'%20fill='url(%23paint5_linear_1144_162613)'/%3e%3cpath%20d='M139.979%2020.75C141.308%2020.75%20142.253%2020.0257%20142.25%2019.0105C142.253%2018.2918%20141.796%2017.7785%20140.921%2017.673V17.6274C141.577%2017.5304%20142.042%2017.077%20142.04%2016.4211C142.042%2015.4686%20141.206%2014.75%20139.99%2014.75C138.766%2014.75%20137.875%2015.48%20137.864%2016.5181H139.173C139.184%2016.1188%20139.533%2015.8508%20139.99%2015.8508C140.425%2015.8508%20140.721%2016.1217%20140.719%2016.5124C140.721%2016.9173%20140.372%2017.1968%20139.868%2017.1968H139.317V18.2006H139.868C140.442%2018.2006%20140.816%2018.4914%20140.81%2018.9021C140.816%2019.3156%20140.472%2019.6036%20139.985%2019.6036C139.5%2019.6036%20139.143%2019.3384%20139.129%2018.9534H137.75C137.761%2020.0086%20138.683%2020.75%20139.979%2020.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M137.75%2032.4453V31.4463L140.339%2027.5H141.981V31.4287H142.75V32.4453H141.981V33.5H140.727V32.4453H137.75ZM140.751%2031.4287V28.8828H140.703L139.07%2031.3818V31.4287H140.751Z'%20fill='%2324292E'/%3e%3cpath%20d='M140.21%2046.25C138.802%2046.25%20137.777%2045.5188%20137.75%2044.4957H139.144C139.178%2044.9552%20139.639%2045.2673%20140.21%2045.2673C140.884%2045.2673%20141.366%2044.8425%20141.366%2044.2269C141.366%2043.6055%20140.874%2043.1749%20140.19%2043.172C139.789%2043.172%20139.383%2043.3251%20139.174%2043.5708L137.896%2043.3714L138.218%2040.25H142.375V41.2731H139.403L139.227%2042.7558H139.267C139.506%2042.4639%20140.021%2042.2471%20140.619%2042.2471C141.844%2042.2471%20142.753%2043.0621%20142.75%2044.1951C142.753%2045.3916%20141.724%2046.25%20140.21%2046.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1144_162613)'%3e%3cpath%20d='M180%2013H156V22.5H180V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M180%2025.75H156V35.25H180V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M180%2038.5H156V48H168H180V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M156%2010H180V0.800641C180%200.588297%20179.894%200.384651%20179.706%200.234502C179.518%200.084353%20179.263%200%20178.997%200L156%200V10Z'%20fill='url(%23paint6_linear_1144_162613)'/%3e%3cpath%20d='M167.999%2046.25C166.69%2046.25%20165.747%2045.5456%20165.75%2044.5989C165.747%2043.8688%20166.299%2043.2728%20167.007%2043.1559V43.116C166.39%2042.9905%20165.962%2042.4601%20165.965%2041.8213C165.962%2040.9173%20166.823%2040.25%20167.999%2040.25C169.171%2040.25%20170.032%2040.9173%20170.035%2041.8213C170.032%2042.4629%20169.599%2042.9905%20168.993%2043.116V43.1559C169.689%2043.2728%20170.247%2043.8688%20170.25%2044.5989C170.247%2045.5456%20169.307%2046.25%20167.999%2046.25ZM167.999%2045.3432C168.579%2045.3432%20168.973%2044.9981%20168.973%2044.5019C168.973%2043.9971%20168.559%2043.6321%20167.999%2043.6321C167.435%2043.6321%20167.024%2043.9971%20167.024%2044.5019C167.024%2044.9952%20167.415%2045.3432%20167.999%2045.3432ZM167.999%2042.7338C168.486%2042.7338%20168.837%2042.4116%20168.837%2041.9496C168.837%2041.4962%20168.491%2041.1797%20167.999%2041.1797C167.503%2041.1797%20167.16%2041.4933%20167.16%2041.9496C167.16%2042.4116%20167.509%2042.7338%20167.999%2042.7338Z'%20fill='%2324292E'/%3e%3cpath%20d='M166.188%2033.5L168.847%2028.5781V28.5371H165.75V27.5H170.25V28.5518L167.588%2033.5H166.188Z'%20fill='%2324292E'/%3e%3cpath%20d='M168.074%2020.75C166.878%2020.7443%20165.747%2020.0199%20165.75%2017.8812C165.756%2015.9192%20166.679%2014.75%20168.116%2014.75C169.278%2014.75%20170.074%2015.5%20170.19%2016.461H168.977C168.884%2016.0532%20168.562%2015.808%20168.116%2015.808C167.358%2015.808%20166.96%2016.5152%20166.955%2017.653H166.994C167.256%2017.1369%20167.821%2016.8289%20168.46%2016.8289C169.491%2016.8289%20170.253%2017.6188%20170.25%2018.7139C170.253%2019.903%20169.369%2020.7557%20168.074%2020.75ZM168.068%2019.7804C168.636%2019.7804%20169.06%2019.3327%20169.057%2018.7481C169.06%2018.1692%20168.645%2017.7215%20168.077%2017.7215C167.511%2017.7215%20167.082%2018.1834%20167.08%2018.7509C167.08%2019.3213%20167.5%2019.7804%20168.068%2019.7804Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162613'%20x1='0'%20y1='15.2551'%20x2='15'%20y2='15.2551'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162613'%20x1='19'%20y1='15.2552'%20x2='34'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162613'%20x1='38'%20y1='15.2552'%20x2='53'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162613'%20x1='57'%20y1='15.2551'%20x2='72'%20y2='15.2551'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_162613'%20x1='100'%20y1='5.004'%20x2='124'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1144_162613'%20x1='128.008'%20y1='5.004'%20x2='152.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_1144_162613'%20x1='156'%20y1='5.004'%20x2='180'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162613'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(100)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162613'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(128)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162613'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(156)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_25 = "data:image/svg+xml,%3csvg%20width='105'%20height='48'%20viewBox='0%200%20105%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162425)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1144_162425)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1144_162425)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M26.4792%2027C27.8085%2027%2028.7528%2026.2757%2028.75%2025.2605C28.7528%2024.5418%2028.2958%2024.0285%2027.4208%2023.923V23.8774C28.0771%2023.7804%2028.5423%2023.327%2028.5395%2022.6711C28.5423%2021.7186%2027.706%2021%2026.4903%2021C25.2663%2021%2024.3746%2021.73%2024.3635%2022.7681H25.6734C25.6845%2022.3688%2026.0334%2022.1008%2026.4903%2022.1008C26.9251%2022.1008%2027.2214%2022.3717%2027.2186%2022.7624C27.2214%2023.1673%2026.8725%2023.4468%2026.3685%2023.4468H25.8174V24.4506H26.3685C26.9417%2024.4506%2027.3155%2024.7414%2027.31%2025.1521C27.3155%2025.5656%2026.9721%2025.8536%2026.4848%2025.8536C26.0001%2025.8536%2025.6429%2025.5884%2025.6291%2025.2034H24.25C24.2611%2026.2586%2025.1832%2027%2026.4792%2027Z'%20fill='%2324292E'/%3e%3cpath%20d='M24%2043.4453V42.4463L26.5893%2038.5H28.2308V42.4287H29V43.4453H28.2308V44.5H26.977V43.4453H24ZM27.0012%2042.4287V39.8828H26.9528L25.3204%2042.3818V42.4287H27.0012Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0777%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2123%2030%2047.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M67.7955%2020.1818H68.2727V20.6591C68.2727%2020.9123%2068.3733%2021.155%2068.5523%2021.3341C68.7313%2021.5131%2068.9741%2021.6136%2069.2273%2021.6136C69.4804%2021.6136%2069.7232%2021.5131%2069.9022%2021.3341C70.0812%2021.155%2070.1818%2020.9123%2070.1818%2020.6591V20.1818H70.6591C70.9123%2020.1818%2071.155%2020.0813%2071.3341%2019.9022C71.5131%2019.7232%2071.6136%2019.4804%2071.6136%2019.2273C71.6136%2018.9741%2071.5131%2018.7313%2071.3341%2018.5523C71.155%2018.3733%2070.9123%2018.2727%2070.6591%2018.2727H70.1818V17.7955C70.1818%2017.5423%2070.0812%2017.2995%2069.9022%2017.1205C69.7232%2016.9415%2069.4804%2016.8409%2069.2273%2016.8409C68.9741%2016.8409%2068.7313%2016.9415%2068.5523%2017.1205C68.3733%2017.2995%2068.2727%2017.5423%2068.2727%2017.7955V18.2727H67.7955C67.5423%2018.2727%2067.2995%2018.3733%2067.1205%2018.5523C66.9415%2018.7313%2066.8409%2018.9741%2066.8409%2019.2273C66.8409%2019.4804%2066.9415%2019.7232%2067.1205%2019.9022C67.2995%2020.0813%2067.5423%2020.1818%2067.7955%2020.1818ZM67.2036%2030.7964C67.3825%2030.9742%2067.6244%2031.0739%2067.8766%2031.0739C68.1288%2031.0739%2068.3707%2030.9742%2068.5495%2030.7964L69.2273%2030.1186L69.905%2030.7964C70.0838%2030.9742%2070.3258%2031.0739%2070.578%2031.0739C70.8301%2031.0739%2071.0721%2030.9742%2071.2509%2030.7964C71.4287%2030.6175%2071.5285%2030.3756%2071.5285%2030.1234C71.5285%2029.8712%2071.4287%2029.6293%2071.2509%2029.4505L70.5732%2028.7727L71.2509%2028.095C71.4073%2027.9124%2071.489%2027.6775%2071.4797%2027.4373C71.4704%2027.197%2071.3709%2026.9691%2071.2009%2026.7991C71.0309%2026.6291%2070.803%2026.5296%2070.5627%2026.5203C70.3225%2026.511%2070.0876%2026.5927%2069.905%2026.7491L69.2273%2027.4268L68.5495%2026.7491C68.3669%2026.5927%2068.132%2026.511%2067.8918%2026.5203C67.6516%2026.5296%2067.4237%2026.6291%2067.2537%2026.7991C67.0837%2026.9691%2066.9841%2027.197%2066.9748%2027.4373C66.9655%2027.6775%2067.0473%2027.9124%2067.2036%2028.095L67.8814%2028.7727L67.2036%2029.4505C67.0259%2029.6293%2066.9261%2029.8712%2066.9261%2030.1234C66.9261%2030.3756%2067.0259%2030.6175%2067.2036%2030.7964V30.7964ZM81.6364%2013.5H66.3636C65.6042%2013.5%2064.8758%2013.8017%2064.3387%2014.3387C63.8017%2014.8758%2063.5%2015.6042%2063.5%2016.3636V31.6364C63.5%2032.3959%2063.8017%2033.1242%2064.3387%2033.6613C64.8758%2034.1983%2065.6042%2034.5%2066.3636%2034.5H81.6364C82.3958%2034.5%2083.1242%2034.1983%2083.6613%2033.6613C84.1983%2033.1242%2084.5%2032.3959%2084.5%2031.6364V16.3636C84.5%2015.6042%2084.1983%2014.8758%2083.6613%2014.3387C83.1242%2013.8017%2082.3958%2013.5%2081.6364%2013.5V13.5ZM73.0455%2032.5909H66.3636C66.1105%2032.5909%2065.8677%2032.4903%2065.6887%2032.3113C65.5097%2032.1323%2065.4091%2031.8895%2065.4091%2031.6364V24.9545H73.0455V32.5909ZM73.0455%2023.0455H65.4091V16.3636C65.4091%2016.1105%2065.5097%2015.8677%2065.6887%2015.6887C65.8677%2015.5097%2066.1105%2015.4091%2066.3636%2015.4091H73.0455V23.0455ZM82.5909%2031.6364C82.5909%2031.8895%2082.4903%2032.1323%2082.3113%2032.3113C82.1323%2032.4903%2081.8895%2032.5909%2081.6364%2032.5909H74.9545V24.9545H82.5909V31.6364ZM82.5909%2023.0455H74.9545V15.4091H81.6364C81.8895%2015.4091%2082.1323%2015.5097%2082.3113%2015.6887C82.4903%2015.8677%2082.5909%2016.1105%2082.5909%2016.3636V23.0455ZM77.3409%2028.2955H80.2045C80.4577%2028.2955%2080.7005%2028.1949%2080.8795%2028.0159C81.0585%2027.8369%2081.1591%2027.5941%2081.1591%2027.3409C81.1591%2027.0878%2081.0585%2026.845%2080.8795%2026.6659C80.7005%2026.4869%2080.4577%2026.3864%2080.2045%2026.3864H77.3409C77.0877%2026.3864%2076.845%2026.4869%2076.6659%2026.6659C76.4869%2026.845%2076.3864%2027.0878%2076.3864%2027.3409C76.3864%2027.5941%2076.4869%2027.8369%2076.6659%2028.0159C76.845%2028.1949%2077.0877%2028.2955%2077.3409%2028.2955V28.2955ZM80.2045%2018.2727H77.3409C77.0877%2018.2727%2076.845%2018.3733%2076.6659%2018.5523C76.4869%2018.7313%2076.3864%2018.9741%2076.3864%2019.2273C76.3864%2019.4804%2076.4869%2019.7232%2076.6659%2019.9022C76.845%2020.0813%2077.0877%2020.1818%2077.3409%2020.1818H80.2045C80.4577%2020.1818%2080.7005%2020.0813%2080.8795%2019.9022C81.0585%2019.7232%2081.1591%2019.4804%2081.1591%2019.2273C81.1591%2018.9741%2081.0585%2018.7313%2080.8795%2018.5523C80.7005%2018.3733%2080.4577%2018.2727%2080.2045%2018.2727ZM77.3409%2031.1591H80.2045C80.4577%2031.1591%2080.7005%2031.0585%2080.8795%2030.8795C81.0585%2030.7005%2081.1591%2030.4577%2081.1591%2030.2045C81.1591%2029.9514%2081.0585%2029.7086%2080.8795%2029.5296C80.7005%2029.3506%2080.4577%2029.25%2080.2045%2029.25H77.3409C77.0877%2029.25%2076.845%2029.3506%2076.6659%2029.5296C76.4869%2029.7086%2076.3864%2029.9514%2076.3864%2030.2045C76.3864%2030.4577%2076.4869%2030.7005%2076.6659%2030.8795C76.845%2031.0585%2077.0877%2031.1591%2077.3409%2031.1591V31.1591Z'%20fill='white'/%3e%3cpath%20d='M90%209.79083V21.75H105V8.75H90.6268C90.4606%208.75%2090.3011%208.85966%2090.1836%209.05485C90.066%209.25005%2090%209.51479%2090%209.79083Z'%20fill='url(%23paint2_linear_1144_162425)'/%3e%3cpath%20d='M105%2026.25H90V39.25H105V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M98.5%2029.75H97.0716L95.5%2030.6699V31.9238L96.9253%2031.1035H96.9627V35.75H98.5V29.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M96.7744%2018.25C97.5264%2018.25%2098.0464%2017.9877%2098.3415%2017.4915H98.3837V18.1678H100V14.8682C100%2013.841%2098.9845%2013.25%2097.6107%2013.25C96.1595%2013.25%2095.3373%2013.9074%2095.2003%2014.7924L96.785%2014.8429C96.8587%2014.5332%2097.1434%2014.3436%2097.5966%2014.3436C98.0183%2014.3436%2098.2853%2014.5269%2098.2853%2014.8524V14.8682C98.2853%2015.1653%2097.9269%2015.2285%2097.0063%2015.3012C95.9136%2015.3834%2095%2015.7468%2095%2016.8214C95%2017.7822%2095.7414%2018.25%2096.7744%2018.25ZM97.305%2017.2386C96.9079%2017.2386%2096.6268%2017.068%2096.6268%2016.7456C96.6268%2016.4327%2096.9009%2016.243%2097.3893%2016.1767C97.7091%2016.1356%2098.1026%2016.0724%2098.2959%2015.9807V16.4422C98.2959%2016.9162%2097.8531%2017.2386%2097.305%2017.2386Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162425'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162425'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162425'%20x1='90'%20y1='15.2552'%20x2='105'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162425'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_26 = "data:image/svg+xml,%3csvg%20width='95'%20height='48'%20viewBox='0%200%2095%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1834_14939)'%3e%3cpath%20d='M0%200.611699V7.64012H14.394V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1834_14939)'/%3e%3cpath%20d='M33.606%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200L33.606%200V7.64012Z'%20fill='url(%23paint1_linear_1834_14939)'/%3e%3cpath%20d='M31.194%200H16.8V7.64012H31.194V0Z'%20fill='url(%23paint2_linear_1834_14939)'/%3e%3cpath%20d='M31.194%2010.0869H16.8V17.727H31.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2010.0869H0V17.727H14.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2010.0869H33.606V17.727H48V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2020.1799H33.606V27.8262H48V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2020.1799H16.8V27.8262H31.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2020.1799H0V27.8262H14.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2030.2668H16.8V37.907H31.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2030.2668H33.606V37.907H48V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2030.2668H0V37.907H14.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M31.194%2040.3599H16.8V48H31.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M48%2047.3883V40.3721H33.606V48H47.3985C47.558%2048%2047.711%2047.9355%2047.8238%2047.8208C47.9366%2047.7061%2048%2047.5505%2048%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2048V40.3721H0V47.3883C0%2047.5505%200.0633725%2047.7061%200.176176%2047.8208C0.28898%2047.9355%200.441975%2048%200.601504%2048H14.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030.4001C62.6011%2030.4001%2067.9327%2026.1334%2067.9327%2024.0001C67.9327%2021.8668%2062.7357%2017.6001%2061.9067%2017.6001C61.0777%2017.6001%2060.4023%2018.1334%2060.4023%2019.1741C60.4023%2020.2147%2063.9067%2022.8487%2063.9067%2022.8487C63.9067%2022.8487%2056.2539%2022.1334%2056%2022.8487C55.7461%2023.564%2055.7461%2024.4362%2056%2025.1515C56.2539%2025.8668%2063.9067%2025.1515%2063.9067%2025.1515C63.9067%2025.1515%2060.4023%2028.0001%2060.4023%2028.8323C60.4023%2029.6644%2061.2123%2030.4001%2061.9067%2030.4001Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M93.9457%2025.1875C93.9457%2026.9347%2093.4911%2028.3835%2092.4542%2029.6477H90.5366C91.3178%2028.7102%2091.9002%2026.8637%2091.9002%2025.1875C91.9002%2023.5114%2091.3178%2021.6648%2090.5366%2020.7273H92.4542C93.4911%2021.9915%2093.9457%2023.4404%2093.9457%2025.1875Z'%20fill='white'/%3e%3cpath%20d='M86.6153%2022.5457L87.4107%2024.236L88.2488%2022.5457H90.1948L88.7317%2025.2729L90.2658%2028.0002H88.334L87.4107%2026.2672L86.5158%2028.0002H84.5556L86.1039%2025.2729L84.655%2022.5457H86.6153Z'%20fill='white'/%3e%3cpath%20d='M80.8757%2025.1875C80.8757%2023.4404%2081.3303%2021.9915%2082.3672%2020.7273H84.2848C83.5036%2021.6648%2082.9212%2023.5114%2082.9212%2025.1875C82.9212%2026.8637%2083.5036%2028.7102%2084.2848%2029.6477H82.3672C81.3303%2028.3835%2080.8757%2026.9347%2080.8757%2025.1875Z'%20fill='white'/%3e%3cpath%20d='M79.7642%2022.5456V23.966H78.7699V28.0001H76.8097V23.966H76.1136V22.5456H76.8097V22.3893C76.8097%2021.0399%2077.5767%2020.3865%2078.7699%2020.3865C79.2671%2020.3865%2079.7926%2020.4859%2080.0199%2020.5427L79.7358%2021.949C79.5938%2021.9064%2079.3807%2021.878%2079.2386%2021.878C78.8693%2021.878%2078.7699%2022.0484%2078.7699%2022.3041V22.5456H79.7642Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1834_14939'%20x1='0'%20y1='3.82312'%20x2='14.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1834_14939'%20x1='33.606'%20y1='3.82312'%20x2='48'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1834_14939'%20x1='16.8'%20y1='3.82312'%20x2='31.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1834_14939'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_27 = "data:image/svg+xml,%3csvg%20width='119'%20height='48'%20viewBox='0%200%20119%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.3704%2020.6776C42.308%2020.6218%2042.2344%2020.5781%2042.1539%2020.549C41.9941%2020.4877%2041.815%2020.4877%2041.6552%2020.549C41.5747%2020.5781%2041.5011%2020.6218%2041.4387%2020.6776L40.1265%2021.9023C40.0029%2022.0177%2039.9335%2022.174%2039.9335%2022.3371C39.9335%2022.5002%2040.0029%2022.6566%2040.1265%2022.7719C40.25%2022.8872%2040.4176%2022.952%2040.5923%2022.952C40.7671%2022.952%2040.9346%2022.8872%2041.0582%2022.7719L41.2484%2022.5882V27.2361C41.2484%2027.3985%2041.3176%2027.5543%2041.4406%2027.6691C41.5637%2027.784%2041.7306%2027.8485%2041.9046%2027.8485C42.0786%2027.8485%2042.2455%2027.784%2042.3685%2027.6691C42.4916%2027.5543%2042.5607%2027.3985%2042.5607%2027.2361V22.5882L42.751%2022.7719C42.8119%2022.8293%2042.8845%2022.8749%2042.9645%2022.906C43.0444%2022.937%2043.1302%2022.953%2043.2168%2022.953C43.3034%2022.953%2043.3892%2022.937%2043.4691%2022.906C43.5491%2022.8749%2043.6216%2022.8293%2043.6826%2022.7719C43.7441%2022.715%2043.7929%2022.6473%2043.8263%2022.5726C43.8596%2022.498%2043.8767%2022.418%2043.8767%2022.3371C43.8767%2022.2563%2043.8596%2022.1762%2043.8263%2022.1016C43.7929%2022.027%2043.7441%2021.9593%2043.6826%2021.9023L42.3704%2020.6776ZM45.8413%2021.7247H52.4024C52.5764%2021.7247%2052.7433%2021.6602%2052.8664%2021.5454C52.9894%2021.4305%2053.0585%2021.2748%2053.0585%2021.1124C53.0585%2020.95%2052.9894%2020.7942%2052.8664%2020.6794C52.7433%2020.5645%2052.5764%2020.5%2052.4024%2020.5H45.8413C45.6672%2020.5%2045.5004%2020.5645%2045.3773%2020.6794C45.2543%2020.7942%2045.1851%2020.95%2045.1851%2021.1124C45.1851%2021.2748%2045.2543%2021.4305%2045.3773%2021.5454C45.5004%2021.6602%2045.6672%2021.7247%2045.8413%2021.7247V21.7247ZM52.4024%2026.6237H45.8413C45.6672%2026.6237%2045.5004%2026.6883%2045.3773%2026.8031C45.2543%2026.9179%2045.1851%2027.0737%2045.1851%2027.2361C45.1851%2027.3985%2045.2543%2027.5543%2045.3773%2027.6691C45.5004%2027.784%2045.6672%2027.8485%2045.8413%2027.8485H52.4024C52.5764%2027.8485%2052.7433%2027.784%2052.8664%2027.6691C52.9894%2027.5543%2053.0585%2027.3985%2053.0585%2027.2361C53.0585%2027.0737%2052.9894%2026.9179%2052.8664%2026.8031C52.7433%2026.6883%2052.5764%2026.6237%2052.4024%2026.6237ZM52.4024%2023.5619H45.8413C45.6672%2023.5619%2045.5004%2023.6264%2045.3773%2023.7412C45.2543%2023.8561%2045.1851%2024.0118%2045.1851%2024.1742C45.1851%2024.3367%2045.2543%2024.4924%2045.3773%2024.6073C45.5004%2024.7221%2045.6672%2024.7866%2045.8413%2024.7866H52.4024C52.5764%2024.7866%2052.7433%2024.7221%2052.8664%2024.6073C52.9894%2024.4924%2053.0585%2024.3367%2053.0585%2024.1742C53.0585%2024.0118%2052.9894%2023.8561%2052.8664%2023.7412C52.7433%2023.6264%2052.5764%2023.5619%2052.4024%2023.5619Z'%20fill='white'/%3e%3cpath%20d='M66.9067%2030C67.6011%2030%2072.9327%2026%2072.9327%2024C72.9327%2022%2067.7357%2018%2066.9067%2018C66.0777%2018%2065.4023%2018.5%2065.4023%2019.4756C65.4023%2020.4512%2068.9067%2022.9206%2068.9067%2022.9206C68.9067%2022.9206%2061.2539%2022.25%2061%2022.9206C60.7461%2023.5911%2060.7461%2024.4089%2061%2025.0794C61.2539%2025.75%2068.9067%2025.0794%2068.9067%2025.0794C68.9067%2025.0794%2065.4023%2027.75%2065.4023%2028.5301C65.4023%2029.3103%2066.2123%2030%2066.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip0_1144_162073)'%3e%3cpath%20d='M81%201.05495V13.1763H95.9563V0H81.625C81.4592%200%2081.3003%200.111146%2081.1831%200.308988C81.0658%200.506829%2081%200.77516%2081%201.05495Z'%20fill='url(%23paint0_linear_1144_162073)'/%3e%3cpath%20d='M95.9563%2017.3962H81V30.5725H95.9563V17.3962Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M95.9563%2034.8132H81V48.0001H95.9563V34.8132Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M81%201.04083V13H96V0H81.6268C81.4606%200%2081.3011%200.109659%2081.1836%200.304853C81.066%200.500047%2081%200.764787%2081%201.04083Z'%20fill='url(%23paint1_linear_1144_162073)'/%3e%3cpath%20d='M96%2017.5H81V30.5H96V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M96%2035H81V48H96V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M88.58%2010.25H89.0225V9.63828C90.2662%209.57764%2090.9946%208.9791%2091%208.00879C90.9946%207.14658%2090.3984%206.61924%2089.3085%206.38457L89.0225%206.32129V5.19541C89.4056%205.25078%2089.616%205.46699%2089.6457%205.79395H90.9245C90.9137%204.84209%2090.1826%204.18027%2089.0225%204.10908V3.5H88.58V4.10908C87.4362%204.18555%2086.6349%204.83418%2086.643%205.77813C86.6403%206.59814%2087.2284%207.05957%2088.1835%207.27314L88.58%207.36279V8.55195C88.1079%208.49658%2087.8058%208.23291%2087.7788%207.77676H86.5C86.5162%208.97119%2087.3174%209.575%2088.58%209.63828V10.25ZM89.0225%208.54932V7.4709C89.446%207.59746%2089.6403%207.75039%2089.6457%208.00615C89.6403%208.28565%2089.4164%208.49131%2089.0225%208.54932ZM88.58%206.21582C88.2266%206.11035%2088.0162%205.95215%2088.0243%205.68848C88.027%205.44063%2088.2104%205.24814%2088.58%205.19541V6.21582Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162073)'%3e%3cpath%20d='M114.956%2017.3962H100V30.5725H114.956V17.3962Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M114.956%2034.8132H100V48.0001H114.956V34.8132Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M115%2017.5001H100V30.5001H115V17.5001Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M115%2035.0001H100V48.0001H115V35.0001Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M100%2013.0001H115V1.04089C115%200.764848%20114.934%200.500108%20114.816%200.304914C114.699%200.10972%20114.539%206.10352e-05%20114.373%206.10352e-05L100%206.10352e-05V13.0001Z'%20fill='url(%23paint2_linear_1144_162073)'/%3e%3cpath%20d='M107.58%2010.25H108.022V9.63828C109.266%209.57764%20109.995%208.9791%20110%208.00879C109.995%207.14658%20109.398%206.61924%20108.308%206.38457L108.022%206.32129V5.19541C108.406%205.25078%20108.616%205.46699%20108.646%205.79395H109.924C109.914%204.84209%20109.183%204.18027%20108.022%204.10908V3.5H107.58V4.10908C106.436%204.18555%20105.635%204.83418%20105.643%205.77813C105.64%206.59814%20106.228%207.05957%20107.183%207.27314L107.58%207.36279V8.55195C107.108%208.49658%20106.806%208.23291%20106.779%207.77676H105.5C105.516%208.97119%20106.317%209.575%20107.58%209.63828V10.25ZM108.022%208.54932V7.4709C108.446%207.59746%20108.64%207.75039%20108.646%208.00615C108.64%208.28565%20108.416%208.49131%20108.022%208.54932ZM107.58%206.21582C107.227%206.11035%20107.016%205.95215%20107.024%205.68848C107.027%205.44063%20107.21%205.24814%20107.58%205.19541V6.21582Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1144_162073)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint3_linear_1144_162073)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1144_162073)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint4_linear_1144_162073)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24.5%209.43623H26.0663V8.71449H26.1149C26.3155%209.12609%2026.7621%209.5%2027.5129%209.5C28.6133%209.5%2029.5%208.72898%2029.5%207.21304C29.5%205.64203%2028.5615%204.92609%2027.5227%204.92609C26.7362%204.92609%2026.3058%205.33768%2026.1149%205.74638H26.0825V3.5H24.5V9.43623ZM26.0502%207.21015C26.0502%206.48261%2026.3867%206.03333%2026.966%206.03333C27.5518%206.03333%2027.8754%206.4942%2027.8754%207.21015C27.8754%207.92899%2027.5518%208.39565%2026.966%208.39565C26.3867%208.39565%2026.0502%207.93188%2026.0502%207.21015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162073'%20x1='81'%20y1='6.59344'%20x2='95.9563'%20y2='6.59344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162073'%20x1='81'%20y1='6.5052'%20x2='96'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162073'%20x1='100'%20y1='6.50527'%20x2='115'%20y2='6.50527'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162073'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1144_162073'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162073'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(81)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162073'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(100)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1144_162073'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1144_162073'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_28 = "data:image/svg+xml,%3csvg%20width='96'%20height='48'%20viewBox='0%200%2096%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162454)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M6.84608%2027C7.52244%2027%207.9902%2026.7377%208.25569%2026.2415H8.29362V26.9178H9.74747V23.6182C9.74747%2022.591%208.83407%2022%207.59829%2022C6.29298%2022%205.55341%2022.6574%205.43015%2023.5424L6.85556%2023.5929C6.92193%2023.2832%207.17794%2023.0936%207.58565%2023.0936C7.96492%2023.0936%208.20512%2023.2769%208.20512%2023.6024V23.6182C8.20512%2023.9153%207.88274%2023.9785%207.05468%2024.0512C6.07174%2024.1334%205.25%2024.4968%205.25%2025.5714C5.25%2026.5322%205.91688%2027%206.84608%2027ZM7.32333%2025.9886C6.96618%2025.9886%206.71334%2025.818%206.71334%2025.4956C6.71334%2025.1827%206.95986%2024.993%207.39918%2024.9267C7.68679%2024.8856%208.04077%2024.8224%208.2146%2024.7307V25.1922C8.2146%2025.6662%207.81637%2025.9886%207.32333%2025.9886Z'%20fill='%2324292E'/%3e%3cpath%20d='M5%2044.4362H6.56634V43.7145H6.61489C6.81553%2044.1261%207.26214%2044.5%208.01294%2044.5C9.11327%2044.5%2010%2043.729%2010%2042.213C10%2040.642%209.06149%2039.9261%208.02265%2039.9261C7.23625%2039.9261%206.80583%2040.3377%206.61489%2040.7464H6.58252V38.5H5V44.4362ZM6.55016%2042.2101C6.55016%2041.4826%206.88673%2041.0333%207.46602%2041.0333C8.05178%2041.0333%208.3754%2041.4942%208.3754%2042.2101C8.3754%2042.929%208.05178%2043.3957%207.46602%2043.3957C6.88673%2043.3957%206.55016%2042.9319%206.55016%2042.2101Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1144_162454)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1144_162454)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M27.5%2021H26.0716L24.5%2021.9199V23.1738L25.9253%2022.3535H25.9627V27H27.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.3373%2044.5H28.75V43.3468H26.3341V43.3092L27.0472%2042.6561C28.3396%2041.5376%2028.6772%2040.9682%2028.6772%2040.289C28.6772%2039.2225%2027.8011%2038.5%2026.4476%2038.5C25.129%2038.5%2024.2471%2039.2543%2024.25%2040.4595H25.6151C25.6151%2039.9249%2025.947%2039.6156%2026.4418%2039.6156C26.9279%2039.6156%2027.2801%2039.9133%2027.2801%2040.4017C27.2801%2040.8439%2027.0006%2041.1445%2026.5116%2041.5809L24.3373%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0777%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2123%2030%2047.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M62%209.79083V21.75H77V8.75H62.6268C62.4606%208.75%2062.3011%208.85966%2062.1836%209.05485C62.066%209.25005%2062%209.51479%2062%209.79083Z'%20fill='url(%23paint2_linear_1144_162454)'/%3e%3cpath%20d='M77%2026.25H62V39.25H77V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M70.5%2029.75H69.0716L67.5%2030.6699V31.9238L68.9253%2031.1035H68.9627V35.75H70.5V29.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7744%2018.25C69.5264%2018.25%2070.0464%2017.9877%2070.3415%2017.4915H70.3837V18.1678H72V14.8682C72%2013.841%2070.9845%2013.25%2069.6107%2013.25C68.1595%2013.25%2067.3373%2013.9074%2067.2003%2014.7924L68.785%2014.8429C68.8587%2014.5332%2069.1434%2014.3436%2069.5966%2014.3436C70.0183%2014.3436%2070.2853%2014.5269%2070.2853%2014.8524V14.8682C70.2853%2015.1653%2069.9269%2015.2285%2069.0063%2015.3012C67.9136%2015.3834%2067%2015.7468%2067%2016.8214C67%2017.7822%2067.7414%2018.25%2068.7744%2018.25ZM69.305%2017.2386C68.9079%2017.2386%2068.6268%2017.068%2068.6268%2016.7456C68.6268%2016.4327%2068.9009%2016.243%2069.3893%2016.1767C69.7091%2016.1356%2070.1026%2016.0724%2070.2959%2015.9807V16.4422C70.2959%2016.9162%2069.8531%2017.2386%2069.305%2017.2386Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1144_162454)'%3e%3cpath%20d='M81%2021.75H96V9.79083C96%209.51479%2095.934%209.25005%2095.8164%209.05485C95.6989%208.85966%2095.5394%208.75%2095.3732%208.75H81V21.75Z'%20fill='url(%23paint3_linear_1144_162454)'/%3e%3cpath%20d='M96%2026.25H81V39.25H96V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M86.3373%2035.75H90.75V34.5968H88.3341V34.5592L89.0472%2033.9061C90.3396%2032.7876%2090.6772%2032.2182%2090.6772%2031.539C90.6772%2030.4725%2089.8011%2029.75%2088.4476%2029.75C87.129%2029.75%2086.2471%2030.5043%2086.25%2031.7095H87.6151C87.6151%2031.1749%2087.947%2030.8656%2088.4418%2030.8656C88.9279%2030.8656%2089.2801%2031.1633%2089.2801%2031.6517C89.2801%2032.0939%2089.0006%2032.3945%2088.5116%2032.8309L86.3373%2034.7211V35.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M86%2018.4362H87.5663V17.7145H87.6149C87.8155%2018.1261%2088.2621%2018.5%2089.0129%2018.5C90.1133%2018.5%2091%2017.729%2091%2016.213C91%2014.642%2090.0615%2013.9261%2089.0227%2013.9261C88.2362%2013.9261%2087.8058%2014.3377%2087.6149%2014.7464H87.5825V12.5H86V18.4362ZM87.5502%2016.2101C87.5502%2015.4826%2087.8867%2015.0333%2088.466%2015.0333C89.0518%2015.0333%2089.3754%2015.4942%2089.3754%2016.2101C89.3754%2016.929%2089.0518%2017.3957%2088.466%2017.3957C87.8867%2017.3957%2087.5502%2016.9319%2087.5502%2016.2101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162454'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162454'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162454'%20x1='62'%20y1='15.2552'%20x2='77'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162454'%20x1='81'%20y1='15.2552'%20x2='96'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162454'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162454'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%208.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_29 = "data:image/svg+xml,%3csvg%20width='138'%20height='59'%20viewBox='0%200%20138%2059'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_162345)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.68848%2053.3679H7.69842C7.6899%2052.5518%207.04004%2052%206.02583%2052C5.02868%2052%204.31064%2052.5433%204.31703%2053.3551C4.3149%2054.0178%204.77939%2054.3906%205.53365%2054.5632L5.98961%2054.6697C6.46902%2054.7805%206.68422%2054.9105%206.68848%2055.1555C6.68422%2055.4219%206.43493%2055.6072%206.01092%2055.6072C5.5443%2055.6072%205.23748%2055.3899%205.21404%2054.9702H4.2041C4.21689%2055.9908%204.9264%2056.4787%206.0237%2056.4787C7.11035%2056.4787%207.75382%2055.9865%207.75808%2055.1577C7.75382%2054.4609%207.28294%2054.0348%206.42214%2053.8452L6.04714%2053.7599C5.65083%2053.6747%205.39941%2053.5426%205.40794%2053.2827C5.41007%2053.044%205.61461%2052.8714%206.0237%2052.8714C6.43493%2052.8714%206.66078%2053.0568%206.68848%2053.3679Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M10.3%2052.0597H9.322L8.24601%2052.7287V53.6406L9.22186%2053.044H9.24743V56.4233H10.3V52.0597Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M27.3343%2035.5H30.674V31.174H35V27.8343H30.674V23.5H27.3343V27.8343H23V31.174H27.3343V35.5Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M58%2027H43V40H58V27Z'%20fill='%233865AB'/%3e%3cpath%20d='M43%2010.5408V22.5H58V9.5H43.6268L43%209.50004L43%2010.5408Z'%20fill='url(%23paint1_linear_1144_162345)'/%3e%3cpath%20d='M50.4792%2036.5C51.8085%2036.5%2052.7528%2035.7757%2052.75%2034.7605C52.7528%2034.0418%2052.2958%2033.5285%2051.4208%2033.423V33.3774C52.0771%2033.2804%2052.5423%2032.827%2052.5395%2032.1711C52.5423%2031.2186%2051.706%2030.5%2050.4903%2030.5C49.2663%2030.5%2048.3746%2031.23%2048.3635%2032.2681H49.6734C49.6845%2031.8688%2050.0334%2031.6008%2050.4903%2031.6008C50.9251%2031.6008%2051.2214%2031.8717%2051.2186%2032.2624C51.2214%2032.6673%2050.8725%2032.9468%2050.3685%2032.9468H49.8174V33.9506H50.3685C50.9417%2033.9506%2051.3155%2034.2414%2051.31%2034.6521C51.3155%2035.0656%2050.9721%2035.3536%2050.4848%2035.3536C50.0001%2035.3536%2049.6429%2035.0884%2049.6291%2034.7034H48.25C48.2611%2035.7586%2049.1832%2036.5%2050.4792%2036.5Z'%20fill='white'/%3e%3cpath%20d='M49.4844%2045.3679H50.4943C50.4858%2044.5518%2049.8359%2044%2048.8217%2044C47.8246%2044%2047.1065%2044.5433%2047.1129%2045.3551C47.1108%2046.0178%2047.5753%2046.3906%2048.3295%2046.5632L48.7855%2046.6697C49.2649%2046.7805%2049.4801%2046.9105%2049.4844%2047.1555C49.4801%2047.4219%2049.2308%2047.6072%2048.8068%2047.6072C48.3402%2047.6072%2048.0334%2047.3899%2048.0099%2046.9702H47C47.0128%2047.9908%2047.7223%2048.4787%2048.8196%2048.4787C49.9062%2048.4787%2050.5497%2047.9865%2050.554%2047.1577C50.5497%2046.4609%2050.0788%2046.0348%2049.218%2045.8452L48.843%2045.7599C48.4467%2045.6747%2048.1953%2045.5426%2048.2038%2045.2827C48.206%2045.044%2048.4105%2044.8714%2048.8196%2044.8714C49.2308%2044.8714%2049.4567%2045.0568%2049.4844%2045.3679Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M51.0781%2048.4233H54.3082V47.5732H52.5398V47.5455L53.0618%2047.0639C54.0078%2046.2393%2054.255%2045.8196%2054.255%2045.3189C54.255%2044.5327%2053.6136%2044%2052.6229%2044C51.6577%2044%2051.0121%2044.5561%2051.0142%2045.4446H52.0135C52.0135%2045.0504%2052.2564%2044.8224%2052.6186%2044.8224C52.9744%2044.8224%2053.2322%2045.0419%2053.2322%2045.402C53.2322%2045.728%2053.0277%2045.9496%2052.6697%2046.2713L51.0781%2047.6648V48.4233Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M49.7744%2018.5C50.5264%2018.5%2051.0464%2018.2377%2051.3415%2017.7415H51.3837V18.4178H53V15.1182C53%2014.091%2051.9845%2013.5%2050.6107%2013.5C49.1595%2013.5%2048.3373%2014.1574%2048.2003%2015.0424L49.785%2015.0929C49.8587%2014.7832%2050.1434%2014.5936%2050.5966%2014.5936C51.0183%2014.5936%2051.2853%2014.7769%2051.2853%2015.1024V15.1182C51.2853%2015.4153%2050.9269%2015.4785%2050.0063%2015.5512C48.9136%2015.6334%2048%2015.9968%2048%2017.0714C48%2018.0322%2048.7414%2018.5%2049.7744%2018.5ZM50.305%2017.4886C49.9079%2017.4886%2049.6268%2017.318%2049.6268%2016.9956C49.6268%2016.6827%2049.9009%2016.493%2050.3893%2016.4267C50.7091%2016.3856%2051.1026%2016.3224%2051.2959%2016.2307V16.6922C51.2959%2017.1662%2050.8531%2017.4886%2050.305%2017.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M71.9067%2035.5C72.6011%2035.5%2077.9327%2031.5%2077.9327%2029.5C77.9327%2027.5%2072.7357%2023.5%2071.9067%2023.5C71.0777%2023.5%2070.4023%2024%2070.4023%2024.9756C70.4023%2025.9512%2073.9067%2028.4206%2073.9067%2028.4206C73.9067%2028.4206%2066.2539%2027.75%2066%2028.4206C65.7461%2029.0911%2065.7461%2029.9089%2066%2030.5794C66.2539%2031.25%2073.9067%2030.5794%2073.9067%2030.5794C73.9067%2030.5794%2070.4023%2033.25%2070.4023%2034.0301C70.4023%2034.8103%2071.2123%2035.5%2071.9067%2035.5Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip0_1144_162345)'%3e%3cpath%20d='M110%2018.5H86V28H110V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110%2031.25H86V40.75H110V31.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110%2044H86V53.5H110V44Z'%20fill='%233865AB'/%3e%3cpath%20d='M86%206.30064V15.5H110V5.5H87.0029C86.7369%205.5%2086.4818%205.58435%2086.2937%205.7345C86.1057%205.88465%2086%206.0883%2086%206.30064Z'%20fill='url(%23paint2_linear_1144_162345)'/%3e%3cpath%20d='M97.4453%2022.3744H98.4394C98.431%2021.5545%2097.7913%2021%2096.7931%2021C95.8116%2021%2095.1049%2021.5459%2095.1111%2022.3616C95.1091%2023.0274%2095.5662%2023.402%2096.3086%2023.5754L96.7574%2023.6824C97.2293%2023.7938%2097.4411%2023.9244%2097.4453%2024.1706C97.4411%2024.4382%2097.1957%2024.6244%2096.7784%2024.6244C96.3191%2024.6244%2096.0171%2024.406%2095.9941%2023.9843H95C95.0126%2025.0098%2095.7109%2025.5%2096.791%2025.5C97.8605%2025.5%2098.4939%2025.0055%2098.4981%2024.1727C98.4939%2023.4726%2098.0304%2023.0445%2097.1832%2022.8539L96.8141%2022.7683C96.424%2022.6827%2096.1765%2022.55%2096.1849%2022.2888C96.187%2022.049%2096.3883%2021.8756%2096.791%2021.8756C97.1957%2021.8756%2097.418%2022.0618%2097.4453%2022.3744Z'%20fill='%2324292E'/%3e%3cpath%20d='M101%2021.0599H100.037L98.9783%2021.7322V22.6484L99.9388%2022.049H99.964V25.4443H101V21.0599Z'%20fill='%2324292E'/%3e%3cpath%20d='M97.4453%2035.1244H98.4394C98.431%2034.3045%2097.7913%2033.75%2096.7931%2033.75C95.8116%2033.75%2095.1049%2034.2959%2095.1111%2035.1116C95.1091%2035.7774%2095.5662%2036.152%2096.3086%2036.3254L96.7574%2036.4324C97.2293%2036.5438%2097.4411%2036.6744%2097.4453%2036.9206C97.4411%2037.1882%2097.1957%2037.3744%2096.7784%2037.3744C96.3191%2037.3744%2096.0171%2037.156%2095.9941%2036.7343H95C95.0126%2037.7598%2095.7109%2038.25%2096.791%2038.25C97.8605%2038.25%2098.4939%2037.7555%2098.4981%2036.9227C98.4939%2036.2226%2098.0304%2035.7945%2097.1832%2035.6039L96.8141%2035.5183C96.424%2035.4327%2096.1765%2035.3%2096.1849%2035.0388C96.187%2034.799%2096.3883%2034.6256%2096.791%2034.6256C97.1957%2034.6256%2097.418%2034.8118%2097.4453%2035.1244Z'%20fill='%2324292E'/%3e%3cpath%20d='M101%2033.8099H100.037L98.9783%2034.4822V35.3984L99.9388%2034.799H99.964V38.1943H101V33.8099Z'%20fill='%2324292E'/%3e%3cpath%20d='M96.9962%2047.8744H98.0109C98.0024%2047.0545%2097.3494%2046.5%2096.3304%2046.5C95.3285%2046.5%2094.607%2047.0459%2094.6135%2047.8616C94.6113%2048.5274%2095.078%2048.902%2095.8359%2049.0754L96.294%2049.1824C96.7757%2049.2938%2096.9919%2049.4244%2096.9962%2049.6706C96.9919%2049.9382%2096.7414%2050.1244%2096.3154%2050.1244C95.8466%2050.1244%2095.5383%2049.906%2095.5147%2049.4843H94.5C94.5128%2050.5098%2095.2257%2051%2096.3283%2051C97.4201%2051%2098.0666%2050.5055%2098.0709%2049.6727C98.0666%2048.9726%2097.5935%2048.5445%2096.7286%2048.3539L96.3518%2048.2683C95.9536%2048.1827%2095.701%2048.05%2095.7096%2047.7888C95.7117%2047.549%2095.9172%2047.3756%2096.3283%2047.3756C96.7414%2047.3756%2096.9684%2047.5618%2096.9962%2047.8744Z'%20fill='white'/%3e%3cpath%20d='M98.5975%2050.9443H101.843V50.0902H100.066V50.0623L100.591%2049.5785C101.541%2048.75%20101.789%2048.3283%20101.789%2047.8252C101.789%2047.0352%20101.145%2046.5%20100.15%2046.5C99.1798%2046.5%2098.5312%2047.0588%2098.5333%2047.9515H99.5373C99.5373%2047.5554%2099.7814%2047.3264%20100.145%2047.3264C100.503%2047.3264%20100.762%2047.5469%20100.762%2047.9087C100.762%2048.2362%20100.556%2048.4588%20100.197%2048.7821L98.5975%2050.1822V50.9443Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_162345)'%3e%3cpath%20d='M114%2015.5H138V6.30064C138%206.0883%20137.894%205.88465%20137.706%205.7345C137.518%205.58435%20137.263%205.5%20136.997%205.5H114V15.5Z'%20fill='url(%23paint3_linear_1144_162345)'/%3e%3cpath%20d='M138%2018.5H114V28H138V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M138%2031.25H114V40.75H138V31.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M138%2044H114V53.5H138V44Z'%20fill='%233865AB'/%3e%3cpath%20d='M127%2020.25H125.572L124%2021.1699V22.4238L125.425%2021.6035H125.463V26.25H127V20.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M123.837%2039H128.25V37.8468H125.834V37.8092L126.547%2037.1561C127.84%2036.0376%20128.177%2035.4682%20128.177%2034.789C128.177%2033.7225%20127.301%2033%20125.948%2033C124.629%2033%20123.747%2033.7543%20123.75%2034.9595H125.115C125.115%2034.4249%20125.447%2034.1156%20125.942%2034.1156C126.428%2034.1156%20126.78%2034.4133%20126.78%2034.9017C126.78%2035.3439%20126.501%2035.6445%20126.012%2036.0809L123.837%2037.9711V39Z'%20fill='%2324292E'/%3e%3cpath%20d='M125.979%2051.75C127.308%2051.75%20128.253%2051.0257%20128.25%2050.0105C128.253%2049.2918%20127.796%2048.7785%20126.921%2048.673V48.6274C127.577%2048.5304%20128.042%2048.077%20128.04%2047.4211C128.042%2046.4686%20127.206%2045.75%20125.99%2045.75C124.766%2045.75%20123.875%2046.48%20123.864%2047.5181H125.173C125.184%2047.1188%20125.533%2046.8508%20125.99%2046.8508C126.425%2046.8508%20126.721%2047.1217%20126.719%2047.5124C126.721%2047.9173%20126.372%2048.1968%20125.868%2048.1968H125.317V49.2006H125.868C126.442%2049.2006%20126.816%2049.4914%20126.81%2049.9021C126.816%2050.3156%20126.472%2050.6036%20125.985%2050.6036C125.5%2050.6036%20125.143%2050.3384%20125.129%2049.9534H123.75C123.761%2051.0086%20124.683%2051.75%20125.979%2051.75Z'%20fill='white'/%3e%3cpath%20d='M124.774%2013C125.526%2013%20126.046%2012.7377%20126.342%2012.2415H126.384V12.9178H128V9.6182C128%208.59102%20126.985%208%20125.611%208C124.16%208%20123.337%208.6574%20123.2%209.54235L124.785%209.59292C124.859%209.28319%20125.143%209.09355%20125.597%209.09355C126.018%209.09355%20126.285%209.27686%20126.285%209.6024V9.6182C126.285%209.9153%20125.927%209.97851%20125.006%2010.0512C123.914%2010.1334%20123%2010.4968%20123%2011.5714C123%2012.5322%20123.741%2013%20124.774%2013ZM125.305%2011.9886C124.908%2011.9886%20124.627%2011.818%20124.627%2011.4956C124.627%2011.1827%20124.901%2010.993%20125.389%2010.9267C125.709%2010.8856%20126.103%2010.8224%20126.296%2010.7307V11.1922C126.296%2011.6662%20125.853%2011.9886%20125.305%2011.9886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162345'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_162345'%20x1='43'%20y1='16.0052'%20x2='58'%20y2='16.0052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1144_162345'%20x1='86'%20y1='10.504'%20x2='110'%20y2='10.504'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1144_162345'%20x1='114'%20y1='10.504'%20x2='138'%20y2='10.504'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_162345'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(86%205.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_162345'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(114%205.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_30 = "data:image/svg+xml,%3csvg%20width='114'%20height='48'%20viewBox='0%200%20114%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_smoothing_dark)'%3e%3cpath%20d='M0%200.611699V7.64012H7V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_smoothing_dark)'/%3e%3cpath%20d='M8%200H15V7.64012H8V0Z'%20fill='url(%23paint1_linear_smoothing_dark)'/%3e%3cpath%20d='M16%200H23V7.64012H16V0Z'%20fill='url(%23paint2_linear_smoothing_dark)'/%3e%3cpath%20d='M24%200H31V7.64012H24V0Z'%20fill='url(%23paint3_linear_smoothing_dark)'/%3e%3cpath%20d='M32%200H39V7.64012H32V0Z'%20fill='url(%23paint4_linear_smoothing_dark)'/%3e%3cpath%20d='M40%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200H40V7.64012Z'%20fill='url(%23paint5_linear_smoothing_dark)'/%3e%3cpath%20d='M2%2038L5%2028L8%2035L11%2025L14%2032L17%2022L20%2030L23%2020L26%2028L29%2024L32%2031L35%2026L38%2033L41%2029L44%2036L46%2032'%20stroke='%2384AFF1'%20stroke-width='2'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2%2038L5%2028L8%2035L11%2025L14%2032L17%2022L20%2030L23%2020L26%2028L29%2024L32%2031L35%2026L38%2033L41%2029L44%2036L46%2032L46%2048L2%2048Z'%20fill='url(%23paint6_linear_smoothing_dark)'%20opacity='0.3'/%3e%3c/g%3e%3cpath%20d='M57.91%2030C58.6%2030%2064%2026%2064%2024C64%2022%2058.7%2018%2057.91%2018C57.08%2018%2056.4%2018.5%2056.4%2019.48C56.4%2020.45%2059.91%2022.92%2059.91%2022.92C59.91%2022.92%2052.25%2022.25%2052%2022.92C51.75%2023.59%2051.75%2024.41%2052%2025.08C52.25%2025.75%2059.91%2025.08%2059.91%2025.08C59.91%2025.08%2056.4%2027.75%2056.4%2028.53C56.4%2029.31%2057.21%2030%2057.91%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_smoothing_dark)'%3e%3cpath%20d='M66%200.611699V7.64012H81V0H66.6015C66.442%200%2066.289%200.0644467%2066.1762%200.179162C66.0634%200.293878%2066%200.449466%2066%200.611699Z'%20fill='url(%23paint7_linear_smoothing_dark)'/%3e%3cpath%20d='M82%200H97V7.64012H82V0Z'%20fill='url(%23paint8_linear_smoothing_dark)'/%3e%3cpath%20d='M98%207.64012H114V0.611699C114%200.449466%20113.937%200.293878%20113.824%200.179162C113.711%200.0644467%20113.558%200%20113.399%200H98V7.64012Z'%20fill='url(%23paint9_linear_smoothing_dark)'/%3e%3cpath%20d='M68%2036Q77%2028%2086%2024Q95%2021%20112%2025'%20stroke='%2384AFF1'%20stroke-width='2.5'%20fill='none'%20stroke-linecap='round'/%3e%3cpath%20d='M68%2036Q77%2028%2086%2024Q95%2021%20112%2025L112%2048L68%2048Z'%20fill='url(%23paint10_linear_smoothing_dark)'%20opacity='0.3'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_smoothing_dark'%20x1='0'%20y1='3.82'%20x2='7'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_smoothing_dark'%20x1='8'%20y1='3.82'%20x2='15'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_smoothing_dark'%20x1='16'%20y1='3.82'%20x2='23'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_smoothing_dark'%20x1='24'%20y1='3.82'%20x2='31'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_smoothing_dark'%20x1='32'%20y1='3.82'%20x2='39'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_smoothing_dark'%20x1='40'%20y1='3.82'%20x2='48'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_smoothing_dark'%20x1='24'%20y1='48'%20x2='24'%20y2='20'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F60C4'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%233865AB'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_smoothing_dark'%20x1='66'%20y1='3.82'%20x2='81'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_smoothing_dark'%20x1='82'%20y1='3.82'%20x2='97'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint9_linear_smoothing_dark'%20x1='98'%20y1='3.82'%20x2='114'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint10_linear_smoothing_dark'%20x1='90'%20y1='48'%20x2='90'%20y2='21'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F60C4'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%233865AB'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_smoothing_dark'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_smoothing_dark'%3e%3crect%20width='48'%20height='48'%20fill='white'%20transform='translate(66)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_31 = "data:image/svg+xml,%3csvg%20width='77'%20height='48'%20viewBox='0%200%2077%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.3704%2020.6776C23.308%2020.6218%2023.2344%2020.5781%2023.1539%2020.549C22.9941%2020.4877%2022.815%2020.4877%2022.6552%2020.549C22.5747%2020.5781%2022.5011%2020.6218%2022.4387%2020.6776L21.1265%2021.9023C21.0029%2022.0177%2020.9335%2022.174%2020.9335%2022.3371C20.9335%2022.5002%2021.0029%2022.6566%2021.1265%2022.7719C21.25%2022.8872%2021.4176%2022.952%2021.5923%2022.952C21.7671%2022.952%2021.9346%2022.8872%2022.0582%2022.7719L22.2484%2022.5882V27.2361C22.2484%2027.3985%2022.3176%2027.5543%2022.4406%2027.6691C22.5637%2027.784%2022.7306%2027.8485%2022.9046%2027.8485C23.0786%2027.8485%2023.2455%2027.784%2023.3685%2027.6691C23.4916%2027.5543%2023.5607%2027.3985%2023.5607%2027.2361V22.5882L23.751%2022.7719C23.8119%2022.8293%2023.8845%2022.8749%2023.9645%2022.906C24.0444%2022.937%2024.1302%2022.953%2024.2168%2022.953C24.3034%2022.953%2024.3892%2022.937%2024.4691%2022.906C24.5491%2022.8749%2024.6216%2022.8293%2024.6826%2022.7719C24.7441%2022.715%2024.7929%2022.6473%2024.8263%2022.5726C24.8596%2022.498%2024.8767%2022.418%2024.8767%2022.3371C24.8767%2022.2563%2024.8596%2022.1762%2024.8263%2022.1016C24.7929%2022.027%2024.7441%2021.9593%2024.6826%2021.9023L23.3704%2020.6776ZM26.8413%2021.7247H33.4024C33.5764%2021.7247%2033.7433%2021.6602%2033.8664%2021.5454C33.9894%2021.4305%2034.0585%2021.2748%2034.0585%2021.1124C34.0585%2020.95%2033.9894%2020.7942%2033.8664%2020.6794C33.7433%2020.5645%2033.5764%2020.5%2033.4024%2020.5H26.8413C26.6672%2020.5%2026.5004%2020.5645%2026.3773%2020.6794C26.2543%2020.7942%2026.1851%2020.95%2026.1851%2021.1124C26.1851%2021.2748%2026.2543%2021.4305%2026.3773%2021.5454C26.5004%2021.6602%2026.6672%2021.7247%2026.8413%2021.7247ZM33.4024%2026.6237H26.8413C26.6672%2026.6237%2026.5004%2026.6883%2026.3773%2026.8031C26.2543%2026.918%2026.1851%2027.0737%2026.1851%2027.2361C26.1851%2027.3985%2026.2543%2027.5543%2026.3773%2027.6691C26.5004%2027.784%2026.6672%2027.8485%2026.8413%2027.8485H33.4024C33.5764%2027.8485%2033.7433%2027.784%2033.8664%2027.6691C33.9894%2027.5543%2034.0585%2027.3985%2034.0585%2027.2361C34.0585%2027.0737%2033.9894%2026.918%2033.8664%2026.8031C33.7433%2026.6883%2033.5764%2026.6237%2033.4024%2026.6237ZM33.4024%2023.5619H26.8413C26.6672%2023.5619%2026.5004%2023.6264%2026.3773%2023.7412C26.2543%2023.8561%2026.1851%2024.0118%2026.1851%2024.1742C26.1851%2024.3367%2026.2543%2024.4924%2026.3773%2024.6073C26.5004%2024.7221%2026.6672%2024.7866%2026.8413%2024.7866H33.4024C33.5764%2024.7866%2033.7433%2024.7221%2033.8664%2024.6073C33.9894%2024.4924%2034.0585%2024.3367%2034.0585%2024.1742C34.0585%2024.0118%2033.9894%2023.8561%2033.8664%2023.7412C33.7433%2023.6264%2033.5764%2023.5619%2033.4024%2023.5619Z'%20fill='white'/%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0777%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2123%2030%2047.9067%2030Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip0_1144_161700)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1144_161700)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1144_161700)'%3e%3cpath%20d='M77%2017.5H62V30.5H77V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2035H62V48H77V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M62%2013H77V1.04083C77%200.764787%2076.934%200.500047%2076.8164%200.304853C76.6989%200.109659%2076.5394%200%2076.3732%200L62%200V13Z'%20fill='url(%23paint1_linear_1144_161700)'/%3e%3cpath%20d='M70.5%2038.5H69.0716L67.5%2039.4199V40.6738L68.9253%2039.8535H68.9627V44.5H70.5V38.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.3373%2027H71.75V25.8468H69.3341V25.8092L70.0472%2025.1561C71.3396%2024.0376%2071.6772%2023.4682%2071.6772%2022.789C71.6772%2021.7225%2070.8011%2021%2069.4476%2021C68.129%2021%2067.2471%2021.7543%2067.25%2022.9595H68.6151C68.6151%2022.4249%2068.947%2022.1156%2069.4418%2022.1156C69.9279%2022.1156%2070.2801%2022.4133%2070.2801%2022.9017C70.2801%2023.3439%2070.0006%2023.6445%2069.5116%2024.0809L67.3373%2025.9711V27Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_161700'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1144_161700'%20x1='62'%20y1='6.5052'%20x2='77'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1144_161700'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1144_161700'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(62)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_32 = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.7436%2030.2214C10.4012%2030.2214%2010.0827%2030.3965%209.89924%2030.6856L1.15566%2044.4642C0.96022%2044.7722%200.947975%2045.1622%201.1237%2045.4818C1.29943%2045.8014%201.63525%2046%202%2046H24H46C46.3648%2046%2046.7006%2045.8014%2046.8763%2045.4818C47.052%2045.1622%2047.0398%2044.7722%2046.8443%2044.4642L38.1008%2030.6856C37.9173%2030.3965%2037.5988%2030.2214%2037.2564%2030.2214H24H10.7436Z'%20fill='url(%23paint0_linear_1144_162218)'%20stroke='%23CCCCDC'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.25%2026.7682C17.25%2030.6622%2021.6037%2035.6872%2024%2038.0189C26.3962%2035.6988%2030.75%2030.6622%2030.75%2026.7682C30.75%2024.9129%2030.0388%2023.1336%2028.773%2021.8218C27.5071%2020.5099%2025.7902%2019.7729%2024%2019.7729C22.2098%2019.7729%2020.4929%2020.5099%2019.227%2021.8218C17.9612%2023.1336%2017.25%2024.9129%2017.25%2026.7682ZM22.7501%2028.7068C23.1201%2028.963%2023.5551%2029.0997%2024.0001%2029.0997C24.5969%2029.0997%2025.1692%2028.8541%2025.5911%2028.4168C26.0131%2027.9795%2026.2501%2027.3864%2026.2501%2026.768C26.2501%2026.3068%2026.1182%2025.856%2025.8709%2025.4725C25.6237%2025.0891%2025.2723%2024.7902%2024.8612%2024.6137C24.45%2024.4372%2023.9976%2024.3911%2023.5612%2024.481C23.1247%2024.571%2022.7238%2024.7931%2022.4091%2025.1192C22.0945%2025.4453%2021.8802%2025.8608%2021.7934%2026.3131C21.7065%2026.7654%2021.7511%2027.2342%2021.9214%2027.6603C22.0917%2028.0864%2022.3801%2028.4506%2022.7501%2028.7068Z'%20fill='%23E02F44'/%3e%3cpath%20d='M24%2017.4426C21.6131%2017.4426%2019.3239%2018.4252%2017.636%2020.1744C15.9482%2021.9236%2015%2024.2959%2015%2026.7696C15%2033.0654%2022.9313%2040.1773%2023.2688%2040.4804C23.4725%2040.661%2023.7319%2040.7603%2024%2040.7603C24.2681%2040.7603%2024.5275%2040.661%2024.7312%2040.4804C25.125%2040.1773%2033%2033.0654%2033%2026.7696C33%2024.2959%2032.0518%2021.9236%2030.364%2020.1744C28.6761%2018.4252%2026.3869%2017.4426%2024%2017.4426ZM24%2038.0204C21.6037%2035.6886%2017.25%2030.6637%2017.25%2026.7696C17.25%2024.9144%2017.9612%2023.1351%2019.227%2021.8232C20.4929%2020.5113%2022.2098%2019.7743%2024%2019.7743C25.7902%2019.7743%2027.5071%2020.5113%2028.773%2021.8232C30.0388%2023.1351%2030.75%2024.9144%2030.75%2026.7696C30.75%2030.6637%2026.3963%2035.7003%2024%2038.0204Z'%20fill='%2322252B'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1144_162218'%20x1='46'%20y1='38.2709'%20x2='3.41025'%20y2='38.2709'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9830'/%3e%3cstop%20offset='1'%20stop-color='%23F2CC0C'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_33 = "data:image/svg+xml,%3csvg%20width='124'%20height='48'%20viewBox='0%200%20124%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1648_105791)'%3e%3cpath%20d='M76%200.611699V7.64012H90.394V0H76.6015C76.442%200%2076.289%200.0644467%2076.1762%200.179162C76.0634%200.293878%2076%200.449466%2076%200.611699Z'%20fill='url(%23paint0_linear_1648_105791)'/%3e%3cpath%20d='M109.606%207.64012H124V0.611699C124%200.449466%20123.937%200.293878%20123.824%200.179162C123.711%200.0644467%20123.558%200%20123.399%200L109.606%200V7.64012Z'%20fill='url(%23paint1_linear_1648_105791)'/%3e%3cpath%20d='M107.194%200H92.8V7.64012H107.194V0Z'%20fill='url(%23paint2_linear_1648_105791)'/%3e%3cpath%20d='M107.194%2010.0869H92.8V17.727H107.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M90.394%2010.0869H76V17.727H90.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2010.0869H109.606V17.727H124V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2020.1799H109.606V27.8262H124V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M107.194%2020.1799H92.8V27.8262H107.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M90.394%2020.1799H76V27.8262H90.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M107.194%2030.2668H92.8V37.907H107.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2030.2668H109.606V37.907H124V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M90.394%2030.2668H76V37.907H90.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M107.194%2040.3599H92.8V48H107.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M124%2047.3883V40.3721H109.606V48H123.399C123.558%2048%20123.711%2047.9355%20123.824%2047.8208C123.937%2047.7061%20124%2047.5505%20124%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M90.394%2048V40.3721H76V47.3883C76%2047.5505%2076.0634%2047.7061%2076.1762%2047.8208C76.289%2047.9355%2076.442%2048%2076.6015%2048H90.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030.4001C62.6011%2030.4001%2067.9327%2026.1334%2067.9327%2024.0001C67.9327%2021.8668%2062.7357%2017.6001%2061.9067%2017.6001C61.0777%2017.6001%2060.4023%2018.1334%2060.4023%2019.1741C60.4023%2020.2147%2063.9067%2022.8487%2063.9067%2022.8487C63.9067%2022.8487%2056.2539%2022.1334%2056%2022.8487C55.7461%2023.564%2055.7461%2024.4362%2056%2025.1515C56.2539%2025.8668%2063.9067%2025.1515%2063.9067%2025.1515C63.9067%2025.1515%2060.4023%2028.0001%2060.4023%2028.8323C60.4023%2029.6644%2061.2123%2030.4001%2061.9067%2030.4001Z'%20fill='%23CCCCDC'/%3e%3cg%20clip-path='url(%23clip1_1648_105791)'%3e%3cpath%20d='M20.5658%2014.8473C20.3887%2014.8474%2020.2137%2014.8094%2020.0526%2014.736L10.9631%2010.6159L1.6881%2014.1483C1.38144%2014.2648%201.04108%2014.2546%200.741903%2014.12C0.442727%2013.9854%200.20924%2013.7375%200.092806%2013.4307C-0.0236282%2013.1238%20-0.0134715%2012.7833%200.121042%2012.484C0.255555%2012.1847%200.503406%2011.9511%200.810071%2011.8346L10.5797%208.12275C10.8826%207.9973%2011.2229%207.9973%2011.5258%208.12275L20.2813%2012.0882L29.5563%202.19003C29.734%202.01998%2029.9583%201.90678%2030.2006%201.86491C30.4429%201.82304%2030.6922%201.85438%2030.9166%201.95495L40.2844%206.01939L49.0832%200.204206C49.2188%200.111618%2049.3714%200.0469507%2049.5322%200.0139747C49.693%20-0.0190012%2049.8587%20-0.0196266%2050.0197%200.0121352C50.1807%200.043897%2050.3338%200.10741%2050.4701%200.198973C50.6063%200.290536%2050.723%200.408317%2050.8133%200.545449C50.9036%200.682581%2050.9656%200.836322%2050.9959%200.997709C51.0262%201.1591%2051.0241%201.3249%2050.9897%201.48546C50.9553%201.64602%2050.8893%201.79812%2050.7955%201.93289C50.7017%202.06766%2050.5821%202.18241%2050.4436%202.27045L41.0882%208.45682C40.9161%208.56985%2040.7185%208.63811%2040.5133%208.6554C40.3082%208.67268%2040.1019%208.63845%2039.9134%208.5558L30.7435%204.57178L21.4685%2014.47C21.3516%2014.591%2021.2113%2014.6869%2021.056%2014.7518C20.9008%2014.8167%2020.734%2014.8492%2020.5658%2014.8473Z'%20fill='url(%23paint3_linear_1648_105791)'/%3e%3cpath%20d='M49.7634%2010.9624L40.408%2020.8606L30.4343%2013.4369L20.5657%2020.8606L11.0063%2019.0047L1.23669%2027.047H1.30471V47.994H49.8932L49.7634%2010.9624Z'%20fill='url(%23paint4_linear_1648_105791)'/%3e%3cpath%20d='M1.30471%2028.2841H1.23669C0.982572%2028.2834%200.734861%2028.2043%200.527257%2028.0577C0.319654%2027.911%200.162238%2027.704%200.0764263%2027.4647C-0.00938568%2027.2254%20-0.0194273%2026.9654%200.0476675%2026.7202C0.114762%2026.475%200.255736%2026.2564%200.451409%2026.0942L10.2211%2018.0519C10.3615%2017.9361%2010.5258%2017.8528%2010.7022%2017.8079C10.8785%2017.763%2011.0626%2017.7576%2011.2413%2017.7921L20.2628%2019.5428L29.6799%2012.447C29.894%2012.2864%2030.1544%2012.1996%2030.4219%2012.1996C30.6895%2012.1996%2030.9499%2012.2864%2031.1639%2012.447L40.2534%2019.2149L48.8482%2010.1148C48.9578%209.9891%2049.0917%209.88688%2049.2418%209.81428C49.3919%209.74167%2049.5551%209.70018%2049.7217%209.6923C49.8882%209.68442%2050.0546%209.7103%2050.2109%209.76841C50.3671%209.82651%2050.5101%209.91562%2050.631%2010.0304C50.752%2010.1452%2050.8485%2010.2832%2050.9148%2010.4363C50.9811%2010.5893%2051.0158%2010.7542%2051.0167%2010.921C51.0177%2011.0878%2050.985%2011.2531%2050.9205%2011.4069C50.856%2011.5607%2050.761%2011.6999%2050.6414%2011.816L41.3046%2021.7142C41.0967%2021.9331%2040.816%2022.0685%2040.5153%2022.0947C40.2146%2022.1209%2039.9148%2022.0362%2039.6722%2021.8565L30.4405%2014.9835L21.3077%2021.8503C21.1699%2021.9547%2021.0118%2022.0289%2020.8435%2022.0684C20.6752%2022.1078%2020.5006%2022.1115%2020.3308%2022.0792L11.3402%2020.3347L2.31259%2027.7583C2.19886%2027.9202%202.04798%2028.0524%201.87261%2028.1439C1.69724%2028.2354%201.50249%2028.2835%201.30471%2028.2841Z'%20fill='%2384AFF1'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1648_105791'%20x1='76'%20y1='3.82312'%20x2='90.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1648_105791'%20x1='109.606'%20y1='3.82312'%20x2='124'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1648_105791'%20x1='92.8'%20y1='3.82312'%20x2='107.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1648_105791'%20x1='5.62111e-05'%20y1='7.42369'%20x2='51.0001'%20y2='7.42369'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1648_105791'%20x1='25.4382'%20y1='48.2414'%20x2='25.9148'%20y2='8.49405'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F60C4'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%233865AB'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1648_105791'%3e%3crect%20width='48'%20height='48'%20fill='white'%20transform='translate(76)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1648_105791'%3e%3crect%20width='51'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_34 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='206'%20zoomAndPan='magnify'%20viewBox='0%200%20154.5%2041.25'%20height='55'%20preserveAspectRatio='xMidYMid%20meet'%20version='1.0'%3e%3cdefs%3e%3cg/%3e%3cclipPath%20id='0cc78e9abe'%3e%3cpath%20d='M%202.78125%202.292969%20L%2019.722656%202.292969%20L%2019.722656%202.871094%20L%202.78125%202.871094%20Z%20M%202.78125%202.871094%20L%2019.722656%202.871094%20L%2019.722656%209.503906%20L%202.78125%209.503906%20Z%20M%202.78125%202.871094%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%202.292546)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='78f737bf82'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='59741fc677'%3e%3cpath%20d='M%202.78125%2012.085938%20L%2019.722656%2012.085938%20L%2019.722656%2012.664062%20L%202.78125%2012.664062%20Z%20M%202.78125%2012.664062%20L%2019.722656%2012.664062%20L%2019.722656%2019.300781%20L%202.78125%2019.300781%20Z%20M%202.78125%2012.664062%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%2012.086858)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='8b36d8a32c'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='4f935a79b9'%3e%3cpath%20d='M%202.78125%2021.726562%20L%2019.722656%2021.726562%20L%2019.722656%2022.304688%20L%202.78125%2022.304688%20Z%20M%202.78125%2022.304688%20L%2019.722656%2022.304688%20L%2019.722656%2028.941406%20L%202.78125%2028.941406%20Z%20M%202.78125%2022.304688%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%2021.72763)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='f2c0bb83c0'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='8400dc1f64'%3e%3cpath%20d='M%202.78125%2031.367188%20L%2019.722656%2031.367188%20L%2019.722656%2031.945312%20L%202.78125%2031.945312%20Z%20M%202.78125%2031.945312%20L%2019.722656%2031.945312%20L%2019.722656%2038.582031%20L%202.78125%2038.582031%20Z%20M%202.78125%2031.945312%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%2031.368404)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='e73fefaf04'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='f01163ac74'%3e%3cpath%20d='M%2023.167969%202.292969%20L%2040.109375%202.292969%20L%2040.109375%202.871094%20L%2023.167969%202.871094%20Z%20M%2023.167969%202.871094%20L%2040.109375%202.871094%20L%2040.109375%209.503906%20L%2023.167969%209.503906%20Z%20M%2023.167969%202.871094%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038809'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%202.844588,%202.292546)'%20y1='5.004'%20x2='51.411943'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='b1fb89d5c4'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='5b0ecc485e'%3e%3cpath%20d='M%2043.5625%202.292969%20L%2060.503906%202.292969%20L%2060.503906%202.871094%20L%2043.5625%202.871094%20Z%20M%2043.5625%202.871094%20L%2060.503906%202.871094%20L%2060.503906%209.503906%20L%2043.5625%209.503906%20Z%20M%2043.5625%202.871094%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038809'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2023.236872,%202.292546)'%20y1='5.004'%20x2='51.411941'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='c5b211b06c'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='7286542c60'%3e%3cpath%20d='M%2023.128906%2012.273438%20L%2040.046875%2012.273438%20L%2040.046875%2018.902344%20L%2023.128906%2018.902344%20Z%20M%2023.128906%2012.273438%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='1fa2f29718'%3e%3cpath%20d='M%2043.523438%2012.273438%20L%2060.441406%2012.273438%20L%2060.441406%2018.902344%20L%2043.523438%2018.902344%20Z%20M%2043.523438%2012.273438%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='c94678cc51'%3e%3cpath%20d='M%2023.191406%2022.042969%20L%2040.109375%2022.042969%20L%2040.109375%2028.671875%20L%2023.191406%2028.671875%20Z%20M%2023.191406%2022.042969%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='e9a287e80a'%3e%3cpath%20d='M%2043.648438%2022.042969%20L%2060.566406%2022.042969%20L%2060.566406%2028.671875%20L%2043.648438%2028.671875%20Z%20M%2043.648438%2022.042969%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='a7d27cb965'%3e%3cpath%20d='M%2023.191406%2031.367188%20L%2040.109375%2031.367188%20L%2040.109375%2037.996094%20L%2023.191406%2037.996094%20Z%20M%2023.191406%2031.367188%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='c25dc36c8d'%3e%3cpath%20d='M%2043.585938%2031.367188%20L%2060.503906%2031.367188%20L%2060.503906%2037.996094%20L%2043.585938%2037.996094%20Z%20M%2043.585938%2031.367188%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='6ef4945aae'%3e%3cpath%20d='M%2072.824219%208.578125%20L%2089.765625%208.578125%20L%2089.765625%209.152344%20L%2072.824219%209.152344%20Z%20M%2072.824219%209.152344%20L%2089.765625%209.152344%20L%2089.765625%2015.789062%20L%2072.824219%2015.789062%20Z%20M%2072.824219%209.152344%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038818'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2052.501412,%208.576231)'%20y1='5.004'%20x2='51.41195'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='24823a5bb5'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='db6204473f'%3e%3cpath%20d='M%2072.824219%2018.371094%20L%2089.765625%2018.371094%20L%2089.765625%2018.949219%20L%2072.824219%2018.949219%20Z%20M%2072.824219%2018.949219%20L%2089.765625%2018.949219%20L%2089.765625%2025.582031%20L%2072.824219%2025.582031%20Z%20M%2072.824219%2018.949219%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038818'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2052.501412,%2018.370546)'%20y1='5.004'%20x2='51.41195'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='7605862bc7'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='e41efe86cc'%3e%3cpath%20d='M%2072.824219%2028.011719%20L%2089.765625%2028.011719%20L%2089.765625%2028.589844%20L%2072.824219%2028.589844%20Z%20M%2072.824219%2028.589844%20L%2089.765625%2028.589844%20L%2089.765625%2035.222656%20L%2072.824219%2035.222656%20Z%20M%2072.824219%2028.589844%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038818'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2052.501412,%2028.011317)'%20y1='5.004'%20x2='51.41195'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='a429b1d81f'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='8a3f75015e'%3e%3cpath%20d='M%2093.214844%208.578125%20L%20110.15625%208.578125%20L%20110.15625%209.152344%20L%2093.214844%209.152344%20Z%20M%2093.214844%209.152344%20L%20110.15625%209.152344%20L%20110.15625%2015.789062%20L%2093.214844%2015.789062%20Z%20M%2093.214844%209.152344%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038816'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2072.889193,%208.576231)'%20y1='5.004'%20x2='51.411949'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='882d133e25'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='2e0372461c'%3e%3cpath%20d='M%20113.605469%208.578125%20L%20130.546875%208.578125%20L%20130.546875%209.152344%20L%20113.605469%209.152344%20Z%20M%20113.605469%209.152344%20L%20130.546875%209.152344%20L%20130.546875%2015.789062%20L%20113.605469%2015.789062%20Z%20M%20113.605469%209.152344%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038807'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2093.281478,%208.576231)'%20y1='5.004'%20x2='51.411939'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='764db36b54'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='1b2cca72e2'%3e%3cpath%20d='M%2093.175781%2018.558594%20L%20110.09375%2018.558594%20L%20110.09375%2025.1875%20L%2093.175781%2025.1875%20Z%20M%2093.175781%2018.558594%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='50535c8f61'%3e%3cpath%20d='M%2093.304688%2028.328125%20L%20110.222656%2028.328125%20L%20110.222656%2034.957031%20L%2093.304688%2034.957031%20Z%20M%2093.304688%2028.328125%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='458f625111'%3e%3cpath%20d='M%20113.660156%2018.558594%20L%20130.578125%2018.558594%20L%20130.578125%2025.1875%20L%20113.660156%2025.1875%20Z%20M%20113.660156%2018.558594%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='ed8e03dbc0'%3e%3cpath%20d='M%20113.761719%2028.03125%20L%20130.679688%2028.03125%20L%20130.679688%2034.664062%20L%20113.761719%2034.664062%20Z%20M%20113.761719%2028.03125%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='a887c078d4'%3e%3cpath%20d='M%20133.894531%2018.625%20L%20150.8125%2018.625%20L%20150.8125%2025.253906%20L%20133.894531%2025.253906%20Z%20M%20133.894531%2018.625%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='2e1313b8e1'%3e%3cpath%20d='M%20134.023438%2027.792969%20L%20150.941406%2027.792969%20L%20150.941406%2034.421875%20L%20134.023438%2034.421875%20Z%20M%20134.023438%2027.792969%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='21653efc97'%3e%3cpath%20d='M%20133.839844%208.570312%20L%20150.78125%208.570312%20L%20150.78125%209.148438%20L%20133.839844%209.148438%20Z%20M%20133.839844%209.148438%20L%20150.78125%209.148438%20L%20150.78125%2015.78125%20L%20133.839844%2015.78125%20Z%20M%20133.839844%209.148438%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038803'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20113.515935,%208.570574)'%20y1='5.004'%20x2='51.411935'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='f20bcca9a3'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.955627%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20clip-path='url(%230cc78e9abe)'%3e%3cpath%20fill='url(%2378f737bf82)'%20d='M%202.78125%202.292969%20L%202.78125%209.503906%20L%2019.722656%209.503906%20L%2019.722656%202.292969%20Z%20M%202.78125%202.292969%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2359741fc677)'%3e%3cpath%20fill='url(%238b36d8a32c)'%20d='M%202.78125%2012.085938%20L%202.78125%2019.300781%20L%2019.722656%2019.300781%20L%2019.722656%2012.085938%20Z%20M%202.78125%2012.085938%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%234f935a79b9)'%3e%3cpath%20fill='url(%23f2c0bb83c0)'%20d='M%202.78125%2021.726562%20L%202.78125%2028.941406%20L%2019.722656%2028.941406%20L%2019.722656%2021.726562%20Z%20M%202.78125%2021.726562%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%238400dc1f64)'%3e%3cpath%20fill='url(%23e73fefaf04)'%20d='M%202.78125%2031.367188%20L%202.78125%2038.582031%20L%2019.722656%2038.582031%20L%2019.722656%2031.367188%20Z%20M%202.78125%2031.367188%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23f01163ac74)'%3e%3cpath%20fill='url(%23b1fb89d5c4)'%20d='M%2023.167969%202.292969%20L%2023.167969%209.503906%20L%2040.109375%209.503906%20L%2040.109375%202.292969%20Z%20M%2023.167969%202.292969%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%235b0ecc485e)'%3e%3cpath%20fill='url(%23c5b211b06c)'%20d='M%2043.5625%202.292969%20L%2043.5625%209.503906%20L%2060.503906%209.503906%20L%2060.503906%202.292969%20Z%20M%2043.5625%202.292969%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%237286542c60)'%3e%3cpath%20fill='%2384aff1'%20d='M%2040.523438%2012.222656%20L%2023.128906%2012.222656%20L%2023.128906%2019.078125%20L%2040.523438%2019.078125%20Z%20M%2040.523438%2012.222656%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%231fa2f29718)'%3e%3cpath%20fill='%2384aff1'%20d='M%2060.917969%2012.222656%20L%2043.523438%2012.222656%20L%2043.523438%2019.078125%20L%2060.917969%2019.078125%20Z%20M%2060.917969%2012.222656%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23c94678cc51)'%3e%3cpath%20fill='%2384aff1'%20d='M%2040.585938%2021.992188%20L%2023.191406%2021.992188%20L%2023.191406%2028.847656%20L%2040.585938%2028.847656%20Z%20M%2040.585938%2021.992188%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23e9a287e80a)'%3e%3cpath%20fill='%2384aff1'%20d='M%2061.042969%2021.992188%20L%2043.648438%2021.992188%20L%2043.648438%2028.847656%20L%2061.042969%2028.847656%20Z%20M%2061.042969%2021.992188%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23a7d27cb965)'%3e%3cpath%20fill='%2384aff1'%20d='M%2040.585938%2031.320312%20L%2023.191406%2031.320312%20L%2023.191406%2038.171875%20L%2040.585938%2038.171875%20Z%20M%2040.585938%2031.320312%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23c25dc36c8d)'%3e%3cpath%20fill='%2384aff1'%20d='M%2060.980469%2031.320312%20L%2043.585938%2031.320312%20L%2043.585938%2038.171875%20L%2060.980469%2038.171875%20Z%20M%2060.980469%2031.320312%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%236ef4945aae)'%3e%3cpath%20fill='url(%2324823a5bb5)'%20d='M%2072.824219%208.578125%20L%2072.824219%2015.789062%20L%2089.765625%2015.789062%20L%2089.765625%208.578125%20Z%20M%2072.824219%208.578125%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23db6204473f)'%3e%3cpath%20fill='url(%237605862bc7)'%20d='M%2072.824219%2018.371094%20L%2072.824219%2025.582031%20L%2089.765625%2025.582031%20L%2089.765625%2018.371094%20Z%20M%2072.824219%2018.371094%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23e41efe86cc)'%3e%3cpath%20fill='url(%23a429b1d81f)'%20d='M%2072.824219%2028.011719%20L%2072.824219%2035.222656%20L%2089.765625%2035.222656%20L%2089.765625%2028.011719%20Z%20M%2072.824219%2028.011719%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%238a3f75015e)'%3e%3cpath%20fill='url(%23882d133e25)'%20d='M%2093.214844%208.578125%20L%2093.214844%2015.789062%20L%20110.15625%2015.789062%20L%20110.15625%208.578125%20Z%20M%2093.214844%208.578125%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%232e0372461c)'%3e%3cpath%20fill='url(%23764db36b54)'%20d='M%20113.605469%208.578125%20L%20113.605469%2015.789062%20L%20130.546875%2015.789062%20L%20130.546875%208.578125%20Z%20M%20113.605469%208.578125%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%231b2cca72e2)'%3e%3cpath%20fill='%2384aff1'%20d='M%20110.570312%2018.507812%20L%2093.175781%2018.507812%20L%2093.175781%2025.359375%20L%20110.570312%2025.359375%20Z%20M%20110.570312%2018.507812%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2350535c8f61)'%3e%3cpath%20fill='%2384aff1'%20d='M%20110.699219%2028.277344%20L%2093.304688%2028.277344%20L%2093.304688%2035.128906%20L%20110.699219%2035.128906%20Z%20M%20110.699219%2028.277344%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23458f625111)'%3e%3cpath%20fill='%2384aff1'%20d='M%20131.054688%2018.507812%20L%20113.660156%2018.507812%20L%20113.660156%2025.359375%20L%20131.054688%2025.359375%20Z%20M%20131.054688%2018.507812%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23ed8e03dbc0)'%3e%3cpath%20fill='%2384aff1'%20d='M%20131.15625%2027.984375%20L%20113.761719%2027.984375%20L%20113.761719%2034.835938%20L%20131.15625%2034.835938%20Z%20M%20131.15625%2027.984375%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23a887c078d4)'%3e%3cpath%20fill='%2384aff1'%20d='M%20151.289062%2018.574219%20L%20133.894531%2018.574219%20L%20133.894531%2025.429688%20L%20151.289062%2025.429688%20Z%20M%20151.289062%2018.574219%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%232e1313b8e1)'%3e%3cpath%20fill='%2384aff1'%20d='M%20151.417969%2027.742188%20L%20134.023438%2027.742188%20L%20134.023438%2034.59375%20L%20151.417969%2034.59375%20Z%20M%20151.417969%2027.742188%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2321653efc97)'%3e%3cpath%20fill='url(%23f20bcca9a3)'%20d='M%20133.839844%208.570312%20L%20133.839844%2015.78125%20L%20150.78125%2015.78125%20L%20150.78125%208.570312%20Z%20M%20133.839844%208.570312%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(7.407211,%2017.93532)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(11.901125,%2017.93532)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(7.303632,%2027.306779)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(11.797546,%2027.306779)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(7.190188,%2036.692702)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(11.684102,%2036.692702)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(27.560215,%208.212119)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(32.274384,%208.212119)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(47.972226,%208.217777)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(52.686396,%208.217777)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(9.753033,%207.918055)'%3e%3cg%3e%3cpath%20d='M%203.859375%20-4.8125%20L%203.859375%20-4.015625%20L%202.46875%20-4.015625%20L%202.46875%200%20L%201.515625%200%20L%201.515625%20-4.015625%20L%200.125%20-4.015625%20L%200.125%20-4.8125%20Z%20M%203.859375%20-4.8125%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(30.04217,%2017.666008)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(51.130956,%2017.93532)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(29.701344,%2027.306779)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(50.911466,%2027.435567)'%3e%3cg%3e%3cpath%20d='M%203.265625%200%20L%202.359375%200%20L%202.359375%20-1.046875%20L%200.171875%20-1.046875%20L%200.171875%20-1.8125%20L%202.046875%20-4.8125%20L%203.265625%20-4.8125%20L%203.265625%20-1.8125%20L%204%20-1.8125%20L%204%20-1.046875%20L%203.265625%20-1.046875%20Z%20M%201.140625%20-1.875%20L%201.171875%20-1.8125%20L%202.359375%20-1.8125%20L%202.359375%20-3.671875%20L%202.28125%20-3.6875%20Z%20M%201.140625%20-1.875%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(29.891734,%2036.692702)'%3e%3cg%3e%3cpath%20d='M%202%200.0625%20C%201.519531%200.0625%201.140625%20-0.0351562%200.859375%20-0.234375%20C%200.578125%20-0.429688%200.394531%20-0.710938%200.3125%20-1.078125%20L%201.03125%20-1.390625%20L%201.109375%20-1.390625%20C%201.171875%20-1.171875%201.269531%20-1.007812%201.40625%20-0.90625%20C%201.550781%20-0.800781%201.75%20-0.75%202%20-0.75%20C%202.25%20-0.75%202.441406%20-0.816406%202.578125%20-0.953125%20C%202.710938%20-1.097656%202.78125%20-1.3125%202.78125%20-1.59375%20C%202.78125%20-1.875%202.710938%20-2.085938%202.578125%20-2.234375%20C%202.441406%20-2.378906%202.253906%20-2.453125%202.015625%20-2.453125%20C%201.835938%20-2.453125%201.6875%20-2.410156%201.5625%20-2.328125%20C%201.445312%20-2.253906%201.347656%20-2.144531%201.265625%20-2%20L%200.484375%20-2.046875%20L%200.578125%20-4.8125%20L%203.453125%20-4.8125%20L%203.453125%20-4.015625%20L%201.390625%20-4.015625%20L%201.34375%20-2.78125%20L%201.40625%20-2.765625%20C%201.519531%20-2.910156%201.65625%20-3.019531%201.8125%20-3.09375%20C%201.96875%20-3.175781%202.15625%20-3.21875%202.375%20-3.21875%20C%202.644531%20-3.21875%202.878906%20-3.15625%203.078125%20-3.03125%20C%203.285156%20-2.90625%203.445312%20-2.722656%203.5625%20-2.484375%20C%203.675781%20-2.242188%203.734375%20-1.953125%203.734375%20-1.609375%20C%203.734375%20-1.253906%203.664062%20-0.953125%203.53125%20-0.703125%20C%203.394531%20-0.453125%203.195312%20-0.257812%202.9375%20-0.125%20C%202.675781%200%202.363281%200.0625%202%200.0625%20Z%20M%202%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(50.672254,%2036.760669)'%3e%3cg%3e%3cpath%20d='M%202.296875%200.0625%20C%201.929688%200.0625%201.609375%20-0.0195312%201.328125%20-0.1875%20C%201.046875%20-0.351562%200.820312%20-0.613281%200.65625%20-0.96875%20C%200.488281%20-1.332031%200.40625%20-1.796875%200.40625%20-2.359375%20C%200.40625%20-2.929688%200.492188%20-3.40625%200.671875%20-3.78125%20C%200.847656%20-4.15625%201.085938%20-4.429688%201.390625%20-4.609375%20C%201.691406%20-4.785156%202.039062%20-4.875%202.4375%20-4.875%20C%202.757812%20-4.875%203.035156%20-4.828125%203.265625%20-4.734375%20C%203.503906%20-4.640625%203.691406%20-4.5%203.828125%20-4.3125%20L%203.359375%20-3.71875%20L%203.28125%20-3.71875%20C%203.070312%20-3.957031%202.789062%20-4.078125%202.4375%20-4.078125%20C%201.75%20-4.078125%201.394531%20-3.578125%201.375%20-2.578125%20L%201.453125%20-2.546875%20C%201.566406%20-2.753906%201.710938%20-2.910156%201.890625%20-3.015625%20C%202.078125%20-3.128906%202.304688%20-3.1875%202.578125%20-3.1875%20C%202.878906%20-3.1875%203.140625%20-3.125%203.359375%20-3%20C%203.578125%20-2.875%203.742188%20-2.691406%203.859375%20-2.453125%20C%203.972656%20-2.222656%204.03125%20-1.945312%204.03125%20-1.625%20C%204.03125%20-1.269531%203.957031%20-0.960938%203.8125%20-0.703125%20C%203.675781%20-0.453125%203.476562%20-0.257812%203.21875%20-0.125%20C%202.957031%200%202.648438%200.0625%202.296875%200.0625%20Z%20M%202.28125%20-0.75%20C%202.53125%20-0.75%202.722656%20-0.820312%202.859375%20-0.96875%20C%203.003906%20-1.113281%203.078125%20-1.316406%203.078125%20-1.578125%20C%203.078125%20-1.835938%203.003906%20-2.039062%202.859375%20-2.1875%20C%202.722656%20-2.332031%202.53125%20-2.40625%202.28125%20-2.40625%20C%202.113281%20-2.40625%201.96875%20-2.367188%201.84375%20-2.296875%20C%201.726562%20-2.234375%201.632812%20-2.140625%201.5625%20-2.015625%20C%201.5%20-1.890625%201.46875%20-1.742188%201.46875%20-1.578125%20C%201.46875%20-1.316406%201.539062%20-1.113281%201.6875%20-0.96875%20C%201.832031%20-0.820312%202.03125%20-0.75%202.28125%20-0.75%20Z%20M%202.28125%20-0.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(77.343314,%2024.219007)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(82.057484,%2024.219007)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(77.239735,%2033.590469)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(81.953905,%2033.590469)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(97.713335,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(102.207249,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(118.130283,%2014.501465)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(122.624198,%2014.501465)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(79.797647,%2014.201743)'%3e%3cg%3e%3cpath%20d='M%203.859375%20-4.8125%20L%203.859375%20-4.015625%20L%202.46875%20-4.015625%20L%202.46875%200%20L%201.515625%200%20L%201.515625%20-4.015625%20L%200.125%20-4.015625%20L%200.125%20-4.8125%20Z%20M%203.859375%20-4.8125%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(100.086779,%2023.949696)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(100.914058,%2033.988566)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(120.169809,%2023.820908)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(121.023713,%2033.425191)'%3e%3cg%3e%3cpath%20d='M%203.265625%200%20L%202.359375%200%20L%202.359375%20-1.046875%20L%200.171875%20-1.046875%20L%200.171875%20-1.8125%20L%202.046875%20-4.8125%20L%203.265625%20-4.8125%20L%203.265625%20-1.8125%20L%204%20-1.8125%20L%204%20-1.046875%20L%203.265625%20-1.046875%20Z%20M%201.140625%20-1.875%20L%201.171875%20-1.8125%20L%202.359375%20-1.8125%20L%202.359375%20-3.671875%20L%202.28125%20-3.6875%20Z%20M%201.140625%20-1.875%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(140.594644,%2023.949696)'%3e%3cg%3e%3cpath%20d='M%202%200.0625%20C%201.519531%200.0625%201.140625%20-0.0351562%200.859375%20-0.234375%20C%200.578125%20-0.429688%200.394531%20-0.710938%200.3125%20-1.078125%20L%201.03125%20-1.390625%20L%201.109375%20-1.390625%20C%201.171875%20-1.171875%201.269531%20-1.007812%201.40625%20-0.90625%20C%201.550781%20-0.800781%201.75%20-0.75%202%20-0.75%20C%202.25%20-0.75%202.441406%20-0.816406%202.578125%20-0.953125%20C%202.710938%20-1.097656%202.78125%20-1.3125%202.78125%20-1.59375%20C%202.78125%20-1.875%202.710938%20-2.085938%202.578125%20-2.234375%20C%202.441406%20-2.378906%202.253906%20-2.453125%202.015625%20-2.453125%20C%201.835938%20-2.453125%201.6875%20-2.410156%201.5625%20-2.328125%20C%201.445312%20-2.253906%201.347656%20-2.144531%201.265625%20-2%20L%200.484375%20-2.046875%20L%200.578125%20-4.8125%20L%203.453125%20-4.8125%20L%203.453125%20-4.015625%20L%201.390625%20-4.015625%20L%201.34375%20-2.78125%20L%201.40625%20-2.765625%20C%201.519531%20-2.910156%201.65625%20-3.019531%201.8125%20-3.09375%20C%201.96875%20-3.175781%202.15625%20-3.21875%202.375%20-3.21875%20C%202.644531%20-3.21875%202.878906%20-3.15625%203.078125%20-3.03125%20C%203.285156%20-2.90625%203.445312%20-2.722656%203.5625%20-2.484375%20C%203.675781%20-2.242188%203.734375%20-1.953125%203.734375%20-1.609375%20C%203.734375%20-1.253906%203.664062%20-0.953125%203.53125%20-0.703125%20C%203.394531%20-0.453125%203.195312%20-0.257812%202.9375%20-0.125%20C%202.675781%200%202.363281%200.0625%202%200.0625%20Z%20M%202%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(141.109147,%2033.184927)'%3e%3cg%3e%3cpath%20d='M%202.296875%200.0625%20C%201.929688%200.0625%201.609375%20-0.0195312%201.328125%20-0.1875%20C%201.046875%20-0.351562%200.820312%20-0.613281%200.65625%20-0.96875%20C%200.488281%20-1.332031%200.40625%20-1.796875%200.40625%20-2.359375%20C%200.40625%20-2.929688%200.492188%20-3.40625%200.671875%20-3.78125%20C%200.847656%20-4.15625%201.085938%20-4.429688%201.390625%20-4.609375%20C%201.691406%20-4.785156%202.039062%20-4.875%202.4375%20-4.875%20C%202.757812%20-4.875%203.035156%20-4.828125%203.265625%20-4.734375%20C%203.503906%20-4.640625%203.691406%20-4.5%203.828125%20-4.3125%20L%203.359375%20-3.71875%20L%203.28125%20-3.71875%20C%203.070312%20-3.957031%202.789062%20-4.078125%202.4375%20-4.078125%20C%201.75%20-4.078125%201.394531%20-3.578125%201.375%20-2.578125%20L%201.453125%20-2.546875%20C%201.566406%20-2.753906%201.710938%20-2.910156%201.890625%20-3.015625%20C%202.078125%20-3.128906%202.304688%20-3.1875%202.578125%20-3.1875%20C%202.878906%20-3.1875%203.140625%20-3.125%203.359375%20-3%20C%203.578125%20-2.875%203.742188%20-2.691406%203.859375%20-2.453125%20C%203.972656%20-2.222656%204.03125%20-1.945312%204.03125%20-1.625%20C%204.03125%20-1.269531%203.957031%20-0.960938%203.8125%20-0.703125%20C%203.675781%20-0.453125%203.476562%20-0.257812%203.21875%20-0.125%20C%202.957031%200%202.648438%200.0625%202.296875%200.0625%20Z%20M%202.28125%20-0.75%20C%202.53125%20-0.75%202.722656%20-0.820312%202.859375%20-0.96875%20C%203.003906%20-1.113281%203.078125%20-1.316406%203.078125%20-1.578125%20C%203.078125%20-1.835938%203.003906%20-2.039062%202.859375%20-2.1875%20C%202.722656%20-2.332031%202.53125%20-2.40625%202.28125%20-2.40625%20C%202.113281%20-2.40625%201.96875%20-2.367188%201.84375%20-2.296875%20C%201.726562%20-2.234375%201.632812%20-2.140625%201.5625%20-2.015625%20C%201.5%20-1.890625%201.46875%20-1.742188%201.46875%20-1.578125%20C%201.46875%20-1.316406%201.539062%20-1.113281%201.6875%20-0.96875%20C%201.832031%20-0.820312%202.03125%20-0.75%202.28125%20-0.75%20Z%20M%202.28125%20-0.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(138.251285,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(142.7452,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cpath%20fill='%23ccccdc'%20d='M%2065.773438%2025.683594%20C%2066.277344%2025.683594%2070.136719%2022.800781%2070.136719%2021.359375%20C%2070.136719%2019.914062%2066.375%2017.03125%2065.773438%2017.03125%20C%2065.175781%2017.03125%2064.6875%2017.390625%2064.6875%2018.09375%20C%2064.6875%2018.796875%2067.222656%2020.578125%2067.222656%2020.578125%20C%2067.222656%2020.578125%2061.683594%2020.09375%2061.5%2020.578125%20C%2061.316406%2021.0625%2061.316406%2021.652344%2061.5%2022.136719%20C%2061.683594%2022.621094%2067.222656%2022.136719%2067.222656%2022.136719%20C%2067.222656%2022.136719%2064.6875%2024.0625%2064.6875%2024.625%20C%2064.6875%2025.1875%2065.273438%2025.683594%2065.773438%2025.683594%20Z%20M%2065.773438%2025.683594%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/svg%3e";
const __vite_glob_0_35 = "data:image/svg+xml,%3csvg%20width='101'%20height='48'%20viewBox='0%200%20101%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H31V0H1.29545C0.951872%200%200.62237%200.109659%200.379427%200.304853C0.136484%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126353)'/%3e%3cpath%20d='M31%2017H0V48H31V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M17%2029.5H15.0954L13%2030.7266V32.3984L14.9004%2031.3047H14.9502V37.5H17V29.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M66%200H35V13H66V0Z'%20fill='url(%23paint1_linear_1248_126353)'/%3e%3cpath%20d='M66%2017H35V48H66V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48.1164%2037.5H54V35.9624H50.7788V35.9123L51.7296%2035.0414C53.4528%2033.5501%2053.903%2032.7909%2053.903%2031.8854C53.903%2030.4634%2052.7348%2029.5%2050.9301%2029.5C49.1721%2029.5%2047.9961%2030.5058%2048%2032.1127H49.8202C49.8202%2031.3998%2050.2626%2030.9875%2050.9224%2030.9875C51.5705%2030.9875%2052.0401%2031.3844%2052.0401%2032.0356C52.0401%2032.6252%2051.6675%2033.026%2051.0155%2033.6079L48.1164%2036.1281V37.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M70%2013H101V1.04083C101%200.764787%20100.864%200.500047%20100.621%200.304853C100.378%200.109659%20100.048%200%2099.7046%200L70%200V13Z'%20fill='url(%23paint2_linear_1248_126353)'/%3e%3cpath%20d='M101%2017H70V48H101V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M78%2029H76.0954L74%2030.2266V31.8984L75.9004%2030.8047H75.9502V37H78V29Z'%20fill='%2324292E'/%3e%3cpath%20d='M90.1164%2037H96V35.4624H92.7788V35.4123L93.7296%2034.5414C95.4528%2033.0501%2095.903%2032.2909%2095.903%2031.3854C95.903%2029.9634%2094.7348%2029%2092.9301%2029C91.1721%2029%2089.9961%2030.0058%2090%2031.6127H91.8202C91.8202%2030.8998%2092.2626%2030.4875%2092.9224%2030.4875C93.5705%2030.4875%2094.0401%2030.8844%2094.0401%2031.5356C94.0401%2032.1252%2093.6675%2032.526%2093.0155%2033.1079L90.1164%2035.6281V37Z'%20fill='%2324292E'/%3e%3cpath%20d='M83.7432%2036H85.2568V34.2568H87V32.7432H85.2568V31H83.7432V32.7432H82V34.2568H83.7432V36Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126353'%20x1='0'%20y1='6.5052'%20x2='31'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126353'%20x1='35'%20y1='6.5052'%20x2='66.013'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126353'%20x1='70'%20y1='6.5052'%20x2='101'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_36 = "data:image/svg+xml,%3csvg%20width='158'%20height='48'%20viewBox='0%200%20158%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_125975)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200%200%200%200C0%200%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_125975)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M27.3343%2030H30.674V25.674H35V22.3343H30.674V18H27.3343V22.3343H23V25.674H27.3343V30Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_125975)'%3e%3cpath%20d='M58%2026.5H43V39.5H58V26.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M43%2010.0408V22H58V9H43.6268C43.4606%209%2043.3011%209.10966%2043.1836%209.30485C43.066%209.50005%2043%209.76479%2043%2010.0408Z'%20fill='url(%23paint1_linear_1248_125975)'/%3e%3cpath%20d='M51.5%2030H50.0716L48.5%2030.9199V32.1738L49.9253%2031.3535H49.9627V36H51.5V30Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1248_125975)'%3e%3cpath%20d='M77%2026.5H62V39.5H77V26.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%2022H77V10.0408C77%209.76479%2076.934%209.50005%2076.8164%209.30485C76.6989%209.10966%2076.5394%209%2076.3732%209H62V22Z'%20fill='url(%23paint2_linear_1248_125975)'/%3e%3cpath%20d='M67.3373%2036H71.75V34.8468H69.3341V34.8092L70.0472%2034.1561C71.3396%2033.0376%2071.6772%2032.4682%2071.6772%2031.789C71.6772%2030.7225%2070.8011%2030%2069.4476%2030C68.129%2030%2067.2471%2030.7543%2067.25%2031.9595H68.6151C68.6151%2031.4249%2068.947%2031.1156%2069.4418%2031.1156C69.9279%2031.1156%2070.2801%2031.4133%2070.2801%2031.9017C70.2801%2032.3439%2070.0006%2032.6445%2069.5116%2033.0809L67.3373%2034.9711V36Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M85%2028.566H97V25.2034H85V28.566ZM85%2022.7966H97V19.434H85V22.7966Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip3_1248_125975)'%3e%3cpath%20d='M105%201.04083V13H120V0H105.627C105.461%200%20105.301%200.109659%20105.184%200.304853C105.066%200.500047%20105%200.764787%20105%201.04083Z'%20fill='url(%23paint3_linear_1248_125975)'/%3e%3cpath%20d='M120%2017.5H105V30.5H120V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M120%2035H105V48H120V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110.337%2044.5H114.75V43.3468H112.334V43.3092L113.047%2042.6561C114.34%2041.5376%20114.677%2040.9682%20114.677%2040.289C114.677%2039.2225%20113.801%2038.5%20112.448%2038.5C111.129%2038.5%20110.247%2039.2543%20110.25%2040.4595H111.615C111.615%2039.9249%20111.947%2039.6156%20112.442%2039.6156C112.928%2039.6156%20113.28%2039.9133%20113.28%2040.4017C113.28%2040.8439%20113.001%2041.1445%20112.512%2041.5809L110.337%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2021H112.072L110.5%2021.9199V23.1738L111.925%2022.3535H111.963V27H113.5V21Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1248_125975)'%3e%3cpath%20d='M139%2035H124V48H139V35Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M124.5%2035.5H138.5V47.5H124.5V35.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M124%201.04083V13H139V0H124.627C124.461%200%20124%200%20124%200C124%200%20124%200.764787%20124%201.04083Z'%20fill='url(%23paint4_linear_1248_125975)'/%3e%3cpath%20d='M139%2017.5H124V30.5H139V17.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M132.5%2021H131.072L129.5%2021.9199V23.1738L130.925%2022.3535H130.963V27H132.5V21Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip5_1248_125975)'%3e%3cpath%20d='M158%2017.5H143V30.5H158V17.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M143%2013H158V1.04083C158%200.764787%20157.934%200.500047%20157.816%200.304853C157.699%200.109659%20157.539%200%20157.373%200L143%200V13Z'%20fill='url(%23paint5_linear_1248_125975)'/%3e%3cpath%20d='M148.337%2027H152.75V25.8468H150.334V25.8092L151.047%2025.1561C152.34%2024.0376%20152.677%2023.4682%20152.677%2022.789C152.677%2021.7225%20151.801%2021%20150.448%2021C149.129%2021%20148.247%2021.7543%20148.25%2022.9595H149.615C149.615%2022.4249%20149.947%2022.1156%20150.442%2022.1156C150.928%2022.1156%20151.28%2022.4133%20151.28%2022.9017C151.28%2023.3439%20151.001%2023.6445%20150.512%2024.0809L148.337%2025.9711V27Z'%20fill='white'/%3e%3cpath%20d='M158%2035H143V48H158V35Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M143.5%2035.5H157.5V47.5H143.5V35.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_125975'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_125975'%20x1='43'%20y1='15.5052'%20x2='58'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_125975'%20x1='62'%20y1='15.5052'%20x2='77'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_125975'%20x1='105'%20y1='6.5052'%20x2='120'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_125975'%20x1='124'%20y1='6.5052'%20x2='139'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1248_125975'%20x1='143'%20y1='6.5052'%20x2='158'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_125975'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_125975'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(43%209)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_125975'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%209)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_125975'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(105)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1248_125975'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(124)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_1248_125975'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(143)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_37 = "data:image/svg+xml,%3csvg%20width='129'%20height='50'%20viewBox='0%200%20129%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126588)'%3e%3cpath%20d='M0%202.04083V14H24V1H1.00293C0.736933%201%200%201%200%201C0%201%200%201.76479%200%202.04083Z'%20fill='url(%23paint0_linear_1248_126588)'/%3e%3cpath%20d='M24%2018.5H0V31.5H24V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2036H0V49H24V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M3%2027.3182H4.56818V24.7727C4.56818%2024.392%204.76705%2024.1591%205.09091%2024.1591C5.41477%2024.1591%205.625%2024.392%205.625%2024.7727V27.3182H7.125V24.7727C7.125%2024.392%207.32386%2024.1591%207.64773%2024.1591C7.97159%2024.1591%208.18182%2024.392%208.18182%2024.7727V27.3182H9.75V24.375C9.75%2023.4801%209.17614%2022.8977%208.34091%2022.8977C7.69318%2022.8977%207.17045%2023.25%207.02273%2023.7841H6.97727C6.88636%2023.25%206.39773%2022.8977%205.78409%2022.8977C5.17898%2022.8977%204.71591%2023.2386%204.53409%2023.7841H4.48864V22.9545H3V27.3182Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.5234%2028.9545H12.0916V26.6023H12.1143C12.2962%2027.0455%2012.7166%2027.375%2013.3303%2027.375C14.2621%2027.375%2015.0462%2026.6477%2015.0462%2025.1364C15.0462%2023.5568%2014.2053%2022.8977%2013.3416%2022.8977C12.6939%2022.8977%2012.2848%2023.2727%2012.1143%2023.7159H12.0803V22.9545H10.5234V28.9545ZM12.0575%2025.1364C12.0575%2024.4886%2012.3189%2024.1023%2012.7507%2024.1023C13.1825%2024.1023%2013.4325%2024.4886%2013.4325%2025.1364C13.4325%2025.7841%2013.1825%2026.1705%2012.7507%2026.1705C12.3189%2026.1705%2012.0575%2025.7727%2012.0575%2025.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M17.2713%2024.8636C17.2741%2024.4318%2017.5241%2024.1705%2017.9077%2024.1705C18.3082%2024.1705%2018.5355%2024.4318%2018.5327%2024.8636V27.3182H20.1009V24.5341C20.1037%2023.5795%2019.5014%2022.8977%2018.5781%2022.8977C17.9332%2022.8977%2017.456%2023.2273%2017.2599%2023.7841H17.2145V21.5H15.7031V27.3182H17.2713V24.8636Z'%20fill='%2324292E'/%3e%3cpath%20d='M3%2044.8182H4.56818V42.2727C4.56818%2041.892%204.76705%2041.6591%205.09091%2041.6591C5.41477%2041.6591%205.625%2041.892%205.625%2042.2727V44.8182H7.125V42.2727C7.125%2041.892%207.32386%2041.6591%207.64773%2041.6591C7.97159%2041.6591%208.18182%2041.892%208.18182%2042.2727V44.8182H9.75V41.875C9.75%2040.9801%209.17614%2040.3977%208.34091%2040.3977C7.69318%2040.3977%207.17045%2040.75%207.02273%2041.2841H6.97727C6.88636%2040.75%206.39773%2040.3977%205.78409%2040.3977C5.17898%2040.3977%204.71591%2040.7386%204.53409%2041.2841H4.48864V40.4545H3V44.8182Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.5234%2046.4545H12.0916V44.1023H12.1143C12.2962%2044.5455%2012.7166%2044.875%2013.3303%2044.875C14.2621%2044.875%2015.0462%2044.1477%2015.0462%2042.6364C15.0462%2041.0568%2014.2053%2040.3977%2013.3416%2040.3977C12.6939%2040.3977%2012.2848%2040.7727%2012.1143%2041.2159H12.0803V40.4545H10.5234V46.4545ZM12.0575%2042.6364C12.0575%2041.9886%2012.3189%2041.6023%2012.7507%2041.6023C13.1825%2041.6023%2013.4325%2041.9886%2013.4325%2042.6364C13.4325%2043.2841%2013.1825%2043.6705%2012.7507%2043.6705C12.3189%2043.6705%2012.0575%2043.2727%2012.0575%2042.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M17.2713%2042.3636C17.2741%2041.9318%2017.5241%2041.6705%2017.9077%2041.6705C18.3082%2041.6705%2018.5355%2041.9318%2018.5327%2042.3636V44.8182H20.1009V42.0341C20.1037%2041.0795%2019.5014%2040.3977%2018.5781%2040.3977C17.9332%2040.3977%2017.456%2040.7273%2017.2599%2041.2841H17.2145V39H15.7031V44.8182H17.2713V42.3636Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126588)'%3e%3cpath%20d='M28%202.04083V14H43V1H28.6268C28.4606%201%2028%201%2028%201C28%201%2028%201.76479%2028%202.04083Z'%20fill='url(%23paint1_linear_1248_126588)'/%3e%3cpath%20d='M43%2018.5H28V31.5H43V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M43%2036H28V49H43V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M36.5%2022H35.0716L33.5%2022.9199V24.1738L34.9253%2023.3535H34.9627V28H36.5V22Z'%20fill='%2324292E'/%3e%3cpath%20d='M33.0873%2045.5H37.5V44.3468H35.0841V44.3092L35.7972%2043.6561C37.0896%2042.5376%2037.4272%2041.9682%2037.4272%2041.289C37.4272%2040.2225%2036.5511%2039.5%2035.1976%2039.5C33.879%2039.5%2032.9971%2040.2543%2033%2041.4595H34.3651C34.3651%2040.9249%2034.697%2040.6156%2035.1918%2040.6156C35.6779%2040.6156%2036.0301%2040.9133%2036.0301%2041.4017C36.0301%2041.8439%2035.7506%2042.1445%2035.2616%2042.5809L33.0873%2044.4711V45.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3crect%20x='27.5'%20y='0.5'%20width='16'%20height='49'%20stroke='white'/%3e%3cpath%20d='M56.9067%2031C57.6011%2031%2062.9327%2027%2062.9327%2025C62.9327%2023%2057.7357%2019%2056.9067%2019C56.0778%2019%2055.4023%2019.5%2055.4023%2020.4756C55.4023%2021.4512%2058.9067%2023.9206%2058.9067%2023.9206C58.9067%2023.9206%2051.2539%2023.25%2051%2023.9206C50.7461%2024.5911%2050.7461%2025.4089%2051%2026.0794C51.2539%2026.75%2058.9067%2026.0794%2058.9067%2026.0794C58.9067%2026.0794%2055.4023%2028.75%2055.4023%2029.5301C55.4023%2030.3103%2056.2124%2031%2056.9067%2031Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126588)'%3e%3cpath%20d='M71%202.04083V14H95V1H72.0029C71.7369%201%2071%201%2071%201C71%201%2071%201.76479%2071%202.04083Z'%20fill='url(%23paint2_linear_1248_126588)'/%3e%3cpath%20d='M95%2018.5H71V31.5H95V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M95%2036H71V49H95V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M75%2027.3182H76.5682V24.7727C76.5682%2024.392%2076.767%2024.1591%2077.0909%2024.1591C77.4148%2024.1591%2077.625%2024.392%2077.625%2024.7727V27.3182H79.125V24.7727C79.125%2024.392%2079.3239%2024.1591%2079.6477%2024.1591C79.9716%2024.1591%2080.1818%2024.392%2080.1818%2024.7727V27.3182H81.75V24.375C81.75%2023.4801%2081.1761%2022.8977%2080.3409%2022.8977C79.6932%2022.8977%2079.1705%2023.25%2079.0227%2023.7841H78.9773C78.8864%2023.25%2078.3977%2022.8977%2077.7841%2022.8977C77.179%2022.8977%2076.7159%2023.2386%2076.5341%2023.7841H76.4886V22.9545H75V27.3182Z'%20fill='%2324292E'/%3e%3cpath%20d='M82.5234%2028.9545H84.0916V26.6023H84.1143C84.2962%2027.0455%2084.7166%2027.375%2085.3303%2027.375C86.2621%2027.375%2087.0462%2026.6477%2087.0462%2025.1364C87.0462%2023.5568%2086.2053%2022.8977%2085.3416%2022.8977C84.6939%2022.8977%2084.2848%2023.2727%2084.1143%2023.7159H84.0803V22.9545H82.5234V28.9545ZM84.0575%2025.1364C84.0575%2024.4886%2084.3189%2024.1023%2084.7507%2024.1023C85.1825%2024.1023%2085.4325%2024.4886%2085.4325%2025.1364C85.4325%2025.7841%2085.1825%2026.1705%2084.7507%2026.1705C84.3189%2026.1705%2084.0575%2025.7727%2084.0575%2025.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M89.2713%2024.8636C89.2741%2024.4318%2089.5241%2024.1705%2089.9077%2024.1705C90.3082%2024.1705%2090.5355%2024.4318%2090.5327%2024.8636V27.3182H92.1009V24.5341C92.1037%2023.5795%2091.5014%2022.8977%2090.5781%2022.8977C89.9332%2022.8977%2089.456%2023.2273%2089.2599%2023.7841H89.2145V21.5H87.7031V27.3182H89.2713V24.8636Z'%20fill='%2324292E'/%3e%3cpath%20d='M74%2044.8182H75.5682V42.2727C75.5682%2041.892%2075.767%2041.6591%2076.0909%2041.6591C76.4148%2041.6591%2076.625%2041.892%2076.625%2042.2727V44.8182H78.125V42.2727C78.125%2041.892%2078.3239%2041.6591%2078.6477%2041.6591C78.9716%2041.6591%2079.1818%2041.892%2079.1818%2042.2727V44.8182H80.75V41.875C80.75%2040.9801%2080.1761%2040.3977%2079.3409%2040.3977C78.6932%2040.3977%2078.1705%2040.75%2078.0227%2041.2841H77.9773C77.8864%2040.75%2077.3977%2040.3977%2076.7841%2040.3977C76.179%2040.3977%2075.7159%2040.7386%2075.5341%2041.2841H75.4886V40.4545H74V44.8182Z'%20fill='%2324292E'/%3e%3cpath%20d='M81.5234%2046.4545H83.0916V44.1023H83.1143C83.2962%2044.5455%2083.7166%2044.875%2084.3303%2044.875C85.2621%2044.875%2086.0462%2044.1477%2086.0462%2042.6364C86.0462%2041.0568%2085.2053%2040.3977%2084.3416%2040.3977C83.6939%2040.3977%2083.2848%2040.7727%2083.1143%2041.2159H83.0803V40.4545H81.5234V46.4545ZM83.0575%2042.6364C83.0575%2041.9886%2083.3189%2041.6023%2083.7507%2041.6023C84.1825%2041.6023%2084.4325%2041.9886%2084.4325%2042.6364C84.4325%2043.2841%2084.1825%2043.6705%2083.7507%2043.6705C83.3189%2043.6705%2083.0575%2043.2727%2083.0575%2042.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M88.2713%2042.3636C88.2741%2041.9318%2088.5241%2041.6705%2088.9077%2041.6705C89.3082%2041.6705%2089.5355%2041.9318%2089.5327%2042.3636V44.8182H91.1009V42.0341C91.1037%2041.0795%2090.5014%2040.3977%2089.5781%2040.3977C88.9332%2040.3977%2088.456%2040.7273%2088.2599%2041.2841H88.2145V39H86.7031V44.8182H88.2713V42.3636Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126588)'%3e%3cpath%20d='M99%202.04083V14H129V1H100.254C99.9212%201%2099%201%2099%201C99%201%2099%201.76479%2099%202.04083Z'%20fill='url(%23paint3_linear_1248_126588)'/%3e%3cpath%20d='M129%2018.5H99V31.5H129V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M129%2036H99V49H129V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M109%2027.3182H110.568V24.7727C110.568%2024.392%20110.767%2024.1591%20111.091%2024.1591C111.415%2024.1591%20111.625%2024.392%20111.625%2024.7727V27.3182H113.125V24.7727C113.125%2024.392%20113.324%2024.1591%20113.648%2024.1591C113.972%2024.1591%20114.182%2024.392%20114.182%2024.7727V27.3182H115.75V24.375C115.75%2023.4801%20115.176%2022.8977%20114.341%2022.8977C113.693%2022.8977%20113.17%2023.25%20113.023%2023.7841H112.977C112.886%2023.25%20112.398%2022.8977%20111.784%2022.8977C111.179%2022.8977%20110.716%2023.2386%20110.534%2023.7841H110.489V22.9545H109V27.3182Z'%20fill='%2324292E'/%3e%3cpath%20d='M116.523%2028.9545H118.092V26.6023H118.114C118.296%2027.0455%20118.717%2027.375%20119.33%2027.375C120.262%2027.375%20121.046%2026.6477%20121.046%2025.1364C121.046%2023.5568%20120.205%2022.8977%20119.342%2022.8977C118.694%2022.8977%20118.285%2023.2727%20118.114%2023.7159H118.08V22.9545H116.523V28.9545ZM118.058%2025.1364C118.058%2024.4886%20118.319%2024.1023%20118.751%2024.1023C119.183%2024.1023%20119.433%2024.4886%20119.433%2025.1364C119.433%2025.7841%20119.183%2026.1705%20118.751%2026.1705C118.319%2026.1705%20118.058%2025.7727%20118.058%2025.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M123.271%2024.8636C123.274%2024.4318%20123.524%2024.1705%20123.908%2024.1705C124.308%2024.1705%20124.536%2024.4318%20124.533%2024.8636V27.3182H126.101V24.5341C126.104%2023.5795%20125.501%2022.8977%20124.578%2022.8977C123.933%2022.8977%20123.456%2023.2273%20123.26%2023.7841H123.214V21.5H121.703V27.3182H123.271V24.8636Z'%20fill='%2324292E'/%3e%3cpath%20d='M109%2044.8182H110.568V42.2727C110.568%2041.892%20110.767%2041.6591%20111.091%2041.6591C111.415%2041.6591%20111.625%2041.892%20111.625%2042.2727V44.8182H113.125V42.2727C113.125%2041.892%20113.324%2041.6591%20113.648%2041.6591C113.972%2041.6591%20114.182%2041.892%20114.182%2042.2727V44.8182H115.75V41.875C115.75%2040.9801%20115.176%2040.3977%20114.341%2040.3977C113.693%2040.3977%20113.17%2040.75%20113.023%2041.2841H112.977C112.886%2040.75%20112.398%2040.3977%20111.784%2040.3977C111.179%2040.3977%20110.716%2040.7386%20110.534%2041.2841H110.489V40.4545H109V44.8182Z'%20fill='%2324292E'/%3e%3cpath%20d='M116.523%2046.4545H118.092V44.1023H118.114C118.296%2044.5455%20118.717%2044.875%20119.33%2044.875C120.262%2044.875%20121.046%2044.1477%20121.046%2042.6364C121.046%2041.0568%20120.205%2040.3977%20119.342%2040.3977C118.694%2040.3977%20118.285%2040.7727%20118.114%2041.2159H118.08V40.4545H116.523V46.4545ZM118.058%2042.6364C118.058%2041.9886%20118.319%2041.6023%20118.751%2041.6023C119.183%2041.6023%20119.433%2041.9886%20119.433%2042.6364C119.433%2043.2841%20119.183%2043.6705%20118.751%2043.6705C118.319%2043.6705%20118.058%2043.2727%20118.058%2042.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M123.271%2042.3636C123.274%2041.9318%20123.524%2041.6705%20123.908%2041.6705C124.308%2041.6705%20124.536%2041.9318%20124.533%2042.3636V44.8182H126.101V42.0341C126.104%2041.0795%20125.501%2040.3977%20124.578%2040.3977C123.933%2040.3977%20123.456%2040.7273%20123.26%2041.2841H123.214V39H121.703V44.8182H123.271V42.3636Z'%20fill='%2324292E'/%3e%3cpath%20d='M106%2021.5H104.572L103%2022.4199V23.6738L104.425%2022.8535H104.463V27.5H106V21.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M102.087%2045H106.5V43.8468H104.084V43.8092L104.797%2043.1561C106.09%2042.0376%20106.427%2041.4682%20106.427%2040.789C106.427%2039.7225%20105.551%2039%20104.198%2039C102.879%2039%20101.997%2039.7543%20102%2040.9595H103.365C103.365%2040.4249%20103.697%2040.1156%20104.192%2040.1156C104.678%2040.1156%20105.03%2040.4133%20105.03%2040.9017C105.03%2041.3439%20104.751%2041.6445%20104.262%2042.0809L102.087%2043.9711V45Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126588'%20x1='0'%20y1='7.5052'%20x2='24'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126588'%20x1='28'%20y1='7.5052'%20x2='43'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126588'%20x1='71'%20y1='7.5052'%20x2='95'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126588'%20x1='99'%20y1='7.5052'%20x2='129'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126588'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(0%201)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126588'%3e%3crect%20x='28'%20y='1'%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126588'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(71%201)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126588'%3e%3crect%20width='30'%20height='48'%20fill='white'%20transform='translate(99%201)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_38 = "data:image/svg+xml,%3csvg%20width='140'%20height='48'%20viewBox='0%200%20140%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126620)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.65%209.3H9.3V3.35C9.3%203.25717%209.26313%203.16815%209.19749%203.10251C9.13185%203.03687%209.04283%203%208.95%203H7.725C7.66392%203.00037%207.604%203.01672%207.5512%203.04742C7.49839%203.07812%207.45454%203.1221%207.424%203.175L3.8505%209.3H3.35C3.25717%209.3%203.16815%209.33687%203.10251%209.40251C3.03687%209.46815%203%209.55717%203%209.65C3%209.74283%203.03687%209.83185%203.10251%209.89749C3.16815%209.96313%203.25717%2010%203.35%2010H4.75C4.84283%2010%204.93185%209.96313%204.99749%209.89749C5.06313%209.83185%205.1%209.74283%205.1%209.65C5.1%209.55717%205.06313%209.46815%204.99749%209.40251C4.93185%209.33687%204.84283%209.3%204.75%209.3H4.659L5.884%207.2H8.6V9.3H8.25C8.15717%209.3%208.06815%209.33687%208.00251%209.40251C7.93687%209.46815%207.9%209.55717%207.9%209.65C7.9%209.74283%207.93687%209.83185%208.00251%209.89749C8.06815%209.96313%208.15717%2010%208.25%2010H9.65C9.74283%2010%209.83185%209.96313%209.89749%209.89749C9.96313%209.83185%2010%209.74283%2010%209.65C10%209.55717%209.96313%209.46815%209.89749%209.40251C9.83185%209.33687%209.74283%209.3%209.65%209.3ZM8.6%206.5H6.2935L7.9245%203.7H8.6V6.5Z'%20fill='white'/%3e%3cpath%20d='M23%2015.5H22.5V16V32V32.5H23H50H50.5V32V16V15.5H50H23Z'%20stroke='%2324292E'/%3e%3cpath%20d='M30.3747%2024.4872C30.3426%2023.7927%2029.7236%2023.3761%2028.7057%2023.3761C27.6992%2023.3761%2027.0779%2023.7607%2027.0825%2024.4444C27.0779%2024.9615%2027.4379%2025.2927%2028.1555%2025.4103L28.7791%2025.5128C29.0542%2025.5598%2029.178%2025.6282%2029.1826%2025.7521C29.178%2025.8889%2029.0106%2025.9658%2028.7791%2025.9658C28.4925%2025.9658%2028.2907%2025.8504%2028.2564%2025.641H27C27.0688%2026.3141%2027.6924%2026.7607%2028.7699%2026.7607C29.7443%2026.7607%2030.4618%2026.3184%2030.4664%2025.6154C30.4618%2025.1303%2030.1134%2024.8483%2029.3935%2024.7265L28.6782%2024.6068C28.41%2024.562%2028.3343%2024.4722%2028.3389%2024.3761C28.3343%2024.2393%2028.5154%2024.1624%2028.7332%2024.1624C28.9831%2024.1624%2029.1917%2024.2863%2029.2101%2024.4872H30.3747Z'%20fill='%2326262A'/%3e%3cpath%20d='M33.0513%2023.4188H32.4461V22.6325H31.1806V23.4188H30.7312V24.2735H31.1806V25.7564C31.1714%2026.4444%2031.6276%2026.7927%2032.5011%2026.7479C32.7877%2026.7329%2033.0009%2026.6773%2033.1155%2026.6453L32.9321%2025.8162C32.884%2025.8269%2032.7602%2025.8504%2032.6845%2025.8504C32.5195%2025.8504%2032.4461%2025.7821%2032.4461%2025.6453V24.2735H33.0513V23.4188Z'%20fill='%2326262A'/%3e%3cpath%20d='M33.5678%2026.7009H34.8333V24.9915C34.8333%2024.6154%2035.1107%2024.3675%2035.4844%2024.3675C35.6151%2024.3675%2035.826%2024.3868%2035.9521%2024.4274V23.4209C35.8512%2023.3932%2035.7411%2023.3761%2035.6311%2023.3761C35.2551%2023.3761%2034.9617%2023.5812%2034.8333%2024.0427H34.7966V23.4188H33.5678V26.7009Z'%20fill='%2326262A'/%3e%3cpath%20d='M36.367%2026.7009H37.6326V23.4188H36.367V26.7009ZM36.9998%2023.0769C37.3437%2023.0769%2037.6234%2022.8355%2037.6234%2022.5385C37.6234%2022.2415%2037.3437%2022%2036.9998%2022C36.6559%2022%2036.3762%2022.2415%2036.3762%2022.5385C36.3762%2022.8355%2036.6559%2023.0769%2036.9998%2023.0769Z'%20fill='%2326262A'/%3e%3cpath%20d='M39.5429%2024.8547C39.5452%2024.5299%2039.7423%2024.3333%2040.0564%2024.3333C40.3751%2024.3333%2040.5631%2024.5299%2040.5608%2024.8547V26.7009H41.8263V24.6068C41.8286%2023.8932%2041.3449%2023.3761%2040.5975%2023.3761C40.0793%2023.3761%2039.669%2023.6282%2039.5154%2024.0427H39.4787V23.4188H38.2773V26.7009H39.5429V24.8547Z'%20fill='%2326262A'/%3e%3cpath%20d='M44.1476%2028C45.2618%2028%2046%2027.5256%2046%2026.6923V23.4188H44.7345V23.9915H44.707C44.5694%2023.6581%2044.2393%2023.3761%2043.7166%2023.3761C43.0196%2023.3761%2042.341%2023.8718%2042.341%2025.0598C42.341%2026.1966%2042.9738%2026.6581%2043.7257%2026.6581C44.2026%2026.6581%2044.5786%2026.4701%2044.7161%2026.1368H44.7528V26.6923C44.7528%2027.0791%2044.5121%2027.2051%2044.1843%2027.2051C43.8931%2027.2051%2043.6799%2027.1239%2043.6432%2026.9145H42.4235C42.4717%2027.547%2043.0884%2028%2044.1476%2028ZM44.1934%2025.8205C43.8449%2025.8205%2043.6432%2025.547%2043.6432%2025.0598C43.6432%2024.5726%2043.8449%2024.2821%2044.1934%2024.2821C44.5419%2024.2821%2044.7528%2024.5726%2044.7528%2025.0598C44.7528%2025.5385%2044.5419%2025.8205%2044.1934%2025.8205Z'%20fill='%2326262A'/%3e%3cpath%20d='M63.9067%2030C64.6011%2030%2069.9327%2026%2069.9327%2024C69.9327%2022%2064.7357%2018%2063.9067%2018C63.0778%2018%2062.4023%2018.5%2062.4023%2019.4756C62.4023%2020.4512%2065.9067%2022.9206%2065.9067%2022.9206C65.9067%2022.9206%2058.2539%2022.25%2058%2022.9206C57.7461%2023.5911%2057.7461%2024.4089%2058%2025.0794C58.2539%2025.75%2065.9067%2025.0794%2065.9067%2025.0794C65.9067%2025.0794%2062.4023%2027.75%2062.4023%2028.5301C62.4023%2029.3103%2063.2124%2030%2063.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M78%201.04083V13H93V0H78.6268C78.4606%200%2078.3011%200.109659%2078.1836%200.304853C78.066%200.500047%2078%200.764787%2078%201.04083Z'%20fill='url(%23paint1_linear_1248_126620)'/%3e%3cpath%20d='M93%2017.5H78V30.5H93V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M93%2035H78V48H93V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M86.5%2021H85.0716L83.5%2021.9199V23.1738L84.9253%2022.3535H84.9627V27H86.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M83.3373%2044.5H87.75V43.3468H85.3341V43.3092L86.0472%2042.6561C87.3396%2041.5376%2087.6772%2040.9682%2087.6772%2040.289C87.6772%2039.2225%2086.8011%2038.5%2085.4476%2038.5C84.129%2038.5%2083.2471%2039.2543%2083.25%2040.4595H84.6151C84.6151%2039.9249%2084.947%2039.6156%2085.4418%2039.6156C85.9279%2039.6156%2086.2801%2039.9133%2086.2801%2040.4017C86.2801%2040.8439%2086.0006%2041.1445%2085.5116%2041.5809L83.3373%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126620)'%3e%3cpath%20d='M83.1733%205.06818H83.3523V5.24716C83.3523%205.3421%2083.39%205.43314%2083.4571%205.50027C83.5242%205.5674%2083.6153%205.60511%2083.7102%205.60511C83.8052%205.60511%2083.8962%205.5674%2083.9633%205.50027C84.0305%205.43314%2084.0682%205.3421%2084.0682%205.24716V5.06818H84.2472C84.3421%205.06818%2084.4331%205.03047%2084.5003%204.96334C84.5674%204.89621%2084.6051%204.80516%2084.6051%204.71023C84.6051%204.61529%2084.5674%204.52425%2084.5003%204.45712C84.4331%204.38999%2084.3421%204.35227%2084.2472%204.35227H84.0682V4.1733C84.0682%204.07836%2084.0305%203.98731%2083.9633%203.92018C83.8962%203.85305%2083.8052%203.81534%2083.7102%203.81534C83.6153%203.81534%2083.5242%203.85305%2083.4571%203.92018C83.39%203.98731%2083.3523%204.07836%2083.3523%204.1733V4.35227H83.1733C83.0784%204.35227%2082.9873%204.38999%2082.9202%204.45712C82.8531%204.52425%2082.8153%204.61529%2082.8153%204.71023C82.8153%204.80516%2082.8531%204.89621%2082.9202%204.96334C82.9873%205.03047%2083.0784%205.06818%2083.1733%205.06818ZM82.9514%209.04864C83.0184%209.11531%2083.1092%209.15273%2083.2037%209.15273C83.2983%209.15273%2083.389%209.11531%2083.4561%209.04864L83.7102%208.79449L83.9644%209.04864C84.0314%209.11531%2084.1222%209.15273%2084.2167%209.15273C84.3113%209.15273%2084.402%209.11531%2084.4691%209.04864C84.5358%208.98157%2084.5732%208.89085%2084.5732%208.79628C84.5732%208.70171%2084.5358%208.61099%2084.4691%208.54392L84.2149%208.28977L84.4691%208.03563C84.5277%207.96715%2084.5584%207.87906%2084.5549%207.78898C84.5514%207.69889%2084.5141%207.61343%2084.4503%207.54968C84.3866%207.48593%2084.3011%207.44858%2084.211%207.4451C84.1209%207.44162%2084.0329%207.47227%2083.9644%207.53091L83.7102%207.78506L83.4561%207.53091C83.3876%207.47227%2083.2995%207.44162%2083.2094%207.4451C83.1193%207.44858%2083.0339%207.48593%2082.9701%207.54968C82.9064%207.61343%2082.869%207.69889%2082.8656%207.78898C82.8621%207.87906%2082.8927%207.96715%2082.9514%208.03563L83.2055%208.28977L82.9514%208.54392C82.8847%208.61099%2082.8473%208.70171%2082.8473%208.79628C82.8473%208.89085%2082.8847%208.98157%2082.9514%209.04864V9.04864ZM88.3636%202.5625H82.6364C82.3516%202.5625%2082.0784%202.67564%2081.877%202.87703C81.6756%203.07842%2081.5625%203.35156%2081.5625%203.63636V9.36364C81.5625%209.64844%2081.6756%209.92159%2081.877%2010.123C82.0784%2010.3244%2082.3516%2010.4375%2082.6364%2010.4375H88.3636C88.6484%2010.4375%2088.9216%2010.3244%2089.123%2010.123C89.3244%209.92159%2089.4375%209.64844%2089.4375%209.36364V3.63636C89.4375%203.35156%2089.3244%203.07842%2089.123%202.87703C88.9216%202.67564%2088.6484%202.5625%2088.3636%202.5625V2.5625ZM85.142%209.72159H82.6364C82.5414%209.72159%2082.4504%209.68388%2082.3833%209.61675C82.3161%209.54962%2082.2784%209.45857%2082.2784%209.36364V6.85796H85.142V9.72159ZM85.142%206.14205H82.2784V3.63636C82.2784%203.54143%2082.3161%203.45038%2082.3833%203.38325C82.4504%203.31612%2082.5414%203.27841%2082.6364%203.27841H85.142V6.14205ZM88.7216%209.36364C88.7216%209.45857%2088.6839%209.54962%2088.6167%209.61675C88.5496%209.68388%2088.4586%209.72159%2088.3636%209.72159H85.858V6.85796H88.7216V9.36364ZM88.7216%206.14205H85.858V3.27841H88.3636C88.4586%203.27841%2088.5496%203.31612%2088.6167%203.38325C88.6839%203.45038%2088.7216%203.54143%2088.7216%203.63636V6.14205ZM86.7528%208.1108H87.8267C87.9216%208.1108%2088.0127%208.07308%2088.0798%208.00595C88.1469%207.93882%2088.1847%207.84778%2088.1847%207.75284C88.1847%207.65791%2088.1469%207.56686%2088.0798%207.49973C88.0127%207.4326%2087.9216%207.39489%2087.8267%207.39489H86.7528C86.6579%207.39489%2086.5669%207.4326%2086.4997%207.49973C86.4326%207.56686%2086.3949%207.65791%2086.3949%207.75284C86.3949%207.84778%2086.4326%207.93882%2086.4997%208.00595C86.5669%208.07308%2086.6579%208.1108%2086.7528%208.1108V8.1108ZM87.8267%204.35227H86.7528C86.6579%204.35227%2086.5669%204.38999%2086.4997%204.45712C86.4326%204.52425%2086.3949%204.61529%2086.3949%204.71023C86.3949%204.80516%2086.4326%204.89621%2086.4997%204.96334C86.5669%205.03047%2086.6579%205.06818%2086.7528%205.06818H87.8267C87.9216%205.06818%2088.0127%205.03047%2088.0798%204.96334C88.1469%204.89621%2088.1847%204.80516%2088.1847%204.71023C88.1847%204.61529%2088.1469%204.52425%2088.0798%204.45712C88.0127%204.38999%2087.9216%204.35227%2087.8267%204.35227ZM86.7528%209.18466H87.8267C87.9216%209.18466%2088.0127%209.14695%2088.0798%209.07982C88.1469%209.01269%2088.1847%208.92164%2088.1847%208.82671C88.1847%208.73177%2088.1469%208.64072%2088.0798%208.57359C88.0127%208.50646%2087.9216%208.46875%2087.8267%208.46875H86.7528C86.6579%208.46875%2086.5669%208.50646%2086.4997%208.57359C86.4326%208.64072%2086.3949%208.73177%2086.3949%208.82671C86.3949%208.92164%2086.4326%209.01269%2086.4997%209.07982C86.5669%209.14695%2086.6579%209.18466%2086.7528%209.18466V9.18466Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M101%2015.5H100.5V16V32V32.5H101H137H137.5V32V16V15.5H137H101Z'%20stroke='%2324292E'/%3e%3cpath%20d='M106.339%2024.4629C106.341%2024.1258%20106.55%2023.9218%20106.882%2023.9218C107.219%2023.9218%20107.418%2024.1258%20107.416%2024.4629V26.3791H108.754V24.2057C108.757%2023.4649%20108.245%2022.9282%20107.454%2022.9282C106.906%2022.9282%20106.472%2023.1899%20106.31%2023.6202H106.271V22.9726H105V26.3791H106.339V24.4629Z'%20fill='%2326262A'/%3e%3cpath%20d='M111.831%2024.8887C111.833%2025.2258%20111.62%2025.4299%20111.288%2025.4299C110.95%2025.4299%20110.756%2025.2258%20110.754%2024.8887V22.9726H109.415V25.146C109.418%2025.8912%20109.932%2026.4234%20110.715%2026.4234C111.271%2026.4234%20111.697%2026.1662%20111.86%2025.7315H111.899V26.3791H113.17V22.9726H111.831V24.8887Z'%20fill='%2326262A'/%3e%3cpath%20d='M113.85%2026.3791H115.189V24.392C115.189%2024.0948%20115.359%2023.9129%20115.636%2023.9129C115.912%2023.9129%20116.091%2024.0948%20116.091%2024.392V26.3791H117.372V24.392C117.372%2024.0948%20117.542%2023.9129%20117.818%2023.9129C118.095%2023.9129%20118.274%2024.0948%20118.274%2024.392V26.3791H119.613V24.0815C119.613%2023.3829%20119.123%2022.9282%20118.41%2022.9282C117.857%2022.9282%20117.411%2023.2032%20117.285%2023.6202H117.246C117.168%2023.2032%20116.751%2022.9282%20116.227%2022.9282C115.711%2022.9282%20115.315%2023.1944%20115.16%2023.6202H115.121V22.9726H113.85V26.3791Z'%20fill='%2326262A'/%3e%3cpath%20d='M122.058%2026.4412C123.091%2026.4412%20123.756%2025.9888%20123.882%2025.2791H122.66C122.582%2025.472%20122.361%2025.5807%20122.087%2025.5807C121.69%2025.5807%20121.457%2025.3412%20121.457%2025.0129V24.9597H123.882V24.6758C123.882%2023.5914%20123.155%2022.9282%20122.029%2022.9282C120.875%2022.9282%20120.137%2023.6291%20120.137%2024.6847C120.137%2025.7869%20120.865%2026.4412%20122.058%2026.4412ZM121.457%2024.2855C121.464%2023.9905%20121.731%2023.7887%20122.058%2023.7887C122.391%2023.7887%20122.643%2023.9928%20122.65%2024.2855H121.457Z'%20fill='%2326262A'/%3e%3cpath%20d='M124.428%2026.3791H125.767V24.6049C125.767%2024.2145%20126.061%2023.9573%20126.456%2023.9573C126.594%2023.9573%20126.817%2023.9772%20126.951%2024.0194V22.9748C126.844%2022.946%20126.728%2022.9282%20126.611%2022.9282C126.213%2022.9282%20125.903%2023.1411%20125.767%2023.6202H125.728V22.9726H124.428V26.3791Z'%20fill='%2326262A'/%3e%3cpath%20d='M127.39%2026.3791H128.728V22.9726H127.39V26.3791ZM128.059%2022.6178C128.423%2022.6178%20128.719%2022.3671%20128.719%2022.0589C128.719%2021.7506%20128.423%2021.5%20128.059%2021.5C127.695%2021.5%20127.399%2021.7506%20127.399%2022.0589C127.399%2022.3671%20127.695%2022.6178%20128.059%2022.6178Z'%20fill='%2326262A'/%3e%3cpath%20d='M131.205%2026.4412C132.309%2026.4412%20132.985%2025.8623%20133%2024.9597H131.758C131.729%2025.3168%20131.518%2025.5097%20131.225%2025.5097C130.873%2025.5097%20130.643%2025.2347%20130.643%2024.6758C130.643%2024.117%20130.873%2023.842%20131.225%2023.842C131.521%2023.842%20131.722%2024.0349%20131.758%2024.392H133C132.993%2023.5049%20132.302%2022.9282%20131.205%2022.9282C129.993%2022.9282%20129.275%2023.6379%20129.275%2024.6847C129.275%2025.7315%20129.993%2026.4412%20131.205%2026.4412Z'%20fill='%2326262A'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126620'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126620'%20x1='78'%20y1='6.5052'%20x2='93'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126620'%3e%3crect%20width='9'%20height='9'%20fill='white'%20transform='translate(81%202)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_39 = "data:image/svg+xml,%3csvg%20width='102'%20height='48'%20viewBox='0%200%20102%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126563)'%3e%3cpath%20d='M0%201.04083V13H40V0H1.67154C1.22822%200%200%200%200%200C0%200%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126563)'/%3e%3cpath%20d='M40%2017.5H0V30.5H40V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M40%2035H0V48H40V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13.75%205.45455H12.1023L11.3977%208.34091H11.3523L10.6477%205.45455H9L10.4659%209.81818H12.2841L13.75%205.45455Z'%20fill='%2324292E'/%3e%3cpath%20d='M15.2947%209.88636C15.8629%209.88636%2016.2919%209.69318%2016.5561%209.20455H16.5902V9.81818H18.0561V6.82955C18.0561%206.02273%2017.2919%205.39773%2016.0447%205.39773C14.7408%205.39773%2014.0987%206.07955%2014.0447%206.875H15.4879C15.5249%206.60511%2015.7237%206.47727%2016.022%206.47727C16.2947%206.47727%2016.4879%206.60227%2016.4879%206.82955V6.84091C16.4879%207.09375%2016.2095%207.1733%2015.4766%207.22727C14.576%207.29261%2013.8743%207.65625%2013.8743%208.61364C13.8743%209.48295%2014.4595%209.88636%2015.2947%209.88636ZM15.8061%208.89773C15.5391%208.89773%2015.3516%208.76705%2015.3516%208.52273C15.3516%208.2983%2015.5107%208.125%2015.8743%208.06818C16.1243%208.02841%2016.3345%207.97727%2016.4993%207.90909V8.27273C16.4993%208.67045%2016.1612%208.89773%2015.8061%208.89773Z'%20fill='%2324292E'/%3e%3cpath%20d='M20.3736%204H18.8054V9.81818H20.3736V4Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.0021%207.90909C24.005%208.34091%2023.755%208.60227%2023.3658%208.60227C22.9709%208.60227%2022.7436%208.34091%2022.7408%207.90909V5.45455H21.1726V8.23864C21.1754%209.19318%2021.7777%209.875%2022.6953%209.875C23.3459%209.875%2023.8459%209.54545%2024.0362%208.98864H24.0817V9.81818H25.5703V5.45455H24.0021V7.90909Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.4588%209.89773C29.669%209.89773%2030.4474%209.31818%2030.5952%208.40909H29.1634C29.0724%208.65625%2028.8139%208.79545%2028.4929%208.79545C28.027%208.79545%2027.7543%208.48864%2027.7543%208.06818V8H30.5952V7.63636C30.5952%206.24716%2029.7429%205.39773%2028.4247%205.39773C27.0724%205.39773%2026.2088%206.29545%2026.2088%207.64773C26.2088%209.05966%2027.0611%209.89773%2028.4588%209.89773ZM27.7543%207.13636C27.7628%206.75852%2028.0753%206.5%2028.4588%206.5C28.848%206.5%2029.1435%206.76136%2029.152%207.13636H27.7543Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.18182%2027.7955V26.6591C5.5%2026.6591%205.40909%2026.429%205.40909%2025.9545V25.3295C5.40909%2024.9063%205.19318%2024.483%204.25%2024.2955V24.1591C5.19318%2023.9716%205.40909%2023.5483%205.40909%2023.125V22.5C5.40909%2022.0256%205.5%2021.7955%206.18182%2021.7955V20.6591C5.01136%2020.6591%203.88636%2020.6591%203.88636%2022.2955V22.7386C3.88636%2023.2955%203.66477%2023.5455%203%2023.5455V24.9091C3.66477%2024.9091%203.88636%2025.1591%203.88636%2025.7159V26.1591C3.88636%2027.7955%205.01136%2027.7955%206.18182%2027.7955Z'%20fill='%2324292E'/%3e%3cpath%20d='M7.92116%2026.5455C8.48935%2026.5455%208.91832%2026.3523%209.18253%2025.8636H9.21662V26.4773H10.6825V23.4886C10.6825%2022.6818%209.91832%2022.0568%208.67116%2022.0568C7.36719%2022.0568%206.72514%2022.7386%206.67116%2023.5341H8.11435C8.15128%2023.2642%208.35014%2023.1364%208.64844%2023.1364C8.92116%2023.1364%209.11435%2023.2614%209.11435%2023.4886V23.5C9.11435%2023.7528%208.83594%2023.8324%208.10298%2023.8864C7.20241%2023.9517%206.50071%2024.3153%206.50071%2025.2727C6.50071%2026.142%207.08594%2026.5455%207.92116%2026.5455ZM8.43253%2025.5568C8.16548%2025.5568%207.97798%2025.4261%207.97798%2025.1818C7.97798%2024.9574%208.13707%2024.7841%208.50071%2024.7273C8.75071%2024.6875%208.96094%2024.6364%209.12571%2024.5682V24.9318C9.12571%2025.3295%208.78764%2025.5568%208.43253%2025.5568Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.2841%2026.5682C12.7017%2026.5682%2013.0739%2026.2159%2013.0795%2025.7727C13.0739%2025.3409%2012.7017%2024.9886%2012.2841%2024.9886C11.8438%2024.9886%2011.483%2025.3409%2011.4886%2025.7727C11.483%2026.2159%2011.8438%2026.5682%2012.2841%2026.5682ZM12.2841%2023.6364C12.7017%2023.6364%2013.0739%2023.2841%2013.0795%2022.8409C13.0739%2022.4091%2012.7017%2022.0568%2012.2841%2022.0568C11.8438%2022.0568%2011.483%2022.4091%2011.4886%2022.8409C11.483%2023.2841%2011.8438%2023.6364%2012.2841%2023.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M16.7727%2020.6591H15.3182L13.8864%2021.5341V22.875L15.1591%2022.1136H15.1932V26.4773H16.7727V20.6591Z'%20fill='%2324292E'/%3e%3cpath%20d='M19.2202%2025.6818H18.0384V26C18.0384%2026.7727%2017.777%2027.5824%2017.6861%2027.8977H18.652C18.7884%2027.5824%2019.1378%2026.821%2019.1974%2026L19.2202%2025.6818Z'%20fill='%2324292E'/%3e%3cpath%20d='M21.3622%2026.4773H22.919V25.7614H22.9531C23.1349%2026.2045%2023.5554%2026.5341%2024.169%2026.5341C25.1009%2026.5341%2025.8849%2025.8068%2025.8849%2024.2955C25.8849%2022.7159%2025.044%2022.0568%2024.1804%2022.0568C23.5327%2022.0568%2023.1236%2022.4318%2022.9531%2022.875H22.9304V20.6591H21.3622V26.4773ZM22.8963%2024.2955C22.8963%2023.6477%2023.1577%2023.2614%2023.5895%2023.2614C24.0213%2023.2614%2024.2713%2023.6477%2024.2713%2024.2955C24.2713%2024.9432%2024.0213%2025.3295%2023.5895%2025.3295C23.1577%2025.3295%2022.8963%2024.9318%2022.8963%2024.2955Z'%20fill='%2324292E'/%3e%3cpath%20d='M27.3935%2026.5682C27.8111%2026.5682%2028.1832%2026.2159%2028.1889%2025.7727C28.1832%2025.3409%2027.8111%2024.9886%2027.3935%2024.9886C26.9531%2024.9886%2026.5923%2025.3409%2026.598%2025.7727C26.5923%2026.2159%2026.9531%2026.5682%2027.3935%2026.5682ZM27.3935%2023.6364C27.8111%2023.6364%2028.1832%2023.2841%2028.1889%2022.8409C28.1832%2022.4091%2027.8111%2022.0568%2027.3935%2022.0568C26.9531%2022.0568%2026.5923%2022.4091%2026.598%2022.8409C26.5923%2023.2841%2026.9531%2023.6364%2027.3935%2023.6364Z'%20fill='%2324292E'/%3e%3cpath%20d='M29.0298%2026.4773H33.4957V25.2159H31.223V25.1818L31.7685%2024.7273C33.0952%2023.6222%2033.4332%2023.0483%2033.4332%2022.375C33.4332%2021.2898%2032.544%2020.5795%2031.1491%2020.5795C29.794%2020.5795%2028.9134%2021.3324%2028.9162%2022.5568H30.4162C30.4134%2022.0682%2030.7116%2021.7955%2031.1491%2021.7955C31.5838%2021.7955%2031.8935%2022.0653%2031.8935%2022.5114C31.8935%2022.9233%2031.6293%2023.1903%2031.2003%2023.5455L29.0298%2025.3409V26.4773Z'%20fill='%2324292E'/%3e%3cpath%20d='M33.9403%2020V21.1364C34.6222%2021.1364%2034.7131%2021.3665%2034.7131%2021.8409V22.4659C34.7131%2022.8892%2034.929%2023.3125%2035.8722%2023.5V23.6364C34.929%2023.8239%2034.7131%2024.2472%2034.7131%2024.6705V25.2955C34.7131%2025.7699%2034.6222%2026%2033.9403%2026V27.1364C35.1108%2027.1364%2036.2358%2027.1364%2036.2358%2025.5V25.0568C36.2358%2024.5%2036.4574%2024.25%2037.1222%2024.25V22.8864C36.4574%2022.8864%2036.2358%2022.6364%2036.2358%2022.0795V21.6364C36.2358%2020%2035.1108%2020%2033.9403%2020Z'%20fill='%2324292E'/%3e%3cpath%20d='M13.1818%2045.1364V44C12.5%2044%2012.4091%2043.7699%2012.4091%2043.2955V42.6705C12.4091%2042.2472%2012.1932%2041.8239%2011.25%2041.6364V41.5C12.1932%2041.3125%2012.4091%2040.8892%2012.4091%2040.4659V39.8409C12.4091%2039.3665%2012.5%2039.1364%2013.1818%2039.1364V38C12.0114%2038%2010.8864%2038%2010.8864%2039.6364V40.0795C10.8864%2040.6364%2010.6648%2040.8864%2010%2040.8864V42.25C10.6648%2042.25%2010.8864%2042.5%2010.8864%2043.0568V43.5C10.8864%2045.1364%2012.0114%2045.1364%2013.1818%2045.1364Z'%20fill='%2324292E'/%3e%3cpath%20d='M14.9212%2044.0117C15.4893%2044.0117%2015.9183%2043.8185%2016.1825%2043.3298H16.2166V43.9435H17.6825V40.9548C17.6825%2040.148%2016.9183%2039.523%2015.6712%2039.523C14.3672%2039.523%2013.7251%2040.2048%2013.6712%2041.0003H15.1143C15.1513%2040.7304%2015.3501%2040.6026%2015.6484%2040.6026C15.9212%2040.6026%2016.1143%2040.7276%2016.1143%2040.9548V40.9662C16.1143%2041.219%2015.8359%2041.2986%2015.103%2041.3526C14.2024%2041.4179%2013.5007%2041.7815%2013.5007%2042.7389C13.5007%2043.6082%2014.0859%2044.0117%2014.9212%2044.0117ZM15.4325%2043.023C15.1655%2043.023%2014.978%2042.8923%2014.978%2042.648C14.978%2042.4236%2015.1371%2042.2503%2015.5007%2042.1935C15.7507%2042.1537%2015.9609%2042.1026%2016.1257%2042.0344V42.398C16.1257%2042.7957%2015.7876%2043.023%2015.4325%2043.023Z'%20fill='%2324292E'/%3e%3cpath%20d='M19.2955%2043.9321C19.7131%2043.9321%2020.0852%2043.5798%2020.0909%2043.1367C20.0852%2042.7048%2019.7131%2042.3526%2019.2955%2042.3526C18.8551%2042.3526%2018.4943%2042.7048%2018.5%2043.1367C18.4943%2043.5798%2018.8551%2043.9321%2019.2955%2043.9321ZM19.2955%2041.0003C19.7131%2041.0003%2020.0852%2040.648%2020.0909%2040.2048C20.0852%2039.773%2019.7131%2039.4207%2019.2955%2039.4207C18.8551%2039.4207%2018.4943%2039.773%2018.5%2040.2048C18.4943%2040.648%2018.8551%2041.0003%2019.2955%2041.0003Z'%20fill='%2324292E'/%3e%3cpath%20d='M23.1932%2044.6139C24.6165%2044.6139%2025.6193%2043.8895%2025.6136%2042.8639C25.6193%2042.1509%2025.142%2041.648%2024.2045%2041.5457V41.5003C24.8977%2041.4264%2025.4034%2040.9804%2025.3977%2040.3298C25.4034%2039.3497%2024.4943%2038.6367%2023.2045%2038.6367C21.8864%2038.6367%2020.9489%2039.3895%2020.9432%2040.4548H22.4545C22.4602%2040.1026%2022.7699%2039.8526%2023.2045%2039.8526C23.6023%2039.8526%2023.8807%2040.094%2023.875%2040.4321C23.8807%2040.7844%2023.5511%2041.0344%2023.0795%2041.0344H22.4886V42.1253H23.0795C23.5909%2042.1253%2023.9489%2042.3753%2023.9432%2042.7276C23.9489%2043.0884%2023.642%2043.3412%2023.2045%2043.3412C22.75%2043.3412%2022.4261%2043.0997%2022.4205%2042.7617H20.8295C20.8352%2043.8469%2021.8153%2044.6139%2023.1932%2044.6139Z'%20fill='%2324292E'/%3e%3cpath%20d='M26%2038.0003V39.1366C26.6818%2039.1366%2026.7727%2039.3667%2026.7727%2039.8412V40.4662C26.7727%2040.8895%2026.9886%2041.3128%2027.9318%2041.5003V41.6366C26.9886%2041.8241%2026.7727%2042.2474%2026.7727%2042.6707V43.2957C26.7727%2043.7702%2026.6818%2044.0003%2026%2044.0003V45.1366C27.1705%2045.1366%2028.2955%2045.1366%2028.2955%2043.5003V43.0571C28.2955%2042.5003%2028.517%2042.2503%2029.1818%2042.2503V40.8866C28.517%2040.8866%2028.2955%2040.6366%2028.2955%2040.0798V39.6366C28.2955%2038.0003%2027.1705%2038.0003%2026%2038.0003Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M53.9067%2030C54.6011%2030%2059.9327%2026%2059.9327%2024C59.9327%2022%2054.7357%2018%2053.9067%2018C53.0778%2018%2052.4023%2018.5%2052.4023%2019.4756C52.4023%2020.4512%2055.9067%2022.9206%2055.9067%2022.9206C55.9067%2022.9206%2048.2539%2022.25%2048%2022.9206C47.7461%2023.5911%2047.7461%2024.4089%2048%2025.0794C48.2539%2025.75%2055.9067%2025.0794%2055.9067%2025.0794C55.9067%2025.0794%2052.4023%2027.75%2052.4023%2028.5301C52.4023%2029.3103%2053.2124%2030%2053.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M68%201.04083V13H83V0H68.6268C68.4606%200%2068.3011%200.109659%2068.1836%200.304853C68.066%200.500047%2068%200.764787%2068%201.04083Z'%20fill='url(%23paint1_linear_1248_126563)'/%3e%3cpath%20d='M83%2017.5H68V30.5H83V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M83%2035H68V48H83V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M76.5%2021H75.0716L73.5%2021.9199V23.1738L74.9253%2022.3535H74.9627V27H76.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M74.7744%209.5C75.5264%209.5%2076.0464%209.23767%2076.3415%208.74147H76.3837V9.41783H78V6.1182C78%205.09102%2076.9845%204.5%2075.6107%204.5C74.1595%204.5%2073.3373%205.1574%2073.2003%206.04235L74.785%206.09292C74.8587%205.78319%2075.1434%205.59355%2075.5966%205.59355C76.0183%205.59355%2076.2853%205.77686%2076.2853%206.1024V6.1182C76.2853%206.4153%2075.9269%206.47851%2075.0063%206.5512C73.9136%206.63338%2073%206.99684%2073%208.07143C73%209.03224%2073.7414%209.5%2074.7744%209.5ZM75.305%208.48862C74.9079%208.48862%2074.6268%208.31795%2074.6268%207.99558C74.6268%207.68268%2074.9009%207.49305%2075.3893%207.42668C75.7091%207.38559%2076.1026%207.32238%2076.2959%207.23072V7.69216C76.2959%208.16625%2075.8531%208.48862%2075.305%208.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M75.4792%2044.5C76.8085%2044.5%2077.7528%2043.7757%2077.75%2042.7605C77.7528%2042.0418%2077.2958%2041.5285%2076.4208%2041.423V41.3774C77.0771%2041.2804%2077.5423%2040.827%2077.5395%2040.1711C77.5423%2039.2186%2076.706%2038.5%2075.4903%2038.5C74.2663%2038.5%2073.3746%2039.23%2073.3635%2040.2681H74.6734C74.6845%2039.8688%2075.0334%2039.6008%2075.4903%2039.6008C75.9251%2039.6008%2076.2214%2039.8717%2076.2186%2040.2624C76.2214%2040.6673%2075.8725%2040.9468%2075.3685%2040.9468H74.8174V41.9506H75.3685C75.9417%2041.9506%2076.3155%2042.2414%2076.31%2042.6521C76.3155%2043.0656%2075.9721%2043.3536%2075.4848%2043.3536C75.0001%2043.3536%2074.6429%2043.0884%2074.6291%2042.7034H73.25C73.2611%2043.7586%2074.1832%2044.5%2075.4792%2044.5Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_126563)'%3e%3cpath%20d='M87%2013H102V1.04083C102%200.764787%20101.934%200.500047%20101.816%200.304853C101.699%200.109659%20101.539%200%20101.373%200L87%200V13Z'%20fill='url(%23paint2_linear_1248_126563)'/%3e%3cpath%20d='M102%2017.5H87V30.5H102V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M102%2035H87V48H102V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M92%209.68623H93.5663V8.96449H93.6149C93.8155%209.37609%2094.2621%209.75%2095.0129%209.75C96.1133%209.75%2097%208.97898%2097%207.46304C97%205.89203%2096.0615%205.17609%2095.0227%205.17609C94.2362%205.17609%2093.8058%205.58768%2093.6149%205.99638H93.5825V3.75H92V9.68623ZM93.5502%207.46015C93.5502%206.73261%2093.8867%206.28333%2094.466%206.28333C95.0518%206.28333%2095.3754%206.7442%2095.3754%207.46015C95.3754%208.17899%2095.0518%208.64565%2094.466%208.64565C93.8867%208.64565%2093.5502%208.18188%2093.5502%207.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M92%2043.4453V42.4463L94.5893%2038.5H96.2308V42.4287H97V43.4453H96.2308V44.5H94.977V43.4453H92ZM95.0012%2042.4287V39.8828H94.9528L93.3204%2042.3818V42.4287H95.0012Z'%20fill='%2324292E'/%3e%3cpath%20d='M92.3373%2027H96.75V25.8468H94.3341V25.8092L95.0472%2025.1561C96.3396%2024.0376%2096.6772%2023.4682%2096.6772%2022.789C96.6772%2021.7225%2095.8011%2021%2094.4476%2021C93.129%2021%2092.2471%2021.7543%2092.25%2022.9595H93.6151C93.6151%2022.4249%2093.947%2022.1156%2094.4418%2022.1156C94.9279%2022.1156%2095.2801%2022.4133%2095.2801%2022.9017C95.2801%2023.3439%2095.0006%2023.6445%2094.5116%2024.0809L92.3373%2025.9711V27Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126563'%20x1='0'%20y1='6.5052'%20x2='40'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126563'%20x1='68'%20y1='6.5052'%20x2='83'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126563'%20x1='87'%20y1='6.5052'%20x2='102'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126563'%3e%3crect%20width='40'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126563'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(87)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_40 = "data:image/svg+xml,%3csvg%20width='50'%20height='48'%20viewBox='0%200%2050%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%200.611699V7.64012H14V0H0.58504C0.429878%200%200.28107%200.0644467%200.171354%200.179162C0.0616379%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1248_126334)'/%3e%3cpath%20d='M14%2010.0869H0V17.727H14V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14%2020.1799H0V27.8262H14V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14%2030.2668H0V37.907H14V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14%2048V40.3721H0V47.3883C0%2047.5505%200.0616379%2047.7061%200.171354%2047.8209C0.28107%2047.9356%200.429878%2048%200.58504%2048H14Z'%20fill='%233865AB'/%3e%3cpath%20d='M47.5651%2035.5782L42.3742%2030.4293C44.3891%2027.9169%2045.3649%2024.7281%2045.1009%2021.5184C44.8369%2018.3087%2043.3532%2015.3222%2040.9548%2013.1728C38.5564%2011.0235%2035.4257%209.87482%2032.2063%209.96291C28.987%2010.051%2025.9238%2011.3692%2023.6465%2013.6465C21.3693%2015.9237%2020.0511%2018.9869%2019.963%2022.2063C19.8749%2025.4256%2021.0236%2028.5563%2023.1729%2030.9547C25.3222%2033.3531%2028.3088%2034.8368%2031.5185%2035.1008C34.7282%2035.3649%2037.917%2034.3891%2040.4294%2032.3741L45.5783%2037.5231C45.7084%2037.6542%2045.8631%2037.7583%2046.0336%2037.8293C46.2041%2037.9004%2046.387%2037.9369%2046.5717%2037.9369C46.7564%2037.9369%2046.9393%2037.9004%2047.1098%2037.8293C47.2803%2037.7583%2047.435%2037.6542%2047.5651%2037.5231C47.8173%2037.2622%2047.9583%2036.9135%2047.9583%2036.5506C47.9583%2036.1878%2047.8173%2035.8391%2047.5651%2035.5782V35.5782ZM32.58%2032.3741C30.6429%2032.3741%2028.7493%2031.7997%2027.1387%2030.7235C25.528%2029.6473%2024.2727%2028.1177%2023.5314%2026.328C22.7901%2024.5384%2022.5961%2022.5691%2022.974%2020.6692C23.3519%2018.7693%2024.2848%2017.0242%2025.6545%2015.6544C27.0242%2014.2847%2028.7694%2013.3519%2030.6693%2012.974C32.5692%2012.5961%2034.5384%2012.79%2036.3281%2013.5313C38.1177%2014.2726%2039.6474%2015.528%2040.7236%2017.1386C41.7998%2018.7492%2042.3742%2020.6428%2042.3742%2022.5799C42.3742%2025.1775%2041.3423%2027.6687%2039.5056%2029.5055C37.6688%2031.3422%2035.1776%2032.3741%2032.58%2032.3741V32.3741Z'%20fill='%2324292E'/%3e%3cpath%20d='M32.5%2016C31.0413%2016%2029.6424%2016.5479%2028.6109%2017.523C27.5795%2018.4982%2027%2019.8209%2027%2021.2C27%2024.71%2031.8469%2028.675%2032.0531%2028.844C32.1777%2028.9447%2032.3361%2029%2032.5%2029C32.6639%2029%2032.8223%2028.9447%2032.9469%2028.844C33.1875%2028.675%2038%2024.71%2038%2021.2C38%2019.8209%2037.4205%2018.4982%2036.3891%2017.523C35.3576%2016.5479%2033.9587%2016%2032.5%2016Z'%20fill='%23FF0000'/%3e%3cpath%20d='M35%2021.5C35%2022.8807%2033.8807%2024%2032.5%2024C31.1193%2024%2030%2022.8807%2030%2021.5C30%2020.1193%2031.1193%2019%2032.5%2019C33.8807%2019%2035%2020.1193%2035%2021.5Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126334'%20x1='0'%20y1='3.82312'%20x2='14'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_41 = "data:image/svg+xml,%3csvg%20width='158'%20height='49'%20viewBox='0%200%20158%2049'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M19%2014H34V2.04083C34%201.76479%2033.934%201.50005%2033.8164%201.30485C33.6989%201.10966%2033.5394%201%2033.3732%201H19V14Z'%20fill='url(%23paint0_linear_1248_126159)'/%3e%3cpath%20d='M34%2018.5H19V31.5H34V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2036H19V49H34V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M0%202.03583V13.995H15V0.994995H0.626828C0.460583%200.994995%200.301147%201.10465%200.183594%201.29985C0.0660407%201.49504%200%201.75978%200%202.03583Z'%20fill='url(%23paint1_linear_1248_126159)'/%3e%3cpath%20d='M15%2018.495H0V31.495H15V18.495Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035.995H0V48.995H15V35.995Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M46.3343%2031H49.674V26.674H54V23.3343H49.674V19H46.3343V23.3343H42V26.674H46.3343V31Z'%20fill='%2324292E'/%3e%3cpath%20d='M82.675%202.5H75.325C74.9073%202.5%2074.5067%202.66594%2074.2113%202.96131C73.9159%203.25668%2073.75%203.65728%2073.75%204.075V4.68925C73.7499%204.90604%2073.7946%205.12052%2073.8813%205.31925V5.35075C73.9554%205.51926%2074.0605%205.6724%2074.191%205.80225L77.425%209.01525V12.475C77.4248%2012.5642%2077.4474%2012.652%2077.4906%2012.7301C77.5337%2012.8082%2077.5961%2012.874%2077.6717%2012.9212C77.7553%2012.973%2077.8517%2013.0003%2077.95%2013C78.0322%2012.9995%2078.1131%2012.9797%2078.1862%2012.9422L80.2862%2011.8922C80.3728%2011.8486%2080.4456%2011.7819%2080.4966%2011.6994C80.5476%2011.6169%2080.5747%2011.5219%2080.575%2011.425V9.01525L83.788%205.80225C83.9185%205.6724%2084.0236%205.51926%2084.0977%205.35075V5.31925C84.1916%205.12208%2084.2435%204.90753%2084.25%204.68925V4.075C84.25%203.65728%2084.0841%203.25668%2083.7887%202.96131C83.4933%202.66594%2083.0927%202.5%2082.675%202.5ZM79.6772%208.42725C79.6286%208.47631%2079.5901%208.53448%2079.564%208.59845C79.5378%208.66241%2079.5246%208.73091%2079.525%208.8V11.0995L78.475%2011.6245V8.8C78.4754%208.73091%2078.4622%208.66241%2078.436%208.59845C78.4099%208.53448%2078.3714%208.47631%2078.3227%208.42725L75.5402%205.65H82.4597L79.6772%208.42725ZM83.2%204.6H74.8V4.075C74.8%203.93576%2074.8553%203.80223%2074.9538%203.70377C75.0522%203.60531%2075.1858%203.55%2075.325%203.55H82.675C82.8142%203.55%2082.9478%203.60531%2083.0462%203.70377C83.1447%203.80223%2083.2%203.93576%2083.2%204.075V4.6Z'%20fill='%2324292E'%20fill-opacity='0.75'/%3e%3cg%20clip-path='url(%23clip0_1248_126159)'%3e%3cpath%20d='M62%2018.7908V30.75H76.9563V17.75H62.625C62.4592%2017.75%2062.3003%2017.8597%2062.1831%2018.0549C62.0658%2018.25%2062%2018.5148%2062%2018.7908Z'%20fill='url(%23paint2_linear_1248_126159)'/%3e%3cpath%20d='M77%2035.25H62V48.25H77V35.25Z'%20fill='%233865AB'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126159)'%3e%3cpath%20d='M81%2030.75H96V18.7908C96%2018.5148%2095.934%2018.25%2095.8164%2018.0549C95.6989%2017.8597%2095.5394%2017.75%2095.3732%2017.75H81V30.75Z'%20fill='url(%23paint3_linear_1248_126159)'/%3e%3cpath%20d='M96%2035.25H81V48.25H96V35.25Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M109.907%2031C110.601%2031%20115.933%2027%20115.933%2025C115.933%2023%20110.736%2019%20109.907%2019C109.078%2019%20108.402%2019.5%20108.402%2020.4756C108.402%2021.4512%20111.907%2023.9206%20111.907%2023.9206C111.907%2023.9206%20104.254%2023.25%20104%2023.9206C103.746%2024.5911%20103.746%2025.4089%20104%2026.0794C104.254%2026.75%20111.907%2026.0794%20111.907%2026.0794C111.907%2026.0794%20108.402%2028.75%20108.402%2029.5301C108.402%2030.3103%20109.212%2031%20109.907%2031Z'%20fill='%2324292E'/%3e%3cpath%20d='M143%2014H158V2.04083C158%201.76479%20157.934%201.50005%20157.816%201.30485C157.699%201.10966%20157.539%201%20157.373%201H143V14Z'%20fill='url(%23paint4_linear_1248_126159)'/%3e%3cpath%20d='M158%2018.5H143V31.5H158V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2036H143V49H158V36Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%202.03583V13.995H139V0.994995H124.627C124.461%200.994995%20124.301%201.10465%20124.184%201.29985C124.066%201.49504%20124%201.75978%20124%202.03583Z'%20fill='url(%23paint5_linear_1248_126159)'/%3e%3cpath%20d='M139%2018.495H124V31.495H139V18.495Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2035.995H124V48.995H139V35.995Z'%20fill='%2384AFF1'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126159'%20x1='19'%20y1='7.5052'%20x2='34'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126159'%20x1='0'%20y1='7.5002'%20x2='15'%20y2='7.5002'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126159'%20x1='62'%20y1='24.2552'%20x2='76.9563'%20y2='24.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126159'%20x1='81'%20y1='24.2552'%20x2='96'%20y2='24.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126159'%20x1='143'%20y1='7.5052'%20x2='158'%20y2='7.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1248_126159'%20x1='124'%20y1='7.5002'%20x2='139'%20y2='7.5002'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126159'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%2017.75)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126159'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%2017.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_42 = "data:image/svg+xml,%3csvg%20width='136'%20height='48'%20viewBox='0%200%20136%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126213)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126213)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1248_126213)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M26.4792%2027C27.8085%2027%2028.7528%2026.2757%2028.75%2025.2605C28.7528%2024.5418%2028.2958%2024.0285%2027.4208%2023.923V23.8774C28.0771%2023.7804%2028.5423%2023.327%2028.5395%2022.6711C28.5423%2021.7186%2027.706%2021%2026.4903%2021C25.2663%2021%2024.3746%2021.73%2024.3635%2022.7681H25.6734C25.6845%2022.3688%2026.0334%2022.1008%2026.4903%2022.1008C26.9251%2022.1008%2027.2214%2022.3717%2027.2186%2022.7624C27.2214%2023.1673%2026.8725%2023.4468%2026.3685%2023.4468H25.8174V24.4506H26.3685C26.9417%2024.4506%2027.3155%2024.7414%2027.31%2025.1521C27.3155%2025.5656%2026.9721%2025.8536%2026.4848%2025.8536C26.0001%2025.8536%2025.6429%2025.5884%2025.6291%2025.2034H24.25C24.2611%2026.2586%2025.1832%2027%2026.4792%2027Z'%20fill='%2324292E'/%3e%3cpath%20d='M24%2043.4453V42.4463L26.5893%2038.5H28.2308V42.4287H29V43.4453H28.2308V44.5H26.977V43.4453H24ZM27.0012%2042.4287V39.8828H26.9528L25.3204%2042.3818V42.4287H27.0012Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126213)'%3e%3cpath%20d='M47.675%2018.75H40.325C39.9073%2018.75%2039.5067%2018.9159%2039.2113%2019.2113C38.9159%2019.5067%2038.75%2019.9073%2038.75%2020.325V20.9392C38.7499%2021.156%2038.7946%2021.3705%2038.8813%2021.5692V21.6007C38.9554%2021.7693%2039.0605%2021.9224%2039.191%2022.0522L42.425%2025.2652V28.725C42.4248%2028.8142%2042.4474%2028.902%2042.4906%2028.9801C42.5337%2029.0582%2042.5961%2029.124%2042.6717%2029.1712C42.7553%2029.223%2042.8517%2029.2503%2042.95%2029.25C43.0322%2029.2495%2043.1131%2029.2297%2043.1862%2029.1922L45.2862%2028.1422C45.3728%2028.0986%2045.4456%2028.0319%2045.4966%2027.9494C45.5476%2027.8669%2045.5747%2027.7719%2045.575%2027.675V25.2652L48.788%2022.0522C48.9185%2021.9224%2049.0236%2021.7693%2049.0977%2021.6007V21.5692C49.1916%2021.3721%2049.2435%2021.1575%2049.25%2020.9392V20.325C49.25%2019.9073%2049.0841%2019.5067%2048.7887%2019.2113C48.4933%2018.9159%2048.0927%2018.75%2047.675%2018.75ZM44.6772%2024.6772C44.6286%2024.7263%2044.5901%2024.7845%2044.564%2024.8484C44.5378%2024.9124%2044.5246%2024.9809%2044.525%2025.05V27.3495L43.475%2027.8745V25.05C43.4754%2024.9809%2043.4622%2024.9124%2043.436%2024.8484C43.4099%2024.7845%2043.3714%2024.7263%2043.3227%2024.6772L40.5402%2021.9H47.4597L44.6772%2024.6772ZM48.2%2020.85H39.8V20.325C39.8%2020.1858%2039.8553%2020.0522%2039.9538%2019.9538C40.0522%2019.8553%2040.1858%2019.8%2040.325%2019.8H47.675C47.8142%2019.8%2047.9478%2019.8553%2048.0462%2019.9538C48.1447%2020.0522%2048.2%2020.1858%2048.2%2020.325V20.85Z'%20fill='%2324292E'%20fill-opacity='0.75'/%3e%3c/g%3e%3cpath%20d='M52.8087%2027C51.7696%2027%2051%2026.4879%2051%2025.477C51%2024.3364%2051.9682%2023.9972%2053.0463%2023.9041C53.9932%2023.8176%2054.3656%2023.7744%2054.3656%2023.4452V23.4252C54.3656%2023.0062%2054.0712%2022.7635%2053.557%2022.7635C53.0144%2022.7635%2052.6917%2023.0129%2052.5888%2023.3521L51.1915%2023.2456C51.4007%2022.3145%2052.259%2021.7292%2053.5641%2021.7292C54.777%2021.7292%2055.8764%2022.2414%2055.8764%2023.4585V26.9036H54.4436V26.1953H54.401C54.1351%2026.6708%2053.6137%2027%2052.8087%2027ZM53.2414%2026.0224C53.9045%2026.0224%2054.3762%2025.6133%2054.3762%2025.0779V24.5359C54.1954%2024.649%2053.6563%2024.7221%2053.3265%2024.7654C52.7945%2024.8352%2052.4434%2025.0314%2052.4434%2025.4304C52.4434%2025.8195%2052.7768%2026.0224%2053.2414%2026.0224Z'%20fill='%2324292E'%20fill-opacity='0.75'/%3e%3cpath%20d='M57.3889%2026.3727V25.1922H62.2866V26.3727H57.3889ZM57.3889%2024.1646V22.9841H62.2866V24.1646H57.3889Z'%20fill='%2324292E'%20fill-opacity='0.75'/%3e%3cpath%20d='M63.0676%2027V26.0983L65.5304%2024.1474C66.1588%2023.6301%2066.4966%2023.3064%2066.4966%2022.8353C66.4966%2022.315%2066.0439%2021.9913%2065.4358%2021.9913C64.8041%2021.9913%2064.3851%2022.3381%2064.3885%2022.9046H63C62.9966%2021.7428%2063.9933%2021%2065.446%2021C66.9291%2021%2067.9088%2021.7254%2067.9088%2022.7514C67.9088%2023.4249%2067.527%2023.9798%2066.1047%2025.0896L65.0946%2025.9364V25.9769H68V27H63.0676Z'%20fill='%2324292E'%20fill-opacity='0.75'/%3e%3cpath%20d='M83.9067%2030C84.6011%2030%2089.9327%2026%2089.9327%2024C89.9327%2022%2084.7357%2018%2083.9067%2018C83.0778%2018%2082.4023%2018.5%2082.4023%2019.4756C82.4023%2020.4512%2085.9067%2022.9206%2085.9067%2022.9206C85.9067%2022.9206%2078.2539%2022.25%2078%2022.9206C77.7461%2023.5911%2077.7461%2024.4089%2078%2025.0794C78.2539%2025.75%2085.9067%2025.0794%2085.9067%2025.0794C85.9067%2025.0794%2082.4023%2027.75%2082.4023%2028.5301C82.4023%2029.3103%2083.2124%2030%2083.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M98%209.79083V21.75H113V8.75H98.6268C98.4606%208.75%2098.3011%208.85966%2098.1836%209.05485C98.066%209.25005%2098%209.51479%2098%209.79083Z'%20fill='url(%23paint2_linear_1248_126213)'/%3e%3cpath%20d='M113%2026.25H98V39.25H113V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.5%2029.75H105.072L103.5%2030.6699V31.9238L104.925%2031.1035H104.963V35.75H106.5V29.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M104.774%2018.25C105.526%2018.25%20106.046%2017.9877%20106.342%2017.4915H106.384V18.1678H108V14.8682C108%2013.841%20106.985%2013.25%20105.611%2013.25C104.16%2013.25%20103.337%2013.9074%20103.2%2014.7924L104.785%2014.8429C104.859%2014.5332%20105.143%2014.3436%20105.597%2014.3436C106.018%2014.3436%20106.285%2014.5269%20106.285%2014.8524V14.8682C106.285%2015.1653%20105.927%2015.2285%20105.006%2015.3012C103.914%2015.3834%20103%2015.7468%20103%2016.8214C103%2017.7822%20103.741%2018.25%20104.774%2018.25ZM105.305%2017.2386C104.908%2017.2386%20104.627%2017.068%20104.627%2016.7456C104.627%2016.4327%20104.901%2016.243%20105.389%2016.1767C105.709%2016.1356%20106.103%2016.0724%20106.296%2015.9807V16.4422C106.296%2016.9162%20105.853%2017.2386%20105.305%2017.2386Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126213)'%3e%3cpath%20d='M117%2021.75H132V9.79083C132%209.51479%20131.934%209.25005%20131.816%209.05485C131.699%208.85966%20131.539%208.75%20131.373%208.75H117V21.75Z'%20fill='url(%23paint3_linear_1248_126213)'/%3e%3cpath%20d='M132%2026.25H117V39.25H132V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M122%2018.4362H123.566V17.7145H123.615C123.816%2018.1261%20124.262%2018.5%20125.013%2018.5C126.113%2018.5%20127%2017.729%20127%2016.213C127%2014.642%20126.061%2013.9261%20125.023%2013.9261C124.236%2013.9261%20123.806%2014.3377%20123.615%2014.7464H123.583V12.5H122V18.4362ZM123.55%2016.2101C123.55%2015.4826%20123.887%2015.0333%20124.466%2015.0333C125.052%2015.0333%20125.375%2015.4942%20125.375%2016.2101C125.375%2016.929%20125.052%2017.3957%20124.466%2017.3957C123.887%2017.3957%20123.55%2016.9319%20123.55%2016.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M124.479%2035.75C125.808%2035.75%20126.753%2035.0257%20126.75%2034.0105C126.753%2033.2918%20126.296%2032.7785%20125.421%2032.673V32.6274C126.077%2032.5304%20126.542%2032.077%20126.54%2031.4211C126.542%2030.4686%20125.706%2029.75%20124.49%2029.75C123.266%2029.75%20122.375%2030.48%20122.364%2031.5181H123.673C123.684%2031.1188%20124.033%2030.8508%20124.49%2030.8508C124.925%2030.8508%20125.221%2031.1217%20125.219%2031.5124C125.221%2031.9173%20124.872%2032.1968%20124.368%2032.1968H123.817V33.2006H124.368C124.942%2033.2006%20125.316%2033.4914%20125.31%2033.9021C125.316%2034.3156%20124.972%2034.6036%20124.485%2034.6036C124%2034.6036%20123.643%2034.3384%20123.629%2033.9534H122.25C122.261%2035.0086%20123.183%2035.75%20124.479%2035.75Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126213'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126213'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126213'%20x1='98'%20y1='15.2552'%20x2='113'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126213'%20x1='117'%20y1='15.2552'%20x2='132'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126213'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126213'%3e%3crect%20width='12'%20height='12'%20fill='white'%20transform='translate(38%2018)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126213'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(117%208.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_43 = "data:image/svg+xml,%3csvg%20width='77'%20height='48'%20viewBox='0%200%2077%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126187)'%3e%3cpath%20d='M19%2023H34V13.8006C34%2013.5883%2033.934%2013.3847%2033.8164%2013.2345C33.6989%2013.0844%2033.5394%2013%2033.3732%2013H19V23Z'%20fill='url(%23paint0_linear_1248_126187)'/%3e%3cpath%20d='M43%2026H19V35.5H43V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2026H19V35.5H34V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2039H19V48.5H34V39Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2020.9362H25.5663V20.2145H25.6149C25.8155%2020.6261%2026.2621%2021%2027.0129%2021C28.1133%2021%2029%2020.229%2029%2018.713C29%2017.142%2028.0615%2016.4261%2027.0227%2016.4261C26.2362%2016.4261%2025.8058%2016.8377%2025.6149%2017.2464H25.5825V15H24V20.9362ZM25.5502%2018.7101C25.5502%2017.9826%2025.8867%2017.5333%2026.466%2017.5333C27.0518%2017.5333%2027.3754%2017.9942%2027.3754%2018.7101C27.3754%2019.429%2027.0518%2019.8957%2026.466%2019.8957C25.8867%2019.8957%2025.5502%2019.4319%2025.5502%2018.7101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126187)'%3e%3cpath%20d='M0%2013.8006V23H15V13H0.626828C0.460583%2013%200.301147%2013.0844%200.183594%2013.2345C0.0660407%2013.3847%200%2013.5883%200%2013.8006Z'%20fill='url(%23paint1_linear_1248_126187)'/%3e%3cpath%20d='M24%2026H0V35.5H24V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2026H0V35.5H15V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2039H0V48.5H15V39Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2028H7.07158L5.5%2028.9199V30.1738L6.92531%2029.3535H6.96266V34H8.5V28Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2046.5H9.75V45.3468H7.33409V45.3092L8.04722%2044.6561C9.33959%2043.5376%209.67723%2042.9682%209.67723%2042.289C9.67723%2041.2225%208.8011%2040.5%207.44761%2040.5C6.12905%2040.5%205.2471%2041.2543%205.25001%2042.4595H6.61514C6.61514%2041.9249%206.94696%2041.6156%207.44179%2041.6156C7.92788%2041.6156%208.28008%2041.9133%208.28008%2042.4017C8.28008%2042.8439%208.00065%2043.1445%207.51165%2043.5809L5.33733%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%2020.5C7.52635%2020.5%208.04638%2020.2377%208.34153%2019.7415H8.3837V20.4178H10V17.1182C10%2016.091%208.98454%2015.5%207.61068%2015.5C6.15952%2015.5%205.33732%2016.1574%205.20028%2017.0424L6.78496%2017.0929C6.85875%2016.7832%207.14336%2016.5936%207.59663%2016.5936C8.01827%2016.5936%208.28531%2016.7769%208.28531%2017.1024V17.1182C8.28531%2017.4153%207.92692%2017.4785%207.00633%2017.5512C5.91356%2017.6334%205%2017.9968%205%2019.0714C5%2020.0322%205.74139%2020.5%206.77442%2020.5ZM7.30499%2019.4886C6.90794%2019.4886%206.62684%2019.318%206.62684%2018.9956C6.62684%2018.6827%206.90091%2018.493%207.38932%2018.4267C7.70907%2018.3856%208.1026%2018.3224%208.29585%2018.2307V18.6922C8.29585%2019.1662%207.85313%2019.4886%207.30499%2019.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2036.5C48.6011%2036.5%2053.9327%2032.5%2053.9327%2030.5C53.9327%2028.5%2048.7357%2024.5%2047.9067%2024.5C47.0778%2024.5%2046.4023%2025%2046.4023%2025.9756C46.4023%2026.9512%2049.9067%2029.4206%2049.9067%2029.4206C49.9067%2029.4206%2042.2539%2028.75%2042%2029.4206C41.7461%2030.0911%2041.7461%2030.9089%2042%2031.5794C42.2539%2032.25%2049.9067%2031.5794%2049.9067%2031.5794C49.9067%2031.5794%2046.4023%2034.25%2046.4023%2035.0301C46.4023%2035.8103%2047.2124%2036.5%2047.9067%2036.5Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126187)'%3e%3cpath%20d='M62%2013.8006V23H77V13H62.6268C62.4606%2013%2062.3011%2013.0844%2062.1836%2013.2345C62.066%2013.3847%2062%2013.5883%2062%2013.8006Z'%20fill='url(%23paint2_linear_1248_126187)'/%3e%3cpath%20d='M86%2026H62V35.5H86V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2026H62V35.5H77V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2039H62V48.5H77V39Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M70.5%2028H69.0716L67.5%2028.9199V30.1738L68.9253%2029.3535H68.9627V34H70.5V28Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.3373%2046.5H71.75V45.3468H69.3341V45.3092L70.0472%2044.6561C71.3396%2043.5376%2071.6772%2042.9682%2071.6772%2042.289C71.6772%2041.2225%2070.8011%2040.5%2069.4476%2040.5C68.129%2040.5%2067.2471%2041.2543%2067.25%2042.4595H68.6151C68.6151%2041.9249%2068.947%2041.6156%2069.4418%2041.6156C69.9279%2041.6156%2070.2801%2041.9133%2070.2801%2042.4017C70.2801%2042.8439%2070.0006%2043.1445%2069.5116%2043.5809L67.3373%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7744%2020.5C69.5264%2020.5%2070.0464%2020.2377%2070.3415%2019.7415H70.3837V20.4178H72V17.1182C72%2016.091%2070.9845%2015.5%2069.6107%2015.5C68.1595%2015.5%2067.3373%2016.1574%2067.2003%2017.0424L68.785%2017.0929C68.8587%2016.7832%2069.1434%2016.5936%2069.5966%2016.5936C70.0183%2016.5936%2070.2853%2016.7769%2070.2853%2017.1024V17.1182C70.2853%2017.4153%2069.9269%2017.4785%2069.0063%2017.5512C67.9136%2017.6334%2067%2017.9968%2067%2019.0714C67%2020.0322%2067.7414%2020.5%2068.7744%2020.5ZM69.305%2019.4886C68.9079%2019.4886%2068.6268%2019.318%2068.6268%2018.9956C68.6268%2018.6827%2068.9009%2018.493%2069.3893%2018.4267C69.7091%2018.3856%2070.1026%2018.3224%2070.2959%2018.2307V18.6922C70.2959%2019.1662%2069.8531%2019.4886%2069.305%2019.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126187)'%3e%3cpath%20d='M29.675%200.75H22.325C21.9073%200.75%2021.5067%200.915937%2021.2113%201.21131C20.9159%201.50668%2020.75%201.90728%2020.75%202.325V2.93925C20.7499%203.15604%2020.7946%203.37052%2020.8813%203.56925V3.60075C20.9554%203.76926%2021.0605%203.9224%2021.191%204.05225L24.425%207.26525V10.725C24.4248%2010.8142%2024.4474%2010.902%2024.4906%2010.9801C24.5337%2011.0582%2024.5961%2011.124%2024.6717%2011.1712C24.7553%2011.223%2024.8517%2011.2503%2024.95%2011.25C25.0322%2011.2495%2025.1131%2011.2297%2025.1862%2011.1922L27.2862%2010.1422C27.3728%2010.0986%2027.4456%2010.0319%2027.4966%209.9494C27.5476%209.86693%2027.5747%209.77195%2027.575%209.675V7.26525L30.788%204.05225C30.9185%203.9224%2031.0236%203.76926%2031.0977%203.60075V3.56925C31.1916%203.37208%2031.2435%203.15753%2031.25%202.93925V2.325C31.25%201.90728%2031.0841%201.50668%2030.7887%201.21131C30.4933%200.915937%2030.0927%200.75%2029.675%200.75ZM26.6772%206.67725C26.6286%206.72631%2026.5901%206.78448%2026.564%206.84845C26.5378%206.91241%2026.5246%206.98091%2026.525%207.05V9.3495L25.475%209.8745V7.05C25.4754%206.98091%2025.4622%206.91241%2025.436%206.84845C25.4099%206.78448%2025.3714%206.72631%2025.3227%206.67725L22.5402%203.9H29.4597L26.6772%206.67725ZM30.2%202.85H21.8V2.325C21.8%202.18576%2021.8553%202.05223%2021.9538%201.95377C22.0522%201.85531%2022.1858%201.8%2022.325%201.8H29.675C29.8142%201.8%2029.9478%201.85531%2030.0462%201.95377C30.1447%202.05223%2030.2%202.18576%2030.2%202.325V2.85Z'%20fill='%2324292E'%20fill-opacity='0.75'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126187'%20x1='19'%20y1='18.004'%20x2='34'%20y2='18.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126187'%20x1='0'%20y1='18.004'%20x2='15'%20y2='18.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126187'%20x1='62'%20y1='18.004'%20x2='77'%20y2='18.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126187'%3e%3crect%20width='15'%20height='35'%20fill='white'%20transform='translate(19%2013)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126187'%3e%3crect%20width='15'%20height='35'%20fill='white'%20transform='translate(0%2013)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126187'%3e%3crect%20width='15'%20height='35'%20fill='white'%20transform='translate(62%2013)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126187'%3e%3crect%20width='12'%20height='12'%20fill='white'%20transform='translate(20)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_44 = "data:image/svg+xml,%3csvg%20width='58'%20height='48'%20viewBox='0%200%2058%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1811_57031)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M9.65%209.3H9.3V3.35C9.3%203.25717%209.26313%203.16815%209.19749%203.10251C9.13185%203.03687%209.04283%203%208.95%203H7.725C7.66392%203.00037%207.604%203.01672%207.5512%203.04742C7.49839%203.07812%207.45454%203.1221%207.424%203.175L3.8505%209.3H3.35C3.25717%209.3%203.16815%209.33687%203.10251%209.40251C3.03687%209.46815%203%209.55717%203%209.65C3%209.74283%203.03687%209.83185%203.10251%209.89749C3.16815%209.96313%203.25717%2010%203.35%2010H4.75C4.84283%2010%204.93185%209.96313%204.99749%209.89749C5.06313%209.83185%205.1%209.74283%205.1%209.65C5.1%209.55717%205.06313%209.46815%204.99749%209.40251C4.93185%209.33687%204.84283%209.3%204.75%209.3H4.659L5.884%207.2H8.6V9.3H8.25C8.15717%209.3%208.06815%209.33687%208.00251%209.40251C7.93687%209.46815%207.9%209.55717%207.9%209.65C7.9%209.74283%207.93687%209.83185%208.00251%209.89749C8.06815%209.96313%208.15717%2010%208.25%2010H9.65C9.74283%2010%209.83185%209.96313%209.89749%209.89749C9.96313%209.83185%2010%209.74283%2010%209.65C10%209.55717%209.96313%209.46815%209.89749%209.40251C9.83185%209.33687%209.74283%209.3%209.65%209.3ZM8.6%206.5H6.2935L7.9245%203.7H8.6V6.5Z'%20fill='white'/%3e%3cpath%20d='M6.84608%2027C7.52244%2027%207.9902%2026.7377%208.25569%2026.2415H8.29362V26.9178H9.74747V23.6182C9.74747%2022.591%208.83407%2022%207.59829%2022C6.29298%2022%205.55341%2022.6574%205.43015%2023.5424L6.85556%2023.5929C6.92193%2023.2832%207.17794%2023.0936%207.58565%2023.0936C7.96492%2023.0936%208.20512%2023.2769%208.20512%2023.6024V23.6182C8.20512%2023.9153%207.88274%2023.9785%207.05468%2024.0512C6.07174%2024.1334%205.25%2024.4968%205.25%2025.5714C5.25%2026.5322%205.91688%2027%206.84608%2027ZM7.32333%2025.9886C6.96618%2025.9886%206.71334%2025.818%206.71334%2025.4956C6.71334%2025.1827%206.95986%2024.993%207.39918%2024.9267C7.68679%2024.8856%208.04077%2024.8224%208.2146%2024.7307V25.1922C8.2146%2025.6662%207.81637%2025.9886%207.32333%2025.9886Z'%20fill='%2324292E'/%3e%3cpath%20d='M5%2044.4362H6.56634V43.7145H6.61489C6.81553%2044.1261%207.26214%2044.5%208.01294%2044.5C9.11327%2044.5%2010%2043.729%2010%2042.213C10%2040.642%209.06149%2039.9261%208.02265%2039.9261C7.23625%2039.9261%206.80583%2040.3377%206.61489%2040.7464H6.58252V38.5H5V44.4362ZM6.55016%2042.2101C6.55016%2041.4826%206.88673%2041.0333%207.46602%2041.0333C8.05178%2041.0333%208.3754%2041.4942%208.3754%2042.2101C8.3754%2042.929%208.05178%2043.3957%207.46602%2043.3957C6.88673%2043.3957%206.55016%2042.9319%206.55016%2042.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.9067%2030C29.6011%2030%2034.9327%2026%2034.9327%2024C34.9327%2022%2029.7357%2018%2028.9067%2018C28.0778%2018%2027.4023%2018.5%2027.4023%2019.4756C27.4023%2020.4512%2030.9067%2022.9206%2030.9067%2022.9206C30.9067%2022.9206%2023.2539%2022.25%2023%2022.9206C22.7461%2023.5911%2022.7461%2024.4089%2023%2025.0794C23.2539%2025.75%2030.9067%2025.0794%2030.9067%2025.0794C30.9067%2025.0794%2027.4023%2027.75%2027.4023%2028.5301C27.4023%2029.3103%2028.2124%2030%2028.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M43%201.04083V13H58V0H43.6268C43.4606%200%2043.3011%200.109659%2043.1836%200.304853C43.066%200.500047%2043%200.764787%2043%201.04083Z'%20fill='url(%23paint1_linear_1811_57031)'/%3e%3cpath%20d='M58%2017.5H43V30.5H58V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M58%2035H43V48H58V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52.65%209.3H52.3V3.35C52.3%203.25717%2052.2631%203.16815%2052.1975%203.10251C52.1318%203.03687%2052.0428%203%2051.95%203H50.725C50.6639%203.00037%2050.604%203.01672%2050.5512%203.04742C50.4984%203.07812%2050.4545%203.1221%2050.424%203.175L46.8505%209.3H46.35C46.2572%209.3%2046.1682%209.33687%2046.1025%209.40251C46.0369%209.46815%2046%209.55717%2046%209.65C46%209.74283%2046.0369%209.83185%2046.1025%209.89749C46.1682%209.96313%2046.2572%2010%2046.35%2010H47.75C47.8428%2010%2047.9318%209.96313%2047.9975%209.89749C48.0631%209.83185%2048.1%209.74283%2048.1%209.65C48.1%209.55717%2048.0631%209.46815%2047.9975%209.40251C47.9318%209.33687%2047.8428%209.3%2047.75%209.3H47.659L48.884%207.2H51.6V9.3H51.25C51.1572%209.3%2051.0682%209.33687%2051.0025%209.40251C50.9369%209.46815%2050.9%209.55717%2050.9%209.65C50.9%209.74283%2050.9369%209.83185%2051.0025%209.89749C51.0682%209.96313%2051.1572%2010%2051.25%2010H52.65C52.7428%2010%2052.8318%209.96313%2052.8975%209.89749C52.9631%209.83185%2053%209.74283%2053%209.65C53%209.55717%2052.9631%209.46815%2052.8975%209.40251C52.8318%209.33687%2052.7428%209.3%2052.65%209.3ZM51.6%206.5H49.2935L50.9245%203.7H51.6V6.5Z'%20fill='white'/%3e%3cpath%20d='M49.0114%2026.8182H47.5L49.4631%2021H51.3352L53.2983%2026.8182H51.7869L51.4034%2025.5966H49.3949L49.0114%2026.8182ZM49.7301%2024.5284H51.0682L50.4205%2022.4659H50.375L49.7301%2024.5284Z'%20fill='black'/%3e%3cpath%20d='M48.5%2044.8182V39H50.9261C52.233%2039%2052.9091%2039.5938%2052.9091%2040.4716C52.9091%2041.1364%2052.4602%2041.5994%2051.821%2041.733V41.7898C52.5256%2041.821%2053.1364%2042.3494%2053.1364%2043.1903C53.1364%2044.1307%2052.3977%2044.8182%2051.1108%2044.8182H48.5ZM49.9062%2043.6847H50.7756C51.3835%2043.6847%2051.6676%2043.4403%2051.6676%2043.0284C51.6676%2042.5824%2051.3381%2042.2983%2050.8011%2042.2983H49.9062V43.6847ZM49.9062%2041.392H50.6847C51.1449%2041.392%2051.4744%2041.1534%2051.4744%2040.7443C51.4744%2040.358%2051.1761%2040.1165%2050.7074%2040.1165H49.9062V41.392Z'%20fill='black'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1811_57031'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1811_57031'%20x1='43'%20y1='6.5052'%20x2='58'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_45 = "data:image/svg+xml,%3csvg%20width='122'%20height='48'%20viewBox='0%200%20122%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1706_105947)'%3e%3cpath%20d='M0%201.04083V13H54V0H2.25658C1.6581%200%200%200%200%200C0%200%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1706_105947)'/%3e%3cpath%20d='M54%2018H0V31H54V18Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M4.28977%2028.6364C3.95739%2028.6364%203.64773%2028.5824%203.4375%2028.4972L3.74432%2027.4886C4.15341%2027.6222%204.45455%2027.6165%204.58807%2027.2898L4.64205%2027.1591L3.09091%2022.6364H4.54545L5.34943%2025.75H5.39489L6.21023%2022.6364H7.6733L6.02841%2027.4176C5.78693%2028.1307%205.28977%2028.6364%204.28977%2028.6364ZM9.0554%2028.6364C8.72301%2028.6364%208.41335%2028.5824%208.20312%2028.4972L8.50994%2027.4886C8.91903%2027.6222%209.22017%2027.6165%209.35369%2027.2898L9.40767%2027.1591L7.85653%2022.6364H9.31108L10.1151%2025.75H10.1605L10.9759%2022.6364H12.4389L10.794%2027.4176C10.5526%2028.1307%2010.0554%2028.6364%209.0554%2028.6364ZM13.821%2028.6364C13.4886%2028.6364%2013.179%2028.5824%2012.9688%2028.4972L13.2756%2027.4886C13.6847%2027.6222%2013.9858%2027.6165%2014.1193%2027.2898L14.1733%2027.1591L12.6222%2022.6364H14.0767L14.8807%2025.75H14.9261L15.7415%2022.6364H17.2045L15.5597%2027.4176C15.3182%2028.1307%2014.821%2028.6364%2013.821%2028.6364ZM18.5866%2028.6364C18.2543%2028.6364%2017.9446%2028.5824%2017.7344%2028.4972L18.0412%2027.4886C18.4503%2027.6222%2018.7514%2027.6165%2018.8849%2027.2898L18.9389%2027.1591L17.3878%2022.6364H18.8423L19.6463%2025.75H19.6918L20.5071%2022.6364H21.9702L20.3253%2027.4176C20.0838%2028.1307%2019.5866%2028.6364%2018.5866%2028.6364ZM25.2955%2024.1108V25.1818H22.6023V24.1108H25.2955ZM26.2763%2027V22.6364H27.5973V23.4375H27.6456C27.8274%2022.9062%2028.282%2022.5795%2028.8786%2022.5795C29.4837%2022.5795%2029.9524%2022.9148%2030.0689%2023.4375H30.1143C30.2763%2022.9176%2030.7848%2022.5795%2031.4297%2022.5795C32.2536%2022.5795%2032.8217%2023.1392%2032.8217%2024.0625V27H31.4325V24.3807C31.4325%2023.946%2031.1825%2023.7102%2030.8303%2023.7102C30.4467%2023.7102%2030.2166%2023.9773%2030.2166%2024.3949V27H28.8814V24.3665C28.8814%2023.9631%2028.6428%2023.7102%2028.282%2023.7102C27.9183%2023.7102%2027.6655%2023.9858%2027.6655%2024.4176V27H26.2763ZM33.6825%2027V22.6364H35.0036V23.4375H35.0518C35.2337%2022.9062%2035.6882%2022.5795%2036.2848%2022.5795C36.8899%2022.5795%2037.3587%2022.9148%2037.4751%2023.4375H37.5206C37.6825%2022.9176%2038.1911%2022.5795%2038.8359%2022.5795C39.6598%2022.5795%2040.228%2023.1392%2040.228%2024.0625V27H38.8388V24.3807C38.8388%2023.946%2038.5888%2023.7102%2038.2365%2023.7102C37.853%2023.7102%2037.6229%2023.9773%2037.6229%2024.3949V27H36.2876V24.3665C36.2876%2023.9631%2036.049%2023.7102%2035.6882%2023.7102C35.3246%2023.7102%2035.0717%2023.9858%2035.0717%2024.4176V27H33.6825ZM43.8814%2024.1108V25.1818H41.1882V24.1108H43.8814ZM46.456%2027.0625C45.4929%2027.0625%2044.7116%2026.3068%2044.7116%2024.821C44.7116%2023.2812%2045.5384%2022.5795%2046.4503%2022.5795C47.1378%2022.5795%2047.5185%2022.983%2047.6832%2023.3835H47.7116V21.1818H49.1009V27H47.7259V26.2926H47.6832C47.5071%2026.696%2047.1151%2027.0625%2046.456%2027.0625ZM46.9389%2025.9801C47.4446%2025.9801%2047.7429%2025.5256%2047.7429%2024.8182C47.7429%2024.1051%2047.4474%2023.6648%2046.9389%2023.6648C46.4219%2023.6648%2046.1378%2024.1165%2046.1378%2024.8182C46.1378%2025.5227%2046.4247%2025.9801%2046.9389%2025.9801Z'%20fill='%2324292E'/%3e%3cpath%20d='M54%2035H0V48H54V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M5.28977%2045.6364C4.95739%2045.6364%204.64773%2045.5824%204.4375%2045.4972L4.74432%2044.4886C5.15341%2044.6222%205.45455%2044.6165%205.58807%2044.2898L5.64205%2044.1591L4.09091%2039.6364H5.54545L6.34943%2042.75H6.39489L7.21023%2039.6364H8.6733L7.02841%2044.4176C6.78693%2045.1307%206.28977%2045.6364%205.28977%2045.6364ZM10.0554%2045.6364C9.72301%2045.6364%209.41335%2045.5824%209.20312%2045.4972L9.50994%2044.4886C9.91903%2044.6222%2010.2202%2044.6165%2010.3537%2044.2898L10.4077%2044.1591L8.85653%2039.6364H10.3111L11.1151%2042.75H11.1605L11.9759%2039.6364H13.4389L11.794%2044.4176C11.5526%2045.1307%2011.0554%2045.6364%2010.0554%2045.6364ZM14.821%2045.6364C14.4886%2045.6364%2014.179%2045.5824%2013.9688%2045.4972L14.2756%2044.4886C14.6847%2044.6222%2014.9858%2044.6165%2015.1193%2044.2898L15.1733%2044.1591L13.6222%2039.6364H15.0767L15.8807%2042.75H15.9261L16.7415%2039.6364H18.2045L16.5597%2044.4176C16.3182%2045.1307%2015.821%2045.6364%2014.821%2045.6364ZM19.5866%2045.6364C19.2543%2045.6364%2018.9446%2045.5824%2018.7344%2045.4972L19.0412%2044.4886C19.4503%2044.6222%2019.7514%2044.6165%2019.8849%2044.2898L19.9389%2044.1591L18.3878%2039.6364H19.8423L20.6463%2042.75H20.6918L21.5071%2039.6364H22.9702L21.3253%2044.4176C21.0838%2045.1307%2020.5866%2045.6364%2019.5866%2045.6364ZM26.2955%2041.1108V42.1818H23.6023V41.1108H26.2955ZM27.2763%2044V39.6364H28.5973V40.4375H28.6456C28.8274%2039.9062%2029.282%2039.5795%2029.8786%2039.5795C30.4837%2039.5795%2030.9524%2039.9148%2031.0689%2040.4375H31.1143C31.2763%2039.9176%2031.7848%2039.5795%2032.4297%2039.5795C33.2536%2039.5795%2033.8217%2040.1392%2033.8217%2041.0625V44H32.4325V41.3807C32.4325%2040.946%2032.1825%2040.7102%2031.8303%2040.7102C31.4467%2040.7102%2031.2166%2040.9773%2031.2166%2041.3949V44H29.8814V41.3665C29.8814%2040.9631%2029.6428%2040.7102%2029.282%2040.7102C28.9183%2040.7102%2028.6655%2040.9858%2028.6655%2041.4176V44H27.2763ZM34.6825%2044V39.6364H36.0036V40.4375H36.0518C36.2337%2039.9062%2036.6882%2039.5795%2037.2848%2039.5795C37.8899%2039.5795%2038.3587%2039.9148%2038.4751%2040.4375H38.5206C38.6825%2039.9176%2039.1911%2039.5795%2039.8359%2039.5795C40.6598%2039.5795%2041.228%2040.1392%2041.228%2041.0625V44H39.8388V41.3807C39.8388%2040.946%2039.5888%2040.7102%2039.2365%2040.7102C38.853%2040.7102%2038.6229%2040.9773%2038.6229%2041.3949V44H37.2876V41.3665C37.2876%2040.9631%2037.049%2040.7102%2036.6882%2040.7102C36.3246%2040.7102%2036.0717%2040.9858%2036.0717%2041.4176V44H34.6825ZM44.8814%2041.1108V42.1818H42.1882V41.1108H44.8814ZM47.456%2044.0625C46.4929%2044.0625%2045.7116%2043.3068%2045.7116%2041.821C45.7116%2040.2812%2046.5384%2039.5795%2047.4503%2039.5795C48.1378%2039.5795%2048.5185%2039.983%2048.6832%2040.3835H48.7116V38.1818H50.1009V44H48.7259V43.2926H48.6832C48.5071%2043.696%2048.1151%2044.0625%2047.456%2044.0625ZM47.9389%2042.9801C48.4446%2042.9801%2048.7429%2042.5256%2048.7429%2041.8182C48.7429%2041.1051%2048.4474%2040.6648%2047.9389%2040.6648C47.4219%2040.6648%2047.1378%2041.1165%2047.1378%2041.8182C47.1378%2042.5227%2047.4247%2042.9801%2047.9389%2042.9801Z'%20fill='%2324292E'/%3e%3cpath%20d='M27%203C26.3078%203%2025.6311%203.20527%2025.0555%203.58986C24.4799%203.97444%2024.0313%204.52107%2023.7664%205.16061C23.5015%205.80015%2023.4322%206.50388%2023.5673%207.18282C23.7023%207.86175%2024.0356%208.48539%2024.5251%208.97487C25.0146%209.46436%2025.6383%209.7977%2026.3172%209.93275C26.9961%2010.0678%2027.6999%209.99848%2028.3394%209.73358C28.9789%209.46867%2029.5256%209.02007%2029.9101%208.44449C30.2947%207.86892%2030.5%207.19223%2030.5%206.5C30.5%206.04037%2030.4095%205.58525%2030.2336%205.16061C30.0577%204.73597%2029.7999%204.35013%2029.4749%204.02513C29.1499%203.70012%2028.764%203.44231%2028.3394%203.26642C27.9148%203.09053%2027.4596%203%2027%203V3ZM27%209.3C26.4462%209.3%2025.9049%209.13578%2025.4444%208.82811C24.9839%208.52045%2024.6251%208.08315%2024.4131%207.57151C24.2012%207.05988%2024.1458%206.49689%2024.2538%205.95375C24.3618%205.4106%2024.6285%204.91169%2025.0201%204.5201C25.4117%204.12851%2025.9106%203.86184%2026.4537%203.7538C26.9969%203.64576%2027.5599%203.70121%2028.0715%203.91314C28.5831%204.12506%2029.0204%204.48395%2029.3281%204.9444C29.6358%205.40486%2029.8%205.94621%2029.8%206.5C29.8%207.24261%2029.505%207.9548%2028.9799%208.4799C28.4548%209.005%2027.7426%209.3%2027%209.3V9.3ZM27%204.4C26.9072%204.4%2026.8182%204.43687%2026.7525%204.50251C26.6869%204.56815%2026.65%204.65717%2026.65%204.75V6.15H25.95C25.8572%206.15%2025.7682%206.18687%2025.7025%206.25251C25.6369%206.31815%2025.6%206.40717%2025.6%206.5C25.6%206.59283%2025.6369%206.68185%2025.7025%206.74749C25.7682%206.81312%2025.8572%206.85%2025.95%206.85H27C27.0928%206.85%2027.1819%206.81312%2027.2475%206.74749C27.3131%206.68185%2027.35%206.59283%2027.35%206.5V4.75C27.35%204.65717%2027.3131%204.56815%2027.2475%204.50251C27.1819%204.43687%2027.0928%204.4%2027%204.4Z'%20fill='white'/%3e%3c/g%3e%3cpath%20d='M67.9067%2030C68.6011%2030%2073.9327%2026%2073.9327%2024C73.9327%2022%2068.7357%2018%2067.9067%2018C67.0778%2018%2066.4023%2018.5%2066.4023%2019.4756C66.4023%2020.4512%2069.9067%2022.9206%2069.9067%2022.9206C69.9067%2022.9206%2062.2539%2022.25%2062%2022.9206C61.7461%2023.5911%2061.7461%2024.4089%2062%2025.0794C62.2539%2025.75%2069.9067%2025.0794%2069.9067%2025.0794C69.9067%2025.0794%2066.4023%2027.75%2066.4023%2028.5301C66.4023%2029.3103%2067.2124%2030%2067.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M82%201.04083V13H122V0H83.6715H82V1.04083Z'%20fill='url(%23paint1_linear_1706_105947)'/%3e%3cpath%20d='M122%2018H82V31H122V18Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M88.4403%2027.5V23.1364H89.7614V23.9375H89.8097C89.9915%2023.4062%2090.446%2023.0795%2091.0426%2023.0795C91.6477%2023.0795%2092.1165%2023.4148%2092.233%2023.9375H92.2784C92.4403%2023.4176%2092.9489%2023.0795%2093.5938%2023.0795C94.4176%2023.0795%2094.9858%2023.6392%2094.9858%2024.5625V27.5H93.5966V24.8807C93.5966%2024.446%2093.3466%2024.2102%2092.9943%2024.2102C92.6108%2024.2102%2092.3807%2024.4773%2092.3807%2024.8949V27.5H91.0455V24.8665C91.0455%2024.4631%2090.8068%2024.2102%2090.446%2024.2102C90.0824%2024.2102%2089.8295%2024.4858%2089.8295%2024.9176V27.5H88.4403ZM95.8466%2027.5V23.1364H97.1676V23.9375H97.2159C97.3977%2023.4062%2097.8523%2023.0795%2098.4489%2023.0795C99.054%2023.0795%2099.5227%2023.4148%2099.6392%2023.9375H99.6847C99.8466%2023.4176%20100.355%2023.0795%20101%2023.0795C101.824%2023.0795%20102.392%2023.6392%20102.392%2024.5625V27.5H101.003V24.8807C101.003%2024.446%20100.753%2024.2102%20100.401%2024.2102C100.017%2024.2102%2099.7869%2024.4773%2099.7869%2024.8949V27.5H98.4517V24.8665C98.4517%2024.4631%2098.2131%2024.2102%2097.8523%2024.2102C97.4886%2024.2102%2097.2358%2024.4858%2097.2358%2024.9176V27.5H95.8466ZM106.045%2024.6108V25.6818H103.352V24.6108H106.045ZM108.62%2027.5625C107.657%2027.5625%20106.876%2026.8068%20106.876%2025.321C106.876%2023.7812%20107.702%2023.0795%20108.614%2023.0795C109.302%2023.0795%20109.683%2023.483%20109.847%2023.8835H109.876V21.6818H111.265V27.5H109.89V26.7926H109.847C109.671%2027.196%20109.279%2027.5625%20108.62%2027.5625ZM109.103%2026.4801C109.609%2026.4801%20109.907%2026.0256%20109.907%2025.3182C109.907%2024.6051%20109.612%2024.1648%20109.103%2024.1648C108.586%2024.1648%20108.302%2024.6165%20108.302%2025.3182C108.302%2026.0227%20108.589%2026.4801%20109.103%2026.4801ZM113.737%2027.5625C112.774%2027.5625%20111.993%2026.8068%20111.993%2025.321C111.993%2023.7812%20112.82%2023.0795%20113.732%2023.0795C114.419%2023.0795%20114.8%2023.483%20114.964%2023.8835H114.993V21.6818H116.382V27.5H115.007V26.7926H114.964C114.788%2027.196%20114.396%2027.5625%20113.737%2027.5625ZM114.22%2026.4801C114.726%2026.4801%20115.024%2026.0256%20115.024%2025.3182C115.024%2024.6051%20114.729%2024.1648%20114.22%2024.1648C113.703%2024.1648%20113.419%2024.6165%20113.419%2025.3182C113.419%2026.0227%20113.706%2026.4801%20114.22%2026.4801Z'%20fill='%2324292E'/%3e%3cpath%20d='M122%2035H82V48H122V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M102%203C101.308%203%20100.631%203.20527%20100.056%203.58986C99.4799%203.97444%2099.0313%204.52107%2098.7664%205.16061C98.5015%205.80015%2098.4322%206.50388%2098.5673%207.18282C98.7023%207.86175%2099.0356%208.48539%2099.5251%208.97487C100.015%209.46436%20100.638%209.7977%20101.317%209.93275C101.996%2010.0678%20102.7%209.99848%20103.339%209.73358C103.979%209.46867%20104.526%209.02007%20104.91%208.44449C105.295%207.86892%20105.5%207.19223%20105.5%206.5C105.5%206.04037%20105.409%205.58525%20105.234%205.16061C105.058%204.73597%20104.8%204.35013%20104.475%204.02513C104.15%203.70012%20103.764%203.44231%20103.339%203.26642C102.915%203.09053%20102.46%203%20102%203V3ZM102%209.3C101.446%209.3%20100.905%209.13578%20100.444%208.82811C99.9839%208.52045%2099.6251%208.08315%2099.4131%207.57151C99.2012%207.05988%2099.1458%206.49689%2099.2538%205.95375C99.3618%205.4106%2099.6285%204.91169%20100.02%204.5201C100.412%204.12851%20100.911%203.86184%20101.454%203.7538C101.997%203.64576%20102.56%203.70121%20103.072%203.91314C103.583%204.12506%20104.02%204.48395%20104.328%204.9444C104.636%205.40486%20104.8%205.94621%20104.8%206.5C104.8%207.24261%20104.505%207.9548%20103.98%208.4799C103.455%209.005%20102.743%209.3%20102%209.3V9.3ZM102%204.4C101.907%204.4%20101.818%204.43687%20101.753%204.50251C101.687%204.56815%20101.65%204.65717%20101.65%204.75V6.15H100.95C100.857%206.15%20100.768%206.18687%20100.703%206.25251C100.637%206.31815%20100.6%206.40717%20100.6%206.5C100.6%206.59283%20100.637%206.68185%20100.703%206.74749C100.768%206.81312%20100.857%206.85%20100.95%206.85H102C102.093%206.85%20102.182%206.81312%20102.247%206.74749C102.313%206.68185%20102.35%206.59283%20102.35%206.5V4.75C102.35%204.65717%20102.313%204.56815%20102.247%204.50251C102.182%204.43687%20102.093%204.4%20102%204.4Z'%20fill='white'/%3e%3cpath%20d='M93.2898%2045.6364C92.9574%2045.6364%2092.6477%2045.5824%2092.4375%2045.4972L92.7443%2044.4886C93.1534%2044.6222%2093.4545%2044.6165%2093.5881%2044.2898L93.642%2044.1591L92.0909%2039.6364H93.5455L94.3494%2042.75H94.3949L95.2102%2039.6364H96.6733L95.0284%2044.4176C94.7869%2045.1307%2094.2898%2045.6364%2093.2898%2045.6364ZM98.0554%2045.6364C97.723%2045.6364%2097.4134%2045.5824%2097.2031%2045.4972L97.5099%2044.4886C97.919%2044.6222%2098.2202%2044.6165%2098.3537%2044.2898L98.4077%2044.1591L96.8565%2039.6364H98.3111L99.1151%2042.75H99.1605L99.9759%2039.6364H101.439L99.794%2044.4176C99.5526%2045.1307%2099.0554%2045.6364%2098.0554%2045.6364ZM102.821%2045.6364C102.489%2045.6364%20102.179%2045.5824%20101.969%2045.4972L102.276%2044.4886C102.685%2044.6222%20102.986%2044.6165%20103.119%2044.2898L103.173%2044.1591L101.622%2039.6364H103.077L103.881%2042.75H103.926L104.741%2039.6364H106.205L104.56%2044.4176C104.318%2045.1307%20103.821%2045.6364%20102.821%2045.6364ZM107.587%2045.6364C107.254%2045.6364%20106.945%2045.5824%20106.734%2045.4972L107.041%2044.4886C107.45%2044.6222%20107.751%2044.6165%20107.885%2044.2898L107.939%2044.1591L106.388%2039.6364H107.842L108.646%2042.75H108.692L109.507%2039.6364H110.97L109.325%2044.4176C109.084%2045.1307%20108.587%2045.6364%20107.587%2045.6364Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1706_105947'%20x1='0'%20y1='6.5052'%20x2='54'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1706_105947'%20x1='82'%20y1='6.5052'%20x2='122'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1706_105947'%3e%3crect%20width='54'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_46 = "data:image/svg+xml,%3csvg%20width='78'%20height='51'%20viewBox='0%200%2078%2051'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126371)'%3e%3cpath%20d='M2%200.800642V10H26V1.05456e-06H3.00292L2.0002%200L2%200.800642Z'%20fill='url(%23paint0_linear_1248_126371)'/%3e%3cpath%20d='M26%2013H2V22.5H26V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2025.75H2V35.25H26V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2038.5H2V48H26V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15.5%2014.75H14.0716L12.5%2015.6699V16.9238L13.9253%2016.1035H13.9627V20.75H15.5V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2033.5H16.5V32.3468H14.0841V32.3092L14.7972%2031.6561C16.0896%2030.5376%2016.4272%2029.9682%2016.4272%2029.289C16.4272%2028.2225%2015.5511%2027.5%2014.1976%2027.5C12.879%2027.5%2011.9971%2028.2543%2012%2029.4595H13.3651C13.3651%2028.9249%2013.697%2028.6156%2014.1918%2028.6156C14.6779%2028.6156%2015.0301%2028.9133%2015.0301%2029.4017C15.0301%2029.8439%2014.7506%2030.1445%2014.2616%2030.5809L12.0873%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2046.5H16.5V45.3468H14.0841V45.3092L14.7972%2044.6561C16.0896%2043.5376%2016.4272%2042.9682%2016.4272%2042.289C16.4272%2041.2225%2015.5511%2040.5%2014.1976%2040.5C12.879%2040.5%2011.9971%2041.2543%2012%2042.4595H13.3651C13.3651%2041.9249%2013.697%2041.6156%2014.1918%2041.6156C14.6779%2041.6156%2015.0301%2041.9133%2015.0301%2042.4017C15.0301%2042.8439%2014.7506%2043.1445%2014.2616%2043.5809L12.0873%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M39.9067%2030C40.6011%2030%2045.9327%2026%2045.9327%2024C45.9327%2022%2040.7357%2018%2039.9067%2018C39.0778%2018%2038.4023%2018.5%2038.4023%2019.4756C38.4023%2020.4512%2041.9067%2022.9206%2041.9067%2022.9206C41.9067%2022.9206%2034.2539%2022.25%2034%2022.9206C33.7461%2023.5911%2033.7461%2024.4089%2034%2025.0794C34.2539%2025.75%2041.9067%2025.0794%2041.9067%2025.0794C41.9067%2025.0794%2038.4023%2027.75%2038.4023%2028.5301C38.4023%2029.3103%2039.2124%2030%2039.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_126371)'%3e%3cpath%20d='M54%200.800642V10H78V1.13097e-06H55.0029C54.7369%201.13097e-06%2054.0001%200%2054.0001%200C54.0001%200%2054%200.588299%2054%200.800642Z'%20fill='url(%23paint1_linear_1248_126371)'/%3e%3cpath%20d='M78%2013H54V29H78V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M78%2032H54V48H78V32Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M67.5%2018H66.0716L64.5%2018.9199V20.1738L65.9253%2019.3535H65.9627V24H67.5V18Z'%20fill='%2324292E'/%3e%3cpath%20d='M64.0873%2043H68.5V41.8468H66.0841V41.8092L66.7972%2041.1561C68.0896%2040.0376%2068.4272%2039.4682%2068.4272%2038.789C68.4272%2037.7225%2067.5511%2037%2066.1976%2037C64.879%2037%2063.9971%2037.7543%2064%2038.9595H65.3651C65.3651%2038.4249%2065.697%2038.1156%2066.1918%2038.1156C66.6779%2038.1156%2067.0301%2038.4133%2067.0301%2038.9017C67.0301%2039.3439%2066.7506%2039.6445%2066.2616%2040.0809L64.0873%2041.9711V43Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26%2025.7421H2V48H26V25.7421ZM0%2023.6179V50H28V23.6179L0%2023.6179Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126371'%20x1='2.00781'%20y1='5.004'%20x2='26.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126371'%20x1='54.001'%20y1='5.004'%20x2='78.001'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126371'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126371'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(54)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_47 = "data:image/svg+xml,%3csvg%20width='77'%20height='50'%20viewBox='0%200%2077%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126389)'%3e%3cpath%20d='M2%200.800642V10H26V1.05456e-06H3.00292L2.0002%200L2%200.800642Z'%20fill='url(%23paint0_linear_1248_126389)'/%3e%3cpath%20d='M26%2013H2V22.5H26V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2025.75H2V35.25H26V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26%2038.5H2V48H26V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15.5%2014.75H14.0716L12.5%2015.6699V16.9238L13.9253%2016.1035H13.9627V20.75H15.5V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2033.5H16.5V32.3468H14.0841V32.3092L14.7972%2031.6561C16.0896%2030.5376%2016.4272%2029.9682%2016.4272%2029.289C16.4272%2028.2225%2015.5511%2027.5%2014.1976%2027.5C12.879%2027.5%2011.9971%2028.2543%2012%2029.4595H13.3651C13.3651%2028.9249%2013.697%2028.6156%2014.1918%2028.6156C14.6779%2028.6156%2015.0301%2028.9133%2015.0301%2029.4017C15.0301%2029.8439%2014.7506%2030.1445%2014.2616%2030.5809L12.0873%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M12.0873%2046.5H16.5V45.3468H14.0841V45.3092L14.7972%2044.6561C16.0896%2043.5376%2016.4272%2042.9682%2016.4272%2042.289C16.4272%2041.2225%2015.5511%2040.5%2014.1976%2040.5C12.879%2040.5%2011.9971%2041.2543%2012%2042.4595H13.3651C13.3651%2041.9249%2013.697%2041.6156%2014.1918%2041.6156C14.6779%2041.6156%2015.0301%2041.9133%2015.0301%2042.4017C15.0301%2042.8439%2014.7506%2043.1445%2014.2616%2043.5809L12.0873%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M38.9067%2030C39.6011%2030%2044.9327%2026%2044.9327%2024C44.9327%2022%2039.7357%2018%2038.9067%2018C38.0778%2018%2037.4023%2018.5%2037.4023%2019.4756C37.4023%2020.4512%2040.9067%2022.9206%2040.9067%2022.9206C40.9067%2022.9206%2033.2539%2022.25%2033%2022.9206C32.7461%2023.5911%2032.7461%2024.4089%2033%2025.0794C33.2539%2025.75%2040.9067%2025.0794%2040.9067%2025.0794C40.9067%2025.0794%2037.4023%2027.75%2037.4023%2028.5301C37.4023%2029.3103%2038.2124%2030%2038.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_126389)'%3e%3cpath%20d='M63.7933%207.6179C64.5533%207.6179%2065.0788%207.32315%2065.3771%206.76562H65.4197V7.52557H67.0533V3.81818C67.0533%202.66406%2066.027%202%2064.6385%202C63.1719%202%2062.3409%202.73864%2062.2024%203.73295L63.804%203.78977C63.8786%203.44176%2064.1662%203.22869%2064.6243%203.22869C65.0504%203.22869%2065.3203%203.43466%2065.3203%203.80043V3.81818C65.3203%204.15199%2064.9581%204.22301%2064.0277%204.30469C62.9233%204.39702%2062%204.8054%2062%206.01278C62%207.09233%2062.7493%207.6179%2063.7933%207.6179ZM64.3295%206.48153C63.9283%206.48153%2063.6442%206.28977%2063.6442%205.92756C63.6442%205.57599%2063.9212%205.36293%2064.4148%205.28835C64.7379%205.24219%2065.1357%205.17116%2065.331%205.06818V5.58665C65.331%206.11932%2064.8835%206.48153%2064.3295%206.48153Z'%20fill='%2324292E'/%3e%3cpath%20d='M53%200.800642V10H77V1.13097e-06H54.0029C53.7369%201.13097e-06%2053.0001%200%2053.0001%200C53.0001%200%2053%200.588299%2053%200.800642Z'%20fill='url(%23paint1_linear_1248_126389)'/%3e%3cpath%20d='M77%2013H53V29H77V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2032H53V48H77V32Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M67%2017H65.0954L63%2018.2266V19.8984L64.9004%2018.8047H64.9502V25H67V17Z'%20fill='%2324292E'/%3e%3cpath%20d='M61.6524%2038.202H61.2683C61.0645%2038.202%2060.8691%2038.1207%2060.725%2037.9759C60.5809%2037.8311%2060.5%2037.6347%2060.5%2037.43C60.5%2037.2253%2060.5809%2037.0289%2060.725%2036.8841C60.8691%2036.7393%2061.0645%2036.658%2061.2683%2036.658H61.6524V36.272C61.6524%2036.0673%2061.7334%2035.8709%2061.8775%2035.7261C62.0216%2035.5813%2062.217%2035.5%2062.4207%2035.5C62.6245%2035.5%2062.8199%2035.5813%2062.964%2035.7261C63.1081%2035.8709%2063.189%2036.0673%2063.189%2036.272V36.658H63.5732C63.7769%2036.658%2063.9724%2036.7393%2064.1164%2036.8841C64.2605%2037.0289%2064.3415%2037.2253%2064.3415%2037.43C64.3415%2037.6347%2064.2605%2037.8311%2064.1164%2037.9759C63.9724%2038.1207%2063.7769%2038.202%2063.5732%2038.202H63.189V38.588C63.189%2038.7927%2063.1081%2038.9891%2062.964%2039.1339C62.8199%2039.2787%2062.6245%2039.36%2062.4207%2039.36C62.217%2039.36%2062.0216%2039.2787%2061.8775%2039.1339C61.7334%2038.9891%2061.6524%2038.7927%2061.6524%2038.588V38.202Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7317%2042.184H66.4268C66.2231%2042.184%2066.0276%2042.1027%2065.8836%2041.9579C65.7395%2041.8131%2065.6585%2041.6167%2065.6585%2041.412C65.6585%2041.2073%2065.7395%2041.0109%2065.8836%2040.8661C66.0276%2040.7213%2066.2231%2040.64%2066.4268%2040.64H68.7317C68.9355%2040.64%2069.1309%2040.7213%2069.275%2040.8661C69.4191%2041.0109%2069.5%2041.2073%2069.5%2041.412C69.5%2041.6167%2069.4191%2041.8131%2069.275%2041.9579C69.1309%2042.1027%2068.9355%2042.184%2068.7317%2042.184Z'%20fill='%2324292E'/%3e%3cpath%20d='M66.4268%2036.658H68.7317C68.9355%2036.658%2069.1309%2036.7393%2069.275%2036.8841C69.4191%2037.0289%2069.5%2037.2253%2069.5%2037.43C69.5%2037.6347%2069.4191%2037.8311%2069.275%2037.9759C69.1309%2038.1207%2068.9355%2038.202%2068.7317%2038.202H66.4268C66.2231%2038.202%2066.0276%2038.1207%2065.8836%2037.9759C65.7395%2037.8311%2065.6585%2037.6347%2065.6585%2037.43C65.6585%2037.2253%2065.7395%2037.0289%2065.8836%2036.8841C66.0276%2036.7393%2066.2231%2036.658%2066.4268%2036.658Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7317%2044.5H66.4268C66.2231%2044.5%2066.0276%2044.4187%2065.8836%2044.2739C65.7395%2044.1291%2065.6585%2043.9328%2065.6585%2043.728C65.6585%2043.5233%2065.7395%2043.3269%2065.8836%2043.1821C66.0276%2043.0373%2066.2231%2042.956%2066.4268%2042.956H68.7317C68.9355%2042.956%2069.1309%2043.0373%2069.275%2043.1821C69.4191%2043.3269%2069.5%2043.5233%2069.5%2043.728C69.5%2043.9328%2069.4191%2044.1291%2069.275%2044.2739C69.1309%2044.4187%2068.9355%2044.5%2068.7317%2044.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M61.2651%2044.5C61.0621%2044.5%2060.8674%2044.4193%2060.7234%2044.2755C60.5803%2044.1309%2060.5%2043.9352%2060.5%2043.7312C60.5%2043.5273%2060.5803%2043.3316%2060.7234%2043.187L61.2689%2042.6389L60.7234%2042.0907C60.5975%2041.9431%2060.5318%2041.7531%2060.5392%2041.5588C60.5467%2041.3645%2060.6269%2041.1802%2060.7637%2041.0427C60.9005%2040.9052%2061.084%2040.8247%2061.2773%2040.8172C61.4707%2040.8097%2061.6597%2040.8758%2061.8067%2041.0022L62.3522%2041.5503L62.8977%2041.0022C63.0447%2040.8758%2063.2337%2040.8097%2063.4271%2040.8172C63.6204%2040.8247%2063.8039%2040.9052%2063.9407%2041.0427C64.0775%2041.1802%2064.1577%2041.3645%2064.1652%2041.5588C64.1726%2041.7531%2064.1069%2041.9431%2063.981%2042.0907L63.4355%2042.6389L63.981%2043.187C64.1241%2043.3316%2064.2044%2043.5273%2064.2044%2043.7312C64.2044%2043.9352%2064.1241%2044.1309%2063.981%2044.2755C63.837%2044.4193%2063.6423%2044.5%2063.4393%2044.5C63.2364%2044.5%2063.0416%2044.4193%2062.8977%2044.2755L62.3522%2043.7274L61.8067%2044.2755C61.6628%2044.4193%2061.468%2044.5%2061.2651%2044.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M26%2025.75H2V47.9532H26V25.75ZM0%2023.7887V50H28V23.7887L0%2023.7887Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126389'%20x1='2.00781'%20y1='5.004'%20x2='26.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126389'%20x1='53.001'%20y1='5.004'%20x2='77.001'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126389'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(2)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126389'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(53)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_48 = "data:image/svg+xml,%3csvg%20width='106'%20height='50'%20viewBox='0%200%20106%2050'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1899_521)'%3e%3cpath%20d='M0%200.800641V10H24V1.05456e-06H1.00292L0.000198677%200L0%200.800641Z'%20fill='url(%23paint0_linear_1899_521)'/%3e%3cpath%20d='M24%2013H0V22.5H24V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2025.75H0V35.25H24V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2038.5H0V48H24V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13%2014.6179H11.5716L10%2015.5378V16.7917L11.4253%2015.9714H11.4627V20.6179H13V14.6179Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2033.5H14.25V32.3468H11.8341V32.3092L12.5472%2031.6561C13.8396%2030.5376%2014.1772%2029.9682%2014.1772%2029.289C14.1772%2028.2225%2013.3011%2027.5%2011.9476%2027.5C10.629%2027.5%209.7471%2028.2543%209.75001%2029.4595H11.1151C11.1151%2028.9249%2011.447%2028.6156%2011.9418%2028.6156C12.4279%2028.6156%2012.7801%2028.9133%2012.7801%2029.4017C12.7801%2029.8439%2012.5006%2030.1445%2012.0116%2030.5809L9.83733%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2046.25H14.25V45.0968H11.8341V45.0592L12.5472%2044.4061C13.8396%2043.2876%2014.1772%2042.7182%2014.1772%2042.039C14.1772%2040.9725%2013.3011%2040.25%2011.9476%2040.25C10.629%2040.25%209.7471%2041.0043%209.75001%2042.2095H11.1151C11.1151%2041.6749%2011.447%2041.3656%2011.9418%2041.3656C12.4279%2041.3656%2012.7801%2041.6633%2012.7801%2042.1517C12.7801%2042.5939%2012.5006%2042.8945%2012.0116%2043.3309L9.83733%2045.2211V46.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1899_521)'%3e%3cpath%20d='M28%200.800641V10H52V1.05456e-06H29.0029L28.0002%200L28%200.800641Z'%20fill='url(%23paint1_linear_1899_521)'/%3e%3cpath%20d='M52%2013H28V22.5H52V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2025.75H28V35.25H52V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2038.5H28V48H52V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M39.9792%2020.875C41.3085%2020.875%2042.2528%2020.1507%2042.25%2019.1355C42.2528%2018.4168%2041.7958%2017.9035%2040.9208%2017.798V17.7524C41.5771%2017.6554%2042.0423%2017.202%2042.0395%2016.5461C42.0423%2015.5936%2041.206%2014.875%2039.9903%2014.875C38.7663%2014.875%2037.8746%2015.605%2037.8635%2016.6431H39.1734C39.1845%2016.2438%2039.5334%2015.9758%2039.9903%2015.9758C40.4251%2015.9758%2040.7214%2016.2467%2040.7186%2016.6374C40.7214%2017.0423%2040.3725%2017.3218%2039.8685%2017.3218H39.3174V18.3256H39.8685C40.4417%2018.3256%2040.8155%2018.6164%2040.81%2019.0271C40.8155%2019.4406%2040.4721%2019.7286%2039.9848%2019.7286C39.5001%2019.7286%2039.1429%2019.4634%2039.1291%2019.0784H37.75C37.7611%2020.1336%2038.6832%2020.875%2039.9792%2020.875Z'%20fill='%2324292E'/%3e%3cpath%20d='M37.5%2032.4453V31.4463L40.0893%2027.5H41.7308V31.4287H42.5V32.4453H41.7308V33.5H40.477V32.4453H37.5ZM40.5012%2031.4287V28.8828H40.4528L38.8204%2031.3818V31.4287H40.5012Z'%20fill='%2324292E'/%3e%3cpath%20d='M40.2102%2046.25C38.8025%2046.25%2037.7766%2045.5188%2037.75%2044.4957H39.1444C39.1776%2044.9552%2039.6391%2045.2673%2040.2102%2045.2673C40.8841%2045.2673%2041.3655%2044.8425%2041.3655%2044.2269C41.3655%2043.6055%2040.8742%2043.1749%2040.1902%2043.172C39.7885%2043.172%2039.3835%2043.3251%2039.1743%2043.5708L37.8961%2043.3714L38.2181%2040.25H42.3748V41.2731H39.4034L39.2274%2042.7558H39.2673C39.5063%2042.4639%2040.0209%2042.2471%2040.6185%2042.2471C41.8436%2042.2471%2042.7533%2043.0621%2042.75%2044.1951C42.7533%2045.3916%2041.7241%2046.25%2040.2102%2046.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M80%200.800641V10H104V1.05456e-06H81.0029L80.0002%200L80%200.800641Z'%20fill='url(%23paint2_linear_1899_521)'/%3e%3cpath%20d='M104%2017H80V24H104V17Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M104%2033H80V40H104V33Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M104%2041H80V48H104V41Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M91.8577%2023C92.9654%2023%2093.7523%2022.3964%2093.75%2021.5504C93.7523%2020.9515%2093.3715%2020.5238%2092.6423%2020.4358V20.3978C93.1892%2020.317%2093.5769%2019.9392%2093.5746%2019.3926C93.5769%2018.5989%2092.88%2018%2091.8669%2018C90.8469%2018%2090.1038%2018.6084%2090.0946%2019.4734H91.1862C91.1954%2019.1407%2091.4861%2018.9173%2091.8669%2018.9173C92.2292%2018.9173%2092.4761%2019.1431%2092.4738%2019.4686C92.4761%2019.8061%2092.1854%2020.039%2091.7654%2020.039H91.3062V20.8755H91.7654C92.2431%2020.8755%2092.5546%2021.1179%2092.55%2021.4601C92.5546%2021.8047%2092.2685%2022.0447%2091.8623%2022.0447C91.4585%2022.0447%2091.1608%2021.8237%2091.1492%2021.5029H90C90.0092%2022.3821%2090.7777%2023%2091.8577%2023Z'%20fill='%2324292E'/%3e%3cpath%20d='M90%2038.1211V37.2886L92.1578%2034H93.5256V37.2739H94.1667V38.1211H93.5256V39H92.4808V38.1211H90ZM92.501%2037.2739V35.1523H92.4606L91.1003%2037.2349V37.2739H92.501Z'%20fill='%2324292E'/%3e%3cpath%20d='M92.0501%2047C90.877%2047%2090.0221%2046.3907%2090%2045.5381H91.162C91.1897%2045.921%2091.5743%2046.1811%2092.0501%2046.1811C92.6118%2046.1811%2093.0129%2045.8271%2093.0129%2045.3141C93.0129%2044.7962%2092.6035%2044.4374%2092.0335%2044.435C91.6988%2044.435%2091.3612%2044.5626%2091.1869%2044.7673L90.1217%2044.6012L90.3901%2042H93.854V42.8526H91.3778L91.2312%2044.0881H91.2644C91.4636%2043.8449%2091.8924%2043.6643%2092.3904%2043.6643C93.4113%2043.6643%2094.1694%2044.3434%2094.1667%2045.2876C94.1694%2046.2847%2093.3117%2047%2092.0501%2047Z'%20fill='%2324292E'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M104%2033H80V47.579H104V33ZM78%2028V50H106V28L78%2028Z'%20fill='%2324292E'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M104%2017H80V24H104V17ZM78%2012V26H106V12H78Z'%20fill='%2324292E'/%3e%3cpath%20d='M65.9067%2031.75C66.6011%2031.75%2071.9327%2027.75%2071.9327%2025.75C71.9327%2023.75%2066.7357%2019.75%2065.9067%2019.75C65.0777%2019.75%2064.4023%2020.25%2064.4023%2021.2256C64.4023%2022.2012%2067.9067%2024.6706%2067.9067%2024.6706C67.9067%2024.6706%2060.2539%2024%2060%2024.6706C59.7461%2025.3411%2059.7461%2026.1589%2060%2026.8294C60.2539%2027.5%2067.9067%2026.8294%2067.9067%2026.8294C67.9067%2026.8294%2064.4023%2029.5%2064.4023%2030.2801C64.4023%2031.0603%2065.2123%2031.75%2065.9067%2031.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M81.25%2013H80.1787L79%2013.6899V14.6304L80.069%2014.0151H80.097V17.5H81.25V13Z'%20fill='white'/%3e%3cpath%20d='M79.0655%2033.5H82.375V32.6351H80.5631V32.6069L81.0979%2032.1171C82.0672%2031.2782%2082.3204%2030.8512%2082.3204%2030.3418C82.3204%2029.5419%2081.6633%2029%2080.6482%2029C79.6593%2029%2078.9978%2029.5658%2079%2030.4697H80.0239C80.0239%2030.0686%2080.2727%2029.8367%2080.6438%2029.8367C81.0084%2029.8367%2081.2726%2030.06%2081.2726%2030.4263C81.2726%2030.7579%2081.063%2030.9834%2080.6962%2031.3107L79.0655%2032.7283V33.5Z'%20fill='white'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1899_521'%20x1='0.00781255'%20y1='5.004'%20x2='24.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1899_521'%20x1='28.0078'%20y1='5.004'%20x2='52.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1899_521'%20x1='80.0078'%20y1='5.004'%20x2='104.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1899_521'%3e%3crect%20width='24'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1899_521'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(28)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_49 = "data:image/svg+xml,%3csvg%20width='188'%20height='48'%20viewBox='0%200%20188%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126059)'%3e%3cpath%20d='M0%200.800641V10H24V1.05456e-06H1.00292L0.000198677%200L0%200.800641Z'%20fill='url(%23paint0_linear_1248_126059)'/%3e%3cpath%20d='M24%2013H0V22.5H24V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2025.75H0V35.25H24V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2038.5H0V48H24V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13%2014.6179H11.5716L10%2015.5378V16.7917L11.4253%2015.9714H11.4627V20.6179H13V14.6179Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2033.5H14.25V32.3468H11.8341V32.3092L12.5472%2031.6561C13.8396%2030.5376%2014.1772%2029.9682%2014.1772%2029.289C14.1772%2028.2225%2013.3011%2027.5%2011.9476%2027.5C10.629%2027.5%209.7471%2028.2543%209.75001%2029.4595H11.1151C11.1151%2028.9249%2011.447%2028.6156%2011.9418%2028.6156C12.4279%2028.6156%2012.7801%2028.9133%2012.7801%2029.4017C12.7801%2029.8439%2012.5006%2030.1445%2012.0116%2030.5809L9.83733%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2046.25H14.25V45.0968H11.8341V45.0592L12.5472%2044.4061C13.8396%2043.2876%2014.1772%2042.7182%2014.1772%2042.039C14.1772%2040.9725%2013.3011%2040.25%2011.9476%2040.25C10.629%2040.25%209.7471%2041.0043%209.75001%2042.2095H11.1151C11.1151%2041.6749%2011.447%2041.3656%2011.9418%2041.3656C12.4279%2041.3656%2012.7801%2041.6633%2012.7801%2042.1517C12.7801%2042.5939%2012.5006%2042.8945%2012.0116%2043.3309L9.83733%2045.2211V46.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126059)'%3e%3cpath%20d='M28%200.800641V10H52V1.05456e-06H29.0029L28.0002%200L28%200.800641Z'%20fill='url(%23paint1_linear_1248_126059)'/%3e%3cpath%20d='M52%2013H28V22.5H52V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2025.75H28V35.25H52V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M52%2038.5H28V48H52V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M40.1058%2046.25C41.5564%2046.25%2042.4563%2045.4582%2042.5%2044.2595H40.9654C40.905%2044.7737%2040.5759%2045.0544%2040.1259%2045.0544C39.5484%2045.0544%2039.1723%2044.597%2039.1723%2043.7358C39.1723%2042.8809%2039.5517%2042.4235%2040.1259%2042.4235C40.596%2042.4235%2040.9016%2042.7232%2040.9654%2043.2185H42.5C42.4631%2042.026%2041.5363%2041.25%2040.1024%2041.25C38.4805%2041.25%2037.5%2042.2658%2037.5%2043.7516C37.5%2045.2311%2038.4738%2046.25%2040.1058%2046.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1248_126059)'%3e%3cpath%20d='M56%200.800641V10H80V1.05456e-06H57.0029L56.0002%200L56%200.800641Z'%20fill='url(%23paint2_linear_1248_126059)'/%3e%3cpath%20d='M80%2013H56V22.5H80V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M80%2025.75H56V35.25H80V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M80%2038.5H56V48H80V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M67.5383%2020.75C68.2141%2020.75%2068.616%2020.3761%2068.7966%2019.9645H68.8403V20.6862H70.25V14.75H68.8257V16.9964H68.7966C68.6277%2016.5877%2068.2374%2016.1761%2067.5325%2016.1761C66.5976%2016.1761%2065.75%2016.892%2065.75%2018.463C65.75%2019.979%2066.551%2020.75%2067.5383%2020.75ZM68.0335%2019.6457C67.5063%2019.6457%2067.2121%2019.179%2067.2121%2018.4601C67.2121%2017.7442%2067.5034%2017.2833%2068.0335%2017.2833C68.5549%2017.2833%2068.8578%2017.7326%2068.8578%2018.4601C68.8578%2019.1819%2068.5519%2019.6457%2068.0335%2019.6457Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.0797%2033C69.4177%2033%2070.2975%2032.3849%2070.4834%2031.4322L68.9927%2031.3912C68.8665%2031.7129%2068.5345%2031.8864%2068.1096%2031.8864C67.4854%2031.8864%2067.1003%2031.4921%2067.1003%2030.8991V30.858H70.5V30.4732C70.5%2028.877%2069.4774%2028%2068.0299%2028C66.4894%2028%2065.5%2029.0032%2065.5%2030.5047C65.5%2032.0568%2066.4761%2033%2068.0797%2033ZM67.1003%2029.9621C67.1235%2029.4795%2067.5252%2029.1136%2068.0631%2029.1136C68.5976%2029.1136%2068.9827%2029.4669%2068.9894%2029.9621H67.1003Z'%20fill='%2324292E'/%3e%3cpath%20d='M69.2936%2041.9515H68.4651V41.7108C68.4651%2041.4646%2068.5669%2041.3134%2068.8893%2041.3134C69.0193%2041.3134%2069.1777%2041.3414%2069.2795%2041.3722L69.5%2040.3703C69.336%2040.3256%2068.9599%2040.25%2068.5782%2040.25C67.6932%2040.25%2067.0853%2040.7369%2067.0853%2041.7332V41.9515H66.5V42.959H67.0853V46.25H68.4651V42.959H69.2936V41.9515Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M93.9067%2030C94.6011%2030%2099.9327%2026%2099.9327%2024C99.9327%2022%2094.7357%2018%2093.9067%2018C93.0778%2018%2092.4023%2018.5%2092.4023%2019.4756C92.4023%2020.4512%2095.9067%2022.9206%2095.9067%2022.9206C95.9067%2022.9206%2088.2539%2022.25%2088%2022.9206C87.7461%2023.5911%2087.7461%2024.4089%2088%2025.0794C88.2539%2025.75%2095.9067%2025.0794%2095.9067%2025.0794C95.9067%2025.0794%2092.4023%2027.75%2092.4023%2028.5301C92.4023%2029.3103%2093.2124%2030%2093.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip3_1248_126059)'%3e%3cpath%20d='M108%200.800641V10H132V1.05456e-06H109.003L108%200L108%200.800641Z'%20fill='url(%23paint3_linear_1248_126059)'/%3e%3cpath%20d='M132%2013H108V22.5H132V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M132%2025.75H108V35.25H132V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M132%2038.5H108V48H132V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M120.106%2046.25C121.556%2046.25%20122.456%2045.4582%20122.5%2044.2595H120.965C120.905%2044.7737%20120.576%2045.0544%20120.126%2045.0544C119.548%2045.0544%20119.172%2044.597%20119.172%2043.7358C119.172%2042.8809%20119.552%2042.4235%20120.126%2042.4235C120.596%2042.4235%20120.902%2042.7232%20120.965%2043.2185H122.5C122.463%2042.026%20121.536%2041.25%20120.102%2041.25C118.481%2041.25%20117.5%2042.2658%20117.5%2043.7516C117.5%2045.2311%20118.474%2046.25%20120.106%2046.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M117.75%2033.4362H119.16V32.7145H119.203C119.384%2033.1261%20119.786%2033.5%20120.462%2033.5C121.452%2033.5%20122.25%2032.729%20122.25%2031.213C122.25%2029.642%20121.405%2028.9261%20120.47%2028.9261C119.763%2028.9261%20119.375%2029.3377%20119.203%2029.7464H119.174V27.5H117.75V33.4362ZM119.145%2031.2101C119.145%2030.4826%20119.448%2030.0333%20119.969%2030.0333C120.497%2030.0333%20120.788%2030.4942%20120.788%2031.2101C120.788%2031.929%20120.497%2032.3957%20119.969%2032.3957C119.448%2032.3957%20119.145%2031.9319%20119.145%2031.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M119.346%2020.25C120.022%2020.25%20120.49%2019.9877%20120.756%2019.4915H120.794V20.1678H122.247V16.8682C122.247%2015.841%20121.334%2015.25%20120.098%2015.25C118.793%2015.25%20118.053%2015.9074%20117.93%2016.7924L119.356%2016.8429C119.422%2016.5332%20119.678%2016.3436%20120.086%2016.3436C120.465%2016.3436%20120.705%2016.5269%20120.705%2016.8524V16.8682C120.705%2017.1653%20120.383%2017.2285%20119.555%2017.3012C118.572%2017.3834%20117.75%2017.7468%20117.75%2018.8214C117.75%2019.7822%20118.417%2020.25%20119.346%2020.25ZM119.823%2019.2386C119.466%2019.2386%20119.213%2019.068%20119.213%2018.7456C119.213%2018.4327%20119.46%2018.243%20119.899%2018.1767C120.187%2018.1356%20120.541%2018.0724%20120.715%2017.9807V18.4422C120.715%2018.9162%20120.316%2019.2386%20119.823%2019.2386Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1248_126059)'%3e%3cpath%20d='M136%200.800641V10H160V1.05456e-06H137.003L136%200L136%200.800641Z'%20fill='url(%23paint4_linear_1248_126059)'/%3e%3cpath%20d='M160%2013H136V22.5H160V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M160%2025.75H136V35.25H160V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M160%2038.5H136V48H160V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M149.5%202H148.072L146.5%202.91992V4.17383L147.925%203.35352H147.963V8H149.5V2Z'%20fill='%2324292E'/%3e%3cpath%20d='M147.538%2021C148.214%2021%20148.616%2020.6261%20148.797%2020.2145H148.84V20.9362H150.25V15H148.826V17.2464H148.797C148.628%2016.8377%20148.237%2016.4261%20147.533%2016.4261C146.598%2016.4261%20145.75%2017.142%20145.75%2018.713C145.75%2020.229%20146.551%2021%20147.538%2021ZM148.033%2019.8957C147.506%2019.8957%20147.212%2019.429%20147.212%2018.7101C147.212%2017.9942%20147.503%2017.5333%20148.033%2017.5333C148.555%2017.5333%20148.858%2017.9826%20148.858%2018.7101C148.858%2019.4319%20148.552%2019.8957%20148.033%2019.8957Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip5_1248_126059)'%3e%3cpath%20d='M164%200.800641V10H188V1.05456e-06H165.003L164%200L164%200.800641Z'%20fill='url(%23paint5_linear_1248_126059)'/%3e%3cpath%20d='M188%2013H164V22.5H188V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M188%2025.75H164V35.25H188V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M188%2038.5H164V48H188V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M173.837%208H178.25V6.84682H175.834V6.80925L176.547%206.15607C177.84%205.03757%20178.177%204.46821%20178.177%203.78902C178.177%202.72254%20177.301%202%20175.948%202C174.629%202%20173.747%202.75434%20173.75%203.95954H175.115C175.115%203.42486%20175.447%203.11561%20175.942%203.11561C176.428%203.11561%20176.78%203.41329%20176.78%203.90173C176.78%204.34393%20176.501%204.64451%20176.012%205.08093L173.837%206.9711V8Z'%20fill='%2324292E'/%3e%3cpath%20d='M176.08%2033C177.418%2033%20178.297%2032.3849%20178.483%2031.4322L176.993%2031.3912C176.867%2031.7129%20176.535%2031.8864%20176.11%2031.8864C175.485%2031.8864%20175.1%2031.4921%20175.1%2030.8991V30.858H178.5V30.4732C178.5%2028.877%20177.477%2028%20176.03%2028C174.489%2028%20173.5%2029.0032%20173.5%2030.5047C173.5%2032.0568%20174.476%2033%20176.08%2033ZM175.1%2029.9621C175.124%2029.4795%20175.525%2029.1136%20176.063%2029.1136C176.598%2029.1136%20176.983%2029.4669%20176.989%2029.9621H175.1Z'%20fill='%2324292E'/%3e%3cpath%20d='M177.294%2041.7015H176.465V41.4608C176.465%2041.2146%20176.567%2041.0634%20176.889%2041.0634C177.019%2041.0634%20177.178%2041.0914%20177.279%2041.1222L177.5%2040.1203C177.336%2040.0756%20176.96%2040%20176.578%2040C175.693%2040%20175.085%2040.4869%20175.085%2041.4832V41.7015H174.5V42.709H175.085V46H176.465V42.709H177.294V41.7015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126059'%20x1='0.00781255'%20y1='5.004'%20x2='24.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126059'%20x1='28.0078'%20y1='5.004'%20x2='52.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126059'%20x1='56.0078'%20y1='5.004'%20x2='80.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126059'%20x1='108.008'%20y1='5.004'%20x2='132.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126059'%20x1='136.008'%20y1='5.004'%20x2='160.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1248_126059'%20x1='164.008'%20y1='5.004'%20x2='188.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126059'%3e%3crect%20width='24'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126059'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(28)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126059'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(56)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126059'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(108)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1248_126059'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(136)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_1248_126059'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(164)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_50 = "data:image/svg+xml,%3csvg%20width='124'%20height='48'%20viewBox='0%200%20124%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_125902)'%3e%3cpath%20d='M0%200.611699V7.64012H14.394V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1248_125902)'/%3e%3cpath%20d='M33.606%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200L33.606%200V7.64012Z'%20fill='url(%23paint1_linear_1248_125902)'/%3e%3cpath%20d='M31.194%200H16.8V7.64012H31.194V0Z'%20fill='url(%23paint2_linear_1248_125902)'/%3e%3cpath%20d='M31.194%2010.0869H16.8V17.727H31.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2010.0869H0V17.727H14.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2010.0869H33.606V17.727H48V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2020.1799H33.606V27.8262H48V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2020.1799H16.8V27.8262H31.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2020.1799H0V27.8262H14.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2030.2668H16.8V37.907H31.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2030.2668H33.606V37.907H48V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2030.2668H0V37.907H14.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M31.194%2040.3599H16.8V48H31.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M48%2047.3883V40.3721H33.606V48H47.3985C47.558%2048%2047.711%2047.9356%2047.8238%2047.8209C47.9366%2047.7061%2048%2047.5505%2048%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2048V40.3721H0V47.3883C0%2047.5505%200.0633725%2047.7061%200.176176%2047.8209C0.28898%2047.9356%200.441975%2048%200.601504%2048H14.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030.4C62.6011%2030.4%2067.9327%2026.1333%2067.9327%2024C67.9327%2021.8666%2062.7357%2017.6%2061.9067%2017.6C61.0778%2017.6%2060.4023%2018.1333%2060.4023%2019.1739C60.4023%2020.2146%2063.9067%2022.8486%2063.9067%2022.8486C63.9067%2022.8486%2056.2539%2022.1333%2056%2022.8486C55.7461%2023.5639%2055.7461%2024.4361%2056%2025.1514C56.2539%2025.8666%2063.9067%2025.1514%2063.9067%2025.1514C63.9067%2025.1514%2060.4023%2028%2060.4023%2028.8321C60.4023%2029.6643%2061.2124%2030.4%2061.9067%2030.4Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_125902)'%3e%3cpath%20d='M81.4059%200H76.5993C76.2683%200%2076%200.268327%2076%200.599326V5.40592C76%205.73692%2076.2683%206.00524%2076.5993%206.00524H81.4059C81.7369%206.00524%2082.0052%205.73692%2082.0052%205.40592V0.599326C82.0052%200.268327%2081.7369%200%2081.4059%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%200H93.3984C93.0674%200%2092.7991%200.268327%2092.7991%200.599326V5.40592C92.7991%205.73692%2093.0674%206.00524%2093.3984%206.00524H98.205C98.536%206.00524%2098.8043%205.73692%2098.8043%205.40592V0.599326C98.8043%200.268327%2098.536%200%2098.205%200Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.608%200H101.801C101.47%200%20101.202%200.268327%20101.202%200.599326V5.40592C101.202%205.73692%20101.47%206.00524%20101.801%206.00524H106.608C106.939%206.00524%20107.207%205.73692%20107.207%205.40592V0.599326C107.207%200.268327%20106.939%200%20106.608%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M115.004%200H110.198C109.867%200%20109.598%200.268327%20109.598%200.599326V5.40592C109.598%205.73692%20109.867%206.00524%20110.198%206.00524H115.004C115.335%206.00524%20115.603%205.73692%20115.603%205.40592V0.599326C115.603%200.268327%20115.335%200%20115.004%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M123.407%208.40253H118.6C118.269%208.40253%20118.001%208.67085%20118.001%209.00185V13.8084C118.001%2014.1394%20118.269%2014.4078%20118.6%2014.4078H123.407C123.738%2014.4078%20124.006%2014.1394%20124.006%2013.8084V9.00185C124.006%208.67085%20123.738%208.40253%20123.407%208.40253Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%2016.7991H93.3984C93.0674%2016.7991%2092.7991%2017.0674%2092.7991%2017.3984V22.205C92.7991%2022.536%2093.0674%2022.8043%2093.3984%2022.8043H98.205C98.536%2022.8043%2098.8043%2022.536%2098.8043%2022.205V17.3984C98.8043%2017.0674%2098.536%2016.7991%2098.205%2016.7991Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.608%2016.7991H101.801C101.47%2016.7991%20101.202%2017.0674%20101.202%2017.3984V22.205C101.202%2022.536%20101.47%2022.8043%20101.801%2022.8043H106.608C106.939%2022.8043%20107.207%2022.536%20107.207%2022.205V17.3984C107.207%2017.0674%20106.939%2016.7991%20106.608%2016.7991Z'%20fill='%233865AB'/%3e%3cpath%20d='M115.004%2016.7991H110.198C109.867%2016.7991%20109.598%2017.0674%20109.598%2017.3984V22.205C109.598%2022.536%20109.867%2022.8043%20110.198%2022.8043H115.004C115.335%2022.8043%20115.603%2022.536%20115.603%2022.205V17.3984C115.603%2017.0674%20115.335%2016.7991%20115.004%2016.7991Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M123.407%2016.7991H118.6C118.269%2016.7991%20118.001%2017.0674%20118.001%2017.3984V22.205C118.001%2022.536%20118.269%2022.8043%20118.6%2022.8043H123.407C123.738%2022.8043%20124.006%2022.536%20124.006%2022.205V17.3984C124.006%2017.0674%20123.738%2016.7991%20123.407%2016.7991Z'%20fill='%233865AB'/%3e%3cpath%20d='M81.4059%2025.2017H76.5993C76.2683%2025.2017%2076%2025.47%2076%2025.801V30.6076C76%2030.9386%2076.2683%2031.2069%2076.5993%2031.2069H81.4059C81.7369%2031.2069%2082.0052%2030.9386%2082.0052%2030.6076V25.801C82.0052%2025.47%2081.7369%2025.2017%2081.4059%2025.2017Z'%20fill='%233865AB'/%3e%3cpath%20d='M106.608%2025.2017H101.801C101.47%2025.2017%20101.202%2025.47%20101.202%2025.801V30.6076C101.202%2030.9386%20101.47%2031.2069%20101.801%2031.2069H106.608C106.939%2031.2069%20107.207%2030.9386%20107.207%2030.6076V25.801C107.207%2025.47%20106.939%2025.2017%20106.608%2025.2017Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M115.004%2025.2017H110.198C109.867%2025.2017%20109.598%2025.47%20109.598%2025.801V30.6076C109.598%2030.9386%20109.867%2031.2069%20110.198%2031.2069H115.004C115.335%2031.2069%20115.603%2030.9386%20115.603%2030.6076V25.801C115.603%2025.47%20115.335%2025.2017%20115.004%2025.2017Z'%20fill='%233865AB'/%3e%3cpath%20d='M123.407%2025.2017H118.6C118.269%2025.2017%20118.001%2025.47%20118.001%2025.801V30.6076C118.001%2030.9386%20118.269%2031.2069%20118.6%2031.2069H123.407C123.738%2031.2069%20124.006%2030.9386%20124.006%2030.6076V25.801C124.006%2025.47%20123.738%2025.2017%20123.407%2025.2017Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M89.8085%2033.5982H85.0019C84.6709%2033.5982%2084.4026%2033.8665%2084.4026%2034.1975V39.0041C84.4026%2039.3351%2084.6709%2039.6035%2085.0019%2039.6035H89.8085C90.1395%2039.6035%2090.4078%2039.3351%2090.4078%2039.0041V34.1975C90.4078%2033.8665%2090.1395%2033.5982%2089.8085%2033.5982Z'%20fill='%233865AB'/%3e%3cpath%20d='M89.8085%2042.0007H85.0019C84.6709%2042.0007%2084.4026%2042.2691%2084.4026%2042.6001V47.4066C84.4026%2047.7376%2084.6709%2048.006%2085.0019%2048.006H89.8085C90.1395%2048.006%2090.4078%2047.7376%2090.4078%2047.4066V42.6001C90.4078%2042.2691%2090.1395%2042.0007%2089.8085%2042.0007Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%2042.0007H93.3984C93.0674%2042.0007%2092.7991%2042.2691%2092.7991%2042.6001V47.4066C92.7991%2047.7376%2093.0674%2048.006%2093.3984%2048.006H98.205C98.536%2048.006%2098.8043%2047.7376%2098.8043%2047.4066V42.6001C98.8043%2042.2691%2098.536%2042.0007%2098.205%2042.0007Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M106.608%2042.0007H101.801C101.47%2042.0007%20101.202%2042.2691%20101.202%2042.6001V47.4066C101.202%2047.7376%20101.47%2048.006%20101.801%2048.006H106.608C106.939%2048.006%20107.207%2047.7376%20107.207%2047.4066V42.6001C107.207%2042.2691%20106.939%2042.0007%20106.608%2042.0007Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M89.8085%200H85.0019C84.6709%200%2084.4026%200.268327%2084.4026%200.599326V5.40592C84.4026%205.73692%2084.6709%206.00524%2085.0019%206.00524H89.8085C90.1395%206.00524%2090.4078%205.73692%2090.4078%205.40592V0.599326C90.4078%200.268327%2090.1395%200%2089.8085%200Z'%20fill='%233865AB'/%3e%3cpath%20d='M82.0052%2022.205V17.3984C82.0052%2017.0674%2081.7369%2016.7991%2081.4059%2016.7991H76.5993C76.2683%2016.7991%2076%2017.0674%2076%2017.3984V22.205C76%2022.536%2076.2683%2022.8043%2076.5993%2022.8043H81.4059C81.7369%2022.8043%2082.0052%2022.536%2082.0052%2022.205Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124.006%2039.0041V34.1975C124.006%2033.8665%20123.738%2033.5982%20123.407%2033.5982H118.6C118.269%2033.5982%20118.001%2033.8665%20118.001%2034.1975V39.0041C118.001%2039.3351%20118.269%2039.6034%20118.6%2039.6034H123.407C123.738%2039.6034%20124.006%2039.3351%20124.006%2039.0041Z'%20fill='%233865AB'/%3e%3cpath%20d='M124%205.40592V0.599326C124%200.268327%20123.732%200%20123.401%200L118.594%200C118.263%200%20117.995%200.268327%20117.995%200.599326V5.40592C117.995%205.73692%20118.263%206.00524%20118.594%206.00524H123.401C123.732%206.00524%20124%205.73692%20124%205.40592Z'%20fill='%233865AB'/%3e%3cpath%20d='M81.3939%2014.3838H76.5993C76.4404%2014.3838%2076.2879%2014.3207%2076.1755%2014.2083C76.0631%2014.0959%2076%2013.9434%2076%2013.7845V8.98989C76%208.83094%2076.0631%208.6785%2076.1755%208.5661C76.2879%208.45371%2076.4404%208.39056%2076.5993%208.39056H81.3939C81.5529%208.39056%2081.7053%208.45371%2081.8177%208.5661C81.9301%208.6785%2081.9933%208.83094%2081.9933%208.98989V13.7845C81.9933%2013.9434%2081.9301%2014.0959%2081.8177%2014.2083C81.7053%2014.3207%2081.5529%2014.3838%2081.3939%2014.3838ZM90.3838%2013.7845V8.98989C90.3838%208.83094%2090.3207%208.6785%2090.2083%208.5661C90.0959%208.45371%2089.9434%208.39056%2089.7845%208.39056H84.9899C84.8309%208.39056%2084.6785%208.45371%2084.5661%208.5661C84.4537%208.6785%2084.3906%208.83094%2084.3906%208.98989V13.7845C84.3906%2013.9434%2084.4537%2014.0959%2084.5661%2014.2083C84.6785%2014.3207%2084.8309%2014.3838%2084.9899%2014.3838H89.7845C89.9434%2014.3838%2090.0959%2014.3207%2090.2083%2014.2083C90.3207%2014.0959%2090.3838%2013.9434%2090.3838%2013.7845ZM98.7744%2013.7845V8.98989C98.7744%208.83094%2098.7112%208.6785%2098.5988%208.5661C98.4864%208.45371%2098.334%208.39056%2098.1751%208.39056H93.3804C93.2215%208.39056%2093.0691%208.45371%2092.9567%208.5661C92.8443%208.6785%2092.7811%208.83094%2092.7811%208.98989V13.7845C92.7811%2013.9434%2092.8443%2014.0959%2092.9567%2014.2083C93.0691%2014.3207%2093.2215%2014.3838%2093.3804%2014.3838H98.1751C98.2562%2014.3879%2098.3374%2014.3754%2098.4136%2014.3471C98.4898%2014.3188%2098.5595%2014.2753%2098.6183%2014.2192C98.6772%2014.1632%2098.7241%2014.0957%2098.756%2014.021C98.788%2013.9462%2098.8044%2013.8658%2098.8043%2013.7845H98.7744ZM115.556%2013.7845V8.98989C115.556%208.83094%20115.492%208.6785%20115.38%208.5661C115.268%208.45371%20115.115%208.39056%20114.956%208.39056H110.162C110.003%208.39056%20109.85%208.45371%20109.738%208.5661C109.625%208.6785%20109.562%208.83094%20109.562%208.98989V13.7845C109.562%2013.9434%20109.625%2014.0959%20109.738%2014.2083C109.85%2014.3207%20110.003%2014.3838%20110.162%2014.3838H114.956C115.039%2014.3905%20115.122%2014.3799%20115.2%2014.3527C115.279%2014.3256%20115.35%2014.2825%20115.411%2014.2262C115.472%2014.1699%20115.521%2014.1015%20115.554%2014.0255C115.587%2013.9495%20115.604%2013.8674%20115.603%2013.7845H115.556ZM106.566%2014.3838H101.771C101.612%2014.3838%20101.46%2014.3207%20101.347%2014.2083C101.235%2014.0959%20101.172%2013.9434%20101.172%2013.7845V8.98989C101.172%208.83094%20101.235%208.6785%20101.347%208.5661C101.46%208.45371%20101.612%208.39056%20101.771%208.39056H106.566C106.725%208.39056%20106.877%208.45371%20106.989%208.5661C107.102%208.6785%20107.165%208.83094%20107.165%208.98989V13.7845C107.165%2013.9374%20107.107%2014.0846%20107.002%2014.1961C106.898%2014.3075%20106.754%2014.3746%20106.602%2014.3838H106.566Z'%20fill='url(%23paint3_linear_1248_125902)'/%3e%3cpath%20d='M89.8085%2016.7991H85.0019C84.6709%2016.7991%2084.4026%2017.0674%2084.4026%2017.3984V22.205C84.4026%2022.536%2084.6709%2022.8043%2085.0019%2022.8043H89.8085C90.1395%2022.8043%2090.4078%2022.536%2090.4078%2022.205V17.3984C90.4078%2017.0674%2090.1395%2016.7991%2089.8085%2016.7991Z'%20fill='%233865AB'/%3e%3cpath%20d='M98.205%2033.5982H93.3984C93.0674%2033.5982%2092.7991%2033.8665%2092.7991%2034.1975V39.0041C92.7991%2039.3351%2093.0674%2039.6035%2093.3984%2039.6035H98.205C98.536%2039.6035%2098.8043%2039.3351%2098.8043%2039.0041V34.1975C98.8043%2033.8665%2098.536%2033.5982%2098.205%2033.5982Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M98.205%2031.2009H93.3804C93.2215%2031.2009%2093.0691%2031.1378%2092.9567%2031.0254C92.8443%2030.913%2092.7811%2030.7605%2092.7811%2030.6016V25.807C92.7811%2025.648%2092.8443%2025.4956%2092.9567%2025.3832C93.0691%2025.2708%2093.2215%2025.2076%2093.3804%2025.2076H98.1751C98.334%2025.2076%2098.4864%2025.2708%2098.5988%2025.3832C98.7112%2025.4956%2098.7744%2025.648%2098.7744%2025.807V30.6016C98.7746%2030.7555%2098.7156%2030.9035%2098.6096%2031.0151C98.5036%2031.1267%2098.3587%2031.1932%2098.205%2031.2009ZM89.8145%2031.2009H84.9899C84.8309%2031.2009%2084.6785%2031.1378%2084.5661%2031.0254C84.4537%2030.913%2084.3906%2030.7605%2084.3906%2030.6016V25.807C84.3906%2025.648%2084.4537%2025.4956%2084.5661%2025.3832C84.6785%2025.2708%2084.8309%2025.2076%2084.9899%2025.2076H89.7845C89.9434%2025.2076%2090.0959%2025.2708%2090.2083%2025.3832C90.3207%2025.4956%2090.3838%2025.648%2090.3838%2025.807V30.6016C90.3838%2030.7605%2090.3207%2030.913%2090.2083%2031.0254C90.0959%2031.1378%2089.9434%2031.2009%2089.7845%2031.2009H89.8145ZM82.0232%2038.9921V34.1975C82.0232%2034.0386%2081.9601%2033.8861%2081.8477%2033.7737C81.7353%2033.6613%2081.5829%2033.5982%2081.4239%2033.5982H76.5993C76.4404%2033.5982%2076.2879%2033.6613%2076.1755%2033.7737C76.0631%2033.8861%2076%2034.0386%2076%2034.1975V38.9921C76%2039.1511%2076.0631%2039.3035%2076.1755%2039.4159C76.2879%2039.5283%2076.4404%2039.5915%2076.5993%2039.5915H81.3939C81.5508%2039.5915%2081.7015%2039.53%2081.8135%2039.4202C81.9256%2039.3104%2081.9901%2039.161%2081.9933%2039.0041L82.0232%2038.9921ZM107.195%2038.9921V34.1975C107.195%2034.0386%20107.132%2033.8861%20107.019%2033.7737C106.907%2033.6613%20106.755%2033.5982%20106.596%2033.5982H101.801C101.642%2033.5982%20101.49%2033.6613%20101.377%2033.7737C101.265%2033.8861%20101.202%2034.0386%20101.202%2034.1975V38.9921C101.202%2039.1511%20101.265%2039.3035%20101.377%2039.4159C101.49%2039.5283%20101.642%2039.5915%20101.801%2039.5915H106.596C106.754%2039.5931%20106.906%2039.5323%20107.019%2039.4223C107.132%2039.3123%20107.198%2039.162%20107.201%2039.0041L107.195%2038.9921ZM115.585%2038.9921V34.1975C115.585%2034.0386%20115.522%2033.8861%20115.41%2033.7737C115.298%2033.6613%20115.145%2033.5982%20114.986%2033.5982H110.192C110.033%2033.5982%20109.88%2033.6613%20109.768%2033.7737C109.655%2033.8861%20109.592%2034.0386%20109.592%2034.1975V38.9921C109.592%2039.1511%20109.655%2039.3035%20109.768%2039.4159C109.88%2039.5283%20110.033%2039.5915%20110.192%2039.5915H114.986C115.065%2039.5939%20115.144%2039.5805%20115.218%2039.5522C115.292%2039.5239%20115.36%2039.4812%20115.417%2039.4266C115.475%2039.372%20115.521%2039.3065%20115.553%2039.234C115.585%2039.1615%20115.602%2039.0833%20115.603%2039.0041L115.585%2038.9921Z'%20fill='url(%23paint4_linear_1248_125902)'/%3e%3cpath%20d='M81.4059%2042.0007H76.5993C76.2683%2042.0007%2076%2042.2691%2076%2042.6001V47.4066C76%2047.7376%2076.2683%2048.006%2076.5993%2048.006H81.4059C81.7369%2048.006%2082.0052%2047.7376%2082.0052%2047.4066V42.6001C82.0052%2042.2691%2081.7369%2042.0007%2081.4059%2042.0007Z'%20fill='%233865AB'/%3e%3cpath%20d='M115.004%2042.0007H110.198C109.867%2042.0007%20109.598%2042.2691%20109.598%2042.6001V47.4066C109.598%2047.7376%20109.867%2048.006%20110.198%2048.006H115.004C115.335%2048.006%20115.603%2047.7376%20115.603%2047.4066V42.6001C115.603%2042.2691%20115.335%2042.0007%20115.004%2042.0007Z'%20fill='%233865AB'/%3e%3cpath%20d='M123.407%2042.0007H118.6C118.269%2042.0007%20118.001%2042.2691%20118.001%2042.6001V47.4066C118.001%2047.7376%20118.269%2048.006%20118.6%2048.006H123.407C123.738%2048.006%20124.006%2047.7376%20124.006%2047.4066V42.6001C124.006%2042.2691%20123.738%2042.0007%20123.407%2042.0007Z'%20fill='%2384AFF1'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_125902'%20x1='0'%20y1='3.82312'%20x2='14.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_125902'%20x1='33.606'%20y1='3.82312'%20x2='48'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_125902'%20x1='16.8'%20y1='3.82312'%20x2='31.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_125902'%20x1='76'%20y1='11.3992'%20x2='115.603'%20y2='11.3992'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_125902'%20x1='76'%20y1='32.3996'%20x2='115.603'%20y2='32.3996'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_125902'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_125902'%3e%3crect%20width='48'%20height='48'%20fill='white'%20transform='translate(76)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_51 = "data:image/svg+xml,%3csvg%20width='121'%20height='48'%20viewBox='0%200%20121%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_125874)'%3e%3cpath%20d='M0%200.611699V7.64012H14.394V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1248_125874)'/%3e%3cpath%20d='M33.606%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200L33.606%200V7.64012Z'%20fill='url(%23paint1_linear_1248_125874)'/%3e%3cpath%20d='M31.194%200H16.8V7.64012H31.194V0Z'%20fill='url(%23paint2_linear_1248_125874)'/%3e%3cpath%20d='M31.194%2010.0869H16.8V17.727H31.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2010.0869H0V17.727H14.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2010.0869H33.606V17.727H48V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2020.1799H33.606V27.8262H48V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2020.1799H16.8V27.8262H31.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2020.1799H0V27.8262H14.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2030.2668H16.8V37.907H31.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2030.2668H33.606V37.907H48V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2030.2668H0V37.907H14.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M31.194%2040.3599H16.8V48H31.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M48%2047.3883V40.3721H33.606V48H47.3985C47.558%2048%2047.711%2047.9356%2047.8238%2047.8209C47.9366%2047.7061%2048%2047.5505%2048%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2048V40.3721H0V47.3883C0%2047.5505%200.0633725%2047.7061%200.176176%2047.8209C0.28898%2047.9356%200.441975%2048%200.601504%2048H14.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030C62.6011%2030%2067.9327%2026%2067.9327%2024C67.9327%2022%2062.7357%2018%2061.9067%2018C61.0778%2018%2060.4023%2018.5%2060.4023%2019.4756C60.4023%2020.4512%2063.9067%2022.9206%2063.9067%2022.9206C63.9067%2022.9206%2056.2539%2022.25%2056%2022.9206C55.7461%2023.5911%2055.7461%2024.4089%2056%2025.0794C56.2539%2025.75%2063.9067%2025.0794%2063.9067%2025.0794C63.9067%2025.0794%2060.4023%2027.75%2060.4023%2028.5301C60.4023%2029.3103%2061.2124%2030%2061.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_125874)'%3e%3cpath%20d='M87.833%2048H85.4439C85.2855%2048%2085.1336%2047.9371%2085.0216%2047.825C84.9095%2047.7129%2084.8466%2047.5609%2084.8466%2047.4023V28.8144C84.8466%2028.6559%2084.9095%2028.5038%2085.0216%2028.3917C85.1336%2028.2797%2085.2855%2028.2167%2085.4439%2028.2167H87.833C87.9914%2028.2167%2088.1433%2028.2797%2088.2554%2028.3917C88.3674%2028.5038%2088.4303%2028.6559%2088.4303%2028.8144V47.4023C88.4303%2047.5609%2088.3674%2047.7129%2088.2554%2047.825C88.1433%2047.9371%2087.9914%2048%2087.833%2048ZM82.4157%2040.8278H80.0266C79.8682%2040.8278%2079.7162%2040.8908%2079.6042%2041.0029C79.4922%2041.115%2079.4293%2041.267%2079.4293%2041.4255V47.4023C79.4293%2047.5609%2079.4922%2047.7129%2079.6042%2047.825C79.7162%2047.9371%2079.8682%2048%2080.0266%2048H82.4157C82.5741%2048%2082.726%2047.9371%2082.838%2047.825C82.95%2047.7129%2083.013%2047.5609%2083.013%2047.4023V41.4255C83.0114%2041.268%2082.9478%2041.1175%2082.8359%2041.0067C82.7241%2040.8959%2082.5731%2040.8338%2082.4157%2040.8338V40.8278ZM93.2503%209.92756H90.8612C90.7028%209.92756%2090.5509%209.99053%2090.4389%2010.1026C90.3269%2010.2147%2090.2639%2010.3667%2090.2639%2010.5252V47.4023C90.2639%2047.5609%2090.3269%2047.7129%2090.4389%2047.825C90.5509%2047.9371%2090.7028%2048%2090.8612%2048H93.2503C93.4088%2048%2093.5607%2047.9371%2093.6727%2047.825C93.7847%2047.7129%2093.8476%2047.5609%2093.8476%2047.4023V10.5252C93.8476%2010.3667%2093.7847%2010.2147%2093.6727%2010.1026C93.5607%209.99053%2093.4088%209.92756%2093.2503%209.92756ZM98.6677%204.07623H96.2786C96.1202%204.07623%2095.9682%204.1392%2095.8562%204.25129C95.7442%204.36338%2095.6813%204.5154%2095.6813%204.67392V47.4023C95.6813%2047.5609%2095.7442%2047.7129%2095.8562%2047.825C95.9682%2047.9371%2096.1202%2048%2096.2786%2048H98.6677C98.8261%2048%2098.978%2047.9371%2099.09%2047.825C99.202%2047.7129%2099.265%2047.5609%2099.265%2047.4023V4.67392C99.265%204.5154%2099.202%204.36338%2099.09%204.25129C98.978%204.1392%2098.8261%204.07623%2098.6677%204.07623ZM104.085%209.92756H101.696C101.537%209.92756%20101.386%209.99053%20101.274%2010.1026C101.162%2010.2147%20101.099%2010.3667%20101.099%2010.5252V47.4023C101.099%2047.5609%20101.162%2047.7129%20101.274%2047.825C101.386%2047.9371%20101.537%2048%20101.696%2048H104.085C104.243%2048%20104.395%2047.9371%20104.507%2047.825C104.619%2047.7129%20104.682%2047.5609%20104.682%2047.4023V10.5252C104.682%2010.3667%20104.619%2010.2147%20104.507%2010.1026C104.395%209.99053%20104.243%209.92756%20104.085%209.92756ZM109.502%2028.2167H107.113C106.955%2028.2167%20106.803%2028.2797%20106.691%2028.3917C106.579%2028.5038%20106.516%2028.6559%20106.516%2028.8144V47.4023C106.516%2047.5609%20106.579%2047.7129%20106.691%2047.825C106.803%2047.9371%20106.955%2048%20107.113%2048H109.502C109.661%2048%20109.813%2047.9371%20109.925%2047.825C110.037%2047.7129%20110.1%2047.5609%20110.1%2047.4023V28.8144C110.1%2028.6559%20110.037%2028.5038%20109.925%2028.3917C109.813%2028.2797%20109.661%2028.2167%20109.502%2028.2167ZM114.92%2040.8338H112.531C112.372%2040.8338%20112.22%2040.8968%20112.108%2041.0089C111.996%2041.1209%20111.933%2041.273%20111.933%2041.4315V47.4083C111.933%2047.5668%20111.996%2047.7189%20112.108%2047.831C112.22%2047.943%20112.372%2048.006%20112.531%2048.006H114.92C115.078%2048.006%20115.23%2047.943%20115.342%2047.831C115.454%2047.7189%20115.517%2047.5668%20115.517%2047.4083V41.4315C115.517%2041.273%20115.454%2041.1209%20115.342%2041.0089C115.23%2040.8968%20115.078%2040.8338%20114.92%2040.8338ZM120.403%2043.7087H118.014C117.855%2043.7087%20117.703%2043.7716%20117.591%2043.8837C117.479%2043.9958%20117.416%2044.1478%20117.416%2044.3063V47.4023C117.416%2047.5609%20117.479%2047.7129%20117.591%2047.825C117.703%2047.9371%20117.855%2048%20118.014%2048H120.403C120.561%2048%20120.713%2047.9371%20120.825%2047.825C120.937%2047.7129%20121%2047.5609%20121%2047.4023V44.3063C121%2044.1478%20120.937%2043.9958%20120.825%2043.8837C120.713%2043.7716%20120.561%2043.7087%20120.403%2043.7087ZM76.9864%2043.7087H74.5973C74.4389%2043.7087%2074.287%2043.7716%2074.1749%2043.8837C74.0629%2043.9958%2074%2044.1478%2074%2044.3063V47.4023C74%2047.5609%2074.0629%2047.7129%2074.1749%2047.825C74.287%2047.9371%2074.4389%2048%2074.5973%2048H76.9864C77.1448%2048%2077.2967%2047.9371%2077.4087%2047.825C77.5208%2047.7129%2077.5837%2047.5609%2077.5837%2047.4023V44.3063C77.5837%2044.1478%2077.5208%2043.9958%2077.4087%2043.8837C77.2967%2043.7716%2077.1448%2043.7087%2076.9864%2043.7087Z'%20fill='url(%23paint3_linear_1248_125874)'/%3e%3cpath%20d='M74%2042.0231V39.6324C74.4652%2039.6368%2074.9277%2039.562%2075.3678%2039.4113L76.1502%2041.6705C75.4581%2041.907%2074.7314%2042.0262%2074%2042.0231Z'%20fill='%233865AB'/%3e%3cpath%20d='M79.1008%2039.6563L77.3089%2038.0486C78.0263%2037.2234%2078.6216%2036.2995%2079.0769%2035.3052L81.2331%2036.3332C80.6874%2037.5387%2079.9691%2038.6582%2079.1008%2039.6563ZM115.863%2039.6145C115.001%2038.6141%20114.287%2037.495%20113.743%2036.2914L115.905%2035.2634C116.349%2036.2573%20116.933%2037.183%20117.637%2038.0127L115.863%2039.6145ZM82.4157%2033.4046L80.14%2032.6335C80.4805%2031.6414%2080.809%2030.5357%2081.1494%2029.2447L83.4609%2029.8424C83.1025%2031.1991%2082.7621%2032.3646%2082.4037%2033.4046H82.4157ZM112.59%2033.3627C112.238%2032.3227%20111.891%2031.1573%20111.539%2029.8125L113.851%2029.2148C114.191%2030.5058%20114.52%2031.6055%20114.854%2032.6037L112.59%2033.3627ZM84.1896%2026.8958L81.8662%2026.3519C82.135%2025.1984%2082.3918%2024.0209%2082.6546%2022.8315L84.99%2023.3515C84.751%2024.5469%2084.4584%2025.7363%2084.1896%2026.8958ZM110.798%2026.848C110.53%2025.7004%20110.267%2024.505%20109.998%2023.3097L112.333%2022.7897C112.596%2023.9851%20112.859%2025.1804%20113.122%2026.31L110.798%2026.848ZM85.647%2020.4109L83.3176%2019.879C83.6282%2018.5043%2083.9149%2017.3747%2084.1657%2016.3287L86.4832%2016.9264C86.2204%2017.9305%2085.9456%2019.0542%2085.647%2020.4109ZM109.341%2020.3631C109.025%2018.9765%20108.744%2017.8708%20108.505%2016.8726L110.822%2016.2749C111.079%2017.291%20111.354%2018.4206%20111.67%2019.8252L109.341%2020.3631ZM87.2417%2014.0575L84.9541%2013.3762C85.3424%2012.0672%2085.7306%2010.9197%2086.1487%209.85581L88.3765%2010.7165C88.0062%2011.7206%2087.6359%2012.8143%2087.2656%2014.0575H87.2417ZM107.693%2014.0037C107.322%2012.7665%20106.958%2011.6787%20106.564%2010.6687L108.792%209.80202C109.204%2010.8719%20109.598%2012.0254%20109.986%2013.3224L107.693%2014.0037ZM89.5651%208.08069L87.4388%206.98693C88.0181%205.83371%2088.7189%204.74572%2089.5293%203.7415L91.3809%205.27157C90.6775%206.1407%2090.0689%207.08239%2089.5651%208.08069ZM105.411%208.03885C104.905%207.04259%20104.294%206.10294%20103.589%205.23571L105.417%203.69966C106.238%204.69703%20106.947%205.78131%20107.531%206.93313L105.411%208.03885ZM93.328%203.4845L92.008%201.49421C93.1468%200.726757%2094.439%200.216857%2095.7948%200L96.171%202.39074C95.154%202.53977%2094.1829%202.91339%2093.328%203.4845ZM101.63%203.4845C100.775%202.91445%2099.8039%202.54094%2098.7871%202.39074L99.1455%200C100.502%200.204683%20101.799%200.702305%20102.944%201.45835L101.63%203.4845Z'%20fill='%233865AB'/%3e%3cpath%20d='M121%2042.0231C120.269%2042.0262%20119.542%2041.907%20118.85%2041.6705L119.626%2039.4113C120.069%2039.5586%20120.533%2039.6333%20121%2039.6324V42.0231Z'%20fill='%233865AB'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_125874'%20x1='0'%20y1='3.82312'%20x2='14.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_125874'%20x1='33.606'%20y1='3.82312'%20x2='48'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_125874'%20x1='16.8'%20y1='3.82312'%20x2='31.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_125874'%20x1='74'%20y1='26.0411'%20x2='121'%20y2='26.0411'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_125874'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_125874'%3e%3crect%20width='47'%20height='48'%20fill='white'%20transform='translate(74)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_52 = "data:image/svg+xml,%3csvg%20width='177'%20height='52'%20viewBox='0%200%20177%2052'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126012)'%3e%3cpath%20d='M0%203.04083V15H15V2H0.626828C0.460583%202%200.301147%202.10966%200.183594%202.30485C0.0660407%202.50005%200%202.76479%200%203.04083Z'%20fill='url(%23paint0_linear_1248_126012)'/%3e%3cpath%20d='M15%2019.5H0V32.5H15V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2037H0V50H15V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M6.77442%2011.5C7.52635%2011.5%208.04638%2011.2377%208.34153%2010.7415H8.3837V11.4178H10V8.1182C10%207.09102%208.98454%206.5%207.61068%206.5C6.15952%206.5%205.33732%207.1574%205.20028%208.04235L6.78496%208.09292C6.85875%207.78319%207.14336%207.59355%207.59663%207.59355C8.01827%207.59355%208.28531%207.77686%208.28531%208.1024V8.1182C8.28531%208.4153%207.92692%208.47851%207.00633%208.5512C5.91356%208.63338%205%208.99684%205%2010.0714C5%2011.0322%205.74139%2011.5%206.77442%2011.5ZM7.30499%2010.4886C6.90794%2010.4886%206.62684%2010.318%206.62684%209.99558C6.62684%209.68268%206.90091%209.49305%207.38932%209.42668C7.70907%209.38559%208.1026%209.32238%208.29585%209.23072V9.69216C8.29585%2010.1662%207.85313%2010.4886%207.30499%2010.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126012)'%3e%3cpath%20d='M19%2015H34V3.04083C34%202.76479%2033.934%202.50005%2033.8164%202.30485C33.6989%202.10966%2033.5394%202%2033.3732%202H19V15Z'%20fill='url(%23paint1_linear_1248_126012)'/%3e%3cpath%20d='M34%2019.5H19V32.5H34V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2037H19V50H34V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M27.5%2023H26.0716L24.5%2023.9199V25.1738L25.9253%2024.3535H25.9627V29H27.5V23Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.3373%2046.5H28.75V45.3468H26.3341V45.3092L27.0472%2044.6561C28.3396%2043.5376%2028.6772%2042.9682%2028.6772%2042.289C28.6772%2041.2225%2027.8011%2040.5%2026.4476%2040.5C25.129%2040.5%2024.2471%2041.2543%2024.25%2042.4595H25.6151C25.6151%2041.9249%2025.947%2041.6156%2026.4418%2041.6156C26.9279%2041.6156%2027.2801%2041.9133%2027.2801%2042.4017C27.2801%2042.8439%2027.0006%2043.1445%2026.5116%2043.5809L24.3373%2045.4711V46.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M24%2011.6862H25.5663V10.9645H25.6149C25.8155%2011.3761%2026.2621%2011.75%2027.0129%2011.75C28.1133%2011.75%2029%2010.979%2029%209.46304C29%207.89203%2028.0615%207.17609%2027.0227%207.17609C26.2362%207.17609%2025.8058%207.58768%2025.6149%207.99638H25.5825V5.75H24V11.6862ZM25.5502%209.46015C25.5502%208.73261%2025.8867%208.28333%2026.466%208.28333C27.0518%208.28333%2027.3754%208.7442%2027.3754%209.46015C27.3754%2010.179%2027.0518%2010.6457%2026.466%2010.6457C25.8867%2010.6457%2025.5502%2010.1819%2025.5502%209.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M46.3343%2030H49.674V25.3135H54V21.6954H49.674V17H46.3343V21.6954H42V25.3135H46.3343V30Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126012)'%3e%3cpath%20d='M77%2025.5H62V38.5H77V25.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%209.04083V21H77V8H62.6268C62.4606%208%2062.3011%208.10966%2062.1836%208.30485C62.066%208.50005%2062%208.76479%2062%209.04083Z'%20fill='url(%23paint2_linear_1248_126012)'/%3e%3cpath%20d='M70.5%2029H69.0716L67.5%2029.9199V31.1738L68.9253%2030.3535H68.9627V35H70.5V29Z'%20fill='white'/%3e%3cpath%20d='M67%2017.6862H68.5663V16.9645H68.6149C68.8155%2017.3761%2069.2621%2017.75%2070.0129%2017.75C71.1133%2017.75%2072%2016.979%2072%2015.463C72%2013.892%2071.0615%2013.1761%2070.0227%2013.1761C69.2362%2013.1761%2068.8058%2013.5877%2068.6149%2013.9964H68.5825V11.75H67V17.6862ZM68.5502%2015.4601C68.5502%2014.7326%2068.8867%2014.2833%2069.466%2014.2833C70.0518%2014.2833%2070.3754%2014.7442%2070.3754%2015.4601C70.3754%2016.179%2070.0518%2016.6457%2069.466%2016.6457C68.8867%2016.6457%2068.5502%2016.1819%2068.5502%2015.4601Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126012)'%3e%3cpath%20d='M96%2025.5H81V38.5H96V25.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M81%2021H96V9.04083C96%208.76479%2095.934%208.50005%2095.8164%208.30485C95.6989%208.10966%2095.5394%208%2095.3732%208H81V21Z'%20fill='url(%23paint3_linear_1248_126012)'/%3e%3cpath%20d='M88.6058%2017.5C90.0564%2017.5%2090.9563%2016.7082%2091%2015.5095H89.4654C89.405%2016.0237%2089.0759%2016.3044%2088.6259%2016.3044C88.0484%2016.3044%2087.6723%2015.847%2087.6723%2014.9858C87.6723%2014.1309%2088.0517%2013.6735%2088.6259%2013.6735C89.096%2013.6735%2089.4016%2013.9732%2089.4654%2014.4685H91C90.9631%2013.276%2090.0363%2012.5%2088.6024%2012.5C86.9805%2012.5%2086%2013.5158%2086%2015.0016C86%2016.4811%2086.9738%2017.5%2088.6058%2017.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M104%2028H116V24.686H104V28ZM104%2022.314H116V19H104V22.314Z'%20fill='%2324292E'/%3e%3cpath%20d='M124%203.04083V15H139V2H124.627C124.461%202%20124.301%202.10966%20124.184%202.30485C124.066%202.50005%20124%202.76479%20124%203.04083Z'%20fill='url(%23paint4_linear_1248_126012)'/%3e%3cpath%20d='M139%2019.5H124V32.5H139V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2037H124V50H139V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2032.5V19.5L124%2032.5H139Z'%20fill='%233865AB'/%3e%3cpath%20d='M129.337%2046.5H133.75V45.3468H131.334V45.3092L132.047%2044.6561C133.34%2043.5376%20133.677%2042.9682%20133.677%2042.289C133.677%2041.2225%20132.801%2040.5%20131.448%2040.5C130.129%2040.5%20129.247%2041.2543%20129.25%2042.4595H130.615C130.615%2041.9249%20130.947%2041.6156%20131.442%2041.6156C131.928%2041.6156%20132.28%2041.9133%20132.28%2042.4017C132.28%2042.8439%20132.001%2043.1445%20131.512%2043.5809L129.337%2045.4711V46.5Z'%20fill='white'/%3e%3cpath%20d='M132.5%2023H131.072L129.5%2023.9199V25.1738L130.925%2024.3535H130.963V29H132.5V23Z'%20fill='white'/%3e%3cpath%20d='M129%2011.6862H130.566V10.9645H130.615C130.816%2011.3761%20131.262%2011.75%20132.013%2011.75C133.113%2011.75%20134%2010.979%20134%209.46304C134%207.89203%20133.061%207.17609%20132.023%207.17609C131.236%207.17609%20130.806%207.58768%20130.615%207.99638H130.583V5.75H129V11.6862ZM130.55%209.46015C130.55%208.73261%20130.887%208.28333%20131.466%208.28333C132.052%208.28333%20132.375%208.7442%20132.375%209.46015C132.375%2010.179%20132.052%2010.6457%20131.466%2010.6457C130.887%2010.6457%20130.55%2010.1819%20130.55%209.46015Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip4_1248_126012)'%3e%3cpath%20d='M143%203.04083V15H158V2H143.627C143.461%202%20143%202%20143%202C143%202%20143%202.76479%20143%203.04083Z'%20fill='url(%23paint5_linear_1248_126012)'/%3e%3cpath%20d='M158%2019.5H143V32.5H158V19.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2037H143V50H158V37Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M149.774%2011.5C150.526%2011.5%20151.046%2011.2377%20151.342%2010.7415H151.384V11.4178H153V8.1182C153%207.09102%20151.985%206.5%20150.611%206.5C149.16%206.5%20148.337%207.1574%20148.2%208.04235L149.785%208.09292C149.859%207.78319%20150.143%207.59355%20150.597%207.59355C151.018%207.59355%20151.285%207.77686%20151.285%208.1024V8.1182C151.285%208.4153%20150.927%208.47851%20150.006%208.5512C148.914%208.63338%20148%208.99684%20148%2010.0714C148%2011.0322%20148.741%2011.5%20149.774%2011.5ZM150.305%2010.4886C149.908%2010.4886%20149.627%2010.318%20149.627%209.99558C149.627%209.68268%20149.901%209.49305%20150.389%209.42668C150.709%209.38559%20151.103%209.32238%20151.296%209.23072V9.69216C151.296%2010.1662%20150.853%2010.4886%20150.305%2010.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip5_1248_126012)'%3e%3cpath%20d='M162%2015.005H177V3.04584C177%202.76979%20176.934%202.50505%20176.816%202.30986C176.699%202.11466%20176.539%202.005%20176.373%202.005H162V15.005Z'%20fill='url(%23paint6_linear_1248_126012)'/%3e%3cpath%20d='M177%2019.505H162V32.505H177V19.505Z'%20fill='%233865AB'/%3e%3cpath%20d='M177%2037.005H162V50.005H177V37.005Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M162.5%2037.505H176.5V49.505H162.5V37.505Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M169.606%2011.5C171.056%2011.5%20171.956%2010.7082%20172%209.50946H170.465C170.405%2010.0237%20170.076%2010.3044%20169.626%2010.3044C169.048%2010.3044%20168.672%209.847%20168.672%208.9858C168.672%208.13092%20169.052%207.6735%20169.626%207.6735C170.096%207.6735%20170.402%207.97319%20170.465%208.46845H172C171.963%207.27602%20171.036%206.5%20169.602%206.5C167.981%206.5%20167%207.51577%20167%209.00158C167%2010.4811%20167.974%2011.5%20169.606%2011.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3crect%20x='18'%20y='1'%20width='17'%20height='50'%20stroke='%2326262A'%20stroke-width='2'/%3e%3crect%20x='61'%20y='7'%20width='17'%20height='32.5'%20stroke='%2326262A'%20stroke-width='2'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126012'%20x1='0'%20y1='8.5052'%20x2='15'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126012'%20x1='19'%20y1='8.5052'%20x2='34'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126012'%20x1='62'%20y1='14.5052'%20x2='77'%20y2='14.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126012'%20x1='81'%20y1='14.5052'%20x2='96'%20y2='14.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126012'%20x1='124'%20y1='8.5052'%20x2='139'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1248_126012'%20x1='143'%20y1='8.5052'%20x2='158'%20y2='8.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_1248_126012'%20x1='162'%20y1='8.51021'%20x2='177'%20y2='8.51021'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126012'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(0%202)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126012'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19%202)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126012'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%208)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126012'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%208)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1248_126012'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(143%202)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip5_1248_126012'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(162%202)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_53 = "data:image/svg+xml,%3csvg%20width='148'%20height='58'%20viewBox='0%200%20148%2058'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126408)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126408)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126408)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1248_126408)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M6.18549%2052H5V56.9302H6.18549V52Z'%20fill='%2324292E'/%3e%3cpath%20d='M7.98978%2056.9928C8.50858%2056.9928%208.86737%2056.793%209.07102%2056.415H9.10011V56.9302H10.2153V54.4169C10.2153%2053.6346%209.51466%2053.1844%208.56676%2053.1844C7.56552%2053.1844%206.99823%2053.6851%206.90369%2054.3592L7.99705%2054.3977C8.04796%2054.1618%208.24433%2054.0173%208.55706%2054.0173C8.84798%2054.0173%209.03223%2054.157%209.03223%2054.4049V54.4169C9.03223%2054.6432%208.78495%2054.6914%208.14978%2054.7468C7.39582%2054.8093%206.7655%2055.0862%206.7655%2055.9047C6.7655%2056.6365%207.27703%2056.9928%207.98978%2056.9928ZM8.35585%2056.2224C8.0819%2056.2224%207.88795%2056.0924%207.88795%2055.8469C7.88795%2055.6086%208.07705%2055.4641%208.41403%2055.4136C8.63464%2055.3823%208.90616%2055.3341%209.0395%2055.2643V55.6158C9.0395%2055.9769%208.73404%2056.2224%208.35585%2056.2224Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.9402%2056.9302H12.1135V56.3308H12.1499C12.3002%2056.6726%2012.6347%2056.9831%2013.1972%2056.9831C14.0214%2056.9831%2014.6857%2056.3428%2014.6857%2055.0838C14.6857%2053.779%2013.9827%2053.1844%2013.2045%2053.1844C12.6153%2053.1844%2012.2929%2053.5262%2012.1499%2053.8657H12.1256V52H10.9402V56.9302ZM12.1014%2055.0814C12.1014%2054.4771%2012.3535%2054.104%2012.7875%2054.104C13.2263%2054.104%2013.4687%2054.4868%2013.4687%2055.0814C13.4687%2055.6784%2013.2263%2056.066%2012.7875%2056.066C12.3535%2056.066%2012.1014%2055.6808%2012.1014%2055.0814Z'%20fill='%2324292E'/%3e%3cpath%20d='M17.0476%2057C18.0246%2057%2018.667%2056.5306%2018.8028%2055.8036L17.7143%2055.7723C17.6221%2056.0178%2017.3797%2056.1502%2017.0694%2056.1502C16.6136%2056.1502%2016.3324%2055.8493%2016.3324%2055.3967V55.3654H18.8149V55.0717C18.8149%2053.8536%2018.0682%2053.1844%2017.0112%2053.1844C15.8863%2053.1844%2015.1639%2053.9499%2015.1639%2055.0958C15.1639%2056.2802%2015.8766%2057%2017.0476%2057ZM16.3324%2054.6818C16.3494%2054.3134%2016.6427%2054.0342%2017.0355%2054.0342C17.4258%2054.0342%2017.707%2054.3038%2017.7118%2054.6818H16.3324Z'%20fill='%2324292E'/%3e%3cpath%20d='M20.6059%2052H19.4204V56.9302H20.6059V52Z'%20fill='%2324292E'/%3e%3cpath%20d='M21.5932%2056.2537H25.0623V55.2884H21.5932V56.2537ZM21.5932%2054.5975H25.0623V53.6322H21.5932V54.5975Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.3333%2052H27.2206L25.9963%2052.7559V53.7862L27.1066%2053.1122H27.1357V56.9302H28.3333V52Z'%20fill='%2324292E'/%3e%3cpath%20d='M46.3343%2035H49.674V30.674H54V27.3343H49.674V23H46.3343V27.3343H42V30.674H46.3343V35Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126408)'%3e%3cpath%20d='M77%2027H62V40H77V27Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%2010.5408V22.5H77V9.5H62.6268C62.4606%209.5%2062.3011%209.60966%2062.1836%209.80485C62.066%2010%2062%2010.2648%2062%2010.5408Z'%20fill='url(%23paint2_linear_1248_126408)'/%3e%3cpath%20d='M69.4792%2036.5C70.8085%2036.5%2071.7528%2035.7757%2071.75%2034.7605C71.7528%2034.0418%2071.2958%2033.5285%2070.4208%2033.423V33.3774C71.0771%2033.2804%2071.5423%2032.827%2071.5395%2032.1711C71.5423%2031.2186%2070.706%2030.5%2069.4903%2030.5C68.2663%2030.5%2067.3746%2031.23%2067.3635%2032.2681H68.6734C68.6845%2031.8688%2069.0334%2031.6008%2069.4903%2031.6008C69.9251%2031.6008%2070.2214%2031.8717%2070.2186%2032.2624C70.2214%2032.6673%2069.8725%2032.9468%2069.3685%2032.9468H68.8174V33.9506H69.3685C69.9417%2033.9506%2070.3155%2034.2414%2070.31%2034.6521C70.3155%2035.0656%2069.9721%2035.3536%2069.4848%2035.3536C69.0001%2035.3536%2068.6429%2035.0884%2068.6291%2034.7034H67.25C67.2611%2035.7586%2068.1832%2036.5%2069.4792%2036.5Z'%20fill='white'/%3e%3cpath%20d='M67%2019.4362H68.5663V18.7145H68.6149C68.8155%2019.1261%2069.2621%2019.5%2070.0129%2019.5C71.1133%2019.5%2072%2018.729%2072%2017.213C72%2015.642%2071.0615%2014.9261%2070.0227%2014.9261C69.2362%2014.9261%2068.8058%2015.3377%2068.6149%2015.7464H68.5825V13.5H67V19.4362ZM68.5502%2017.2101C68.5502%2016.4826%2068.8867%2016.0333%2069.466%2016.0333C70.0518%2016.0333%2070.3754%2016.4942%2070.3754%2017.2101C70.3754%2017.929%2070.0518%2018.3957%2069.466%2018.3957C68.8867%2018.3957%2068.5502%2017.9319%2068.5502%2017.2101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126408)'%3e%3cpath%20d='M96%2027H81V40H96V27Z'%20fill='%233865AB'/%3e%3cpath%20d='M81%2022.5H96V10.5408C96%2010.2648%2095.934%2010%2095.8164%209.80485C95.6989%209.60966%2095.5394%209.5%2095.3732%209.5H81V22.5Z'%20fill='url(%23paint3_linear_1248_126408)'/%3e%3cpath%20d='M88.6058%2019.5C90.0564%2019.5%2090.9563%2018.7082%2091%2017.5095H89.4654C89.405%2018.0237%2089.0759%2018.3044%2088.6259%2018.3044C88.0484%2018.3044%2087.6723%2017.847%2087.6723%2016.9858C87.6723%2016.1309%2088.0517%2015.6735%2088.6259%2015.6735C89.096%2015.6735%2089.4016%2015.9732%2089.4654%2016.4685H91C90.9631%2015.276%2090.0363%2014.5%2088.6024%2014.5C86.9805%2014.5%2086%2015.5158%2086%2017.0016C86%2018.4811%2086.9738%2019.5%2088.6058%2019.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M68.1855%2043.75H67V48.6802H68.1855V43.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M69.9898%2048.7428C70.5086%2048.7428%2070.8674%2048.543%2071.071%2048.165H71.1001V48.6802H72.2153V46.1669C72.2153%2045.3846%2071.5147%2044.9344%2070.5668%2044.9344C69.5655%2044.9344%2068.9982%2045.4351%2068.9037%2046.1092L69.997%2046.1477C70.048%2045.9118%2070.2443%2045.7673%2070.5571%2045.7673C70.848%2045.7673%2071.0322%2045.907%2071.0322%2046.1549V46.1669C71.0322%2046.3932%2070.7849%2046.4414%2070.1498%2046.4968C69.3958%2046.5593%2068.7655%2046.8362%2068.7655%2047.6547C68.7655%2048.3865%2069.277%2048.7428%2069.9898%2048.7428ZM70.3558%2047.9724C70.0819%2047.9724%2069.888%2047.8424%2069.888%2047.5969C69.888%2047.3586%2070.077%2047.2141%2070.414%2047.1636C70.6346%2047.1323%2070.9062%2047.0841%2071.0395%2047.0143V47.3658C71.0395%2047.7269%2070.734%2047.9724%2070.3558%2047.9724Z'%20fill='%2324292E'/%3e%3cpath%20d='M72.9402%2048.6802H74.1135V48.0808H74.1499C74.3002%2048.4226%2074.6347%2048.7331%2075.1972%2048.7331C76.0214%2048.7331%2076.6857%2048.0928%2076.6857%2046.8338C76.6857%2045.529%2075.9827%2044.9344%2075.2045%2044.9344C74.6153%2044.9344%2074.2929%2045.2762%2074.1499%2045.6157H74.1256V43.75H72.9402V48.6802ZM74.1014%2046.8314C74.1014%2046.2271%2074.3535%2045.854%2074.7875%2045.854C75.2263%2045.854%2075.4687%2046.2368%2075.4687%2046.8314C75.4687%2047.4284%2075.2263%2047.816%2074.7875%2047.816C74.3535%2047.816%2074.1014%2047.4308%2074.1014%2046.8314Z'%20fill='%2324292E'/%3e%3cpath%20d='M79.0476%2048.75C80.0246%2048.75%2080.667%2048.2806%2080.8028%2047.5536L79.7143%2047.5223C79.6221%2047.7678%2079.3797%2047.9002%2079.0694%2047.9002C78.6136%2047.9002%2078.3324%2047.5993%2078.3324%2047.1467V47.1154H80.8149V46.8217C80.8149%2045.6036%2080.0682%2044.9344%2079.0112%2044.9344C77.8863%2044.9344%2077.1639%2045.6999%2077.1639%2046.8458C77.1639%2048.0302%2077.8766%2048.75%2079.0476%2048.75ZM78.3324%2046.4318C78.3494%2046.0634%2078.6427%2045.7842%2079.0355%2045.7842C79.4258%2045.7842%2079.707%2046.0538%2079.7118%2046.4318H78.3324Z'%20fill='%2324292E'/%3e%3cpath%20d='M82.6059%2043.75H81.4204V48.6802H82.6059V43.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M83.5932%2048.0037H87.0623V47.0384H83.5932V48.0037ZM83.5932%2046.3475H87.0623V45.3822H83.5932V46.3475Z'%20fill='%2324292E'/%3e%3cpath%20d='M90.3333%2043.75H89.2206L87.9963%2044.5059V45.5362L89.1066%2044.8622H89.1357V48.6802H90.3333V43.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M109.907%2035C110.601%2035%20115.933%2031%20115.933%2029C115.933%2027%20110.736%2023%20109.907%2023C109.078%2023%20108.402%2023.5%20108.402%2024.4756C108.402%2025.4512%20111.907%2027.9206%20111.907%2027.9206C111.907%2027.9206%20104.254%2027.25%20104%2027.9206C103.746%2028.5911%20103.746%2029.4089%20104%2030.0794C104.254%2030.75%20111.907%2030.0794%20111.907%2030.0794C111.907%2030.0794%20108.402%2032.75%20108.402%2033.5301C108.402%2034.3103%20109.212%2035%20109.907%2035Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip4_1248_126408)'%3e%3cpath%20d='M124%205.80064V15H148V5H125.003L124%205L124%205.80064Z'%20fill='url(%23paint4_linear_1248_126408)'/%3e%3cpath%20d='M134.774%2012.5C135.526%2012.5%20136.046%2012.2377%20136.342%2011.7415H136.384V12.4178H138V9.1182C138%208.09102%20136.985%207.5%20135.611%207.5C134.16%207.5%20133.337%208.1574%20133.2%209.04235L134.785%209.09292C134.859%208.78319%20135.143%208.59355%20135.597%208.59355C136.018%208.59355%20136.285%208.77686%20136.285%209.1024V9.1182C136.285%209.4153%20135.927%209.47851%20135.006%209.5512C133.914%209.63338%20133%209.99684%20133%2011.0714C133%2012.0322%20133.741%2012.5%20134.774%2012.5ZM135.305%2011.4886C134.908%2011.4886%20134.627%2011.318%20134.627%2010.9956C134.627%2010.6827%20134.901%2010.493%20135.389%2010.4267C135.709%2010.3856%20136.103%2010.3224%20136.296%2010.2307V10.6922C136.296%2011.1662%20135.853%2011.4886%20135.305%2011.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M148%2018H124V27.5H148V18Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M148%2030.75H124V40.25H148V30.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M148%2043.5H124V53H148V43.5Z'%20fill='%233865AB'/%3e%3cpath%20d='M137%2019.75H135.572L134%2020.6699V21.9238L135.425%2021.1035H135.463V25.75H137V19.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M134.087%2038.5H138.5V37.3468H136.084V37.3092L136.797%2036.6561C138.09%2035.5376%20138.427%2034.9682%20138.427%2034.289C138.427%2033.2225%20137.551%2032.5%20136.198%2032.5C134.879%2032.5%20133.997%2033.2543%20134%2034.4595H135.365C135.365%2033.9249%20135.697%2033.6156%20136.192%2033.6156C136.678%2033.6156%20137.03%2033.9133%20137.03%2034.4017C137.03%2034.8439%20136.751%2035.1445%20136.262%2035.5809L134.087%2037.4711V38.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M135.979%2051.25C137.308%2051.25%20138.253%2050.5257%20138.25%2049.5105C138.253%2048.7918%20137.796%2048.2785%20136.921%2048.173V48.1274C137.577%2048.0304%20138.042%2047.577%20138.04%2046.9211C138.042%2045.9686%20137.206%2045.25%20135.99%2045.25C134.766%2045.25%20133.875%2045.98%20133.864%2047.0181H135.173C135.184%2046.6188%20135.533%2046.3508%20135.99%2046.3508C136.425%2046.3508%20136.721%2046.6217%20136.719%2047.0124C136.721%2047.4173%20136.372%2047.6968%20135.868%2047.6968H135.317V48.7006H135.868C136.442%2048.7006%20136.816%2048.9914%20136.81%2049.4021C136.816%2049.8156%20136.472%2050.1036%20135.985%2050.1036C135.5%2050.1036%20135.143%2049.8384%20135.129%2049.4534H133.75C133.761%2050.5086%20134.683%2051.25%20135.979%2051.25Z'%20fill='white'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126408'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126408'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126408'%20x1='62'%20y1='16.0052'%20x2='77'%20y2='16.0052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126408'%20x1='81'%20y1='16.0052'%20x2='96'%20y2='16.0052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126408'%20x1='124.008'%20y1='10.004'%20x2='148.008'%20y2='10.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126408'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126408'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126408'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%209.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126408'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%209.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1248_126408'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(124%205)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_54 = "data:image/svg+xml,%3csvg%20width='125'%20height='58'%20viewBox='0%200%20125%2058'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126711)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126711)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126711)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1248_126711)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0778%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2124%2030%2047.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126711)'%3e%3cpath%20d='M62%201.04083V13H77V0H62.6268C62.4606%200%2062.3011%200.109659%2062.1836%200.304853C62.066%200.500047%2062%200.764787%2062%201.04083Z'%20fill='url(%23paint2_linear_1248_126711)'/%3e%3cpath%20d='M77%2017.5H62V30.5H77V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2035H62V48H77V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M70.5%2021H69.0716L67.5%2021.9199V23.1738L68.9253%2022.3535H68.9627V27H70.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.3373%2044.5H71.75V43.3468H69.3341V43.3092L70.0472%2042.6561C71.3396%2041.5376%2071.6772%2040.9682%2071.6772%2040.289C71.6772%2039.2225%2070.8011%2038.5%2069.4476%2038.5C68.129%2038.5%2067.2471%2039.2543%2067.25%2040.4595H68.6151C68.6151%2039.9249%2068.947%2039.6156%2069.4418%2039.6156C69.9279%2039.6156%2070.2801%2039.9133%2070.2801%2040.4017C70.2801%2040.8439%2070.0006%2041.1445%2069.5116%2041.5809L67.3373%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7744%209.5C69.5264%209.5%2070.0464%209.23767%2070.3415%208.74147H70.3837V9.41783H72V6.1182C72%205.09102%2070.9845%204.5%2069.6107%204.5C68.1595%204.5%2067.3373%205.1574%2067.2003%206.04235L68.785%206.09292C68.8587%205.78319%2069.1434%205.59355%2069.5966%205.59355C70.0183%205.59355%2070.2853%205.77686%2070.2853%206.1024V6.1182C70.2853%206.4153%2069.9269%206.47851%2069.0063%206.5512C67.9136%206.63338%2067%206.99684%2067%208.07143C67%209.03224%2067.7414%209.5%2068.7744%209.5ZM69.305%208.48862C68.9079%208.48862%2068.6268%208.31795%2068.6268%207.99558C68.6268%207.68268%2068.9009%207.49305%2069.3893%207.42668C69.7091%207.38559%2070.1026%207.32238%2070.2959%207.23072V7.69216C70.2959%208.16625%2069.8531%208.48862%2069.305%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126711)'%3e%3cpath%20d='M96%2017.5H81V30.5H96V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M96%2035H81V48H96V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M81%201.04083V13H96V0H81.6268C81.4606%200%2081%200%2081%200C81%200%2081%200.764787%2081%201.04083Z'%20fill='url(%23paint3_linear_1248_126711)'/%3e%3cpath%20d='M86%209.68623H87.5663V8.96449H87.6149C87.8155%209.37609%2088.2621%209.75%2089.0129%209.75C90.1133%209.75%2091%208.97898%2091%207.46304C91%205.89203%2090.0615%205.17609%2089.0227%205.17609C88.2362%205.17609%2087.8058%205.58768%2087.6149%205.99638H87.5825V3.75H86V9.68623ZM87.5502%207.46015C87.5502%206.73261%2087.8867%206.28333%2088.466%206.28333C89.0518%206.28333%2089.3754%206.7442%2089.3754%207.46015C89.3754%208.17899%2089.0518%208.64565%2088.466%208.64565C87.8867%208.64565%2087.5502%208.18188%2087.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1248_126711)'%3e%3cpath%20d='M100%2013H124V1.04083C124%200.764787%20123.894%200.500047%20123.706%200.304853C123.518%200.109659%20123.263%200%20122.997%200L100%200V13Z'%20fill='url(%23paint4_linear_1248_126711)'/%3e%3cpath%20d='M105.185%204H104V8.93019H105.185V4Z'%20fill='%2324292E'/%3e%3cpath%20d='M106.99%208.99278C107.509%208.99278%20107.867%208.79297%20108.071%208.41502H108.1V8.93019H109.215V6.41695C109.215%205.63457%20108.515%205.1844%20107.567%205.1844C106.566%205.1844%20105.998%205.68512%20105.904%206.35917L106.997%206.39769C107.048%206.16177%20107.244%206.01733%20107.557%206.01733C107.848%206.01733%20108.032%206.15696%20108.032%206.40491V6.41695C108.032%206.64324%20107.785%206.69138%20107.15%206.74675C106.396%206.80934%20105.766%207.08618%20105.766%207.90467C105.766%208.63649%20106.277%208.99278%20106.99%208.99278ZM107.356%208.22244C107.082%208.22244%20106.888%208.09244%20106.888%207.84689C106.888%207.60857%20107.077%207.46413%20107.414%207.41358C107.635%207.38228%20107.906%207.33414%20108.039%207.26432V7.61579C108.039%207.97689%20107.734%208.22244%20107.356%208.22244Z'%20fill='%2324292E'/%3e%3cpath%20d='M109.94%208.93019H111.114V8.33077H111.15C111.3%208.6726%20111.635%208.98315%20112.197%208.98315C113.021%208.98315%20113.686%208.3428%20113.686%207.08377C113.686%205.77901%20112.983%205.1844%20112.204%205.1844C111.615%205.1844%20111.293%205.52624%20111.15%205.86567H111.126V4H109.94V8.93019ZM111.101%207.08137C111.101%206.47713%20111.354%206.104%20111.787%206.104C112.226%206.104%20112.469%206.48676%20112.469%207.08137C112.469%207.67838%20112.226%208.06596%20111.787%208.06596C111.354%208.06596%20111.101%207.68079%20111.101%207.08137Z'%20fill='%2324292E'/%3e%3cpath%20d='M116.048%209C117.025%209%20117.667%208.53057%20117.803%207.80356L116.714%207.77227C116.622%208.01781%20116.38%208.15022%20116.069%208.15022C115.614%208.15022%20115.332%207.8493%20115.332%207.39673V7.36543H117.815V7.07174C117.815%205.85363%20117.068%205.1844%20116.011%205.1844C114.886%205.1844%20114.164%205.94993%20114.164%207.09581C114.164%208.28021%20114.877%209%20116.048%209ZM115.332%206.68175C115.349%206.31343%20115.643%206.03418%20116.035%206.03418C116.426%206.03418%20116.707%206.3038%20116.712%206.68175H115.332Z'%20fill='%2324292E'/%3e%3cpath%20d='M119.606%204H118.42V8.93019H119.606V4Z'%20fill='%2324292E'/%3e%3cpath%20d='M124%2017.5H100V30.5H124V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2035H100V48H124V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M113.5%2021H112.072L110.5%2021.9199V23.1738L111.925%2022.3535H111.963V27H113.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2039H112.072L110.5%2039.9199V41.1738L111.925%2040.3535H111.963V45H113.5V39Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M9.18549%2051H8V55.9302H9.18549V51Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.9898%2055.9928C11.5086%2055.9928%2011.8674%2055.793%2012.071%2055.415H12.1001V55.9302H13.2153V53.4169C13.2153%2052.6346%2012.5147%2052.1844%2011.5668%2052.1844C10.5655%2052.1844%209.99823%2052.6851%209.90369%2053.3592L10.997%2053.3977C11.048%2053.1618%2011.2443%2053.0173%2011.5571%2053.0173C11.848%2053.0173%2012.0322%2053.157%2012.0322%2053.4049V53.4169C12.0322%2053.6432%2011.7849%2053.6914%2011.1498%2053.7468C10.3958%2053.8093%209.7655%2054.0862%209.7655%2054.9047C9.7655%2055.6365%2010.277%2055.9928%2010.9898%2055.9928ZM11.3558%2055.2224C11.0819%2055.2224%2010.888%2055.0924%2010.888%2054.8469C10.888%2054.6086%2011.077%2054.4641%2011.414%2054.4136C11.6346%2054.3823%2011.9062%2054.3341%2012.0395%2054.2643V54.6158C12.0395%2054.9769%2011.734%2055.2224%2011.3558%2055.2224Z'%20fill='%2324292E'/%3e%3cpath%20d='M13.9402%2055.9302H15.1135V55.3308H15.1499C15.3002%2055.6726%2015.6347%2055.9831%2016.1972%2055.9831C17.0214%2055.9831%2017.6857%2055.3428%2017.6857%2054.0838C17.6857%2052.779%2016.9827%2052.1844%2016.2045%2052.1844C15.6153%2052.1844%2015.2929%2052.5262%2015.1499%2052.8657H15.1256V51H13.9402V55.9302ZM15.1014%2054.0814C15.1014%2053.4771%2015.3535%2053.104%2015.7875%2053.104C16.2263%2053.104%2016.4687%2053.4868%2016.4687%2054.0814C16.4687%2054.6784%2016.2263%2055.066%2015.7875%2055.066C15.3535%2055.066%2015.1014%2054.6808%2015.1014%2054.0814Z'%20fill='%2324292E'/%3e%3cpath%20d='M20.0476%2056C21.0246%2056%2021.667%2055.5306%2021.8028%2054.8036L20.7143%2054.7723C20.6221%2055.0178%2020.3797%2055.1502%2020.0694%2055.1502C19.6136%2055.1502%2019.3324%2054.8493%2019.3324%2054.3967V54.3654H21.8149V54.0717C21.8149%2052.8536%2021.0682%2052.1844%2020.0112%2052.1844C18.8863%2052.1844%2018.1639%2052.9499%2018.1639%2054.0958C18.1639%2055.2802%2018.8766%2056%2020.0476%2056ZM19.3324%2053.6818C19.3494%2053.3134%2019.6427%2053.0342%2020.0355%2053.0342C20.4258%2053.0342%2020.707%2053.3038%2020.7118%2053.6818H19.3324Z'%20fill='%2324292E'/%3e%3cpath%20d='M23.6059%2051H22.4204V55.9302H23.6059V51Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.5932%2055.2537H28.0623V54.2884H24.5932V55.2537ZM24.5932%2053.5975H28.0623V52.6322H24.5932V53.5975Z'%20fill='%2324292E'/%3e%3cpath%20d='M31.3333%2051H30.2206L28.9963%2051.7559V52.7862L30.1066%2052.1122H30.1357V55.9302H31.3333V51Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126711'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126711'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126711'%20x1='62'%20y1='6.5052'%20x2='77'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126711'%20x1='81'%20y1='6.5052'%20x2='96'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126711'%20x1='100'%20y1='6.5052'%20x2='124'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126711'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126711'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126711'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(62)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126711'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(81)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1248_126711'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(100)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_55 = "data:image/svg+xml,%3csvg%20width='108'%20height='48'%20viewBox='0%200%20108%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126481)'%3e%3cpath%20d='M0%200.800642V10H24V1.05456e-06H1.00292L0.000198677%200L0%200.800642Z'%20fill='url(%23paint0_linear_1248_126481)'/%3e%3cpath%20d='M24%2013H0V22.5H24V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2025.75H0V35.25H24V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%2038.5H0V48H24V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M13%2014.75H11.5716L10%2015.6699V16.9238L11.4253%2016.1035H11.4627V20.75H13V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M9.83733%2033.5H14.25V32.3468H11.8341V32.3092L12.5472%2031.6561C13.8396%2030.5376%2014.1772%2029.9682%2014.1772%2029.289C14.1772%2028.2225%2013.3011%2027.5%2011.9476%2027.5C10.629%2027.5%209.7471%2028.2543%209.75001%2029.4595H11.1151C11.1151%2028.9249%2011.447%2028.6156%2011.9418%2028.6156C12.4279%2028.6156%2012.7801%2028.9133%2012.7801%2029.4017C12.7801%2029.8439%2012.5006%2030.1445%2012.0116%2030.5809L9.83733%2032.4711V33.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M11.9792%2046.25C13.3085%2046.25%2014.2528%2045.5257%2014.25%2044.5105C14.2528%2043.7918%2013.7958%2043.2785%2012.9208%2043.173V43.1274C13.5771%2043.0304%2014.0423%2042.577%2014.0395%2041.9211C14.0423%2040.9686%2013.206%2040.25%2011.9903%2040.25C10.7663%2040.25%209.87462%2040.98%209.86354%2042.0181H11.1734C11.1845%2041.6188%2011.5334%2041.3508%2011.9903%2041.3508C12.4251%2041.3508%2012.7214%2041.6217%2012.7186%2042.0124C12.7214%2042.4173%2012.3725%2042.6968%2011.8685%2042.6968H11.3174V43.7006H11.8685C12.4417%2043.7006%2012.8155%2043.9914%2012.81%2044.4021C12.8155%2044.8156%2012.4721%2045.1036%2011.9848%2045.1036C11.5001%2045.1036%2011.1429%2044.8384%2011.1291%2044.4534H9.75C9.76108%2045.5086%2010.6832%2046.25%2011.9792%2046.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.7744%207.5C11.5264%207.5%2012.0464%207.23767%2012.3415%206.74147H12.3837V7.41783H14V4.1182C14%203.09102%2012.9845%202.5%2011.6107%202.5C10.1595%202.5%209.33732%203.1574%209.20028%204.04235L10.785%204.09292C10.8587%203.78319%2011.1434%203.59355%2011.5966%203.59355C12.0183%203.59355%2012.2853%203.77686%2012.2853%204.1024V4.1182C12.2853%204.4153%2011.9269%204.47851%2011.0063%204.5512C9.91356%204.63338%209%204.99684%209%206.07143C9%207.03224%209.74139%207.5%2010.7744%207.5ZM11.305%206.48862C10.9079%206.48862%2010.6268%206.31795%2010.6268%205.99558C10.6268%205.68268%2010.9009%205.49305%2011.3893%205.42668C11.7091%205.38559%2012.1026%205.32238%2012.2959%205.23072V5.69216C12.2959%206.16625%2011.8531%206.48862%2011.305%206.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M32.5%2019H55.5V29H32.5V19Z'%20stroke='%2324292E'/%3e%3cpath%20d='M36.0776%2026.5H40V25.539H37.8525V25.5077L38.4864%2024.9634C39.6352%2024.0313%2039.9353%2023.5568%2039.9353%2022.9908C39.9353%2022.1021%2039.1565%2021.5%2037.9534%2021.5C36.7814%2021.5%2035.9974%2022.1286%2036%2023.1329H37.2135C37.2135%2022.6874%2037.5084%2022.4297%2037.9483%2022.4297C38.3803%2022.4297%2038.6934%2022.6777%2038.6934%2023.0848C38.6934%2023.4533%2038.445%2023.7038%2038.0104%2024.0674L36.0776%2025.6426V26.5Z'%20fill='%2326262A'/%3e%3cpath%20d='M37.3525%2025.539V26H36.5776V25.8801L38.026%2024.6997L37.5268%2025.1284L37.3525%2025.278V25.5077V25.539ZM39.4353%2022.9908C39.4353%2023.2453%2039.359%2023.5204%2038.6951%2024.1273C38.9687%2023.8557%2039.1934%2023.5298%2039.1934%2023.0848C39.1934%2022.7428%2039.0569%2022.4371%2038.8075%2022.2243C38.7381%2022.1651%2038.6631%2022.1156%2038.5841%2022.0751C38.7959%2022.1308%2038.9657%2022.2137%2039.0935%2022.3106C39.3183%2022.481%2039.4353%2022.7084%2039.4353%2022.9908ZM36.8547%2022.3253C36.9643%2022.2347%2037.1045%2022.1569%2037.275%2022.1C37.2042%2022.1413%2037.137%2022.1906%2037.0748%2022.2487C36.9565%2022.3591%2036.8684%2022.4896%2036.8089%2022.6329H36.6079C36.6683%2022.512%2036.7522%2022.41%2036.8547%2022.3253Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cmask%20id='path-12-inside-1_1248_126481'%20fill='white'%3e%3cpath%20d='M51.8597%2022.6397C51.7708%2022.5502%2051.6506%2022.5%2051.5253%2022.5C51.4%2022.5%2051.2798%2022.5502%2051.1909%2022.6397L49.4881%2024.3398L47.8091%2022.6397C47.7202%2022.5502%2047.6%2022.5%2047.4747%2022.5C47.3494%2022.5%2047.2292%2022.5502%2047.1403%2022.6397C47.0958%2022.6843%2047.0606%2022.7374%2047.0365%2022.7959C47.0124%2022.8545%2047%2022.9172%2047%2022.9806C47%2023.044%2047.0124%2023.1068%2047.0365%2023.1653C47.0606%2023.2239%2047.0958%2023.277%2047.1403%2023.3216L49.1514%2025.3579C49.1955%2025.403%2049.2479%2025.4387%2049.3057%2025.4631C49.3635%2025.4874%2049.4255%2025.5%2049.4881%2025.5C49.5508%2025.5%2049.6128%2025.4874%2049.6706%2025.4631C49.7284%2025.4387%2049.7808%2025.403%2049.8249%2025.3579L51.8597%2023.3216C51.9042%2023.277%2051.9394%2023.2239%2051.9635%2023.1653C51.9876%2023.1068%2052%2023.044%2052%2022.9806C52%2022.9172%2051.9876%2022.8545%2051.9635%2022.7959C51.9394%2022.7374%2051.9042%2022.6843%2051.8597%2022.6397Z'/%3e%3c/mask%3e%3cpath%20d='M51.8597%2022.6397C51.7708%2022.5502%2051.6506%2022.5%2051.5253%2022.5C51.4%2022.5%2051.2798%2022.5502%2051.1909%2022.6397L49.4881%2024.3398L47.8091%2022.6397C47.7202%2022.5502%2047.6%2022.5%2047.4747%2022.5C47.3494%2022.5%2047.2292%2022.5502%2047.1403%2022.6397C47.0958%2022.6843%2047.0606%2022.7374%2047.0365%2022.7959C47.0124%2022.8545%2047%2022.9172%2047%2022.9806C47%2023.044%2047.0124%2023.1068%2047.0365%2023.1653C47.0606%2023.2239%2047.0958%2023.277%2047.1403%2023.3216L49.1514%2025.3579C49.1955%2025.403%2049.2479%2025.4387%2049.3057%2025.4631C49.3635%2025.4874%2049.4255%2025.5%2049.4881%2025.5C49.5508%2025.5%2049.6128%2025.4874%2049.6706%2025.4631C49.7284%2025.4387%2049.7808%2025.403%2049.8249%2025.3579L51.8597%2023.3216C51.9042%2023.277%2051.9394%2023.2239%2051.9635%2023.1653C51.9876%2023.1068%2052%2023.044%2052%2022.9806C52%2022.9172%2051.9876%2022.8545%2051.9635%2022.7959C51.9394%2022.7374%2051.9042%2022.6843%2051.8597%2022.6397Z'%20fill='%2326262A'/%3e%3cpath%20d='M51.8597%2022.6397L51.1503%2023.3445L51.1511%2023.3453L51.8597%2022.6397ZM51.5253%2022.5V21.5V22.5ZM51.1909%2022.6397L51.8975%2023.3473L51.9003%2023.3445L51.1909%2022.6397ZM49.4881%2024.3398L48.7766%2025.0425L49.4832%2025.7579L50.1947%2025.0474L49.4881%2024.3398ZM47.8091%2022.6397L48.5206%2021.937L48.5185%2021.9349L47.8091%2022.6397ZM47.1403%2022.6397L47.8489%2023.3453L47.8497%2023.3445L47.1403%2022.6397ZM47.1403%2023.3216L47.8518%2022.6189L47.8489%2022.616L47.1403%2023.3216ZM49.1514%2025.3579L49.8658%2024.6582L49.8629%2024.6553L49.1514%2025.3579ZM49.8249%2025.3579L49.1175%2024.6511L49.1105%2024.6582L49.8249%2025.3579ZM51.8597%2023.3216L52.5671%2024.0285L52.5683%2024.0272L51.8597%2023.3216ZM52.5691%2021.9349C52.2938%2021.6578%2051.9188%2021.5%2051.5253%2021.5V23.5C51.3824%2023.5%2051.2478%2023.4426%2051.1503%2023.3445L52.5691%2021.9349ZM51.5253%2021.5C51.1318%2021.5%2050.7568%2021.6578%2050.4815%2021.9349L51.9003%2023.3445C51.8028%2023.4426%2051.6682%2023.5%2051.5253%2023.5V21.5ZM50.4844%2021.932L48.7816%2023.6321L50.1947%2025.0474L51.8975%2023.3473L50.4844%2021.932ZM50.1996%2023.6371L48.5206%2021.937L47.0976%2023.3423L48.7766%2025.0425L50.1996%2023.6371ZM48.5185%2021.9349C48.2432%2021.6578%2047.8682%2021.5%2047.4747%2021.5V23.5C47.3318%2023.5%2047.1972%2023.4426%2047.0997%2023.3445L48.5185%2021.9349ZM47.4747%2021.5C47.0812%2021.5%2046.7062%2021.6578%2046.4309%2021.9349L47.8497%2023.3445C47.7522%2023.4426%2047.6176%2023.5%2047.4747%2023.5V21.5ZM46.4317%2021.9341C46.2941%2022.0722%2046.1855%2022.236%2046.1117%2022.4154L47.9613%2023.1765C47.9356%2023.2389%2047.8976%2023.2964%2047.8489%2023.3453L46.4317%2021.9341ZM46.1117%2022.4154C46.0379%2022.5949%2046%2022.787%2046%2022.9806H48C48%2023.0475%2047.9869%2023.114%2047.9613%2023.1765L46.1117%2022.4154ZM46%2022.9806C46%2023.1743%2046.0379%2023.3664%2046.1117%2023.5458L47.9613%2022.7848C47.9869%2022.8472%2048%2022.9138%2048%2022.9806H46ZM46.1117%2023.5458C46.1855%2023.7253%2046.2941%2023.889%2046.4317%2024.0272L47.8489%2022.616C47.8976%2022.6649%2047.9356%2022.7224%2047.9613%2022.7848L46.1117%2023.5458ZM46.4288%2024.0243L48.4399%2026.0606L49.8629%2024.6553L47.8518%2022.6189L46.4288%2024.0243ZM48.437%2026.0577C48.5735%2026.197%2048.7365%2026.3083%2048.9171%2026.3844L49.6944%2024.5417C49.7594%2024.5691%2049.8175%2024.6089%2049.8658%2024.6582L48.437%2026.0577ZM48.9171%2026.3844C49.0976%2026.4606%2049.2918%2026.5%2049.4881%2026.5V24.5C49.5593%2024.5%2049.6294%2024.5143%2049.6944%2024.5417L48.9171%2026.3844ZM49.4881%2026.5C49.6845%2026.5%2049.8787%2026.4606%2050.0592%2026.3844L49.2819%2024.5417C49.3468%2024.5143%2049.417%2024.5%2049.4881%2024.5V26.5ZM50.0592%2026.3844C50.2398%2026.3083%2050.4028%2026.197%2050.5393%2026.0577L49.1105%2024.6582C49.1588%2024.6089%2049.2169%2024.5691%2049.2819%2024.5417L50.0592%2026.3844ZM50.5323%2026.0648L52.5671%2024.0285L51.1523%2022.6148L49.1175%2024.6511L50.5323%2026.0648ZM52.5683%2024.0272C52.7059%2023.889%2052.8145%2023.7253%2052.8883%2023.5458L51.0387%2022.7848C51.0644%2022.7224%2051.1024%2022.6649%2051.1511%2022.616L52.5683%2024.0272ZM52.8883%2023.5458C52.9621%2023.3664%2053%2023.1743%2053%2022.9806H51C51%2022.9138%2051.0131%2022.8472%2051.0387%2022.7848L52.8883%2023.5458ZM53%2022.9806C53%2022.787%2052.9621%2022.5949%2052.8883%2022.4154L51.0387%2023.1765C51.0131%2023.114%2051%2023.0475%2051%2022.9806H53ZM52.8883%2022.4154C52.8145%2022.236%2052.7059%2022.0722%2052.5683%2021.9341L51.1511%2023.3453C51.1024%2023.2964%2051.0644%2023.2389%2051.0387%2023.1765L52.8883%2022.4154Z'%20fill='%23CCCCDC'%20fill-opacity='0.25'%20mask='url(%23path-12-inside-1_1248_126481)'/%3e%3cpath%20d='M69.9067%2030C70.6011%2030%2075.9327%2026%2075.9327%2024C75.9327%2022%2070.7357%2018%2069.9067%2018C69.0778%2018%2068.4023%2018.5%2068.4023%2019.4756C68.4023%2020.4512%2071.9067%2022.9206%2071.9067%2022.9206C71.9067%2022.9206%2064.2539%2022.25%2064%2022.9206C63.7461%2023.5911%2063.7461%2024.4089%2064%2025.0794C64.2539%2025.75%2071.9067%2025.0794%2071.9067%2025.0794C71.9067%2025.0794%2068.4023%2027.75%2068.4023%2028.5301C68.4023%2029.3103%2069.2124%2030%2069.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_126481)'%3e%3cpath%20d='M84%206.80064V16H108V6H85.0029L84.0002%206L84%206.80064Z'%20fill='url(%23paint1_linear_1248_126481)'/%3e%3cpath%20d='M108%2019H84V28.5H108V19Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M108%2019H84V28.5H108V19Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M108%2031.75H84V41.25H108V31.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M97%2020.75H95.5716L94%2021.6699V22.9238L95.4253%2022.1035H95.4627V26.75H97V20.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M93.8373%2039.5H98.25V38.3468H95.8341V38.3092L96.5472%2037.6561C97.8396%2036.5376%2098.1772%2035.9682%2098.1772%2035.289C98.1772%2034.2225%2097.3011%2033.5%2095.9476%2033.5C94.629%2033.5%2093.7471%2034.2543%2093.75%2035.4595H95.1151C95.1151%2034.9249%2095.447%2034.6156%2095.9418%2034.6156C96.4279%2034.6156%2096.7801%2034.9133%2096.7801%2035.4017C96.7801%2035.8439%2096.5006%2036.1445%2096.0116%2036.5809L93.8373%2038.4711V39.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M94.7744%2013.5C95.5264%2013.5%2096.0464%2013.2377%2096.3415%2012.7415H96.3837V13.4178H98V10.1182C98%209.09102%2096.9845%208.5%2095.6107%208.5C94.1595%208.5%2093.3373%209.1574%2093.2003%2010.0424L94.785%2010.0929C94.8587%209.78319%2095.1434%209.59355%2095.5966%209.59355C96.0183%209.59355%2096.2853%209.77686%2096.2853%2010.1024V10.1182C96.2853%2010.4153%2095.9269%2010.4785%2095.0063%2010.5512C93.9136%2010.6334%2093%2010.9968%2093%2012.0714C93%2013.0322%2093.7414%2013.5%2094.7744%2013.5ZM95.305%2012.4886C94.9079%2012.4886%2094.6268%2012.318%2094.6268%2011.9956C94.6268%2011.6827%2094.9009%2011.493%2095.3893%2011.4267C95.7091%2011.3856%2096.1026%2011.3224%2096.2959%2011.2307V11.6922C96.2959%2012.1662%2095.8531%2012.4886%2095.305%2012.4886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126481'%20x1='0.00781255'%20y1='5.004'%20x2='24.0078'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126481'%20x1='84.0078'%20y1='11.004'%20x2='108.008'%20y2='11.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126481'%3e%3crect%20width='24'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126481'%3e%3crect%20width='24'%20height='36'%20fill='white'%20transform='translate(84%206)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_56 = "data:image/svg+xml,%3csvg%20width='177'%20height='48'%20viewBox='0%200%20177%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1248_126108)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126108)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126108)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1248_126108)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M46.3343%2030H49.674V25.674H54V22.3343H49.674V18H46.3343V22.3343H42V25.674H46.3343V30Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip2_1248_126108)'%3e%3cpath%20d='M77%2026.25H62V39.25H77V26.25Z'%20fill='%233865AB'/%3e%3cpath%20d='M62%209.79083V21.75H77V8.75H62.6268C62.4606%208.75%2062.3011%208.85966%2062.1836%209.05485C62.066%209.25005%2062%209.51479%2062%209.79083Z'%20fill='url(%23paint2_linear_1248_126108)'/%3e%3cpath%20d='M69.4792%2035.75C70.8085%2035.75%2071.7528%2035.0257%2071.75%2034.0105C71.7528%2033.2918%2071.2958%2032.7785%2070.4208%2032.673V32.6274C71.0771%2032.5304%2071.5423%2032.077%2071.5395%2031.4211C71.5423%2030.4686%2070.706%2029.75%2069.4903%2029.75C68.2663%2029.75%2067.3746%2030.48%2067.3635%2031.5181H68.6734C68.6845%2031.1188%2069.0334%2030.8508%2069.4903%2030.8508C69.9251%2030.8508%2070.2214%2031.1217%2070.2186%2031.5124C70.2214%2031.9173%2069.8725%2032.1968%2069.3685%2032.1968H68.8174V33.2006H69.3685C69.9417%2033.2006%2070.3155%2033.4914%2070.31%2033.9021C70.3155%2034.3156%2069.9721%2034.6036%2069.4848%2034.6036C69.0001%2034.6036%2068.6429%2034.3384%2068.6291%2033.9534H67.25C67.2611%2035.0086%2068.1832%2035.75%2069.4792%2035.75Z'%20fill='white'/%3e%3cpath%20d='M67%2018.4362H68.5663V17.7145H68.6149C68.8155%2018.1261%2069.2621%2018.5%2070.0129%2018.5C71.1133%2018.5%2072%2017.729%2072%2016.213C72%2014.642%2071.0615%2013.9261%2070.0227%2013.9261C69.2362%2013.9261%2068.8058%2014.3377%2068.6149%2014.7464H68.5825V12.5H67V18.4362ZM68.5502%2016.2101C68.5502%2015.4826%2068.8867%2015.0333%2069.466%2015.0333C70.0518%2015.0333%2070.3754%2015.4942%2070.3754%2016.2101C70.3754%2016.929%2070.0518%2017.3957%2069.466%2017.3957C68.8867%2017.3957%2068.5502%2016.9319%2068.5502%2016.2101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126108)'%3e%3cpath%20d='M96%2026.25H81V39.25H96V26.25Z'%20fill='%233865AB'/%3e%3cpath%20d='M81%2021.75H96V9.79083C96%209.51479%2095.934%209.25005%2095.8164%209.05485C95.6989%208.85966%2095.5394%208.75%2095.3732%208.75H81V21.75Z'%20fill='url(%23paint3_linear_1248_126108)'/%3e%3cpath%20d='M88.6058%2018.5C90.0564%2018.5%2090.9563%2017.7082%2091%2016.5095H89.4654C89.405%2017.0237%2089.0759%2017.3044%2088.6259%2017.3044C88.0484%2017.3044%2087.6723%2016.847%2087.6723%2015.9858C87.6723%2015.1309%2088.0517%2014.6735%2088.6259%2014.6735C89.096%2014.6735%2089.4016%2014.9732%2089.4654%2015.4685H91C90.9631%2014.276%2090.0363%2013.5%2088.6024%2013.5C86.9805%2013.5%2086%2014.5158%2086%2016.0016C86%2017.4811%2086.9738%2018.5%2088.6058%2018.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M109.907%2030C110.601%2030%20115.933%2026%20115.933%2024C115.933%2022%20110.736%2018%20109.907%2018C109.078%2018%20108.402%2018.5%20108.402%2019.4756C108.402%2020.4512%20111.907%2022.9206%20111.907%2022.9206C111.907%2022.9206%20104.254%2022.25%20104%2022.9206C103.746%2023.5911%20103.746%2024.4089%20104%2025.0794C104.254%2025.75%20111.907%2025.0794%20111.907%2025.0794C111.907%2025.0794%20108.402%2027.75%20108.402%2028.5301C108.402%2029.3103%20109.212%2030%20109.907%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M124%200.720576V9H139V0H124.627C124.461%200%20124.301%200.0759177%20124.184%200.211052C124.066%200.346186%20124%200.529468%20124%200.720576Z'%20fill='url(%23paint4_linear_1248_126108)'/%3e%3cpath%20d='M139%2013H124V22H139V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2026H124V35H139V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M139%2039H124V48H139V39Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M124.5%2039.5H138.5V47.5H124.5V39.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M132.5%2015H131.31L130%2015.7666V16.8115L131.188%2016.1279H131.219V20H132.5V15Z'%20fill='%2324292E'/%3e%3cpath%20d='M130.072%2033H133.724V32.039H131.724V32.0077L132.315%2031.4634C133.384%2030.5313%20133.663%2030.0568%20133.663%2029.4908C133.663%2028.6021%20132.938%2028%20131.818%2028C130.727%2028%20129.998%2028.6286%20130%2029.6329H131.13C131.13%2029.1874%20131.404%2028.9297%20131.814%2028.9297C132.216%2028.9297%20132.507%2029.1777%20132.507%2029.5848C132.507%2029.9533%20132.276%2030.2038%20131.871%2030.5674L130.072%2032.1426V33Z'%20fill='%2324292E'/%3e%3cpath%20d='M129%207.68623H130.566V6.96449H130.615C130.816%207.37609%20131.262%207.75%20132.013%207.75C133.113%207.75%20134%206.97898%20134%205.46304C134%203.89203%20133.061%203.17609%20132.023%203.17609C131.236%203.17609%20130.806%203.58768%20130.615%203.99638H130.583V1.75H129V7.68623ZM130.55%205.46015C130.55%204.73261%20130.887%204.28333%20131.466%204.28333C132.052%204.28333%20132.375%204.7442%20132.375%205.46015C132.375%206.17899%20132.052%206.64565%20131.466%206.64565C130.887%206.64565%20130.55%206.18188%20130.55%205.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M143%200.720576V9H158V0H143.627C143.461%200%20143.301%200.0759177%20143.184%200.211052C143.066%200.346186%20143%200.529468%20143%200.720576Z'%20fill='url(%23paint5_linear_1248_126108)'/%3e%3cpath%20d='M158%2013H143V22H158V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2026H143V35H158V26Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M158%2039H143V48H158V39Z'%20fill='%233865AB'/%3e%3cpath%20d='M150.913%2046C152.054%2046%20152.864%2045.3964%20152.862%2044.5504C152.864%2043.9515%20152.472%2043.5238%20151.721%2043.4358V43.3978C152.284%2043.317%20152.683%2042.9392%20152.681%2042.3926C152.683%2041.5989%20151.966%2041%20150.923%2041C149.872%2041%20149.107%2041.6084%20149.097%2042.4734H150.221C150.231%2042.1407%20150.53%2041.9173%20150.923%2041.9173C151.296%2041.9173%20151.55%2042.1431%20151.548%2042.4686C151.55%2042.8061%20151.25%2043.039%20150.818%2043.039H150.345V43.8755H150.818C151.31%2043.8755%20151.631%2044.1179%20151.626%2044.4601C151.631%2044.8047%20151.336%2045.0447%20150.918%2045.0447C150.502%2045.0447%20150.195%2044.8237%20150.183%2044.5029H149C149.01%2045.3821%20149.801%2046%20150.913%2046Z'%20fill='white'/%3e%3cpath%20d='M149.774%207.5C150.526%207.5%20151.046%207.23767%20151.342%206.74147H151.384V7.41783H153V4.1182C153%203.09102%20151.985%202.5%20150.611%202.5C149.16%202.5%20148.337%203.1574%20148.2%204.04235L149.785%204.09292C149.859%203.78319%20150.143%203.59355%20150.597%203.59355C151.018%203.59355%20151.285%203.77686%20151.285%204.1024V4.1182C151.285%204.4153%20150.927%204.47851%20150.006%204.5512C148.914%204.63338%20148%204.99684%20148%206.07143C148%207.03224%20148.741%207.5%20149.774%207.5ZM150.305%206.48862C149.908%206.48862%20149.627%206.31795%20149.627%205.99558C149.627%205.68268%20149.901%205.49305%20150.389%205.42668C150.709%205.38559%20151.103%205.32238%20151.296%205.23072V5.69216C151.296%206.16625%20150.853%206.48862%20150.305%206.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M162%209H177V0.720576C177%200.529468%20176.934%200.346186%20176.816%200.211052C176.699%200.0759177%20176.539%200%20176.373%200L162%200V9Z'%20fill='url(%23paint6_linear_1248_126108)'/%3e%3cpath%20d='M177%2039H162V48H177V39Z'%20fill='%233865AB'/%3e%3cpath%20d='M177%2026H162V35H177V26Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M162.5%2026.5H176.5V34.5H162.5V26.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M177%2013H162V22H177V13Z'%20fill='%23CCCCDC'%20fill-opacity='0.4'/%3e%3cpath%20d='M162.5%2013.5H176.5V21.5H162.5V13.5Z'%20stroke='%23CCCCDC'%20stroke-opacity='0.25'/%3e%3cpath%20d='M169.606%207.5C171.056%207.5%20171.956%206.7082%20172%205.50946H170.465C170.405%206.02366%20170.076%206.30442%20169.626%206.30442C169.048%206.30442%20168.672%205.847%20168.672%204.9858C168.672%204.13092%20169.052%203.6735%20169.626%203.6735C170.096%203.6735%20170.402%203.97319%20170.465%204.46845H172C171.963%203.27602%20171.036%202.5%20169.602%202.5C167.981%202.5%20167%203.51577%20167%205.00158C167%206.48107%20167.974%207.5%20169.606%207.5Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126108'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126108'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126108'%20x1='62'%20y1='15.2552'%20x2='77'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126108'%20x1='81'%20y1='15.2552'%20x2='96'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126108'%20x1='124'%20y1='4.5036'%20x2='139'%20y2='4.5036'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1248_126108'%20x1='143'%20y1='4.5036'%20x2='158'%20y2='4.5036'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_1248_126108'%20x1='162'%20y1='4.5036'%20x2='177'%20y2='4.5036'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126108'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126108'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126108'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(62%208.75)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126108'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%208.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_57 = "data:image/svg+xml,%3csvg%20width='154'%20height='48'%20viewBox='0%200%20154%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M15%202.57189C15.0002%202.53241%2014.9927%202.49327%2014.9777%202.45672C14.9628%202.42018%2014.9408%202.38693%2014.913%202.3589L13.641%201.087C13.613%201.0592%2013.5797%201.0372%2013.5432%201.02227C13.5066%201.00734%2013.4675%200.999777%2013.428%201.00001C13.3885%200.999777%2013.3494%201.00734%2013.3128%201.02227C13.2763%201.0372%2013.243%201.0592%2013.215%201.087L12.366%201.93594L9.087%205.21469C9.0592%205.24272%209.0372%205.27596%209.02227%205.31251C9.00734%205.34906%208.99978%205.3882%209.00001%205.42767V6.69958C9.00001%206.77914%209.03161%206.85544%209.08787%206.9117C9.14413%206.96795%209.22044%206.99956%209.3%206.99956H10.572C10.614%207.00184%2010.656%206.99528%2010.6952%206.98029C10.7345%206.9653%2010.7702%206.94223%2010.8%206.91256L14.061%203.63381L14.913%202.79987C14.9404%202.7708%2014.9627%202.73733%2014.979%202.70088C14.9819%202.67697%2014.9819%202.65279%2014.979%202.62888C14.9804%202.61492%2014.9804%202.60085%2014.979%202.58689L15%202.57189ZM10.449%206.3996H9.6V5.55067L12.579%202.57189L13.428%203.42082L10.449%206.3996ZM13.851%202.99786L13.002%202.14892L13.428%201.72595L14.274%202.57189L13.851%202.99786Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip0_1248_126295)'%3e%3cpath%20d='M0%2011.3611V27H24V10H1.00293C0.736933%2010%200.481835%2010.1434%200.29375%2010.3987C0.105665%2010.6539%200%2011.0001%200%2011.3611Z'%20fill='url(%23paint0_linear_1248_126295)'/%3e%3cpath%20d='M24%2031H0V48H24V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M10.7744%2021.5C11.5264%2021.5%2012.0464%2021.2377%2012.3415%2020.7415H12.3837V21.4178H14V18.1182C14%2017.091%2012.9845%2016.5%2011.6107%2016.5C10.1595%2016.5%209.33732%2017.1574%209.20028%2018.0424L10.785%2018.0929C10.8587%2017.7832%2011.1434%2017.5936%2011.5966%2017.5936C12.0183%2017.5936%2012.2853%2017.7769%2012.2853%2018.1024V18.1182C12.2853%2018.4153%2011.9269%2018.4785%2011.0063%2018.5512C9.91356%2018.6334%209%2018.9968%209%2020.0714C9%2021.0322%209.74139%2021.5%2010.7744%2021.5ZM11.305%2020.4886C10.9079%2020.4886%2010.6268%2020.318%2010.6268%2019.9956C10.6268%2019.6827%2010.9009%2019.493%2011.3893%2019.4267C11.7091%2019.3856%2012.1026%2019.3224%2012.2959%2019.2307V19.6922C12.2959%2020.1662%2011.8531%2020.4886%2011.305%2020.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M13%2036.5H11.5716L10%2037.4199V38.6738L11.4253%2037.8535H11.4627V42.5H13V36.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M35.7976%202.10148C35.7643%202.06962%2035.725%202.04465%2035.6821%202.02799C35.5969%201.993%2035.5013%201.993%2035.4161%202.02799C35.3732%202.04465%2035.3339%202.06962%2035.3007%202.10148L34.6008%202.80134C34.5349%202.86723%2034.4979%202.9566%2034.4979%203.04979C34.4979%203.14297%2034.5349%203.23234%2034.6008%203.29823C34.6667%203.36413%2034.7561%203.40115%2034.8493%203.40115C34.9424%203.40115%2035.0318%203.36413%2035.0977%203.29823L35.1992%203.19326V5.84921C35.1992%205.94202%2035.2361%206.03103%2035.3017%206.09665C35.3673%206.16227%2035.4563%206.19914%2035.5491%206.19914C35.6419%206.19914%2035.7309%206.16227%2035.7965%206.09665C35.8622%206.03103%2035.899%205.94202%2035.899%205.84921V3.19326L36.0005%203.29823C36.033%203.33103%2036.0718%203.35707%2036.1144%203.37483C36.157%203.3926%2036.2028%203.40174%2036.249%203.40174C36.2952%203.40174%2036.3409%203.3926%2036.3835%203.37483C36.4262%203.35707%2036.4649%203.33103%2036.4974%203.29823C36.5302%203.2657%2036.5562%203.227%2036.574%203.18436C36.5918%203.14172%2036.6009%203.09598%2036.6009%203.04979C36.6009%203.00359%2036.5918%202.95785%2036.574%202.91521C36.5562%202.87257%2036.5302%202.83387%2036.4974%202.80134L35.7976%202.10148ZM37.6487%202.69986H41.148C41.2408%202.69986%2041.3298%202.66299%2041.3954%202.59737C41.461%202.53174%2041.4979%202.44274%2041.4979%202.34993C41.4979%202.25712%2041.461%202.16812%2041.3954%202.10249C41.3298%202.03687%2041.2408%202%2041.148%202H37.6487C37.5559%202%2037.4669%202.03687%2037.4012%202.10249C37.3356%202.16812%2037.2988%202.25712%2037.2988%202.34993C37.2988%202.44274%2037.3356%202.53174%2037.4012%202.59737C37.4669%202.66299%2037.5559%202.69986%2037.6487%202.69986V2.69986ZM41.148%205.49928H37.6487C37.5559%205.49928%2037.4669%205.53615%2037.4012%205.60178C37.3356%205.6674%2037.2988%205.75641%2037.2988%205.84921C37.2988%205.94202%2037.3356%206.03103%2037.4012%206.09665C37.4669%206.16227%2037.5559%206.19914%2037.6487%206.19914H41.148C41.2408%206.19914%2041.3298%206.16227%2041.3954%206.09665C41.461%206.03103%2041.4979%205.94202%2041.4979%205.84921C41.4979%205.75641%2041.461%205.6674%2041.3954%205.60178C41.3298%205.53615%2041.2408%205.49928%2041.148%205.49928ZM41.148%203.74964H37.6487C37.5559%203.74964%2037.4669%203.78651%2037.4012%203.85213C37.3356%203.91776%2037.2988%204.00676%2037.2988%204.09957C37.2988%204.19238%2037.3356%204.28138%2037.4012%204.34701C37.4669%204.41263%2037.5559%204.4495%2037.6487%204.4495H41.148C41.2408%204.4495%2041.3298%204.41263%2041.3954%204.34701C41.461%204.28138%2041.4979%204.19238%2041.4979%204.09957C41.4979%204.00676%2041.461%203.91776%2041.3954%203.85213C41.3298%203.78651%2041.2408%203.74964%2041.148%203.74964Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip1_1248_126295)'%3e%3cpath%20d='M26%2027H50V11.3611V10H48.9971H26V27Z'%20fill='url(%23paint1_linear_1248_126295)'/%3e%3cpath%20d='M50%2031H26V48H50V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M35.5%2021.4362H37.0663V20.7145H37.1149C37.3155%2021.1261%2037.7621%2021.5%2038.5129%2021.5C39.6133%2021.5%2040.5%2020.729%2040.5%2019.213C40.5%2017.642%2039.5615%2016.9261%2038.5227%2016.9261C37.7362%2016.9261%2037.3058%2017.3377%2037.1149%2017.7464H37.0825V15.5H35.5V21.4362ZM37.0502%2019.2101C37.0502%2018.4826%2037.3867%2018.0333%2037.966%2018.0333C38.5518%2018.0333%2038.8754%2018.4942%2038.8754%2019.2101C38.8754%2019.929%2038.5518%2020.3957%2037.966%2020.3957C37.3867%2020.3957%2037.0502%2019.9319%2037.0502%2019.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M35.5873%2042.5H40V41.3468H37.5841V41.3092L38.2972%2040.6561C39.5896%2039.5376%2039.9272%2038.9682%2039.9272%2038.289C39.9272%2037.2225%2039.0511%2036.5%2037.6976%2036.5C36.379%2036.5%2035.4971%2037.2543%2035.5%2038.4595H36.8651C36.8651%2037.9249%2037.197%2037.6156%2037.6918%2037.6156C38.1779%2037.6156%2038.5301%2037.9133%2038.5301%2038.4017C38.5301%2038.8439%2038.2506%2039.1445%2037.7616%2039.5809L35.5873%2041.4711V42.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M63.6798%202.22255C63.785%202.20642%2063.8912%202.19841%2063.9976%202.19856C64.9512%202.19856%2065.8477%202.88522%2066.3695%203.99767C66.2897%204.16696%2066.1995%204.33119%2066.0996%204.48943C66.0679%204.53854%2066.0512%204.59587%2066.0516%204.65434C66.0523%204.71978%2066.0743%204.78321%2066.1144%204.83494C66.1545%204.88667%2066.2104%204.92387%2066.2736%204.94086C66.3368%204.95784%2066.4038%204.95369%2066.4645%204.92903C66.5251%204.90437%2066.576%204.86055%2066.6093%204.80427C66.7491%204.58476%2066.8704%204.35409%2066.9722%204.11461C66.9883%204.0772%2066.9966%204.0369%2066.9966%203.99617C66.9966%203.95544%2066.9883%203.91514%2066.9722%203.87773C66.3665%202.47142%2065.227%201.59886%2063.9976%201.59886C63.8569%201.59815%2063.7164%201.61019%2063.5778%201.63484C63.5385%201.64153%2063.5008%201.65592%2063.467%201.67717C63.4332%201.69842%2063.4039%201.72613%2063.3807%201.75871C63.3576%201.79128%2063.3412%201.82809%2063.3323%201.86704C63.3234%201.90598%2063.3223%201.94629%2063.329%201.98566C63.3357%202.02504%2063.35%202.06271%2063.3713%202.09653C63.3926%202.13035%2063.4203%202.15965%2063.4528%202.18276C63.4854%202.20587%2063.5222%202.22234%2063.5612%202.23122C63.6001%202.24011%2063.6404%202.24123%2063.6798%202.23454V2.22255ZM61.5119%201.08611C61.4839%201.05815%2061.4507%201.03597%2061.4142%201.02084C61.3777%201.00571%2061.3385%200.997925%2061.299%200.997925C61.2594%200.997925%2061.2203%201.00571%2061.1838%201.02084C61.1472%201.03597%2061.114%201.05815%2061.0861%201.08611C61.0296%201.14257%2060.9979%201.21915%2060.9979%201.299C60.9979%201.37885%2061.0296%201.45543%2061.0861%201.5119L62.0156%202.43844C61.5915%202.8467%2061.254%203.33619%2061.0231%203.87773C61.0066%203.91556%2060.9981%203.95639%2060.9981%203.99767C60.9981%204.03895%2061.0066%204.07978%2061.0231%204.11761C61.6288%205.52391%2062.7682%206.39648%2063.9976%206.39648C64.5365%206.39276%2065.0626%206.23231%2065.5119%205.93471L66.4834%206.90923C66.5113%206.93733%2066.5444%206.95964%2066.581%206.97486C66.6175%206.99009%2066.6567%206.99792%2066.6963%206.99792C66.7359%206.99792%2066.7751%206.99009%2066.8116%206.97486C66.8482%206.95964%2066.8813%206.93733%2066.9092%206.90923C66.9373%206.88135%2066.9596%206.84819%2066.9748%206.81165C66.9901%206.77511%2066.9979%206.73592%2066.9979%206.69633C66.9979%206.65675%2066.9901%206.61756%2066.9748%206.58102C66.9596%206.54448%2066.9373%206.51131%2066.9092%206.48344L61.5119%201.08611ZM63.4189%203.84175L64.1536%204.57638C64.1029%204.59092%2064.0504%204.59799%2063.9976%204.59737C63.8386%204.59737%2063.6861%204.53419%2063.5736%204.42172C63.4611%204.30926%2063.3979%204.15672%2063.3979%203.99767C63.3973%203.94495%2063.4044%203.89242%2063.4189%203.84175ZM63.9976%205.79678C63.0441%205.79678%2062.1476%205.11012%2061.6288%203.99767C61.8225%203.57%2062.0975%203.18404%2062.4384%202.86123L62.9691%203.39797C62.8445%203.62549%2062.797%203.88731%2062.8337%204.14413C62.8704%204.40096%2062.9895%204.63895%2063.1729%204.8224C63.3564%205.00586%2063.5943%205.12488%2063.8512%205.16162C64.108%205.19835%2064.3698%205.15082%2064.5973%205.02616L65.0741%205.49693C64.7476%205.6891%2064.3765%205.79247%2063.9976%205.79678Z'%20fill='white'/%3e%3cg%20clip-path='url(%23clip2_1248_126295)'%3e%3cpath%20d='M52%2027H76V11.3611C76%2011.0001%2075.8943%2010.6539%2075.7063%2010.3987C75.5182%2010.1434%2075.2631%2010%2074.9971%2010H52V27Z'%20fill='url(%23paint2_linear_1248_126295)'/%3e%3cpath%20d='M76%2031H52V48H76V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M64.1058%2021.5C65.5564%2021.5%2066.4563%2020.7082%2066.5%2019.5095H64.9654C64.905%2020.0237%2064.5759%2020.3044%2064.1259%2020.3044C63.5484%2020.3044%2063.1723%2019.847%2063.1723%2018.9858C63.1723%2018.1309%2063.5517%2017.6735%2064.1259%2017.6735C64.596%2017.6735%2064.9016%2017.9732%2064.9654%2018.4685H66.5C66.4631%2017.276%2065.5363%2016.5%2064.1024%2016.5C62.4805%2016.5%2061.5%2017.5158%2061.5%2019.0016C61.5%2020.4811%2062.4738%2021.5%2064.1058%2021.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M63.9769%2042.5C65.4538%2042.5%2066.5031%2041.7757%2066.5%2040.7605C66.5031%2040.0418%2065.9954%2039.5285%2065.0231%2039.423V39.3774C65.7523%2039.2804%2066.2692%2038.827%2066.2661%2038.1711C66.2692%2037.2186%2065.34%2036.5%2063.9892%2036.5C62.6292%2036.5%2061.6385%2037.23%2061.6262%2038.2681H63.0815C63.0938%2037.8688%2063.4815%2037.6008%2063.9892%2037.6008C64.4723%2037.6008%2064.8015%2037.8717%2064.7985%2038.2624C64.8015%2038.6673%2064.4138%2038.9468%2063.8538%2038.9468H63.2415V39.9506H63.8538C64.4908%2039.9506%2064.9061%2040.2414%2064.9%2040.6521C64.9061%2041.0656%2064.5246%2041.3536%2063.9831%2041.3536C63.4446%2041.3536%2063.0477%2041.0884%2063.0323%2040.7034H61.5C61.5123%2041.7586%2062.5369%2042.5%2063.9769%2042.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M89.9067%2030C90.6011%2030%2095.9327%2026%2095.9327%2024C95.9327%2022%2090.7357%2018%2089.9067%2018C89.0778%2018%2088.4023%2018.5%2088.4023%2019.4756C88.4023%2020.4512%2091.9067%2022.9206%2091.9067%2022.9206C91.9067%2022.9206%2084.2539%2022.25%2084%2022.9206C83.7461%2023.5911%2083.7461%2024.4089%2084%2025.0794C84.2539%2025.75%2091.9067%2025.0794%2091.9067%2025.0794C91.9067%2025.0794%2088.4023%2027.75%2088.4023%2028.5301C88.4023%2029.3103%2089.2124%2030%2089.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip3_1248_126295)'%3e%3cpath%20d='M130%2027H154V11.3611C154%2011.0001%20153.894%2010.6539%20153.706%2010.3987C153.518%2010.1434%20153.263%2010%20152.997%2010H130V27Z'%20fill='url(%23paint3_linear_1248_126295)'/%3e%3cpath%20d='M154%2031H130V48H154V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M143%2036.5H141.572L140%2037.4199V38.6738L141.425%2037.8535H141.463V42.5H143V36.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M140.987%2021.5C141.738%2021.5%20142.184%2021.1261%20142.385%2020.7145H142.434V21.4362H144V15.5H142.417V17.7464H142.385C142.197%2017.3377%20141.764%2016.9261%20140.981%2016.9261C139.942%2016.9261%20139%2017.642%20139%2019.213C139%2020.729%20139.89%2021.5%20140.987%2021.5ZM141.537%2020.3957C140.951%2020.3957%20140.625%2019.929%20140.625%2019.2101C140.625%2018.4942%20140.948%2018.0333%20141.537%2018.0333C142.117%2018.0333%20142.453%2018.4826%20142.453%2019.2101C142.453%2019.9319%20142.113%2020.3957%20141.537%2020.3957Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip4_1248_126295)'%3e%3cpath%20d='M128%2031H104V48H128V31Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M104%2011.3611V27H128V10H105.003C104.737%2010%20104.482%2010.1434%20104.294%2010.3987C104.106%2010.6539%20104%2011.0001%20104%2011.3611Z'%20fill='url(%23paint4_linear_1248_126295)'/%3e%3cpath%20d='M113.5%2021.4362H115.066V20.7145H115.115C115.316%2021.1261%20115.762%2021.5%20116.513%2021.5C117.613%2021.5%20118.5%2020.729%20118.5%2019.213C118.5%2017.642%20117.561%2016.9261%20116.523%2016.9261C115.736%2016.9261%20115.306%2017.3377%20115.115%2017.7464H115.083V15.5H113.5V21.4362ZM115.05%2019.2101C115.05%2018.4826%20115.387%2018.0333%20115.966%2018.0333C116.552%2018.0333%20116.875%2018.4942%20116.875%2019.2101C116.875%2019.929%20116.552%2020.3957%20115.966%2020.3957C115.387%2020.3957%20115.05%2019.9319%20115.05%2019.2101Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.587%2042.5H118V41.3468H115.584V41.3092L116.297%2040.6561C117.59%2039.5376%20117.927%2038.9682%20117.927%2038.289C117.927%2037.2225%20117.051%2036.5%20115.698%2036.5C114.379%2036.5%20113.497%2037.2543%20113.5%2038.4595H114.865C114.865%2037.9249%20115.197%2037.6156%20115.692%2037.6156C116.178%2037.6156%20116.53%2037.9133%20116.53%2038.4017C116.53%2038.8439%20116.251%2039.1445%20115.762%2039.5809L113.587%2041.4711V42.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126295'%20x1='0'%20y1='18.5068'%20x2='24'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126295'%20x1='26'%20y1='18.5068'%20x2='50'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126295'%20x1='52'%20y1='18.5068'%20x2='76'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126295'%20x1='130'%20y1='18.5068'%20x2='154'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126295'%20x1='104'%20y1='18.5068'%20x2='128'%20y2='18.5068'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126295'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(0%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126295'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(26%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126295'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(52%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126295'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(130%2010)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip4_1248_126295'%3e%3crect%20width='24'%20height='38'%20fill='white'%20transform='translate(104%2010)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_58 = "data:image/svg+xml,%3csvg%20width='101'%20height='48'%20viewBox='0%200%20101%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126643)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M28.9067%2030C29.6011%2030%2034.9327%2026%2034.9327%2024C34.9327%2022%2029.7357%2018%2028.9067%2018C28.0778%2018%2027.4023%2018.5%2027.4023%2019.4756C27.4023%2020.4512%2030.9067%2022.9206%2030.9067%2022.9206C30.9067%2022.9206%2023.2539%2022.25%2023%2022.9206C22.7461%2023.5911%2022.7461%2024.4089%2023%2025.0794C23.2539%2025.75%2030.9067%2025.0794%2030.9067%2025.0794C30.9067%2025.0794%2027.4023%2027.75%2027.4023%2028.5301C27.4023%2029.3103%2028.2124%2030%2028.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M43%2010.0408V22H58V9H43.6268C43.4606%209%2043.3011%209.10966%2043.1836%209.30485C43.066%209.50005%2043%209.76479%2043%2010.0408Z'%20fill='url(%23paint1_linear_1248_126643)'/%3e%3cpath%20d='M58%2026.5H43V39.5H58V26.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M51.5%2030H50.0716L48.5%2030.9199V32.1738L49.9253%2031.3535H49.9627V36H51.5V30Z'%20fill='%2324292E'/%3e%3cpath%20d='M49.7744%2018.5C50.5264%2018.5%2051.0464%2018.2377%2051.3415%2017.7415H51.3837V18.4178H53V15.1182C53%2014.091%2051.9845%2013.5%2050.6107%2013.5C49.1595%2013.5%2048.3373%2014.1574%2048.2003%2015.0424L49.785%2015.0929C49.8587%2014.7832%2050.1434%2014.5936%2050.5966%2014.5936C51.0183%2014.5936%2051.2853%2014.7769%2051.2853%2015.1024V15.1182C51.2853%2015.4153%2050.9269%2015.4785%2050.0063%2015.5512C48.9136%2015.6334%2048%2015.9968%2048%2017.0714C48%2018.0322%2048.7414%2018.5%2049.7744%2018.5ZM50.305%2017.4886C49.9079%2017.4886%2049.6268%2017.318%2049.6268%2016.9956C49.6268%2016.6827%2049.9009%2016.493%2050.3893%2016.4267C50.7091%2016.3856%2051.1026%2016.3224%2051.2959%2016.2307V16.6922C51.2959%2017.1662%2050.8531%2017.4886%2050.305%2017.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M70.3343%2030H73.674V25.674H78V22.3343H73.674V18H70.3343V22.3343H66V25.674H70.3343V30Z'%20fill='%2324292E'/%3e%3cpath%20d='M86%2010.0408V22H101V9H86.6268C86.4606%209%2086.3011%209.10966%2086.1836%209.30485C86.066%209.50005%2086%209.76479%2086%2010.0408Z'%20fill='url(%23paint2_linear_1248_126643)'/%3e%3cpath%20d='M101%2026.5H86V39.5H101V26.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M92.7744%2018.5C93.5264%2018.5%2094.0464%2018.2377%2094.3415%2017.7415H94.3837V18.4178H96V15.1182C96%2014.091%2094.9845%2013.5%2093.6107%2013.5C92.1595%2013.5%2091.3373%2014.1574%2091.2003%2015.0424L92.785%2015.0929C92.8587%2014.7832%2093.1434%2014.5936%2093.5966%2014.5936C94.0183%2014.5936%2094.2853%2014.7769%2094.2853%2015.1024V15.1182C94.2853%2015.4153%2093.9269%2015.4785%2093.0063%2015.5512C91.9136%2015.6334%2091%2015.9968%2091%2017.0714C91%2018.0322%2091.7414%2018.5%2092.7744%2018.5ZM93.305%2017.4886C92.9079%2017.4886%2092.6268%2017.318%2092.6268%2016.9956C92.6268%2016.6827%2092.9009%2016.493%2093.3893%2016.4267C93.7091%2016.3856%2094.1026%2016.3224%2094.2959%2016.2307V16.6922C94.2959%2017.1662%2093.8531%2017.4886%2093.305%2017.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M91.0873%2036H95.5V34.8468H93.0841V34.8092L93.7972%2034.1561C95.0896%2033.0376%2095.4272%2032.4682%2095.4272%2031.789C95.4272%2030.7225%2094.5511%2030%2093.1976%2030C91.879%2030%2090.9971%2030.7543%2091%2031.9595H92.3651C92.3651%2031.4249%2092.697%2031.1156%2093.1918%2031.1156C93.6779%2031.1156%2094.0301%2031.4133%2094.0301%2031.9017C94.0301%2032.3439%2093.7506%2032.6445%2093.2616%2033.0809L91.0873%2034.9711V36Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126643'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126643'%20x1='43'%20y1='15.5052'%20x2='58'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126643'%20x1='86'%20y1='15.5052'%20x2='101'%20y2='15.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_59 = "data:image/svg+xml,%3csvg%20width='180'%20height='48'%20viewBox='0%200%20180%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%209.79071V21.7499H15V8.74988H0.626828C0.460583%208.74988%200.301147%208.85954%200.183594%209.05473C0.0660407%209.24992%200%209.51466%200%209.79071Z'%20fill='url(%23paint0_linear_1248_126664)'/%3e%3cpath%20d='M15%2026.2499H0V39.2499H15V26.2499Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2030H7.07158L5.5%2030.9199V32.1738L6.92531%2031.3535H6.96266V36H8.5V30Z'%20fill='%2324292E'/%3e%3cpath%20d='M19%209.79083V21.75H34V8.75H19.6268C19.4606%208.75%2019%208.75%2019%208.75C19%208.75%2019%209.51479%2019%209.79083Z'%20fill='url(%23paint1_linear_1248_126664)'/%3e%3cpath%20d='M34%2026.25H19V39.25H34V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M26.5739%2018.25C25.3778%2018.2443%2024.2472%2017.5199%2024.25%2015.3812C24.2557%2013.4192%2025.179%2012.25%2026.6165%2012.25C27.7784%2012.25%2028.5739%2013%2028.6903%2013.961H27.4773C27.3835%2013.5532%2027.0625%2013.308%2026.6165%2013.308C25.858%2013.308%2025.4602%2014.0152%2025.4545%2015.153H25.4943C25.7557%2014.6369%2026.321%2014.3289%2026.9602%2014.3289C27.9915%2014.3289%2028.7528%2015.1188%2028.75%2016.2139C28.7528%2017.403%2027.8693%2018.2557%2026.5739%2018.25ZM26.5682%2017.2804C27.1364%2017.2804%2027.5597%2016.8327%2027.5568%2016.2481C27.5597%2015.6692%2027.1449%2015.2215%2026.5767%2015.2215C26.0114%2015.2215%2025.5824%2015.6834%2025.5795%2016.2509C25.5795%2016.8213%2026%2017.2804%2026.5682%2017.2804Z'%20fill='%2324292E'/%3e%3cpath%20d='M26.2292%2035.75C27.5585%2035.75%2028.5028%2035.0257%2028.5%2034.0105C28.5028%2033.2918%2028.0458%2032.7785%2027.1708%2032.673V32.6274C27.8271%2032.5304%2028.2923%2032.077%2028.2895%2031.4211C28.2923%2030.4686%2027.456%2029.75%2026.2403%2029.75C25.0163%2029.75%2024.1246%2030.48%2024.1135%2031.5181H25.4234C25.4345%2031.1188%2025.7834%2030.8508%2026.2403%2030.8508C26.6751%2030.8508%2026.9714%2031.1217%2026.9686%2031.5124C26.9714%2031.9173%2026.6225%2032.1968%2026.1185%2032.1968H25.5674V33.2006H26.1185C26.6917%2033.2006%2027.0655%2033.4914%2027.06%2033.9021C27.0655%2034.3156%2026.7221%2034.6036%2026.2348%2034.6036C25.7501%2034.6036%2025.3929%2034.3384%2025.3791%2033.9534H24C24.0111%2035.0086%2024.9332%2035.75%2026.2292%2035.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M38%209.79083V21.75H53V8.75H38.6268C38.4606%208.75%2038%208.75%2038%208.75C38%208.75%2038%209.51479%2038%209.79083Z'%20fill='url(%23paint2_linear_1248_126664)'/%3e%3cpath%20d='M53%2026.25H38V39.25H53V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M43.6884%2018.25L46.3471%2013.3281V13.2871H43.25V12.25H47.75V13.3018L45.0882%2018.25H43.6884Z'%20fill='%2324292E'/%3e%3cpath%20d='M43%2034.6953V33.6963L45.5893%2029.75H47.2308V33.6787H48V34.6953H47.2308V35.75H45.977V34.6953H43ZM46.0012%2033.6787V31.1328H45.9528L44.3204%2033.6318V33.6787H46.0012Z'%20fill='%2324292E'/%3e%3cpath%20d='M57%2021.7499H72V9.79071C72%209.51466%2071.934%209.24992%2071.8164%209.05473C71.6989%208.85954%2071.5394%208.74988%2071.3732%208.74988H57V21.7499Z'%20fill='url(%23paint3_linear_1248_126664)'/%3e%3cpath%20d='M72%2026.2499H57V39.2499H72V26.2499Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M64.4602%2035.75C63.0525%2035.75%2062.0266%2035.0188%2062%2033.9957H63.3944C63.4276%2034.4552%2063.8891%2034.7673%2064.4602%2034.7673C65.1341%2034.7673%2065.6155%2034.3425%2065.6155%2033.7269C65.6155%2033.1055%2065.1242%2032.6749%2064.4402%2032.672C64.0385%2032.672%2063.6335%2032.8251%2063.4243%2033.0708L62.1461%2032.8714L62.4681%2029.75H66.6248V30.7731H63.6534L63.4774%2032.2558H63.5173C63.7563%2031.9639%2064.2709%2031.7471%2064.8685%2031.7471C66.0936%2031.7471%2067.0033%2032.5621%2067%2033.6951C67.0033%2034.8916%2065.9741%2035.75%2064.4602%2035.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M64.4986%2018.25C63.1902%2018.25%2062.2472%2017.5456%2062.25%2016.5989C62.2472%2015.8688%2062.7994%2015.2728%2063.5074%2015.1559V15.116C62.89%2014.9905%2062.4624%2014.4601%2062.4652%2013.8213C62.4624%2012.9173%2063.3233%2012.25%2064.4986%2012.25C65.671%2012.25%2066.5319%2012.9173%2066.5348%2013.8213C66.5319%2014.4629%2066.0986%2014.9905%2065.4926%2015.116V15.1559C66.1893%2015.2728%2066.7472%2015.8688%2066.75%2016.5989C66.7472%2017.5456%2065.807%2018.25%2064.4986%2018.25ZM64.4986%2017.3432C65.0791%2017.3432%2065.4728%2016.9981%2065.4728%2016.5019C65.4728%2015.9971%2065.0593%2015.6321%2064.4986%2015.6321C63.935%2015.6321%2063.5244%2015.9971%2063.5244%2016.5019C63.5244%2016.9952%2063.9152%2017.3432%2064.4986%2017.3432ZM64.4986%2014.7338C64.9857%2014.7338%2065.3369%2014.4116%2065.3369%2013.9496C65.3369%2013.4962%2064.9914%2013.1797%2064.4986%2013.1797C64.003%2013.1797%2063.6603%2013.4933%2063.6603%2013.9496C63.6603%2014.4116%2064.0087%2014.7338%2064.4986%2014.7338Z'%20fill='%2324292E'/%3e%3cpath%20d='M85.9067%2030C86.6011%2030%2091.9327%2026%2091.9327%2024C91.9327%2022%2086.7357%2018%2085.9067%2018C85.0778%2018%2084.4023%2018.5%2084.4023%2019.4756C84.4023%2020.4512%2087.9067%2022.9206%2087.9067%2022.9206C87.9067%2022.9206%2080.2539%2022.25%2080%2022.9206C79.7461%2023.5911%2079.7461%2024.4089%2080%2025.0794C80.2539%2025.75%2087.9067%2025.0794%2087.9067%2025.0794C87.9067%2025.0794%2084.4023%2027.75%2084.4023%2028.5301C84.4023%2029.3103%2085.2124%2030%2085.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126664)'%3e%3cpath%20d='M100%200.800641V10H124V0H101.003C100.737%200%20100.482%200.084353%20100.294%200.234502C100.106%200.384651%20100%200.588297%20100%200.800641Z'%20fill='url(%23paint4_linear_1248_126664)'/%3e%3cpath%20d='M124%2013H100V22.5H124V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2025.75H100V35.25H124V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2038.5H100V48H112H124V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M113.5%2040.25H112.072L110.5%2041.1699V42.4238L111.925%2041.6035H111.963V46.25H113.5V40.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2014.75H112.072L110.5%2015.6699V16.9238L111.925%2016.1035H111.963V20.75H113.5V14.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M113.5%2027.5H112.072L110.5%2028.4199V29.6738L111.925%2028.8535H111.963V33.5H113.5V27.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126664)'%3e%3cpath%20d='M152%2013H128V22.5H152V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M152%2025.75H128V35.25H152V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M152%2038.5H128V48H140H152V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M128%200.800641V10H152V1.05456e-06H129.003L128%200L128%200.800641Z'%20fill='url(%23paint5_linear_1248_126664)'/%3e%3cpath%20d='M139.979%2020.75C141.308%2020.75%20142.253%2020.0257%20142.25%2019.0105C142.253%2018.2918%20141.796%2017.7785%20140.921%2017.673V17.6274C141.577%2017.5304%20142.042%2017.077%20142.04%2016.4211C142.042%2015.4686%20141.206%2014.75%20139.99%2014.75C138.766%2014.75%20137.875%2015.48%20137.864%2016.5181H139.173C139.184%2016.1188%20139.533%2015.8508%20139.99%2015.8508C140.425%2015.8508%20140.721%2016.1217%20140.719%2016.5124C140.721%2016.9173%20140.372%2017.1968%20139.868%2017.1968H139.317V18.2006H139.868C140.442%2018.2006%20140.816%2018.4914%20140.81%2018.9021C140.816%2019.3156%20140.472%2019.6036%20139.985%2019.6036C139.5%2019.6036%20139.143%2019.3384%20139.129%2018.9534H137.75C137.761%2020.0086%20138.683%2020.75%20139.979%2020.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M137.75%2032.4453V31.4463L140.339%2027.5H141.981V31.4287H142.75V32.4453H141.981V33.5H140.727V32.4453H137.75ZM140.751%2031.4287V28.8828H140.703L139.07%2031.3818V31.4287H140.751Z'%20fill='%2324292E'/%3e%3cpath%20d='M140.21%2046.25C138.802%2046.25%20137.777%2045.5188%20137.75%2044.4957H139.144C139.178%2044.9552%20139.639%2045.2673%20140.21%2045.2673C140.884%2045.2673%20141.366%2044.8425%20141.366%2044.2269C141.366%2043.6055%20140.874%2043.1749%20140.19%2043.172C139.789%2043.172%20139.383%2043.3251%20139.174%2043.5708L137.896%2043.3714L138.218%2040.25H142.375V41.2731H139.403L139.227%2042.7558H139.267C139.506%2042.4639%20140.021%2042.2471%20140.619%2042.2471C141.844%2042.2471%20142.753%2043.0621%20142.75%2044.1951C142.753%2045.3916%20141.724%2046.25%20140.21%2046.25Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1248_126664)'%3e%3cpath%20d='M180%2013H156V22.5H180V13Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M180%2025.75H156V35.25H180V25.75Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M180%2038.5H156V48H168H180V38.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M156%2010H180V0.800641C180%200.588297%20179.894%200.384651%20179.706%200.234502C179.518%200.084353%20179.263%200%20178.997%200L156%200V10Z'%20fill='url(%23paint6_linear_1248_126664)'/%3e%3cpath%20d='M167.999%2046.25C166.69%2046.25%20165.747%2045.5456%20165.75%2044.5989C165.747%2043.8688%20166.299%2043.2728%20167.007%2043.1559V43.116C166.39%2042.9905%20165.962%2042.4601%20165.965%2041.8213C165.962%2040.9173%20166.823%2040.25%20167.999%2040.25C169.171%2040.25%20170.032%2040.9173%20170.035%2041.8213C170.032%2042.4629%20169.599%2042.9905%20168.993%2043.116V43.1559C169.689%2043.2728%20170.247%2043.8688%20170.25%2044.5989C170.247%2045.5456%20169.307%2046.25%20167.999%2046.25ZM167.999%2045.3432C168.579%2045.3432%20168.973%2044.9981%20168.973%2044.5019C168.973%2043.9971%20168.559%2043.6321%20167.999%2043.6321C167.435%2043.6321%20167.024%2043.9971%20167.024%2044.5019C167.024%2044.9952%20167.415%2045.3432%20167.999%2045.3432ZM167.999%2042.7338C168.486%2042.7338%20168.837%2042.4116%20168.837%2041.9496C168.837%2041.4962%20168.491%2041.1797%20167.999%2041.1797C167.503%2041.1797%20167.16%2041.4933%20167.16%2041.9496C167.16%2042.4116%20167.509%2042.7338%20167.999%2042.7338Z'%20fill='%2324292E'/%3e%3cpath%20d='M166.188%2033.5L168.847%2028.5781V28.5371H165.75V27.5H170.25V28.5518L167.588%2033.5H166.188Z'%20fill='%2324292E'/%3e%3cpath%20d='M168.074%2020.75C166.878%2020.7443%20165.747%2020.0199%20165.75%2017.8812C165.756%2015.9192%20166.679%2014.75%20168.116%2014.75C169.278%2014.75%20170.074%2015.5%20170.19%2016.461H168.977C168.884%2016.0532%20168.562%2015.808%20168.116%2015.808C167.358%2015.808%20166.96%2016.5152%20166.955%2017.653H166.994C167.256%2017.1369%20167.821%2016.8289%20168.46%2016.8289C169.491%2016.8289%20170.253%2017.6188%20170.25%2018.7139C170.253%2019.903%20169.369%2020.7557%20168.074%2020.75ZM168.068%2019.7804C168.636%2019.7804%20169.06%2019.3327%20169.057%2018.7481C169.06%2018.1692%20168.645%2017.7215%20168.077%2017.7215C167.511%2017.7215%20167.082%2018.1834%20167.08%2018.7509C167.08%2019.3213%20167.5%2019.7804%20168.068%2019.7804Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126664'%20x1='0'%20y1='15.2551'%20x2='15'%20y2='15.2551'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126664'%20x1='19'%20y1='15.2552'%20x2='34'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126664'%20x1='38'%20y1='15.2552'%20x2='53'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126664'%20x1='57'%20y1='15.2551'%20x2='72'%20y2='15.2551'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126664'%20x1='100'%20y1='5.004'%20x2='124'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_1248_126664'%20x1='128.008'%20y1='5.004'%20x2='152.008'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_1248_126664'%20x1='156'%20y1='5.004'%20x2='180'%20y2='5.004'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126664'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(100)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126664'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(128)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126664'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(156)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_60 = "data:image/svg+xml,%3csvg%20width='105'%20height='48'%20viewBox='0%200%20105%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126508)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126508)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1248_126508)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24%209.68623H25.5663V8.96449H25.6149C25.8155%209.37609%2026.2621%209.75%2027.0129%209.75C28.1133%209.75%2029%208.97898%2029%207.46304C29%205.89203%2028.0615%205.17609%2027.0227%205.17609C26.2362%205.17609%2025.8058%205.58768%2025.6149%205.99638H25.5825V3.75H24V9.68623ZM25.5502%207.46015C25.5502%206.73261%2025.8867%206.28333%2026.466%206.28333C27.0518%206.28333%2027.3754%206.7442%2027.3754%207.46015C27.3754%208.17899%2027.0518%208.64565%2026.466%208.64565C25.8867%208.64565%2025.5502%208.18188%2025.5502%207.46015Z'%20fill='%2324292E'/%3e%3cpath%20d='M26.4792%2027C27.8085%2027%2028.7528%2026.2757%2028.75%2025.2605C28.7528%2024.5418%2028.2958%2024.0285%2027.4208%2023.923V23.8774C28.0771%2023.7804%2028.5423%2023.327%2028.5395%2022.6711C28.5423%2021.7186%2027.706%2021%2026.4903%2021C25.2663%2021%2024.3746%2021.73%2024.3635%2022.7681H25.6734C25.6845%2022.3688%2026.0334%2022.1008%2026.4903%2022.1008C26.9251%2022.1008%2027.2214%2022.3717%2027.2186%2022.7624C27.2214%2023.1673%2026.8725%2023.4468%2026.3685%2023.4468H25.8174V24.4506H26.3685C26.9417%2024.4506%2027.3155%2024.7414%2027.31%2025.1521C27.3155%2025.5656%2026.9721%2025.8536%2026.4848%2025.8536C26.0001%2025.8536%2025.6429%2025.5884%2025.6291%2025.2034H24.25C24.2611%2026.2586%2025.1832%2027%2026.4792%2027Z'%20fill='%2324292E'/%3e%3cpath%20d='M24%2043.4453V42.4463L26.5893%2038.5H28.2308V42.4287H29V43.4453H28.2308V44.5H26.977V43.4453H24ZM27.0012%2042.4287V39.8828H26.9528L25.3204%2042.3818V42.4287H27.0012Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0778%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2124%2030%2047.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.7955%2020.1818H68.2727V20.6591C68.2727%2020.9123%2068.3733%2021.155%2068.5523%2021.3341C68.7313%2021.5131%2068.9741%2021.6136%2069.2273%2021.6136C69.4804%2021.6136%2069.7232%2021.5131%2069.9022%2021.3341C70.0812%2021.155%2070.1818%2020.9123%2070.1818%2020.6591V20.1818H70.6591C70.9123%2020.1818%2071.155%2020.0813%2071.3341%2019.9022C71.5131%2019.7232%2071.6136%2019.4804%2071.6136%2019.2273C71.6136%2018.9741%2071.5131%2018.7313%2071.3341%2018.5523C71.155%2018.3733%2070.9123%2018.2727%2070.6591%2018.2727H70.1818V17.7955C70.1818%2017.5423%2070.0812%2017.2995%2069.9022%2017.1205C69.7232%2016.9415%2069.4804%2016.8409%2069.2273%2016.8409C68.9741%2016.8409%2068.7313%2016.9415%2068.5523%2017.1205C68.3733%2017.2995%2068.2727%2017.5423%2068.2727%2017.7955V18.2727H67.7955C67.5423%2018.2727%2067.2995%2018.3733%2067.1205%2018.5523C66.9415%2018.7313%2066.8409%2018.9741%2066.8409%2019.2273C66.8409%2019.4804%2066.9415%2019.7232%2067.1205%2019.9022C67.2995%2020.0813%2067.5423%2020.1818%2067.7955%2020.1818ZM67.2036%2030.7964C67.3825%2030.9742%2067.6244%2031.0739%2067.8766%2031.0739C68.1288%2031.0739%2068.3707%2030.9742%2068.5495%2030.7964L69.2273%2030.1186L69.905%2030.7964C70.0838%2030.9742%2070.3258%2031.0739%2070.578%2031.0739C70.8301%2031.0739%2071.0721%2030.9742%2071.2509%2030.7964C71.4287%2030.6175%2071.5285%2030.3756%2071.5285%2030.1234C71.5285%2029.8712%2071.4287%2029.6293%2071.2509%2029.4505L70.5732%2028.7727L71.2509%2028.095C71.4073%2027.9124%2071.489%2027.6775%2071.4797%2027.4373C71.4704%2027.197%2071.3709%2026.9691%2071.2009%2026.7991C71.0309%2026.6291%2070.803%2026.5296%2070.5627%2026.5203C70.3225%2026.511%2070.0876%2026.5927%2069.905%2026.7491L69.2273%2027.4268L68.5495%2026.7491C68.3669%2026.5927%2068.132%2026.511%2067.8918%2026.5203C67.6516%2026.5296%2067.4237%2026.6291%2067.2537%2026.7991C67.0837%2026.9691%2066.9841%2027.197%2066.9748%2027.4373C66.9655%2027.6775%2067.0473%2027.9124%2067.2036%2028.095L67.8814%2028.7727L67.2036%2029.4505C67.0259%2029.6293%2066.9261%2029.8712%2066.9261%2030.1234C66.9261%2030.3756%2067.0259%2030.6175%2067.2036%2030.7964V30.7964ZM81.6364%2013.5H66.3636C65.6042%2013.5%2064.8758%2013.8017%2064.3387%2014.3387C63.8017%2014.8758%2063.5%2015.6042%2063.5%2016.3636V31.6364C63.5%2032.3959%2063.8017%2033.1242%2064.3387%2033.6613C64.8758%2034.1983%2065.6042%2034.5%2066.3636%2034.5H81.6364C82.3958%2034.5%2083.1242%2034.1983%2083.6613%2033.6613C84.1983%2033.1242%2084.5%2032.3959%2084.5%2031.6364V16.3636C84.5%2015.6042%2084.1983%2014.8758%2083.6613%2014.3387C83.1242%2013.8017%2082.3958%2013.5%2081.6364%2013.5V13.5ZM73.0455%2032.5909H66.3636C66.1105%2032.5909%2065.8677%2032.4903%2065.6887%2032.3113C65.5097%2032.1323%2065.4091%2031.8895%2065.4091%2031.6364V24.9545H73.0455V32.5909ZM73.0455%2023.0455H65.4091V16.3636C65.4091%2016.1105%2065.5097%2015.8677%2065.6887%2015.6887C65.8677%2015.5097%2066.1105%2015.4091%2066.3636%2015.4091H73.0455V23.0455ZM82.5909%2031.6364C82.5909%2031.8895%2082.4903%2032.1323%2082.3113%2032.3113C82.1323%2032.4903%2081.8895%2032.5909%2081.6364%2032.5909H74.9545V24.9545H82.5909V31.6364ZM82.5909%2023.0455H74.9545V15.4091H81.6364C81.8895%2015.4091%2082.1323%2015.5097%2082.3113%2015.6887C82.4903%2015.8677%2082.5909%2016.1105%2082.5909%2016.3636V23.0455ZM77.3409%2028.2955H80.2045C80.4577%2028.2955%2080.7005%2028.1949%2080.8795%2028.0159C81.0585%2027.8369%2081.1591%2027.5941%2081.1591%2027.3409C81.1591%2027.0878%2081.0585%2026.845%2080.8795%2026.6659C80.7005%2026.4869%2080.4577%2026.3864%2080.2045%2026.3864H77.3409C77.0877%2026.3864%2076.845%2026.4869%2076.6659%2026.6659C76.4869%2026.845%2076.3864%2027.0878%2076.3864%2027.3409C76.3864%2027.5941%2076.4869%2027.8369%2076.6659%2028.0159C76.845%2028.1949%2077.0877%2028.2955%2077.3409%2028.2955V28.2955ZM80.2045%2018.2727H77.3409C77.0877%2018.2727%2076.845%2018.3733%2076.6659%2018.5523C76.4869%2018.7313%2076.3864%2018.9741%2076.3864%2019.2273C76.3864%2019.4804%2076.4869%2019.7232%2076.6659%2019.9022C76.845%2020.0813%2077.0877%2020.1818%2077.3409%2020.1818H80.2045C80.4577%2020.1818%2080.7005%2020.0813%2080.8795%2019.9022C81.0585%2019.7232%2081.1591%2019.4804%2081.1591%2019.2273C81.1591%2018.9741%2081.0585%2018.7313%2080.8795%2018.5523C80.7005%2018.3733%2080.4577%2018.2727%2080.2045%2018.2727ZM77.3409%2031.1591H80.2045C80.4577%2031.1591%2080.7005%2031.0585%2080.8795%2030.8795C81.0585%2030.7005%2081.1591%2030.4577%2081.1591%2030.2045C81.1591%2029.9514%2081.0585%2029.7086%2080.8795%2029.5296C80.7005%2029.3506%2080.4577%2029.25%2080.2045%2029.25H77.3409C77.0877%2029.25%2076.845%2029.3506%2076.6659%2029.5296C76.4869%2029.7086%2076.3864%2029.9514%2076.3864%2030.2045C76.3864%2030.4577%2076.4869%2030.7005%2076.6659%2030.8795C76.845%2031.0585%2077.0877%2031.1591%2077.3409%2031.1591V31.1591Z'%20fill='%2326262A'/%3e%3cpath%20d='M90%209.79083V21.75H105V8.75H90.6268C90.4606%208.75%2090.3011%208.85966%2090.1836%209.05485C90.066%209.25005%2090%209.51479%2090%209.79083Z'%20fill='url(%23paint2_linear_1248_126508)'/%3e%3cpath%20d='M105%2026.25H90V39.25H105V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M98.5%2029.75H97.0716L95.5%2030.6699V31.9238L96.9253%2031.1035H96.9627V35.75H98.5V29.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M96.7744%2018.25C97.5264%2018.25%2098.0464%2017.9877%2098.3415%2017.4915H98.3837V18.1678H100V14.8682C100%2013.841%2098.9845%2013.25%2097.6107%2013.25C96.1595%2013.25%2095.3373%2013.9074%2095.2003%2014.7924L96.785%2014.8429C96.8587%2014.5332%2097.1434%2014.3436%2097.5966%2014.3436C98.0183%2014.3436%2098.2853%2014.5269%2098.2853%2014.8524V14.8682C98.2853%2015.1653%2097.9269%2015.2285%2097.0063%2015.3012C95.9136%2015.3834%2095%2015.7468%2095%2016.8214C95%2017.7822%2095.7414%2018.25%2096.7744%2018.25ZM97.305%2017.2386C96.9079%2017.2386%2096.6268%2017.068%2096.6268%2016.7456C96.6268%2016.4327%2096.9009%2016.243%2097.3893%2016.1767C97.7091%2016.1356%2098.1026%2016.0724%2098.2959%2015.9807V16.4422C98.2959%2016.9162%2097.8531%2017.2386%2097.305%2017.2386Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126508'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126508'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126508'%20x1='90'%20y1='15.2552'%20x2='105'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126508'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_61 = "data:image/svg+xml,%3csvg%20width='95'%20height='48'%20viewBox='0%200%2095%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1834_45844)'%3e%3cpath%20d='M0%200.611699V7.64012H14.394V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_1834_45844)'/%3e%3cpath%20d='M33.606%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200L33.606%200V7.64012Z'%20fill='url(%23paint1_linear_1834_45844)'/%3e%3cpath%20d='M31.194%200H16.8V7.64012H31.194V0Z'%20fill='url(%23paint2_linear_1834_45844)'/%3e%3cpath%20d='M31.194%2010.0869H16.8V17.727H31.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2010.0869H0V17.727H14.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2010.0869H33.606V17.727H48V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2020.1799H33.606V27.8262H48V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2020.1799H16.8V27.8262H31.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2020.1799H0V27.8262H14.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M31.194%2030.2668H16.8V37.907H31.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M48%2030.2668H33.606V37.907H48V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M14.394%2030.2668H0V37.907H14.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M31.194%2040.3599H16.8V48H31.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M48%2047.3883V40.3721H33.606V48H47.3985C47.558%2048%2047.711%2047.9355%2047.8238%2047.8208C47.9366%2047.7061%2048%2047.5505%2048%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M14.394%2048V40.3721H0V47.3883C0%2047.5505%200.0633725%2047.7061%200.176176%2047.8208C0.28898%2047.9355%200.441975%2048%200.601504%2048H14.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030.4001C62.6011%2030.4001%2067.9327%2026.1334%2067.9327%2024.0001C67.9327%2021.8668%2062.7357%2017.6001%2061.9067%2017.6001C61.0778%2017.6001%2060.4023%2018.1334%2060.4023%2019.1741C60.4023%2020.2147%2063.9067%2022.8487%2063.9067%2022.8487C63.9067%2022.8487%2056.2539%2022.1334%2056%2022.8487C55.7461%2023.564%2055.7461%2024.4362%2056%2025.1515C56.2539%2025.8668%2063.9067%2025.1515%2063.9067%2025.1515C63.9067%2025.1515%2060.4023%2028.0001%2060.4023%2028.8323C60.4023%2029.6644%2061.2124%2030.4001%2061.9067%2030.4001Z'%20fill='%23CCCCDC'/%3e%3cpath%20d='M93.832%2024.801C93.832%2026.5482%2093.3775%2027.9971%2092.3406%2029.2613H90.4229C91.2042%2028.3238%2091.7866%2026.4772%2091.7866%2024.801C91.7866%2023.1249%2091.2042%2021.2783%2090.4229%2020.3408H92.3406C93.3775%2021.605%2093.832%2023.0539%2093.832%2024.801Z'%20fill='%2324292E'/%3e%3cpath%20d='M86.5016%2022.1592L87.297%2023.8495L88.1351%2022.1592H90.0811L88.6181%2024.8865L90.1522%2027.6137H88.2203L87.297%2025.8808L86.4022%2027.6137H84.4419L85.9902%2024.8865L84.5414%2022.1592H86.5016Z'%20fill='%2324292E'/%3e%3cpath%20d='M80.7621%2024.801C80.7621%2023.0539%2081.2166%2021.605%2082.2536%2020.3408H84.1712C83.3899%2021.2783%2082.8075%2023.1249%2082.8075%2024.801C82.8075%2026.4772%2083.3899%2028.3238%2084.1712%2029.2613H82.2536C81.2166%2027.9971%2080.7621%2026.5482%2080.7621%2024.801Z'%20fill='%2324292E'/%3e%3cpath%20d='M79.6506%2022.1591V23.5795H78.6563V27.6136H76.696V23.5795H76V22.1591H76.696V22.0028C76.696%2020.6534%2077.4631%2020%2078.6563%2020C79.1534%2020%2079.679%2020.0994%2079.9063%2020.1562L79.6222%2021.5625C79.4801%2021.5199%2079.267%2021.4915%2079.125%2021.4915C78.7557%2021.4915%2078.6563%2021.6619%2078.6563%2021.9176V22.1591H79.6506Z'%20fill='%2324292E'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1834_45844'%20x1='0'%20y1='3.82312'%20x2='14.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1834_45844'%20x1='33.606'%20y1='3.82312'%20x2='48'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1834_45844'%20x1='16.8'%20y1='3.82312'%20x2='31.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1834_45844'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_62 = "data:image/svg+xml,%3csvg%20width='119'%20height='48'%20viewBox='0%200%20119%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M42.3704%2020.6776C42.308%2020.6218%2042.2344%2020.5781%2042.1539%2020.549C41.9941%2020.4877%2041.815%2020.4877%2041.6552%2020.549C41.5747%2020.5781%2041.5011%2020.6218%2041.4387%2020.6776L40.1265%2021.9023C40.0029%2022.0177%2039.9335%2022.174%2039.9335%2022.3371C39.9335%2022.5002%2040.0029%2022.6566%2040.1265%2022.7719C40.25%2022.8872%2040.4176%2022.952%2040.5923%2022.952C40.7671%2022.952%2040.9346%2022.8872%2041.0582%2022.7719L41.2484%2022.5882V27.2361C41.2484%2027.3985%2041.3176%2027.5543%2041.4406%2027.6691C41.5637%2027.784%2041.7306%2027.8485%2041.9046%2027.8485C42.0786%2027.8485%2042.2455%2027.784%2042.3685%2027.6691C42.4916%2027.5543%2042.5607%2027.3985%2042.5607%2027.2361V22.5882L42.751%2022.7719C42.8119%2022.8293%2042.8845%2022.8749%2042.9645%2022.906C43.0444%2022.937%2043.1302%2022.953%2043.2168%2022.953C43.3034%2022.953%2043.3892%2022.937%2043.4691%2022.906C43.5491%2022.8749%2043.6216%2022.8293%2043.6826%2022.7719C43.7441%2022.715%2043.7929%2022.6473%2043.8263%2022.5726C43.8596%2022.498%2043.8767%2022.418%2043.8767%2022.3371C43.8767%2022.2563%2043.8596%2022.1762%2043.8263%2022.1016C43.7929%2022.027%2043.7441%2021.9593%2043.6826%2021.9023L42.3704%2020.6776ZM45.8413%2021.7247H52.4024C52.5764%2021.7247%2052.7433%2021.6602%2052.8664%2021.5454C52.9894%2021.4305%2053.0585%2021.2748%2053.0585%2021.1124C53.0585%2020.95%2052.9894%2020.7942%2052.8664%2020.6794C52.7433%2020.5645%2052.5764%2020.5%2052.4024%2020.5H45.8413C45.6672%2020.5%2045.5004%2020.5645%2045.3773%2020.6794C45.2543%2020.7942%2045.1851%2020.95%2045.1851%2021.1124C45.1851%2021.2748%2045.2543%2021.4305%2045.3773%2021.5454C45.5004%2021.6602%2045.6672%2021.7247%2045.8413%2021.7247V21.7247ZM52.4024%2026.6237H45.8413C45.6672%2026.6237%2045.5004%2026.6883%2045.3773%2026.8031C45.2543%2026.9179%2045.1851%2027.0737%2045.1851%2027.2361C45.1851%2027.3985%2045.2543%2027.5543%2045.3773%2027.6691C45.5004%2027.784%2045.6672%2027.8485%2045.8413%2027.8485H52.4024C52.5764%2027.8485%2052.7433%2027.784%2052.8664%2027.6691C52.9894%2027.5543%2053.0585%2027.3985%2053.0585%2027.2361C53.0585%2027.0737%2052.9894%2026.9179%2052.8664%2026.8031C52.7433%2026.6883%2052.5764%2026.6237%2052.4024%2026.6237ZM52.4024%2023.5619H45.8413C45.6672%2023.5619%2045.5004%2023.6264%2045.3773%2023.7412C45.2543%2023.8561%2045.1851%2024.0118%2045.1851%2024.1742C45.1851%2024.3367%2045.2543%2024.4924%2045.3773%2024.6073C45.5004%2024.7221%2045.6672%2024.7866%2045.8413%2024.7866H52.4024C52.5764%2024.7866%2052.7433%2024.7221%2052.8664%2024.6073C52.9894%2024.4924%2053.0585%2024.3367%2053.0585%2024.1742C53.0585%2024.0118%2052.9894%2023.8561%2052.8664%2023.7412C52.7433%2023.6264%2052.5764%2023.5619%2052.4024%2023.5619Z'%20fill='%2326262A'/%3e%3cpath%20d='M66.9067%2030C67.6011%2030%2072.9327%2026%2072.9327%2024C72.9327%2022%2067.7357%2018%2066.9067%2018C66.0778%2018%2065.4023%2018.5%2065.4023%2019.4756C65.4023%2020.4512%2068.9067%2022.9206%2068.9067%2022.9206C68.9067%2022.9206%2061.2539%2022.25%2061%2022.9206C60.7461%2023.5911%2060.7461%2024.4089%2061%2025.0794C61.2539%2025.75%2068.9067%2025.0794%2068.9067%2025.0794C68.9067%2025.0794%2065.4023%2027.75%2065.4023%2028.5301C65.4023%2029.3103%2066.2124%2030%2066.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126251)'%3e%3cpath%20d='M81%201.05495V13.1763H95.9563V0H81.625C81.4592%200%2081.3003%200.111146%2081.1831%200.308988C81.0658%200.506829%2081%200.77516%2081%201.05495Z'%20fill='url(%23paint0_linear_1248_126251)'/%3e%3cpath%20d='M95.9563%2017.3962H81V30.5725H95.9563V17.3962Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M95.9563%2034.8132H81V48.0001H95.9563V34.8132Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M81%201.04083V13H96V0H81.6268C81.4606%200%2081.3011%200.109659%2081.1836%200.304853C81.066%200.500047%2081%200.764787%2081%201.04083Z'%20fill='url(%23paint1_linear_1248_126251)'/%3e%3cpath%20d='M96%2017.5H81V30.5H96V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M96%2035H81V48H96V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M88.58%2010.25H89.0225V9.63828C90.2662%209.57764%2090.9946%208.9791%2091%208.00879C90.9946%207.14658%2090.3984%206.61924%2089.3085%206.38457L89.0225%206.32129V5.19541C89.4056%205.25078%2089.616%205.46699%2089.6457%205.79395H90.9245C90.9137%204.84209%2090.1826%204.18027%2089.0225%204.10908V3.5H88.58V4.10908C87.4362%204.18555%2086.6349%204.83418%2086.643%205.77813C86.6403%206.59814%2087.2284%207.05957%2088.1835%207.27314L88.58%207.36279V8.55195C88.1079%208.49658%2087.8058%208.23291%2087.7788%207.77676H86.5C86.5162%208.97119%2087.3174%209.575%2088.58%209.63828V10.25ZM89.0225%208.54932V7.4709C89.446%207.59746%2089.6403%207.75039%2089.6457%208.00615C89.6403%208.28565%2089.4164%208.49131%2089.0225%208.54932ZM88.58%206.21582C88.2266%206.11035%2088.0162%205.95215%2088.0243%205.68848C88.027%205.44063%2088.2104%205.24814%2088.58%205.19541V6.21582Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126251)'%3e%3cpath%20d='M114.956%2017.3962H100V30.5725H114.956V17.3962Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M114.956%2034.8132H100V48.0001H114.956V34.8132Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M115%2017.5001H100V30.5001H115V17.5001Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M115%2035.0001H100V48.0001H115V35.0001Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M100%2013.0001H115V1.04089C115%200.764848%20114.934%200.500108%20114.816%200.304914C114.699%200.10972%20114.539%206.10352e-05%20114.373%206.10352e-05L100%206.10352e-05V13.0001Z'%20fill='url(%23paint2_linear_1248_126251)'/%3e%3cpath%20d='M107.58%2010.25H108.022V9.63828C109.266%209.57764%20109.995%208.9791%20110%208.00879C109.995%207.14658%20109.398%206.61924%20108.308%206.38457L108.022%206.32129V5.19541C108.406%205.25078%20108.616%205.46699%20108.646%205.79395H109.924C109.914%204.84209%20109.183%204.18027%20108.022%204.10908V3.5H107.58V4.10908C106.436%204.18555%20105.635%204.83418%20105.643%205.77813C105.64%206.59814%20106.228%207.05957%20107.183%207.27314L107.58%207.36279V8.55195C107.108%208.49658%20106.806%208.23291%20106.779%207.77676H105.5C105.516%208.97119%20106.317%209.575%20107.58%209.63828V10.25ZM108.022%208.54932V7.4709C108.446%207.59746%20108.64%207.75039%20108.646%208.00615C108.64%208.28565%20108.416%208.49131%20108.022%208.54932ZM107.58%206.21582C107.227%206.11035%20107.016%205.95215%20107.024%205.68848C107.027%205.44063%20107.21%205.24814%20107.58%205.19541V6.21582Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip2_1248_126251)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint3_linear_1248_126251)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip3_1248_126251)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint4_linear_1248_126251)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M24.5%209.43623H26.0663V8.71449H26.1149C26.3155%209.12609%2026.7621%209.5%2027.5129%209.5C28.6133%209.5%2029.5%208.72898%2029.5%207.21304C29.5%205.64203%2028.5615%204.92609%2027.5227%204.92609C26.7362%204.92609%2026.3058%205.33768%2026.1149%205.74638H26.0825V3.5H24.5V9.43623ZM26.0502%207.21015C26.0502%206.48261%2026.3867%206.03333%2026.966%206.03333C27.5518%206.03333%2027.8754%206.4942%2027.8754%207.21015C27.8754%207.92899%2027.5518%208.39565%2026.966%208.39565C26.3867%208.39565%2026.0502%207.93188%2026.0502%207.21015Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126251'%20x1='81'%20y1='6.59344'%20x2='95.9563'%20y2='6.59344'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126251'%20x1='81'%20y1='6.5052'%20x2='96'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126251'%20x1='100'%20y1='6.50527'%20x2='115'%20y2='6.50527'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126251'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1248_126251'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126251'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(81)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126251'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(100)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip2_1248_126251'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip3_1248_126251'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_63 = "data:image/svg+xml,%3csvg%20width='96'%20height='48'%20viewBox='0%200%2096%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126533)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M6.84608%2027C7.52244%2027%207.9902%2026.7377%208.25569%2026.2415H8.29362V26.9178H9.74747V23.6182C9.74747%2022.591%208.83407%2022%207.59829%2022C6.29298%2022%205.55341%2022.6574%205.43015%2023.5424L6.85556%2023.5929C6.92193%2023.2832%207.17794%2023.0936%207.58565%2023.0936C7.96492%2023.0936%208.20512%2023.2769%208.20512%2023.6024V23.6182C8.20512%2023.9153%207.88274%2023.9785%207.05468%2024.0512C6.07174%2024.1334%205.25%2024.4968%205.25%2025.5714C5.25%2026.5322%205.91688%2027%206.84608%2027ZM7.32333%2025.9886C6.96618%2025.9886%206.71334%2025.818%206.71334%2025.4956C6.71334%2025.1827%206.95986%2024.993%207.39918%2024.9267C7.68679%2024.8856%208.04077%2024.8224%208.2146%2024.7307V25.1922C8.2146%2025.6662%207.81637%2025.9886%207.32333%2025.9886Z'%20fill='%2324292E'/%3e%3cpath%20d='M5%2044.4362H6.56634V43.7145H6.61489C6.81553%2044.1261%207.26214%2044.5%208.01294%2044.5C9.11327%2044.5%2010%2043.729%2010%2042.213C10%2040.642%209.06149%2039.9261%208.02265%2039.9261C7.23625%2039.9261%206.80583%2040.3377%206.61489%2040.7464H6.58252V38.5H5V44.4362ZM6.55016%2042.2101C6.55016%2041.4826%206.88673%2041.0333%207.46602%2041.0333C8.05178%2041.0333%208.3754%2041.4942%208.3754%2042.2101C8.3754%2042.929%208.05178%2043.3957%207.46602%2043.3957C6.88673%2043.3957%206.55016%2042.9319%206.55016%2042.2101Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126533)'%3e%3cpath%20d='M19%2013H34V1.04083C34%200.764787%2033.934%200.500047%2033.8164%200.304853C33.6989%200.109659%2033.5394%200%2033.3732%200L19%200V13Z'%20fill='url(%23paint1_linear_1248_126533)'/%3e%3cpath%20d='M34%2017.5H19V30.5H34V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M34%2035H19V48H34V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M27.5%2021H26.0716L24.5%2021.9199V23.1738L25.9253%2022.3535H25.9627V27H27.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M24.3373%2044.5H28.75V43.3468H26.3341V43.3092L27.0472%2042.6561C28.3396%2041.5376%2028.6772%2040.9682%2028.6772%2040.289C28.6772%2039.2225%2027.8011%2038.5%2026.4476%2038.5C25.129%2038.5%2024.2471%2039.2543%2024.25%2040.4595H25.6151C25.6151%2039.9249%2025.947%2039.6156%2026.4418%2039.6156C26.9279%2039.6156%2027.2801%2039.9133%2027.2801%2040.4017C27.2801%2040.8439%2027.0006%2041.1445%2026.5116%2041.5809L24.3373%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0778%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2124%2030%2047.9067%2030Z'%20fill='%2324292E'/%3e%3cpath%20d='M62%209.79083V21.75H77V8.75H62.6268C62.4606%208.75%2062.3011%208.85966%2062.1836%209.05485C62.066%209.25005%2062%209.51479%2062%209.79083Z'%20fill='url(%23paint2_linear_1248_126533)'/%3e%3cpath%20d='M77%2026.25H62V39.25H77V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M70.5%2029.75H69.0716L67.5%2030.6699V31.9238L68.9253%2031.1035H68.9627V35.75H70.5V29.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M68.7744%2018.25C69.5264%2018.25%2070.0464%2017.9877%2070.3415%2017.4915H70.3837V18.1678H72V14.8682C72%2013.841%2070.9845%2013.25%2069.6107%2013.25C68.1595%2013.25%2067.3373%2013.9074%2067.2003%2014.7924L68.785%2014.8429C68.8587%2014.5332%2069.1434%2014.3436%2069.5966%2014.3436C70.0183%2014.3436%2070.2853%2014.5269%2070.2853%2014.8524V14.8682C70.2853%2015.1653%2069.9269%2015.2285%2069.0063%2015.3012C67.9136%2015.3834%2067%2015.7468%2067%2016.8214C67%2017.7822%2067.7414%2018.25%2068.7744%2018.25ZM69.305%2017.2386C68.9079%2017.2386%2068.6268%2017.068%2068.6268%2016.7456C68.6268%2016.4327%2068.9009%2016.243%2069.3893%2016.1767C69.7091%2016.1356%2070.1026%2016.0724%2070.2959%2015.9807V16.4422C70.2959%2016.9162%2069.8531%2017.2386%2069.305%2017.2386Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1248_126533)'%3e%3cpath%20d='M81%2021.75H96V9.79083C96%209.51479%2095.934%209.25005%2095.8164%209.05485C95.6989%208.85966%2095.5394%208.75%2095.3732%208.75H81V21.75Z'%20fill='url(%23paint3_linear_1248_126533)'/%3e%3cpath%20d='M96%2026.25H81V39.25H96V26.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M86.3373%2035.75H90.75V34.5968H88.3341V34.5592L89.0472%2033.9061C90.3396%2032.7876%2090.6772%2032.2182%2090.6772%2031.539C90.6772%2030.4725%2089.8011%2029.75%2088.4476%2029.75C87.129%2029.75%2086.2471%2030.5043%2086.25%2031.7095H87.6151C87.6151%2031.1749%2087.947%2030.8656%2088.4418%2030.8656C88.9279%2030.8656%2089.2801%2031.1633%2089.2801%2031.6517C89.2801%2032.0939%2089.0006%2032.3945%2088.5116%2032.8309L86.3373%2034.7211V35.75Z'%20fill='%2324292E'/%3e%3cpath%20d='M86%2018.4362H87.5663V17.7145H87.6149C87.8155%2018.1261%2088.2621%2018.5%2089.0129%2018.5C90.1133%2018.5%2091%2017.729%2091%2016.213C91%2014.642%2090.0615%2013.9261%2089.0227%2013.9261C88.2362%2013.9261%2087.8058%2014.3377%2087.6149%2014.7464H87.5825V12.5H86V18.4362ZM87.5502%2016.2101C87.5502%2015.4826%2087.8867%2015.0333%2088.466%2015.0333C89.0518%2015.0333%2089.3754%2015.4942%2089.3754%2016.2101C89.3754%2016.929%2089.0518%2017.3957%2088.466%2017.3957C87.8867%2017.3957%2087.5502%2016.9319%2087.5502%2016.2101Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126533'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126533'%20x1='19'%20y1='6.5052'%20x2='34'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126533'%20x1='62'%20y1='15.2552'%20x2='77'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126533'%20x1='81'%20y1='15.2552'%20x2='96'%20y2='15.2552'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126533'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(19)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126533'%3e%3crect%20width='15'%20height='30.5'%20fill='white'%20transform='translate(81%208.75)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_64 = "data:image/svg+xml,%3csvg%20width='138'%20height='59'%20viewBox='0%200%20138%2059'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_126445)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.68848%2053.3679H7.69842C7.6899%2052.5518%207.04004%2052%206.02583%2052C5.02868%2052%204.31064%2052.5433%204.31703%2053.3551C4.3149%2054.0178%204.77939%2054.3906%205.53365%2054.5632L5.98961%2054.6697C6.46902%2054.7805%206.68422%2054.9105%206.68848%2055.1555C6.68422%2055.4219%206.43493%2055.6072%206.01092%2055.6072C5.5443%2055.6072%205.23748%2055.3899%205.21404%2054.9702H4.2041C4.21689%2055.9908%204.9264%2056.4787%206.0237%2056.4787C7.11035%2056.4787%207.75382%2055.9865%207.75808%2055.1577C7.75382%2054.4609%207.28294%2054.0348%206.42214%2053.8452L6.04714%2053.7599C5.65083%2053.6747%205.39941%2053.5426%205.40794%2053.2827C5.41007%2053.044%205.61461%2052.8714%206.0237%2052.8714C6.43493%2052.8714%206.66078%2053.0568%206.68848%2053.3679Z'%20fill='%2324292E'/%3e%3cpath%20d='M10.3%2052.0597H9.322L8.24601%2052.7287V53.6406L9.22186%2053.044H9.24743V56.4233H10.3V52.0597Z'%20fill='%2324292E'/%3e%3cpath%20d='M6.77442%209.5C7.52635%209.5%208.04638%209.23767%208.34153%208.74147H8.3837V9.41783H10V6.1182C10%205.09102%208.98454%204.5%207.61068%204.5C6.15952%204.5%205.33732%205.1574%205.20028%206.04235L6.78496%206.09292C6.85875%205.78319%207.14336%205.59355%207.59663%205.59355C8.01827%205.59355%208.28531%205.77686%208.28531%206.1024V6.1182C8.28531%206.4153%207.92692%206.47851%207.00633%206.5512C5.91356%206.63338%205%206.99684%205%208.07143C5%209.03224%205.74139%209.5%206.77442%209.5ZM7.30499%208.48862C6.90794%208.48862%206.62684%208.31795%206.62684%207.99558C6.62684%207.68268%206.90091%207.49305%207.38932%207.42668C7.70907%207.38559%208.1026%207.32238%208.29585%207.23072V7.69216C8.29585%208.16625%207.85313%208.48862%207.30499%208.48862Z'%20fill='%2324292E'/%3e%3cpath%20d='M27.3343%2035.5H30.674V31.174H35V27.8343H30.674V23.5H27.3343V27.8343H23V31.174H27.3343V35.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M58%2027H43V40H58V27Z'%20fill='%233865AB'/%3e%3cpath%20d='M43%2010.5408V22.5H58V9.5H43.6268L43%209.50004L43%2010.5408Z'%20fill='url(%23paint1_linear_1248_126445)'/%3e%3cpath%20d='M50.4792%2036.5C51.8085%2036.5%2052.7528%2035.7757%2052.75%2034.7605C52.7528%2034.0418%2052.2958%2033.5285%2051.4208%2033.423V33.3774C52.0771%2033.2804%2052.5423%2032.827%2052.5395%2032.1711C52.5423%2031.2186%2051.706%2030.5%2050.4903%2030.5C49.2663%2030.5%2048.3746%2031.23%2048.3635%2032.2681H49.6734C49.6845%2031.8688%2050.0334%2031.6008%2050.4903%2031.6008C50.9251%2031.6008%2051.2214%2031.8717%2051.2186%2032.2624C51.2214%2032.6673%2050.8725%2032.9468%2050.3685%2032.9468H49.8174V33.9506H50.3685C50.9417%2033.9506%2051.3155%2034.2414%2051.31%2034.6521C51.3155%2035.0656%2050.9721%2035.3536%2050.4848%2035.3536C50.0001%2035.3536%2049.6429%2035.0884%2049.6291%2034.7034H48.25C48.2611%2035.7586%2049.1832%2036.5%2050.4792%2036.5Z'%20fill='white'/%3e%3cpath%20d='M49.4844%2045.3679H50.4943C50.4858%2044.5518%2049.8359%2044%2048.8217%2044C47.8246%2044%2047.1065%2044.5433%2047.1129%2045.3551C47.1108%2046.0178%2047.5753%2046.3906%2048.3295%2046.5632L48.7855%2046.6697C49.2649%2046.7805%2049.4801%2046.9105%2049.4844%2047.1555C49.4801%2047.4219%2049.2308%2047.6072%2048.8068%2047.6072C48.3402%2047.6072%2048.0334%2047.3899%2048.0099%2046.9702H47C47.0128%2047.9908%2047.7223%2048.4787%2048.8196%2048.4787C49.9062%2048.4787%2050.5497%2047.9865%2050.554%2047.1577C50.5497%2046.4609%2050.0788%2046.0348%2049.218%2045.8452L48.843%2045.7599C48.4467%2045.6747%2048.1953%2045.5426%2048.2038%2045.2827C48.206%2045.044%2048.4105%2044.8714%2048.8196%2044.8714C49.2308%2044.8714%2049.4567%2045.0568%2049.4844%2045.3679Z'%20fill='%2324292E'/%3e%3cpath%20d='M51.0781%2048.4233H54.3082V47.5732H52.5398V47.5455L53.0618%2047.0639C54.0078%2046.2393%2054.255%2045.8196%2054.255%2045.3189C54.255%2044.5327%2053.6136%2044%2052.6229%2044C51.6577%2044%2051.0121%2044.5561%2051.0142%2045.4446H52.0135C52.0135%2045.0504%2052.2564%2044.8224%2052.6186%2044.8224C52.9744%2044.8224%2053.2322%2045.0419%2053.2322%2045.402C53.2322%2045.728%2053.0277%2045.9496%2052.6697%2046.2713L51.0781%2047.6648V48.4233Z'%20fill='%2324292E'/%3e%3cpath%20d='M49.7744%2018.5C50.5264%2018.5%2051.0464%2018.2377%2051.3415%2017.7415H51.3837V18.4178H53V15.1182C53%2014.091%2051.9845%2013.5%2050.6107%2013.5C49.1595%2013.5%2048.3373%2014.1574%2048.2003%2015.0424L49.785%2015.0929C49.8587%2014.7832%2050.1434%2014.5936%2050.5966%2014.5936C51.0183%2014.5936%2051.2853%2014.7769%2051.2853%2015.1024V15.1182C51.2853%2015.4153%2050.9269%2015.4785%2050.0063%2015.5512C48.9136%2015.6334%2048%2015.9968%2048%2017.0714C48%2018.0322%2048.7414%2018.5%2049.7744%2018.5ZM50.305%2017.4886C49.9079%2017.4886%2049.6268%2017.318%2049.6268%2016.9956C49.6268%2016.6827%2049.9009%2016.493%2050.3893%2016.4267C50.7091%2016.3856%2051.1026%2016.3224%2051.2959%2016.2307V16.6922C51.2959%2017.1662%2050.8531%2017.4886%2050.305%2017.4886Z'%20fill='%2324292E'/%3e%3cpath%20d='M71.9067%2035.5C72.6011%2035.5%2077.9327%2031.5%2077.9327%2029.5C77.9327%2027.5%2072.7357%2023.5%2071.9067%2023.5C71.0778%2023.5%2070.4023%2024%2070.4023%2024.9756C70.4023%2025.9512%2073.9067%2028.4206%2073.9067%2028.4206C73.9067%2028.4206%2066.2539%2027.75%2066%2028.4206C65.7461%2029.0911%2065.7461%2029.9089%2066%2030.5794C66.2539%2031.25%2073.9067%2030.5794%2073.9067%2030.5794C73.9067%2030.5794%2070.4023%2033.25%2070.4023%2034.0301C70.4023%2034.8103%2071.2124%2035.5%2071.9067%2035.5Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_126445)'%3e%3cpath%20d='M110%2018.5H86V28H110V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110%2031.25H86V40.75H110V31.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M110%2044H86V53.5H110V44Z'%20fill='%233865AB'/%3e%3cpath%20d='M86%206.30064V15.5H110V5.5H87.0029C86.7369%205.5%2086.4818%205.58435%2086.2937%205.7345C86.1057%205.88465%2086%206.0883%2086%206.30064Z'%20fill='url(%23paint2_linear_1248_126445)'/%3e%3cpath%20d='M97.4453%2022.3744H98.4394C98.431%2021.5545%2097.7913%2021%2096.7931%2021C95.8116%2021%2095.1049%2021.5459%2095.1111%2022.3616C95.1091%2023.0274%2095.5662%2023.402%2096.3086%2023.5754L96.7574%2023.6824C97.2293%2023.7938%2097.4411%2023.9244%2097.4453%2024.1706C97.4411%2024.4382%2097.1957%2024.6244%2096.7784%2024.6244C96.3191%2024.6244%2096.0171%2024.406%2095.9941%2023.9843H95C95.0126%2025.0098%2095.7109%2025.5%2096.791%2025.5C97.8605%2025.5%2098.4939%2025.0055%2098.4981%2024.1727C98.4939%2023.4726%2098.0304%2023.0445%2097.1832%2022.8539L96.8141%2022.7683C96.424%2022.6827%2096.1765%2022.55%2096.1849%2022.2888C96.187%2022.049%2096.3883%2021.8756%2096.791%2021.8756C97.1957%2021.8756%2097.418%2022.0618%2097.4453%2022.3744Z'%20fill='%2324292E'/%3e%3cpath%20d='M101%2021.0599H100.037L98.9783%2021.7322V22.6484L99.9388%2022.049H99.964V25.4443H101V21.0599Z'%20fill='%2324292E'/%3e%3cpath%20d='M97.4453%2035.1244H98.4394C98.431%2034.3045%2097.7913%2033.75%2096.7931%2033.75C95.8116%2033.75%2095.1049%2034.2959%2095.1111%2035.1116C95.1091%2035.7774%2095.5662%2036.152%2096.3086%2036.3254L96.7574%2036.4324C97.2293%2036.5438%2097.4411%2036.6744%2097.4453%2036.9206C97.4411%2037.1882%2097.1957%2037.3744%2096.7784%2037.3744C96.3191%2037.3744%2096.0171%2037.156%2095.9941%2036.7343H95C95.0126%2037.7598%2095.7109%2038.25%2096.791%2038.25C97.8605%2038.25%2098.4939%2037.7555%2098.4981%2036.9227C98.4939%2036.2226%2098.0304%2035.7945%2097.1832%2035.6039L96.8141%2035.5183C96.424%2035.4327%2096.1765%2035.3%2096.1849%2035.0388C96.187%2034.799%2096.3883%2034.6256%2096.791%2034.6256C97.1957%2034.6256%2097.418%2034.8118%2097.4453%2035.1244Z'%20fill='%2324292E'/%3e%3cpath%20d='M101%2033.8099H100.037L98.9783%2034.4822V35.3984L99.9388%2034.799H99.964V38.1943H101V33.8099Z'%20fill='%2324292E'/%3e%3cpath%20d='M96.9962%2047.8744H98.0109C98.0024%2047.0545%2097.3494%2046.5%2096.3304%2046.5C95.3285%2046.5%2094.607%2047.0459%2094.6135%2047.8616C94.6113%2048.5274%2095.078%2048.902%2095.8359%2049.0754L96.294%2049.1824C96.7757%2049.2938%2096.9919%2049.4244%2096.9962%2049.6706C96.9919%2049.9382%2096.7414%2050.1244%2096.3154%2050.1244C95.8466%2050.1244%2095.5383%2049.906%2095.5147%2049.4843H94.5C94.5128%2050.5098%2095.2257%2051%2096.3283%2051C97.4201%2051%2098.0666%2050.5055%2098.0709%2049.6727C98.0666%2048.9726%2097.5935%2048.5445%2096.7286%2048.3539L96.3518%2048.2683C95.9536%2048.1827%2095.701%2048.05%2095.7096%2047.7888C95.7117%2047.549%2095.9172%2047.3756%2096.3283%2047.3756C96.7414%2047.3756%2096.9684%2047.5618%2096.9962%2047.8744Z'%20fill='white'/%3e%3cpath%20d='M98.5975%2050.9443H101.843V50.0902H100.066V50.0623L100.591%2049.5785C101.541%2048.75%20101.789%2048.3283%20101.789%2047.8252C101.789%2047.0352%20101.145%2046.5%20100.15%2046.5C99.1798%2046.5%2098.5312%2047.0588%2098.5333%2047.9515H99.5373C99.5373%2047.5554%2099.7814%2047.3264%20100.145%2047.3264C100.503%2047.3264%20100.762%2047.5469%20100.762%2047.9087C100.762%2048.2362%20100.556%2048.4588%20100.197%2048.7821L98.5975%2050.1822V50.9443Z'%20fill='white'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_126445)'%3e%3cpath%20d='M114%2015.5H138V6.30064C138%206.0883%20137.894%205.88465%20137.706%205.7345C137.518%205.58435%20137.263%205.5%20136.997%205.5H114V15.5Z'%20fill='url(%23paint3_linear_1248_126445)'/%3e%3cpath%20d='M138%2018.5H114V28H138V18.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M138%2031.25H114V40.75H138V31.25Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M138%2044H114V53.5H138V44Z'%20fill='%233865AB'/%3e%3cpath%20d='M127%2020.25H125.572L124%2021.1699V22.4238L125.425%2021.6035H125.463V26.25H127V20.25Z'%20fill='%2324292E'/%3e%3cpath%20d='M123.837%2039H128.25V37.8468H125.834V37.8092L126.547%2037.1561C127.84%2036.0376%20128.177%2035.4682%20128.177%2034.789C128.177%2033.7225%20127.301%2033%20125.948%2033C124.629%2033%20123.747%2033.7543%20123.75%2034.9595H125.115C125.115%2034.4249%20125.447%2034.1156%20125.942%2034.1156C126.428%2034.1156%20126.78%2034.4133%20126.78%2034.9017C126.78%2035.3439%20126.501%2035.6445%20126.012%2036.0809L123.837%2037.9711V39Z'%20fill='%2324292E'/%3e%3cpath%20d='M125.979%2051.75C127.308%2051.75%20128.253%2051.0257%20128.25%2050.0105C128.253%2049.2918%20127.796%2048.7785%20126.921%2048.673V48.6274C127.577%2048.5304%20128.042%2048.077%20128.04%2047.4211C128.042%2046.4686%20127.206%2045.75%20125.99%2045.75C124.766%2045.75%20123.875%2046.48%20123.864%2047.5181H125.173C125.184%2047.1188%20125.533%2046.8508%20125.99%2046.8508C126.425%2046.8508%20126.721%2047.1217%20126.719%2047.5124C126.721%2047.9173%20126.372%2048.1968%20125.868%2048.1968H125.317V49.2006H125.868C126.442%2049.2006%20126.816%2049.4914%20126.81%2049.9021C126.816%2050.3156%20126.472%2050.6036%20125.985%2050.6036C125.5%2050.6036%20125.143%2050.3384%20125.129%2049.9534H123.75C123.761%2051.0086%20124.683%2051.75%20125.979%2051.75Z'%20fill='white'/%3e%3cpath%20d='M124.774%2013C125.526%2013%20126.046%2012.7377%20126.342%2012.2415H126.384V12.9178H128V9.6182C128%208.59102%20126.985%208%20125.611%208C124.16%208%20123.337%208.6574%20123.2%209.54235L124.785%209.59292C124.859%209.28319%20125.143%209.09355%20125.597%209.09355C126.018%209.09355%20126.285%209.27686%20126.285%209.6024V9.6182C126.285%209.9153%20125.927%209.97851%20125.006%2010.0512C123.914%2010.1334%20123%2010.4968%20123%2011.5714C123%2012.5322%20123.741%2013%20124.774%2013ZM125.305%2011.9886C124.908%2011.9886%20124.627%2011.818%20124.627%2011.4956C124.627%2011.1827%20124.901%2010.993%20125.389%2010.9267C125.709%2010.8856%20126.103%2010.8224%20126.296%2010.7307V11.1922C126.296%2011.6662%20125.853%2011.9886%20125.305%2011.9886Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126445'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_126445'%20x1='43'%20y1='16.0052'%20x2='58'%20y2='16.0052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1248_126445'%20x1='86'%20y1='10.504'%20x2='110'%20y2='10.504'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1248_126445'%20x1='114'%20y1='10.504'%20x2='138'%20y2='10.504'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_126445'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(86%205.5)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_126445'%3e%3crect%20width='24'%20height='48'%20fill='white'%20transform='translate(114%205.5)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_65 = "data:image/svg+xml,%3csvg%20width='114'%20height='48'%20viewBox='0%200%20114%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_smoothing_light)'%3e%3cpath%20d='M0%200.611699V7.64012H7V0H0.601504C0.441975%200%200.28898%200.0644467%200.176176%200.179162C0.0633725%200.293878%200%200.449466%200%200.611699Z'%20fill='url(%23paint0_linear_smoothing_light)'/%3e%3cpath%20d='M8%200H15V7.64012H8V0Z'%20fill='url(%23paint1_linear_smoothing_light)'/%3e%3cpath%20d='M16%200H23V7.64012H16V0Z'%20fill='url(%23paint2_linear_smoothing_light)'/%3e%3cpath%20d='M24%200H31V7.64012H24V0Z'%20fill='url(%23paint3_linear_smoothing_light)'/%3e%3cpath%20d='M32%200H39V7.64012H32V0Z'%20fill='url(%23paint4_linear_smoothing_light)'/%3e%3cpath%20d='M40%207.64012H48V0.611699C48%200.449466%2047.9366%200.293878%2047.8238%200.179162C47.711%200.0644467%2047.558%200%2047.3985%200H40V7.64012Z'%20fill='url(%23paint5_linear_smoothing_light)'/%3e%3cpath%20d='M2%2038L5%2028L8%2035L11%2025L14%2032L17%2022L20%2030L23%2020L26%2028L29%2024L32%2031L35%2026L38%2033L41%2029L44%2036L46%2032'%20stroke='%2384AFF1'%20stroke-width='2'%20fill='none'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3cpath%20d='M2%2038L5%2028L8%2035L11%2025L14%2032L17%2022L20%2030L23%2020L26%2028L29%2024L32%2031L35%2026L38%2033L41%2029L44%2036L46%2032L46%2048L2%2048Z'%20fill='url(%23paint6_linear_smoothing_light)'%20opacity='0.3'/%3e%3c/g%3e%3cpath%20d='M57.91%2030C58.6%2030%2064%2026%2064%2024C64%2022%2058.7%2018%2057.91%2018C57.08%2018%2056.4%2018.5%2056.4%2019.48C56.4%2020.45%2059.91%2022.92%2059.91%2022.92C59.91%2022.92%2052.25%2022.25%2052%2022.92C51.75%2023.59%2051.75%2024.41%2052%2025.08C52.25%2025.75%2059.91%2025.08%2059.91%2025.08C59.91%2025.08%2056.4%2027.75%2056.4%2028.53C56.4%2029.31%2057.21%2030%2057.91%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_smoothing_light)'%3e%3cpath%20d='M66%200.611699V7.64012H81V0H66.6015C66.442%200%2066.289%200.0644467%2066.1762%200.179162C66.0634%200.293878%2066%200.449466%2066%200.611699Z'%20fill='url(%23paint7_linear_smoothing_light)'/%3e%3cpath%20d='M82%200H97V7.64012H82V0Z'%20fill='url(%23paint8_linear_smoothing_light)'/%3e%3cpath%20d='M98%207.64012H114V0.611699C114%200.449466%20113.937%200.293878%20113.824%200.179162C113.711%200.0644467%20113.558%200%20113.399%200H98V7.64012Z'%20fill='url(%23paint9_linear_smoothing_light)'/%3e%3cpath%20d='M68%2036Q77%2028%2086%2024Q95%2021%20112%2025'%20stroke='%2384AFF1'%20stroke-width='2.5'%20fill='none'%20stroke-linecap='round'/%3e%3cpath%20d='M68%2036Q77%2028%2086%2024Q95%2021%20112%2025L112%2048L68%2048Z'%20fill='url(%23paint10_linear_smoothing_light)'%20opacity='0.3'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_smoothing_light'%20x1='0'%20y1='3.82'%20x2='7'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_smoothing_light'%20x1='8'%20y1='3.82'%20x2='15'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_smoothing_light'%20x1='16'%20y1='3.82'%20x2='23'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_smoothing_light'%20x1='24'%20y1='3.82'%20x2='31'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_smoothing_light'%20x1='32'%20y1='3.82'%20x2='39'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint5_linear_smoothing_light'%20x1='40'%20y1='3.82'%20x2='48'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint6_linear_smoothing_light'%20x1='24'%20y1='48'%20x2='24'%20y2='20'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F60C4'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%233865AB'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint7_linear_smoothing_light'%20x1='66'%20y1='3.82'%20x2='81'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint8_linear_smoothing_light'%20x1='82'%20y1='3.82'%20x2='97'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint9_linear_smoothing_light'%20x1='98'%20y1='3.82'%20x2='114'%20y2='3.82'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint10_linear_smoothing_light'%20x1='90'%20y1='48'%20x2='90'%20y2='21'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F60C4'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%233865AB'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_smoothing_light'%3e%3crect%20width='48'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_smoothing_light'%3e%3crect%20width='48'%20height='48'%20fill='white'%20transform='translate(66)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_66 = "data:image/svg+xml,%3csvg%20width='77'%20height='48'%20viewBox='0%200%2077%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M23.3704%2020.6776C23.308%2020.6218%2023.2344%2020.5781%2023.1539%2020.549C22.9941%2020.4877%2022.815%2020.4877%2022.6552%2020.549C22.5747%2020.5781%2022.5011%2020.6218%2022.4387%2020.6776L21.1265%2021.9023C21.0029%2022.0177%2020.9335%2022.174%2020.9335%2022.3371C20.9335%2022.5002%2021.0029%2022.6566%2021.1265%2022.7719C21.25%2022.8872%2021.4176%2022.952%2021.5923%2022.952C21.7671%2022.952%2021.9346%2022.8872%2022.0582%2022.7719L22.2484%2022.5882V27.2361C22.2484%2027.3985%2022.3176%2027.5543%2022.4406%2027.6691C22.5637%2027.784%2022.7306%2027.8485%2022.9046%2027.8485C23.0786%2027.8485%2023.2455%2027.784%2023.3685%2027.6691C23.4916%2027.5543%2023.5607%2027.3985%2023.5607%2027.2361V22.5882L23.751%2022.7719C23.8119%2022.8293%2023.8845%2022.8749%2023.9645%2022.906C24.0444%2022.937%2024.1302%2022.953%2024.2168%2022.953C24.3034%2022.953%2024.3892%2022.937%2024.4691%2022.906C24.5491%2022.8749%2024.6216%2022.8293%2024.6826%2022.7719C24.7441%2022.715%2024.7929%2022.6473%2024.8263%2022.5726C24.8596%2022.498%2024.8767%2022.418%2024.8767%2022.3371C24.8767%2022.2563%2024.8596%2022.1762%2024.8263%2022.1016C24.7929%2022.027%2024.7441%2021.9593%2024.6826%2021.9023L23.3704%2020.6776ZM26.8413%2021.7247H33.4024C33.5764%2021.7247%2033.7433%2021.6602%2033.8664%2021.5454C33.9894%2021.4305%2034.0585%2021.2748%2034.0585%2021.1124C34.0585%2020.95%2033.9894%2020.7942%2033.8664%2020.6794C33.7433%2020.5645%2033.5764%2020.5%2033.4024%2020.5H26.8413C26.6672%2020.5%2026.5004%2020.5645%2026.3773%2020.6794C26.2543%2020.7942%2026.1851%2020.95%2026.1851%2021.1124C26.1851%2021.2748%2026.2543%2021.4305%2026.3773%2021.5454C26.5004%2021.6602%2026.6672%2021.7247%2026.8413%2021.7247ZM33.4024%2026.6237H26.8413C26.6672%2026.6237%2026.5004%2026.6883%2026.3773%2026.8031C26.2543%2026.918%2026.1851%2027.0737%2026.1851%2027.2361C26.1851%2027.3985%2026.2543%2027.5543%2026.3773%2027.6691C26.5004%2027.784%2026.6672%2027.8485%2026.8413%2027.8485H33.4024C33.5764%2027.8485%2033.7433%2027.784%2033.8664%2027.6691C33.9894%2027.5543%2034.0585%2027.3985%2034.0585%2027.2361C34.0585%2027.0737%2033.9894%2026.918%2033.8664%2026.8031C33.7433%2026.6883%2033.5764%2026.6237%2033.4024%2026.6237ZM33.4024%2023.5619H26.8413C26.6672%2023.5619%2026.5004%2023.6264%2026.3773%2023.7412C26.2543%2023.8561%2026.1851%2024.0118%2026.1851%2024.1742C26.1851%2024.3367%2026.2543%2024.4924%2026.3773%2024.6073C26.5004%2024.7221%2026.6672%2024.7866%2026.8413%2024.7866H33.4024C33.5764%2024.7866%2033.7433%2024.7221%2033.8664%2024.6073C33.9894%2024.4924%2034.0585%2024.3367%2034.0585%2024.1742C34.0585%2024.0118%2033.9894%2023.8561%2033.8664%2023.7412C33.7433%2023.6264%2033.5764%2023.5619%2033.4024%2023.5619Z'%20fill='%2326262A'/%3e%3cpath%20d='M47.9067%2030C48.6011%2030%2053.9327%2026%2053.9327%2024C53.9327%2022%2048.7357%2018%2047.9067%2018C47.0778%2018%2046.4023%2018.5%2046.4023%2019.4756C46.4023%2020.4512%2049.9067%2022.9206%2049.9067%2022.9206C49.9067%2022.9206%2042.2539%2022.25%2042%2022.9206C41.7461%2023.5911%2041.7461%2024.4089%2042%2025.0794C42.2539%2025.75%2049.9067%2025.0794%2049.9067%2025.0794C49.9067%2025.0794%2046.4023%2027.75%2046.4023%2028.5301C46.4023%2029.3103%2047.2124%2030%2047.9067%2030Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip0_1248_125954)'%3e%3cpath%20d='M0%201.04083V13H15V0H0.626828C0.460583%200%200.301147%200.109659%200.183594%200.304853C0.0660407%200.500047%200%200.764787%200%201.04083Z'%20fill='url(%23paint0_linear_1248_125954)'/%3e%3cpath%20d='M15%2017.5H0V30.5H15V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M15%2035H0V48H15V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M8.5%2021H7.07158L5.5%2021.9199V23.1738L6.92531%2022.3535H6.96266V27H8.5V21Z'%20fill='%2324292E'/%3e%3cpath%20d='M5.33733%2044.5H9.75V43.3468H7.33409V43.3092L8.04722%2042.6561C9.33959%2041.5376%209.67723%2040.9682%209.67723%2040.289C9.67723%2039.2225%208.8011%2038.5%207.44761%2038.5C6.12905%2038.5%205.2471%2039.2543%205.25001%2040.4595H6.61514C6.61514%2039.9249%206.94696%2039.6156%207.44179%2039.6156C7.92788%2039.6156%208.28008%2039.9133%208.28008%2040.4017C8.28008%2040.8439%208.00065%2041.1445%207.51165%2041.5809L5.33733%2043.4711V44.5Z'%20fill='%2324292E'/%3e%3c/g%3e%3cg%20clip-path='url(%23clip1_1248_125954)'%3e%3cpath%20d='M77%2017.5H62V30.5H77V17.5Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M77%2035H62V48H77V35Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M62%2013H77V1.04083C77%200.764787%2076.934%200.500047%2076.8164%200.304853C76.6989%200.109659%2076.5394%200%2076.3732%200L62%200V13Z'%20fill='url(%23paint1_linear_1248_125954)'/%3e%3cpath%20d='M70.5%2038.5H69.0716L67.5%2039.4199V40.6738L68.9253%2039.8535H68.9627V44.5H70.5V38.5Z'%20fill='%2324292E'/%3e%3cpath%20d='M67.3373%2027H71.75V25.8468H69.3341V25.8092L70.0472%2025.1561C71.3396%2024.0376%2071.6772%2023.4682%2071.6772%2022.789C71.6772%2021.7225%2070.8011%2021%2069.4476%2021C68.129%2021%2067.2471%2021.7543%2067.25%2022.9595H68.6151C68.6151%2022.4249%2068.947%2022.1156%2069.4418%2022.1156C69.9279%2022.1156%2070.2801%2022.4133%2070.2801%2022.9017C70.2801%2023.3439%2070.0006%2023.6445%2069.5116%2024.0809L67.3373%2025.9711V27Z'%20fill='%2324292E'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_125954'%20x1='0'%20y1='6.5052'%20x2='15'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1248_125954'%20x1='62'%20y1='6.5052'%20x2='77'%20y2='6.5052'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1248_125954'%3e%3crect%20width='15'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1248_125954'%3e%3crect%20width='15'%20height='48'%20fill='white'%20transform='translate(62)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_67 = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.7436%2030.2214C10.4012%2030.2214%2010.0827%2030.3965%209.89924%2030.6856L1.15566%2044.4642C0.96022%2044.7722%200.947975%2045.1622%201.1237%2045.4818C1.29943%2045.8014%201.63525%2046%202%2046H24H46C46.3648%2046%2046.7006%2045.8014%2046.8763%2045.4818C47.052%2045.1622%2047.0398%2044.7722%2046.8443%2044.4642L38.1008%2030.6856C37.9173%2030.3965%2037.5988%2030.2214%2037.2564%2030.2214H24H10.7436Z'%20fill='url(%23paint0_linear_1248_126346)'%20stroke='%23CCCCDC'%20stroke-width='2'%20stroke-linejoin='round'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.25%2026.7682C17.25%2030.6622%2021.6037%2035.6872%2024%2038.0189C26.3962%2035.6988%2030.75%2030.6622%2030.75%2026.7682C30.75%2024.9129%2030.0388%2023.1336%2028.773%2021.8218C27.5071%2020.5099%2025.7902%2019.7729%2024%2019.7729C22.2098%2019.7729%2020.4929%2020.5099%2019.227%2021.8218C17.9612%2023.1336%2017.25%2024.9129%2017.25%2026.7682ZM22.7501%2028.7068C23.1201%2028.963%2023.5551%2029.0997%2024.0001%2029.0997C24.5969%2029.0997%2025.1692%2028.8541%2025.5911%2028.4168C26.0131%2027.9795%2026.2501%2027.3864%2026.2501%2026.768C26.2501%2026.3068%2026.1182%2025.856%2025.8709%2025.4725C25.6237%2025.0891%2025.2723%2024.7902%2024.8612%2024.6137C24.45%2024.4372%2023.9976%2024.3911%2023.5612%2024.481C23.1247%2024.571%2022.7238%2024.7931%2022.4091%2025.1192C22.0945%2025.4453%2021.8802%2025.8608%2021.7934%2026.3131C21.7065%2026.7654%2021.7511%2027.2342%2021.9214%2027.6603C22.0917%2028.0864%2022.3801%2028.4506%2022.7501%2028.7068Z'%20fill='%23E02F44'/%3e%3cpath%20d='M24%2017.4426C21.6131%2017.4426%2019.3239%2018.4252%2017.636%2020.1744C15.9482%2021.9236%2015%2024.2959%2015%2026.7696C15%2033.0654%2022.9313%2040.1773%2023.2688%2040.4804C23.4725%2040.661%2023.7319%2040.7603%2024%2040.7603C24.2681%2040.7603%2024.5275%2040.661%2024.7312%2040.4804C25.125%2040.1773%2033%2033.0654%2033%2026.7696C33%2024.2959%2032.0518%2021.9236%2030.364%2020.1744C28.6761%2018.4252%2026.3869%2017.4426%2024%2017.4426ZM24%2038.0204C21.6037%2035.6886%2017.25%2030.6637%2017.25%2026.7696C17.25%2024.9144%2017.9612%2023.1351%2019.227%2021.8232C20.4929%2020.5113%2022.2098%2019.7743%2024%2019.7743C25.7902%2019.7743%2027.5071%2020.5113%2028.773%2021.8232C30.0388%2023.1351%2030.75%2024.9144%2030.75%2026.7696C30.75%2030.6637%2026.3963%2035.7003%2024%2038.0204Z'%20fill='%2322252B'/%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1248_126346'%20x1='46'%20y1='38.2709'%20x2='3.41025'%20y2='38.2709'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23FF9830'/%3e%3cstop%20offset='1'%20stop-color='%23F2CC0C'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_68 = "data:image/svg+xml,%3csvg%20width='124'%20height='48'%20viewBox='0%200%20124%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_1648_105907)'%3e%3cpath%20d='M76%200.611699V7.64012H90.394V0H76.6015C76.442%200%2076.289%200.0644467%2076.1762%200.179162C76.0634%200.293878%2076%200.449466%2076%200.611699Z'%20fill='url(%23paint0_linear_1648_105907)'/%3e%3cpath%20d='M109.606%207.64012H124V0.611699C124%200.449466%20123.937%200.293878%20123.824%200.179162C123.711%200.0644467%20123.558%200%20123.399%200L109.606%200V7.64012Z'%20fill='url(%23paint1_linear_1648_105907)'/%3e%3cpath%20d='M107.194%200H92.8V7.64012H107.194V0Z'%20fill='url(%23paint2_linear_1648_105907)'/%3e%3cpath%20d='M107.194%2010.0869H92.8V17.727H107.194V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M90.394%2010.0869H76V17.727H90.394V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2010.0869H109.606V17.727H124V10.0869Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2020.1799H109.606V27.8262H124V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M107.194%2020.1799H92.8V27.8262H107.194V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M90.394%2020.1799H76V27.8262H90.394V20.1799Z'%20fill='%233865AB'/%3e%3cpath%20d='M107.194%2030.2668H92.8V37.907H107.194V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M124%2030.2668H109.606V37.907H124V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M90.394%2030.2668H76V37.907H90.394V30.2668Z'%20fill='%2384AFF1'/%3e%3cpath%20d='M107.194%2040.3599H92.8V48H107.194V40.3599Z'%20fill='%233865AB'/%3e%3cpath%20d='M124%2047.3883V40.3721H109.606V48H123.399C123.558%2048%20123.711%2047.9355%20123.824%2047.8208C123.937%2047.7061%20124%2047.5505%20124%2047.3883Z'%20fill='%233865AB'/%3e%3cpath%20d='M90.394%2048V40.3721H76V47.3883C76%2047.5505%2076.0634%2047.7061%2076.1762%2047.8208C76.289%2047.9355%2076.442%2048%2076.6015%2048H90.394Z'%20fill='%233865AB'/%3e%3c/g%3e%3cpath%20d='M61.9067%2030.4001C62.6011%2030.4001%2067.9327%2026.1334%2067.9327%2024.0001C67.9327%2021.8668%2062.7357%2017.6001%2061.9067%2017.6001C61.0778%2017.6001%2060.4023%2018.1334%2060.4023%2019.1741C60.4023%2020.2147%2063.9067%2022.8487%2063.9067%2022.8487C63.9067%2022.8487%2056.2539%2022.1334%2056%2022.8487C55.7461%2023.564%2055.7461%2024.4362%2056%2025.1515C56.2539%2025.8668%2063.9067%2025.1515%2063.9067%2025.1515C63.9067%2025.1515%2060.4023%2028.0001%2060.4023%2028.8323C60.4023%2029.6644%2061.2124%2030.4001%2061.9067%2030.4001Z'%20fill='%2324292E'/%3e%3cg%20clip-path='url(%23clip1_1648_105907)'%3e%3cpath%20d='M20.5657%2014.8473C20.3886%2014.8474%2020.2136%2014.8094%2020.0525%2014.736L10.963%2010.6159L1.68804%2014.1483C1.38138%2014.2648%201.04102%2014.2546%200.741842%2014.12C0.442666%2013.9854%200.209179%2013.7375%200.0927449%2013.4307C-0.0236892%2013.1238%20-0.0135325%2012.7833%200.120981%2012.484C0.255494%2012.1847%200.503345%2011.9511%200.81001%2011.8346L10.5796%208.12275C10.8825%207.9973%2011.2228%207.9973%2011.5257%208.12275L20.2813%2012.0882L29.5562%202.19003C29.7339%202.01998%2029.9583%201.90678%2030.2006%201.86491C30.4429%201.82304%2030.6922%201.85438%2030.9166%201.95495L40.2843%206.01939L49.0832%200.204206C49.2187%200.111618%2049.3713%200.0469507%2049.5321%200.0139747C49.6929%20-0.0190012%2049.8586%20-0.0196266%2050.0197%200.0121352C50.1807%200.043897%2050.3338%200.10741%2050.47%200.198973C50.6063%200.290536%2050.7229%200.408317%2050.8132%200.545449C50.9035%200.682581%2050.9656%200.836322%2050.9959%200.997709C51.0262%201.1591%2051.024%201.3249%2050.9896%201.48546C50.9552%201.64602%2050.8892%201.79812%2050.7954%201.93289C50.7017%202.06766%2050.582%202.18241%2050.4435%202.27045L41.0881%208.45682C40.916%208.56985%2040.7184%208.63811%2040.5133%208.6554C40.3081%208.67268%2040.1019%208.63845%2039.9133%208.5558L30.7434%204.57178L21.4685%2014.47C21.3516%2014.591%2021.2112%2014.6869%2021.056%2014.7518C20.9008%2014.8167%2020.7339%2014.8492%2020.5657%2014.8473Z'%20fill='url(%23paint3_linear_1648_105907)'/%3e%3cpath%20d='M49.7633%2010.9624L40.408%2020.8606L30.4343%2013.4369L20.5657%2020.8606L11.0063%2019.0047L1.23666%2027.047H1.30468V47.994H49.8932L49.7633%2010.9624Z'%20fill='url(%23paint4_linear_1648_105907)'/%3e%3cpath%20d='M1.30468%2028.2841H1.23666C0.982542%2028.2834%200.73483%2028.2043%200.527227%2028.0577C0.319623%2027.911%200.162208%2027.704%200.0763958%2027.4647C-0.00941619%2027.2254%20-0.0194578%2026.9654%200.047637%2026.7202C0.114732%2026.475%200.255705%2026.2564%200.451379%2026.0942L10.221%2018.0519C10.3615%2017.9361%2010.5258%2017.8528%2010.7021%2017.8079C10.8785%2017.763%2011.0626%2017.7576%2011.2413%2017.7921L20.2627%2019.5428L29.6799%2012.447C29.894%2012.2864%2030.1543%2012.1996%2030.4219%2012.1996C30.6895%2012.1996%2030.9499%2012.2864%2031.1639%2012.447L40.2534%2019.2149L48.8482%2010.1148C48.9578%209.9891%2049.0917%209.88688%2049.2418%209.81428C49.3919%209.74167%2049.5551%209.70018%2049.7216%209.6923C49.8882%209.68442%2050.0546%209.7103%2050.2108%209.76841C50.3671%209.82651%2050.51%209.91562%2050.631%2010.0304C50.752%2010.1452%2050.8485%2010.2832%2050.9148%2010.4363C50.9811%2010.5893%2051.0157%2010.7542%2051.0167%2010.921C51.0177%2011.0878%2050.9849%2011.2531%2050.9204%2011.4069C50.8559%2011.5607%2050.761%2011.6999%2050.6414%2011.816L41.3046%2021.7142C41.0967%2021.9331%2040.816%2022.0685%2040.5153%2022.0947C40.2146%2022.1209%2039.9147%2022.0362%2039.6722%2021.8565L30.4405%2014.9835L21.3077%2021.8503C21.1699%2021.9547%2021.0117%2022.0289%2020.8435%2022.0684C20.6752%2022.1078%2020.5005%2022.1115%2020.3307%2022.0792L11.3402%2020.3347L2.31256%2027.7583C2.19883%2027.9202%202.04795%2028.0524%201.87258%2028.1439C1.69721%2028.2354%201.50246%2028.2835%201.30468%2028.2841Z'%20fill='%2384AFF1'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_1648_105907'%20x1='76'%20y1='3.82312'%20x2='90.394'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_1648_105907'%20x1='109.606'%20y1='3.82312'%20x2='124'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_1648_105907'%20x1='92.8'%20y1='3.82312'%20x2='107.2'%20y2='3.82312'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_1648_105907'%20x1='-4.82403e-06'%20y1='7.42369'%20x2='51'%20y2='7.42369'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F2CC0C'/%3e%3cstop%20offset='1'%20stop-color='%23FF9830'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_1648_105907'%20x1='25.4382'%20y1='48.2414'%20x2='25.9148'%20y2='8.49405'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231F60C4'%20stop-opacity='0'/%3e%3cstop%20offset='1'%20stop-color='%233865AB'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_1648_105907'%3e%3crect%20width='48'%20height='48'%20fill='white'%20transform='translate(76)'/%3e%3c/clipPath%3e%3cclipPath%20id='clip1_1648_105907'%3e%3crect%20width='51'%20height='48'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e";
const __vite_glob_0_69 = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='206'%20zoomAndPan='magnify'%20viewBox='0%200%20154.5%2041.25'%20height='55'%20preserveAspectRatio='xMidYMid%20meet'%20version='1.0'%3e%3cdefs%3e%3cg/%3e%3cclipPath%20id='9c77b18430'%3e%3cpath%20d='M%202.78125%202.292969%20L%2019.722656%202.292969%20L%2019.722656%202.871094%20L%202.78125%202.871094%20Z%20M%202.78125%202.871094%20L%2019.722656%202.871094%20L%2019.722656%209.503906%20L%202.78125%209.503906%20Z%20M%202.78125%202.871094%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%202.292546)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='586e4e0aaf'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='85a7b304f5'%3e%3cpath%20d='M%202.78125%2012.085938%20L%2019.722656%2012.085938%20L%2019.722656%2012.664062%20L%202.78125%2012.664062%20Z%20M%202.78125%2012.664062%20L%2019.722656%2012.664062%20L%2019.722656%2019.300781%20L%202.78125%2019.300781%20Z%20M%202.78125%2012.664062%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%2012.086858)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='d62f7bd1f9'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='5fd514023d'%3e%3cpath%20d='M%202.78125%2021.726562%20L%2019.722656%2021.726562%20L%2019.722656%2022.304688%20L%202.78125%2022.304688%20Z%20M%202.78125%2022.304688%20L%2019.722656%2022.304688%20L%2019.722656%2028.941406%20L%202.78125%2028.941406%20Z%20M%202.78125%2022.304688%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%2021.72763)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='a1cdb846f2'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='533432af0f'%3e%3cpath%20d='M%202.78125%2031.367188%20L%2019.722656%2031.367188%20L%2019.722656%2031.945312%20L%202.78125%2031.945312%20Z%20M%202.78125%2031.945312%20L%2019.722656%2031.945312%20L%2019.722656%2038.582031%20L%202.78125%2038.582031%20Z%20M%202.78125%2031.945312%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038808'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20-17.543196,%2031.368404)'%20y1='5.004'%20x2='51.41194'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='2f4d7a7d59'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='32844660bb'%3e%3cpath%20d='M%2023.167969%202.292969%20L%2040.109375%202.292969%20L%2040.109375%202.871094%20L%2023.167969%202.871094%20Z%20M%2023.167969%202.871094%20L%2040.109375%202.871094%20L%2040.109375%209.503906%20L%2023.167969%209.503906%20Z%20M%2023.167969%202.871094%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038809'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%202.844588,%202.292546)'%20y1='5.004'%20x2='51.411943'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='3fd4eaccda'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='f8ded3fd83'%3e%3cpath%20d='M%2043.5625%202.292969%20L%2060.503906%202.292969%20L%2060.503906%202.871094%20L%2043.5625%202.871094%20Z%20M%2043.5625%202.871094%20L%2060.503906%202.871094%20L%2060.503906%209.503906%20L%2043.5625%209.503906%20Z%20M%2043.5625%202.871094%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038809'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2023.236872,%202.292546)'%20y1='5.004'%20x2='51.411941'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='e28c8340a7'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='807e5e3a31'%3e%3cpath%20d='M%2023.128906%2012.273438%20L%2040.046875%2012.273438%20L%2040.046875%2018.902344%20L%2023.128906%2018.902344%20Z%20M%2023.128906%2012.273438%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='1a9efdd965'%3e%3cpath%20d='M%2043.523438%2012.273438%20L%2060.441406%2012.273438%20L%2060.441406%2018.902344%20L%2043.523438%2018.902344%20Z%20M%2043.523438%2012.273438%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='eb15d22d78'%3e%3cpath%20d='M%2023.191406%2022.042969%20L%2040.109375%2022.042969%20L%2040.109375%2028.671875%20L%2023.191406%2028.671875%20Z%20M%2023.191406%2022.042969%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='6ed351094f'%3e%3cpath%20d='M%2043.648438%2022.042969%20L%2060.566406%2022.042969%20L%2060.566406%2028.671875%20L%2043.648438%2028.671875%20Z%20M%2043.648438%2022.042969%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='7b2bb54ce0'%3e%3cpath%20d='M%2023.191406%2031.367188%20L%2040.109375%2031.367188%20L%2040.109375%2037.996094%20L%2023.191406%2037.996094%20Z%20M%2023.191406%2031.367188%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='4cdf6db877'%3e%3cpath%20d='M%2043.585938%2031.367188%20L%2060.503906%2031.367188%20L%2060.503906%2037.996094%20L%2043.585938%2037.996094%20Z%20M%2043.585938%2031.367188%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='c7b3e253da'%3e%3cpath%20d='M%2072.824219%208.578125%20L%2089.765625%208.578125%20L%2089.765625%209.152344%20L%2072.824219%209.152344%20Z%20M%2072.824219%209.152344%20L%2089.765625%209.152344%20L%2089.765625%2015.789062%20L%2072.824219%2015.789062%20Z%20M%2072.824219%209.152344%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038818'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2052.501412,%208.576231)'%20y1='5.004'%20x2='51.41195'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='a98ad63194'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='59bc7dc508'%3e%3cpath%20d='M%2072.824219%2018.371094%20L%2089.765625%2018.371094%20L%2089.765625%2018.949219%20L%2072.824219%2018.949219%20Z%20M%2072.824219%2018.949219%20L%2089.765625%2018.949219%20L%2089.765625%2025.582031%20L%2072.824219%2025.582031%20Z%20M%2072.824219%2018.949219%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038818'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2052.501412,%2018.370546)'%20y1='5.004'%20x2='51.41195'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='7aa9c63f84'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='3374980bc7'%3e%3cpath%20d='M%2072.824219%2028.011719%20L%2089.765625%2028.011719%20L%2089.765625%2028.589844%20L%2072.824219%2028.589844%20Z%20M%2072.824219%2028.589844%20L%2089.765625%2028.589844%20L%2089.765625%2035.222656%20L%2072.824219%2035.222656%20Z%20M%2072.824219%2028.589844%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038818'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2052.501412,%2028.011317)'%20y1='5.004'%20x2='51.41195'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='f0b776da89'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='9de7fff919'%3e%3cpath%20d='M%2093.214844%208.578125%20L%20110.15625%208.578125%20L%20110.15625%209.152344%20L%2093.214844%209.152344%20Z%20M%2093.214844%209.152344%20L%20110.15625%209.152344%20L%20110.15625%2015.789062%20L%2093.214844%2015.789062%20Z%20M%2093.214844%209.152344%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038816'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2072.889193,%208.576231)'%20y1='5.004'%20x2='51.411949'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='076aceffe8'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='e9901ed91b'%3e%3cpath%20d='M%20113.605469%208.578125%20L%20130.546875%208.578125%20L%20130.546875%209.152344%20L%20113.605469%209.152344%20Z%20M%20113.605469%209.152344%20L%20130.546875%209.152344%20L%20130.546875%2015.789062%20L%20113.605469%2015.789062%20Z%20M%20113.605469%209.152344%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038807'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%2093.281478,%208.576231)'%20y1='5.004'%20x2='51.411939'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='d4c57477a4'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.954102%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3cclipPath%20id='eb792ed027'%3e%3cpath%20d='M%2093.175781%2018.558594%20L%20110.09375%2018.558594%20L%20110.09375%2025.1875%20L%2093.175781%2025.1875%20Z%20M%2093.175781%2018.558594%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='96a42728f2'%3e%3cpath%20d='M%2093.304688%2028.328125%20L%20110.222656%2028.328125%20L%20110.222656%2034.957031%20L%2093.304688%2034.957031%20Z%20M%2093.304688%2028.328125%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='fe8633168e'%3e%3cpath%20d='M%20113.660156%2018.558594%20L%20130.578125%2018.558594%20L%20130.578125%2025.1875%20L%20113.660156%2025.1875%20Z%20M%20113.660156%2018.558594%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='61c7415809'%3e%3cpath%20d='M%20113.761719%2028.03125%20L%20130.679688%2028.03125%20L%20130.679688%2034.664062%20L%20113.761719%2034.664062%20Z%20M%20113.761719%2028.03125%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='acf50263c6'%3e%3cpath%20d='M%20133.894531%2018.625%20L%20150.8125%2018.625%20L%20150.8125%2025.253906%20L%20133.894531%2025.253906%20Z%20M%20133.894531%2018.625%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='eba48b04ac'%3e%3cpath%20d='M%20134.023438%2027.792969%20L%20150.941406%2027.792969%20L%20150.941406%2034.421875%20L%20134.023438%2034.421875%20Z%20M%20134.023438%2027.792969%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3cclipPath%20id='a073bb6f5a'%3e%3cpath%20d='M%20133.839844%208.570312%20L%20150.78125%208.570312%20L%20150.78125%209.148438%20L%20133.839844%209.148438%20Z%20M%20133.839844%209.148438%20L%20150.78125%209.148438%20L%20150.78125%2015.78125%20L%20133.839844%2015.78125%20Z%20M%20133.839844%209.148438%20'%20clip-rule='nonzero'/%3e%3c/clipPath%3e%3clinearGradient%20x1='28.038803'%20gradientTransform='matrix(0.724848,%200,%200,%200.721261,%20113.515935,%208.570574)'%20y1='5.004'%20x2='51.411935'%20gradientUnits='userSpaceOnUse'%20y2='5.004'%20id='61512084a3'%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.90509%25,%2079.972839%25,%204.718018%25)'%20offset='0'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(94.943237%25,%2079.8172%25,%204.824829%25)'%20offset='0.015625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.021057%25,%2079.507446%25,%205.038452%25)'%20offset='0.03125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.098877%25,%2079.196167%25,%205.253601%25)'%20offset='0.046875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.176697%25,%2078.886414%25,%205.467224%25)'%20offset='0.0625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.254517%25,%2078.575134%25,%205.682373%25)'%20offset='0.078125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.332336%25,%2078.265381%25,%205.897522%25)'%20offset='0.09375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.410156%25,%2077.955627%25,%206.111145%25)'%20offset='0.109375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.48645%25,%2077.644348%25,%206.326294%25)'%20offset='0.125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.56427%25,%2077.334595%25,%206.539917%25)'%20offset='0.140625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.64209%25,%2077.023315%25,%206.755066%25)'%20offset='0.15625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.71991%25,%2076.713562%25,%206.970215%25)'%20offset='0.171875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.797729%25,%2076.402283%25,%207.183838%25)'%20offset='0.1875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.875549%25,%2076.092529%25,%207.398987%25)'%20offset='0.203125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(95.953369%25,%2075.78125%25,%207.614136%25)'%20offset='0.21875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.029663%25,%2075.471497%25,%207.827759%25)'%20offset='0.234375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.107483%25,%2075.161743%25,%208.042908%25)'%20offset='0.25'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.185303%25,%2074.850464%25,%208.256531%25)'%20offset='0.265625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.263123%25,%2074.54071%25,%208.47168%25)'%20offset='0.28125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.340942%25,%2074.229431%25,%208.686829%25)'%20offset='0.296875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.418762%25,%2073.919678%25,%208.900452%25)'%20offset='0.3125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.496582%25,%2073.608398%25,%209.115601%25)'%20offset='0.328125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.574402%25,%2073.298645%25,%209.329224%25)'%20offset='0.34375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.650696%25,%2072.987366%25,%209.544373%25)'%20offset='0.359375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.728516%25,%2072.677612%25,%209.759521%25)'%20offset='0.375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.806335%25,%2072.367859%25,%209.973145%25)'%20offset='0.390625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.884155%25,%2072.05658%25,%2010.188293%25)'%20offset='0.40625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(96.961975%25,%2071.746826%25,%2010.401917%25)'%20offset='0.421875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.039795%25,%2071.435547%25,%2010.617065%25)'%20offset='0.4375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.117615%25,%2071.125793%25,%2010.832214%25)'%20offset='0.453125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.193909%25,%2070.814514%25,%2011.045837%25)'%20offset='0.46875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.271729%25,%2070.504761%25,%2011.260986%25)'%20offset='0.484375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.349548%25,%2070.195007%25,%2011.476135%25)'%20offset='0.5'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.427368%25,%2069.883728%25,%2011.689758%25)'%20offset='0.515625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.505188%25,%2069.573975%25,%2011.904907%25)'%20offset='0.53125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.583008%25,%2069.262695%25,%2012.11853%25)'%20offset='0.546875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.660828%25,%2068.952942%25,%2012.333679%25)'%20offset='0.5625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.737122%25,%2068.641663%25,%2012.548828%25)'%20offset='0.578125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.814941%25,%2068.331909%25,%2012.762451%25)'%20offset='0.59375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.892761%25,%2068.02063%25,%2012.9776%25)'%20offset='0.609375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(97.970581%25,%2067.710876%25,%2013.191223%25)'%20offset='0.625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.048401%25,%2067.401123%25,%2013.406372%25)'%20offset='0.640625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.126221%25,%2067.089844%25,%2013.621521%25)'%20offset='0.65625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.204041%25,%2066.78009%25,%2013.835144%25)'%20offset='0.671875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.280334%25,%2066.468811%25,%2014.050293%25)'%20offset='0.6875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.358154%25,%2066.159058%25,%2014.265442%25)'%20offset='0.703125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.435974%25,%2065.847778%25,%2014.479065%25)'%20offset='0.71875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.513794%25,%2065.538025%25,%2014.694214%25)'%20offset='0.734375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.591614%25,%2065.226746%25,%2014.907837%25)'%20offset='0.75'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.669434%25,%2064.916992%25,%2015.122986%25)'%20offset='0.765625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.747253%25,%2064.607239%25,%2015.338135%25)'%20offset='0.78125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.823547%25,%2064.295959%25,%2015.551758%25)'%20offset='0.796875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.901367%25,%2063.986206%25,%2015.766907%25)'%20offset='0.8125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(98.979187%25,%2063.674927%25,%2015.98053%25)'%20offset='0.828125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.057007%25,%2063.365173%25,%2016.195679%25)'%20offset='0.84375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.134827%25,%2063.053894%25,%2016.410828%25)'%20offset='0.859375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.212646%25,%2062.744141%25,%2016.624451%25)'%20offset='0.875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.290466%25,%2062.434387%25,%2016.8396%25)'%20offset='0.890625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.36676%25,%2062.123108%25,%2017.053223%25)'%20offset='0.90625'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.44458%25,%2061.813354%25,%2017.268372%25)'%20offset='0.921875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.5224%25,%2061.502075%25,%2017.483521%25)'%20offset='0.9375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.60022%25,%2061.192322%25,%2017.697144%25)'%20offset='0.953125'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.67804%25,%2060.881042%25,%2017.912292%25)'%20offset='0.96875'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.755859%25,%2060.571289%25,%2018.127441%25)'%20offset='0.984375'/%3e%3cstop%20stop-opacity='1'%20stop-color='rgb(99.833679%25,%2060.26001%25,%2018.341064%25)'%20offset='1'/%3e%3c/linearGradient%3e%3c/defs%3e%3cpath%20fill='%2324292e'%20d='M%2066.765625%2024.945312%20C%2067.269531%2024.945312%2071.136719%2022.0625%2071.136719%2020.617188%20C%2071.136719%2019.175781%2067.367188%2016.292969%2066.765625%2016.292969%20C%2066.167969%2016.292969%2065.675781%2016.652344%2065.675781%2017.355469%20C%2065.675781%2018.058594%2068.214844%2019.839844%2068.214844%2019.839844%20C%2068.214844%2019.839844%2062.667969%2019.355469%2062.484375%2019.839844%20C%2062.300781%2020.324219%2062.300781%2020.914062%2062.484375%2021.398438%20C%2062.667969%2021.882812%2068.214844%2021.398438%2068.214844%2021.398438%20C%2068.214844%2021.398438%2065.675781%2023.324219%2065.675781%2023.886719%20C%2065.675781%2024.449219%2066.261719%2024.945312%2066.765625%2024.945312%20Z%20M%2066.765625%2024.945312%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3cg%20clip-path='url(%239c77b18430)'%3e%3cpath%20fill='url(%23586e4e0aaf)'%20d='M%202.78125%202.292969%20L%202.78125%209.503906%20L%2019.722656%209.503906%20L%2019.722656%202.292969%20Z%20M%202.78125%202.292969%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2385a7b304f5)'%3e%3cpath%20fill='url(%23d62f7bd1f9)'%20d='M%202.78125%2012.085938%20L%202.78125%2019.300781%20L%2019.722656%2019.300781%20L%2019.722656%2012.085938%20Z%20M%202.78125%2012.085938%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%235fd514023d)'%3e%3cpath%20fill='url(%23a1cdb846f2)'%20d='M%202.78125%2021.726562%20L%202.78125%2028.941406%20L%2019.722656%2028.941406%20L%2019.722656%2021.726562%20Z%20M%202.78125%2021.726562%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23533432af0f)'%3e%3cpath%20fill='url(%232f4d7a7d59)'%20d='M%202.78125%2031.367188%20L%202.78125%2038.582031%20L%2019.722656%2038.582031%20L%2019.722656%2031.367188%20Z%20M%202.78125%2031.367188%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2332844660bb)'%3e%3cpath%20fill='url(%233fd4eaccda)'%20d='M%2023.167969%202.292969%20L%2023.167969%209.503906%20L%2040.109375%209.503906%20L%2040.109375%202.292969%20Z%20M%2023.167969%202.292969%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23f8ded3fd83)'%3e%3cpath%20fill='url(%23e28c8340a7)'%20d='M%2043.5625%202.292969%20L%2043.5625%209.503906%20L%2060.503906%209.503906%20L%2060.503906%202.292969%20Z%20M%2043.5625%202.292969%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23807e5e3a31)'%3e%3cpath%20fill='%2384aff1'%20d='M%2040.523438%2012.222656%20L%2023.128906%2012.222656%20L%2023.128906%2019.078125%20L%2040.523438%2019.078125%20Z%20M%2040.523438%2012.222656%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%231a9efdd965)'%3e%3cpath%20fill='%2384aff1'%20d='M%2060.917969%2012.222656%20L%2043.523438%2012.222656%20L%2043.523438%2019.078125%20L%2060.917969%2019.078125%20Z%20M%2060.917969%2012.222656%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23eb15d22d78)'%3e%3cpath%20fill='%2384aff1'%20d='M%2040.585938%2021.992188%20L%2023.191406%2021.992188%20L%2023.191406%2028.847656%20L%2040.585938%2028.847656%20Z%20M%2040.585938%2021.992188%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%236ed351094f)'%3e%3cpath%20fill='%2384aff1'%20d='M%2061.042969%2021.992188%20L%2043.648438%2021.992188%20L%2043.648438%2028.847656%20L%2061.042969%2028.847656%20Z%20M%2061.042969%2021.992188%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%237b2bb54ce0)'%3e%3cpath%20fill='%2384aff1'%20d='M%2040.585938%2031.320312%20L%2023.191406%2031.320312%20L%2023.191406%2038.171875%20L%2040.585938%2038.171875%20Z%20M%2040.585938%2031.320312%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%234cdf6db877)'%3e%3cpath%20fill='%2384aff1'%20d='M%2060.980469%2031.320312%20L%2043.585938%2031.320312%20L%2043.585938%2038.171875%20L%2060.980469%2038.171875%20Z%20M%2060.980469%2031.320312%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23c7b3e253da)'%3e%3cpath%20fill='url(%23a98ad63194)'%20d='M%2072.824219%208.578125%20L%2072.824219%2015.789062%20L%2089.765625%2015.789062%20L%2089.765625%208.578125%20Z%20M%2072.824219%208.578125%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2359bc7dc508)'%3e%3cpath%20fill='url(%237aa9c63f84)'%20d='M%2072.824219%2018.371094%20L%2072.824219%2025.582031%20L%2089.765625%2025.582031%20L%2089.765625%2018.371094%20Z%20M%2072.824219%2018.371094%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%233374980bc7)'%3e%3cpath%20fill='url(%23f0b776da89)'%20d='M%2072.824219%2028.011719%20L%2072.824219%2035.222656%20L%2089.765625%2035.222656%20L%2089.765625%2028.011719%20Z%20M%2072.824219%2028.011719%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%239de7fff919)'%3e%3cpath%20fill='url(%23076aceffe8)'%20d='M%2093.214844%208.578125%20L%2093.214844%2015.789062%20L%20110.15625%2015.789062%20L%20110.15625%208.578125%20Z%20M%2093.214844%208.578125%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23e9901ed91b)'%3e%3cpath%20fill='url(%23d4c57477a4)'%20d='M%20113.605469%208.578125%20L%20113.605469%2015.789062%20L%20130.546875%2015.789062%20L%20130.546875%208.578125%20Z%20M%20113.605469%208.578125%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23eb792ed027)'%3e%3cpath%20fill='%2384aff1'%20d='M%20110.570312%2018.507812%20L%2093.175781%2018.507812%20L%2093.175781%2025.359375%20L%20110.570312%2025.359375%20Z%20M%20110.570312%2018.507812%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2396a42728f2)'%3e%3cpath%20fill='%2384aff1'%20d='M%20110.699219%2028.277344%20L%2093.304688%2028.277344%20L%2093.304688%2035.128906%20L%20110.699219%2035.128906%20Z%20M%20110.699219%2028.277344%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23fe8633168e)'%3e%3cpath%20fill='%2384aff1'%20d='M%20131.054688%2018.507812%20L%20113.660156%2018.507812%20L%20113.660156%2025.359375%20L%20131.054688%2025.359375%20Z%20M%20131.054688%2018.507812%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%2361c7415809)'%3e%3cpath%20fill='%2384aff1'%20d='M%20131.15625%2027.984375%20L%20113.761719%2027.984375%20L%20113.761719%2034.835938%20L%20131.15625%2034.835938%20Z%20M%20131.15625%2027.984375%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23acf50263c6)'%3e%3cpath%20fill='%2384aff1'%20d='M%20151.289062%2018.574219%20L%20133.894531%2018.574219%20L%20133.894531%2025.429688%20L%20151.289062%2025.429688%20Z%20M%20151.289062%2018.574219%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23eba48b04ac)'%3e%3cpath%20fill='%2384aff1'%20d='M%20151.417969%2027.742188%20L%20134.023438%2027.742188%20L%20134.023438%2034.59375%20L%20151.417969%2034.59375%20Z%20M%20151.417969%2027.742188%20'%20fill-opacity='1'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20clip-path='url(%23a073bb6f5a)'%3e%3cpath%20fill='url(%2361512084a3)'%20d='M%20133.839844%208.570312%20L%20133.839844%2015.78125%20L%20150.78125%2015.78125%20L%20150.78125%208.570312%20Z%20M%20133.839844%208.570312%20'%20fill-rule='nonzero'/%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(7.407211,%2017.93532)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(11.901125,%2017.93532)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(7.303632,%2027.306779)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(11.797546,%2027.306779)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(7.190188,%2036.692702)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(11.684102,%2036.692702)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(27.560215,%208.212119)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(32.274384,%208.212119)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(47.972226,%208.217777)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(52.686396,%208.217777)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(9.753033,%207.918055)'%3e%3cg%3e%3cpath%20d='M%203.859375%20-4.8125%20L%203.859375%20-4.015625%20L%202.46875%20-4.015625%20L%202.46875%200%20L%201.515625%200%20L%201.515625%20-4.015625%20L%200.125%20-4.015625%20L%200.125%20-4.8125%20Z%20M%203.859375%20-4.8125%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(30.04217,%2017.666008)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(51.130956,%2017.93532)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(29.701344,%2027.306779)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(50.911466,%2027.435567)'%3e%3cg%3e%3cpath%20d='M%203.265625%200%20L%202.359375%200%20L%202.359375%20-1.046875%20L%200.171875%20-1.046875%20L%200.171875%20-1.8125%20L%202.046875%20-4.8125%20L%203.265625%20-4.8125%20L%203.265625%20-1.8125%20L%204%20-1.8125%20L%204%20-1.046875%20L%203.265625%20-1.046875%20Z%20M%201.140625%20-1.875%20L%201.171875%20-1.8125%20L%202.359375%20-1.8125%20L%202.359375%20-3.671875%20L%202.28125%20-3.6875%20Z%20M%201.140625%20-1.875%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(29.891734,%2036.692702)'%3e%3cg%3e%3cpath%20d='M%202%200.0625%20C%201.519531%200.0625%201.140625%20-0.0351562%200.859375%20-0.234375%20C%200.578125%20-0.429688%200.394531%20-0.710938%200.3125%20-1.078125%20L%201.03125%20-1.390625%20L%201.109375%20-1.390625%20C%201.171875%20-1.171875%201.269531%20-1.007812%201.40625%20-0.90625%20C%201.550781%20-0.800781%201.75%20-0.75%202%20-0.75%20C%202.25%20-0.75%202.441406%20-0.816406%202.578125%20-0.953125%20C%202.710938%20-1.097656%202.78125%20-1.3125%202.78125%20-1.59375%20C%202.78125%20-1.875%202.710938%20-2.085938%202.578125%20-2.234375%20C%202.441406%20-2.378906%202.253906%20-2.453125%202.015625%20-2.453125%20C%201.835938%20-2.453125%201.6875%20-2.410156%201.5625%20-2.328125%20C%201.445312%20-2.253906%201.347656%20-2.144531%201.265625%20-2%20L%200.484375%20-2.046875%20L%200.578125%20-4.8125%20L%203.453125%20-4.8125%20L%203.453125%20-4.015625%20L%201.390625%20-4.015625%20L%201.34375%20-2.78125%20L%201.40625%20-2.765625%20C%201.519531%20-2.910156%201.65625%20-3.019531%201.8125%20-3.09375%20C%201.96875%20-3.175781%202.15625%20-3.21875%202.375%20-3.21875%20C%202.644531%20-3.21875%202.878906%20-3.15625%203.078125%20-3.03125%20C%203.285156%20-2.90625%203.445312%20-2.722656%203.5625%20-2.484375%20C%203.675781%20-2.242188%203.734375%20-1.953125%203.734375%20-1.609375%20C%203.734375%20-1.253906%203.664062%20-0.953125%203.53125%20-0.703125%20C%203.394531%20-0.453125%203.195312%20-0.257812%202.9375%20-0.125%20C%202.675781%200%202.363281%200.0625%202%200.0625%20Z%20M%202%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(50.672254,%2036.760669)'%3e%3cg%3e%3cpath%20d='M%202.296875%200.0625%20C%201.929688%200.0625%201.609375%20-0.0195312%201.328125%20-0.1875%20C%201.046875%20-0.351562%200.820312%20-0.613281%200.65625%20-0.96875%20C%200.488281%20-1.332031%200.40625%20-1.796875%200.40625%20-2.359375%20C%200.40625%20-2.929688%200.492188%20-3.40625%200.671875%20-3.78125%20C%200.847656%20-4.15625%201.085938%20-4.429688%201.390625%20-4.609375%20C%201.691406%20-4.785156%202.039062%20-4.875%202.4375%20-4.875%20C%202.757812%20-4.875%203.035156%20-4.828125%203.265625%20-4.734375%20C%203.503906%20-4.640625%203.691406%20-4.5%203.828125%20-4.3125%20L%203.359375%20-3.71875%20L%203.28125%20-3.71875%20C%203.070312%20-3.957031%202.789062%20-4.078125%202.4375%20-4.078125%20C%201.75%20-4.078125%201.394531%20-3.578125%201.375%20-2.578125%20L%201.453125%20-2.546875%20C%201.566406%20-2.753906%201.710938%20-2.910156%201.890625%20-3.015625%20C%202.078125%20-3.128906%202.304688%20-3.1875%202.578125%20-3.1875%20C%202.878906%20-3.1875%203.140625%20-3.125%203.359375%20-3%20C%203.578125%20-2.875%203.742188%20-2.691406%203.859375%20-2.453125%20C%203.972656%20-2.222656%204.03125%20-1.945312%204.03125%20-1.625%20C%204.03125%20-1.269531%203.957031%20-0.960938%203.8125%20-0.703125%20C%203.675781%20-0.453125%203.476562%20-0.257812%203.21875%20-0.125%20C%202.957031%200%202.648438%200.0625%202.296875%200.0625%20Z%20M%202.28125%20-0.75%20C%202.53125%20-0.75%202.722656%20-0.820312%202.859375%20-0.96875%20C%203.003906%20-1.113281%203.078125%20-1.316406%203.078125%20-1.578125%20C%203.078125%20-1.835938%203.003906%20-2.039062%202.859375%20-2.1875%20C%202.722656%20-2.332031%202.53125%20-2.40625%202.28125%20-2.40625%20C%202.113281%20-2.40625%201.96875%20-2.367188%201.84375%20-2.296875%20C%201.726562%20-2.234375%201.632812%20-2.140625%201.5625%20-2.015625%20C%201.5%20-1.890625%201.46875%20-1.742188%201.46875%20-1.578125%20C%201.46875%20-1.316406%201.539062%20-1.113281%201.6875%20-0.96875%20C%201.832031%20-0.820312%202.03125%20-0.75%202.28125%20-0.75%20Z%20M%202.28125%20-0.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(77.343314,%2024.219007)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(82.057484,%2024.219007)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(77.239735,%2033.590469)'%3e%3cg%3e%3cpath%20d='M%202.625%200.0625%20C%202.1875%200.0625%201.796875%20-0.0234375%201.453125%20-0.203125%20C%201.117188%20-0.390625%200.851562%20-0.664062%200.65625%20-1.03125%20C%200.46875%20-1.40625%200.375%20-1.863281%200.375%20-2.40625%20C%200.375%20-2.945312%200.46875%20-3.398438%200.65625%20-3.765625%20C%200.851562%20-4.140625%201.117188%20-4.414062%201.453125%20-4.59375%20C%201.796875%20-4.78125%202.1875%20-4.875%202.625%20-4.875%20C%203.09375%20-4.875%203.488281%20-4.78125%203.8125%20-4.59375%20C%204.132812%20-4.414062%204.363281%20-4.144531%204.5%20-3.78125%20L%203.796875%20-3.359375%20L%203.71875%20-3.359375%20C%203.613281%20-3.609375%203.472656%20-3.785156%203.296875%20-3.890625%20C%203.117188%20-4.003906%202.894531%20-4.0625%202.625%20-4.0625%20C%202.226562%20-4.0625%201.914062%20-3.925781%201.6875%20-3.65625%20C%201.46875%20-3.394531%201.359375%20-2.976562%201.359375%20-2.40625%20C%201.359375%20-1.832031%201.46875%20-1.410156%201.6875%20-1.140625%20C%201.914062%20-0.878906%202.226562%20-0.75%202.625%20-0.75%20C%203.25%20-0.75%203.632812%20-1.050781%203.78125%20-1.65625%20L%203.859375%20-1.65625%20L%204.5625%20-1.296875%20C%204.425781%20-0.835938%204.195312%20-0.492188%203.875%20-0.265625%20C%203.5625%20-0.046875%203.144531%200.0625%202.625%200.0625%20Z%20M%202.625%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(81.953905,%2033.590469)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(97.713335,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(102.207249,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(118.130283,%2014.501465)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(122.624198,%2014.501465)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(79.797647,%2014.201743)'%3e%3cg%3e%3cpath%20d='M%203.859375%20-4.8125%20L%203.859375%20-4.015625%20L%202.46875%20-4.015625%20L%202.46875%200%20L%201.515625%200%20L%201.515625%20-4.015625%20L%200.125%20-4.015625%20L%200.125%20-4.8125%20Z%20M%203.859375%20-4.8125%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(100.086779,%2023.949696)'%3e%3cg%3e%3cpath%20d='M%200.25%200%20L%200.25%20-0.78125%20L%201.40625%20-0.78125%20L%201.40625%20-3.78125%20L%201.34375%20-3.796875%20C%201.175781%20-3.710938%201.007812%20-3.648438%200.84375%20-3.609375%20C%200.6875%20-3.566406%200.507812%20-3.53125%200.3125%20-3.5%20L%200.3125%20-4.3125%20C%200.84375%20-4.425781%201.269531%20-4.59375%201.59375%20-4.8125%20L%202.359375%20-4.8125%20L%202.359375%20-0.78125%20L%203.390625%20-0.78125%20L%203.390625%200%20Z%20M%200.25%200%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(100.914058,%2033.988566)'%3e%3cg%3e%3cpath%20d='M%200.234375%20-0.375%20C%200.234375%20-0.644531%200.257812%20-0.867188%200.3125%20-1.046875%20C%200.375%20-1.234375%200.46875%20-1.398438%200.59375%20-1.546875%20C%200.726562%20-1.703125%200.914062%20-1.863281%201.15625%20-2.03125%20L%201.8125%20-2.5%20C%201.976562%20-2.625%202.109375%20-2.734375%202.203125%20-2.828125%20C%202.304688%20-2.921875%202.382812%20-3.015625%202.4375%20-3.109375%20C%202.488281%20-3.210938%202.515625%20-3.328125%202.515625%20-3.453125%20C%202.515625%20-3.648438%202.453125%20-3.800781%202.328125%20-3.90625%20C%202.210938%20-4.019531%202.035156%20-4.078125%201.796875%20-4.078125%20C%201.566406%20-4.078125%201.363281%20-4.019531%201.1875%20-3.90625%20C%201.007812%20-3.800781%200.863281%20-3.65625%200.75%20-3.46875%20L%200.6875%20-3.453125%20L%200.171875%20-4.03125%20C%200.335938%20-4.28125%200.554688%20-4.484375%200.828125%20-4.640625%20C%201.109375%20-4.796875%201.441406%20-4.875%201.828125%20-4.875%20C%202.191406%20-4.875%202.492188%20-4.8125%202.734375%20-4.6875%20C%202.972656%20-4.570312%203.148438%20-4.410156%203.265625%20-4.203125%20C%203.390625%20-4.003906%203.453125%20-3.773438%203.453125%20-3.515625%20C%203.453125%20-3.285156%203.40625%20-3.070312%203.3125%20-2.875%20C%203.21875%20-2.6875%203.082031%20-2.515625%202.90625%20-2.359375%20C%202.738281%20-2.203125%202.523438%20-2.03125%202.265625%20-1.84375%20L%201.703125%20-1.453125%20C%201.523438%20-1.328125%201.398438%20-1.21875%201.328125%20-1.125%20C%201.265625%20-1.03125%201.234375%20-0.921875%201.234375%20-0.796875%20L%203.40625%20-0.796875%20L%203.40625%200%20L%200.234375%200%20Z%20M%200.234375%20-0.375%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(120.169809,%2023.820908)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(121.023713,%2033.425191)'%3e%3cg%3e%3cpath%20d='M%203.265625%200%20L%202.359375%200%20L%202.359375%20-1.046875%20L%200.171875%20-1.046875%20L%200.171875%20-1.8125%20L%202.046875%20-4.8125%20L%203.265625%20-4.8125%20L%203.265625%20-1.8125%20L%204%20-1.8125%20L%204%20-1.046875%20L%203.265625%20-1.046875%20Z%20M%201.140625%20-1.875%20L%201.171875%20-1.8125%20L%202.359375%20-1.8125%20L%202.359375%20-3.671875%20L%202.28125%20-3.6875%20Z%20M%201.140625%20-1.875%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(140.594644,%2023.949696)'%3e%3cg%3e%3cpath%20d='M%202%200.0625%20C%201.519531%200.0625%201.140625%20-0.0351562%200.859375%20-0.234375%20C%200.578125%20-0.429688%200.394531%20-0.710938%200.3125%20-1.078125%20L%201.03125%20-1.390625%20L%201.109375%20-1.390625%20C%201.171875%20-1.171875%201.269531%20-1.007812%201.40625%20-0.90625%20C%201.550781%20-0.800781%201.75%20-0.75%202%20-0.75%20C%202.25%20-0.75%202.441406%20-0.816406%202.578125%20-0.953125%20C%202.710938%20-1.097656%202.78125%20-1.3125%202.78125%20-1.59375%20C%202.78125%20-1.875%202.710938%20-2.085938%202.578125%20-2.234375%20C%202.441406%20-2.378906%202.253906%20-2.453125%202.015625%20-2.453125%20C%201.835938%20-2.453125%201.6875%20-2.410156%201.5625%20-2.328125%20C%201.445312%20-2.253906%201.347656%20-2.144531%201.265625%20-2%20L%200.484375%20-2.046875%20L%200.578125%20-4.8125%20L%203.453125%20-4.8125%20L%203.453125%20-4.015625%20L%201.390625%20-4.015625%20L%201.34375%20-2.78125%20L%201.40625%20-2.765625%20C%201.519531%20-2.910156%201.65625%20-3.019531%201.8125%20-3.09375%20C%201.96875%20-3.175781%202.15625%20-3.21875%202.375%20-3.21875%20C%202.644531%20-3.21875%202.878906%20-3.15625%203.078125%20-3.03125%20C%203.285156%20-2.90625%203.445312%20-2.722656%203.5625%20-2.484375%20C%203.675781%20-2.242188%203.734375%20-1.953125%203.734375%20-1.609375%20C%203.734375%20-1.253906%203.664062%20-0.953125%203.53125%20-0.703125%20C%203.394531%20-0.453125%203.195312%20-0.257812%202.9375%20-0.125%20C%202.675781%200%202.363281%200.0625%202%200.0625%20Z%20M%202%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(141.109147,%2033.184927)'%3e%3cg%3e%3cpath%20d='M%202.296875%200.0625%20C%201.929688%200.0625%201.609375%20-0.0195312%201.328125%20-0.1875%20C%201.046875%20-0.351562%200.820312%20-0.613281%200.65625%20-0.96875%20C%200.488281%20-1.332031%200.40625%20-1.796875%200.40625%20-2.359375%20C%200.40625%20-2.929688%200.492188%20-3.40625%200.671875%20-3.78125%20C%200.847656%20-4.15625%201.085938%20-4.429688%201.390625%20-4.609375%20C%201.691406%20-4.785156%202.039062%20-4.875%202.4375%20-4.875%20C%202.757812%20-4.875%203.035156%20-4.828125%203.265625%20-4.734375%20C%203.503906%20-4.640625%203.691406%20-4.5%203.828125%20-4.3125%20L%203.359375%20-3.71875%20L%203.28125%20-3.71875%20C%203.070312%20-3.957031%202.789062%20-4.078125%202.4375%20-4.078125%20C%201.75%20-4.078125%201.394531%20-3.578125%201.375%20-2.578125%20L%201.453125%20-2.546875%20C%201.566406%20-2.753906%201.710938%20-2.910156%201.890625%20-3.015625%20C%202.078125%20-3.128906%202.304688%20-3.1875%202.578125%20-3.1875%20C%202.878906%20-3.1875%203.140625%20-3.125%203.359375%20-3%20C%203.578125%20-2.875%203.742188%20-2.691406%203.859375%20-2.453125%20C%203.972656%20-2.222656%204.03125%20-1.945312%204.03125%20-1.625%20C%204.03125%20-1.269531%203.957031%20-0.960938%203.8125%20-0.703125%20C%203.675781%20-0.453125%203.476562%20-0.257812%203.21875%20-0.125%20C%202.957031%200%202.648438%200.0625%202.296875%200.0625%20Z%20M%202.28125%20-0.75%20C%202.53125%20-0.75%202.722656%20-0.820312%202.859375%20-0.96875%20C%203.003906%20-1.113281%203.078125%20-1.316406%203.078125%20-1.578125%20C%203.078125%20-1.835938%203.003906%20-2.039062%202.859375%20-2.1875%20C%202.722656%20-2.332031%202.53125%20-2.40625%202.28125%20-2.40625%20C%202.113281%20-2.40625%201.96875%20-2.367188%201.84375%20-2.296875%20C%201.726562%20-2.234375%201.632812%20-2.140625%201.5625%20-2.015625%20C%201.5%20-1.890625%201.46875%20-1.742188%201.46875%20-1.578125%20C%201.46875%20-1.316406%201.539062%20-1.113281%201.6875%20-0.96875%20C%201.832031%20-0.820312%202.03125%20-0.75%202.28125%20-0.75%20Z%20M%202.28125%20-0.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(138.251285,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%200.625%200%20L%200.625%20-4.8125%20L%202.5625%20-4.8125%20C%203.050781%20-4.8125%203.421875%20-4.695312%203.671875%20-4.46875%20C%203.929688%20-4.238281%204.0625%20-3.921875%204.0625%20-3.515625%20C%204.0625%20-3.222656%203.984375%20-2.984375%203.828125%20-2.796875%20C%203.679688%20-2.609375%203.460938%20-2.46875%203.171875%20-2.375%20L%203.171875%20-2.296875%20C%203.328125%20-2.234375%203.453125%20-2.132812%203.546875%20-2%20C%203.640625%20-1.875%203.726562%20-1.6875%203.8125%20-1.4375%20L%204.28125%200%20L%203.3125%200%20L%202.84375%20-1.4375%20C%202.789062%20-1.582031%202.734375%20-1.691406%202.671875%20-1.765625%20C%202.617188%20-1.847656%202.546875%20-1.90625%202.453125%20-1.9375%20C%202.359375%20-1.976562%202.234375%20-2%202.078125%20-2%20L%201.578125%20-2%20L%201.578125%200%20Z%20M%202.4375%20-2.75%20C%202.894531%20-2.75%203.125%20-2.96875%203.125%20-3.40625%20C%203.125%20-3.832031%202.894531%20-4.046875%202.4375%20-4.046875%20L%201.578125%20-4.046875%20L%201.578125%20-2.75%20Z%20M%202.4375%20-2.75%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cg%20fill='%23000000'%20fill-opacity='1'%3e%3cg%20transform='translate(142.7452,%2014.495807)'%3e%3cg%3e%3cpath%20d='M%201.953125%200.0625%20C%201.441406%200.0625%201.035156%20-0.0390625%200.734375%20-0.25%20C%200.429688%20-0.46875%200.238281%20-0.78125%200.15625%20-1.1875%20L%200.875%20-1.515625%20L%200.953125%20-1.5%20C%201.035156%20-1.238281%201.148438%20-1.046875%201.296875%20-0.921875%20C%201.453125%20-0.804688%201.660156%20-0.75%201.921875%20-0.75%20C%202.179688%20-0.75%202.378906%20-0.804688%202.515625%20-0.921875%20C%202.648438%20-1.046875%202.71875%20-1.222656%202.71875%20-1.453125%20C%202.71875%20-1.671875%202.648438%20-1.84375%202.515625%20-1.96875%20C%202.378906%20-2.09375%202.179688%20-2.15625%201.921875%20-2.15625%20L%201.203125%20-2.15625%20L%201.203125%20-2.890625%20L%201.828125%20-2.890625%20C%202.046875%20-2.890625%202.21875%20-2.941406%202.34375%20-3.046875%20C%202.46875%20-3.160156%202.53125%20-3.316406%202.53125%20-3.515625%20C%202.53125%20-3.710938%202.472656%20-3.859375%202.359375%20-3.953125%20C%202.242188%20-4.054688%202.078125%20-4.109375%201.859375%20-4.109375%20C%201.648438%20-4.109375%201.460938%20-4.054688%201.296875%20-3.953125%20C%201.128906%20-3.847656%200.992188%20-3.710938%200.890625%20-3.546875%20L%200.8125%20-3.53125%20L%200.3125%20-4.109375%20C%200.488281%20-4.335938%200.707031%20-4.519531%200.96875%20-4.65625%20C%201.238281%20-4.800781%201.554688%20-4.875%201.921875%20-4.875%20C%202.421875%20-4.875%202.800781%20-4.769531%203.0625%20-4.5625%20C%203.332031%20-4.351562%203.46875%20-4.054688%203.46875%20-3.671875%20C%203.46875%20-3.441406%203.410156%20-3.242188%203.296875%20-3.078125%20C%203.191406%20-2.921875%203.039062%20-2.78125%202.84375%20-2.65625%20L%202.84375%20-2.59375%20C%203.394531%20-2.394531%203.671875%20-2%203.671875%20-1.40625%20C%203.671875%20-1.101562%203.609375%20-0.84375%203.484375%20-0.625%20C%203.359375%20-0.40625%203.164062%20-0.234375%202.90625%20-0.109375%20C%202.65625%200.00390625%202.335938%200.0625%201.953125%200.0625%20Z%20M%201.953125%200.0625%20'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
const _hoisted_1$1i = {
  class: "tpd",
  "data-testid": "transform-picker-drawer"
};
const _hoisted_2$12 = { class: "tpd-search" };
const _hoisted_3$W = {
  class: "tpd-count",
  "data-testid": "transform-picker-count"
};
const _hoisted_4$J = { class: "tpd-cats" };
const _hoisted_5$E = ["data-testid", "onClick"];
const _hoisted_6$y = { class: "tpd-images" };
const _hoisted_7$t = { class: "tpd-switch" };
const _hoisted_8$m = { class: "tpd-grid" };
const _hoisted_9$l = ["data-testid", "onClick"];
const _hoisted_10$h = ["src", "alt"];
const _hoisted_11$f = { class: "tpd-name" };
const _hoisted_12$e = { class: "tpd-desc" };
const _hoisted_13$e = {
  key: 1,
  class: "tpd-tags"
};
const _hoisted_14$e = {
  key: 0,
  class: "tpd-empty"
};
const _sfc_main$1n = /* @__PURE__ */ defineComponent({
  __name: "TransformationPickerDrawer",
  props: {
    open: { type: Boolean }
  },
  emits: ["update:open", "add"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const { resolved } = useTheme();
    const query = ref("");
    const category = ref("all");
    const showImages = ref(true);
    const categories = computed(() => {
      return Object.keys(TRANSFORMER_CATEGORY_LABELS).map((k) => ({
        id: k,
        label: TRANSFORMER_CATEGORY_LABELS[k]
      }));
    });
    const all = computed(() => filterTransformers({ category: "all" }));
    const filtered = computed(
      () => filterTransformers({ query: query.value, category: category.value })
    );
    const IMAGE_ALIAS = {
      organize: "organize",
      filterByValue: "filterByValue",
      filterFieldsByName: "filterFieldsByName",
      filterByRefId: "filterByRefId",
      calculateField: "calculateField",
      groupBy: "groupBy",
      joinByField: "joinByField",
      extractFields: "extractFields",
      convertFieldType: "convertFieldType",
      partitionByValues: "partitionByValues",
      reduce: "reduce",
      sortBy: "sortBy",
      limit: "limit",
      histogram: "histogram",
      heatmap: "heatmap",
      merge: "merge",
      concatenate: "concatenate",
      seriesToRows: "seriesToRows",
      labelsToFields: "labelsToFields",
      prepareTimeSeries: "prepareTimeSeries",
      renameByRegex: "renameByRegex",
      groupToNestedTable: "groupToNestedTable",
      groupingToMatrix: "groupingToMatrix",
      joinByLabels: "joinByLabels",
      rowsToFields: "rowsToFields",
      configFromData: "configFromData",
      fieldLookup: "fieldLookup",
      formatTime: "formatTime",
      formatString: "formatString",
      spatial: "spatial"
    };
    function illustrationUrl(t2) {
      const theme = resolved.value === "light" ? "light" : "dark";
      const base = t2.image || IMAGE_ALIAS[t2.id] || t2.id;
      try {
        return new URL((/* @__PURE__ */ Object.assign({ "./images/dark/calculateField.svg": __vite_glob_0_0, "./images/dark/concatenate.svg": __vite_glob_0_1, "./images/dark/configFromData.svg": __vite_glob_0_2, "./images/dark/convertFieldType.svg": __vite_glob_0_3, "./images/dark/extractFields.svg": __vite_glob_0_4, "./images/dark/fieldLookup.svg": __vite_glob_0_5, "./images/dark/filterByRefId.svg": __vite_glob_0_6, "./images/dark/filterByValue.svg": __vite_glob_0_7, "./images/dark/filterFieldsByName.svg": __vite_glob_0_8, "./images/dark/formatString.svg": __vite_glob_0_9, "./images/dark/formatTime.svg": __vite_glob_0_10, "./images/dark/groupBy.svg": __vite_glob_0_11, "./images/dark/groupByCalculation.svg": __vite_glob_0_12, "./images/dark/groupToNestedTable.svg": __vite_glob_0_13, "./images/dark/groupingToMatrix.svg": __vite_glob_0_14, "./images/dark/heatmap.svg": __vite_glob_0_15, "./images/dark/histogram.svg": __vite_glob_0_16, "./images/dark/joinByField.svg": __vite_glob_0_17, "./images/dark/joinByLabels.svg": __vite_glob_0_18, "./images/dark/labelsToFields.svg": __vite_glob_0_19, "./images/dark/limit.svg": __vite_glob_0_20, "./images/dark/merge.svg": __vite_glob_0_21, "./images/dark/organize.svg": __vite_glob_0_22, "./images/dark/partitionByValues.svg": __vite_glob_0_23, "./images/dark/prepareTimeSeries.svg": __vite_glob_0_24, "./images/dark/reduce.svg": __vite_glob_0_25, "./images/dark/regression.svg": __vite_glob_0_26, "./images/dark/renameByRegex.svg": __vite_glob_0_27, "./images/dark/rowsToFields.svg": __vite_glob_0_28, "./images/dark/seriesToRows.svg": __vite_glob_0_29, "./images/dark/smoothing.svg": __vite_glob_0_30, "./images/dark/sortBy.svg": __vite_glob_0_31, "./images/dark/spatial.svg": __vite_glob_0_32, "./images/dark/timeSeriesTable.svg": __vite_glob_0_33, "./images/dark/transpose.svg": __vite_glob_0_34, "./images/light/calculateField.svg": __vite_glob_0_35, "./images/light/concatenate.svg": __vite_glob_0_36, "./images/light/configFromData.svg": __vite_glob_0_37, "./images/light/convertFieldType.svg": __vite_glob_0_38, "./images/light/extractFields.svg": __vite_glob_0_39, "./images/light/fieldLookup.svg": __vite_glob_0_40, "./images/light/filterByRefId.svg": __vite_glob_0_41, "./images/light/filterByValue.svg": __vite_glob_0_42, "./images/light/filterFieldsByName.svg": __vite_glob_0_43, "./images/light/formatString.svg": __vite_glob_0_44, "./images/light/formatTime.svg": __vite_glob_0_45, "./images/light/groupBy.svg": __vite_glob_0_46, "./images/light/groupByCalculation.svg": __vite_glob_0_47, "./images/light/groupToNestedTable.svg": __vite_glob_0_48, "./images/light/groupingToMatrix.svg": __vite_glob_0_49, "./images/light/heatmap.svg": __vite_glob_0_50, "./images/light/histogram.svg": __vite_glob_0_51, "./images/light/joinByField.svg": __vite_glob_0_52, "./images/light/joinByLabels.svg": __vite_glob_0_53, "./images/light/labelsToFields.svg": __vite_glob_0_54, "./images/light/limit.svg": __vite_glob_0_55, "./images/light/merge.svg": __vite_glob_0_56, "./images/light/organize.svg": __vite_glob_0_57, "./images/light/partitionByValues.svg": __vite_glob_0_58, "./images/light/prepareTimeSeries.svg": __vite_glob_0_59, "./images/light/reduce.svg": __vite_glob_0_60, "./images/light/regression.svg": __vite_glob_0_61, "./images/light/renameByRegex.svg": __vite_glob_0_62, "./images/light/rowsToFields.svg": __vite_glob_0_63, "./images/light/seriesToRows.svg": __vite_glob_0_64, "./images/light/smoothing.svg": __vite_glob_0_65, "./images/light/sortBy.svg": __vite_glob_0_66, "./images/light/spatial.svg": __vite_glob_0_67, "./images/light/timeSeriesTable.svg": __vite_glob_0_68, "./images/light/transpose.svg": __vite_glob_0_69 }))[`./images/${theme}/${base}.svg`], import.meta.url).href;
      } catch {
        return "";
      }
    }
    function onPick(t2) {
      emit("add", t2.id);
      emit("update:open", false);
      query.value = "";
    }
    watch(
      () => props.open,
      (v) => {
        if (v) {
          query.value = "";
          category.value = "all";
        }
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(_sfc_main$4s), {
        open: __props.open,
        title: "添加转换",
        width: "600px",
        "onUpdate:open": _cache[3] || (_cache[3] = ($event) => emit("update:open", $event))
      }, {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1$1i, [
            createElementVNode("div", _hoisted_2$12, [
              createVNode(unref(GInput), {
                modelValue: query.value,
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => query.value = $event),
                placeholder: "搜索名称 / 描述 / 标签…",
                "test-id": "transform-picker-search"
              }, null, 8, ["modelValue"]),
              createElementVNode(
                "span",
                _hoisted_3$W,
                toDisplayString(filtered.value.length) + " / " + toDisplayString(all.value.length),
                1
                /* TEXT */
              )
            ]),
            createElementVNode("div", _hoisted_4$J, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(categories.value, (c) => {
                  return openBlock(), createElementBlock("button", {
                    key: c.id,
                    type: "button",
                    class: normalizeClass(["tpd-cat", { active: category.value === c.id }]),
                    "data-testid": `transform-cat-${c.id}`,
                    onClick: ($event) => category.value = c.id
                  }, toDisplayString(c.label), 11, _hoisted_5$E);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ]),
            createElementVNode("div", _hoisted_6$y, [
              createElementVNode("label", _hoisted_7$t, [
                createVNode(unref(_sfc_main$4v), {
                  checked: showImages.value,
                  "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => showImages.value = $event)
                }, null, 8, ["checked"]),
                _cache[4] || (_cache[4] = createTextVNode(
                  " 显示插图",
                  -1
                  /* CACHED */
                ))
              ])
            ]),
            createElementVNode("div", _hoisted_8$m, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(filtered.value, (t2) => {
                  return openBlock(), createElementBlock("button", {
                    key: t2.id,
                    type: "button",
                    class: "tpd-card",
                    "data-testid": `transform-pick-${t2.id}`,
                    onClick: ($event) => onPick(t2)
                  }, [
                    showImages.value ? (openBlock(), createElementBlock("img", {
                      key: 0,
                      class: "tpd-illu",
                      src: illustrationUrl(t2),
                      alt: t2.name,
                      loading: "lazy",
                      onError: _cache[2] || (_cache[2] = ($event) => $event.target.style.display = "none")
                    }, null, 40, _hoisted_10$h)) : createCommentVNode("v-if", true),
                    createElementVNode(
                      "div",
                      _hoisted_11$f,
                      toDisplayString(t2.name),
                      1
                      /* TEXT */
                    ),
                    createElementVNode(
                      "div",
                      _hoisted_12$e,
                      toDisplayString(t2.description),
                      1
                      /* TEXT */
                    ),
                    t2.tags?.length ? (openBlock(), createElementBlock("div", _hoisted_13$e, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(t2.tags.slice(0, 4), (tag) => {
                          return openBlock(), createElementBlock(
                            "span",
                            { key: tag },
                            toDisplayString(tag),
                            1
                            /* TEXT */
                          );
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ])) : createCommentVNode("v-if", true)
                  ], 8, _hoisted_9$l);
                }),
                128
                /* KEYED_FRAGMENT */
              )),
              !filtered.value.length ? (openBlock(), createElementBlock("div", _hoisted_14$e, "无匹配的转换")) : createCommentVNode("v-if", true)
            ])
          ])
        ]),
        _: 1
        /* STABLE */
      }, 8, ["open"]);
    };
  }
});
const TransformationPickerDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$1n, [["__scopeId", "data-v-ca536e4a"]]);
const _hoisted_1$1h = {
  class: "section",
  "data-testid": "transform-section"
};
const _hoisted_2$11 = {
  key: 0,
  class: "empty",
  "data-testid": "transform-empty"
};
const _hoisted_3$V = { class: "transform-toolbar" };
const _hoisted_4$I = ["data-testid", "data-transform-id", "onDragstart", "onDrop"];
const _hoisted_5$D = { class: "id" };
const _hoisted_6$x = { class: "card-actions" };
const _hoisted_7$s = ["data-testid"];
const _hoisted_8$l = ["data-testid"];
const _hoisted_9$k = ["data-testid"];
const _hoisted_10$g = {
  class: "debug-col",
  "data-testid": "transform-debug-input"
};
const _hoisted_11$e = {
  key: 0,
  class: "debug-empty"
};
const _hoisted_12$d = { class: "debug-frame-name" };
const _hoisted_13$d = { key: 0 };
const _hoisted_14$d = {
  class: "debug-col",
  "data-testid": "transform-debug-output"
};
const _hoisted_15$b = {
  key: 0,
  class: "debug-note"
};
const _hoisted_16$a = {
  key: 1,
  class: "debug-empty"
};
const _hoisted_17$8 = { class: "debug-frame-name" };
const _hoisted_18$8 = { key: 0 };
const _sfc_main$1m = /* @__PURE__ */ defineComponent({
  __name: "TransformEditorTab",
  props: {
    transforms: {},
    transformerIds: {},
    refIds: {},
    frames: {}
  },
  emits: ["add", "update", "remove", "toggle", "move", "clear"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const drawerOpen = ref(false);
    const confirmClear = ref(false);
    const expandedFilter = ref({});
    const expandedDebug = ref({});
    const expandedHelp = ref({});
    const dragFrom = ref(null);
    function toggleFilter(i) {
      expandedFilter.value = {
        ...expandedFilter.value,
        [i]: !expandedFilter.value[i]
      };
    }
    function toggleDebug(i) {
      expandedDebug.value = {
        ...expandedDebug.value,
        [i]: !expandedDebug.value[i]
      };
    }
    function toggleHelp(i) {
      expandedHelp.value = { ...expandedHelp.value, [i]: !expandedHelp.value[i] };
    }
    const isEmpty = computed(() => !props.transforms.length);
    const refIdOptions = computed(() => {
      const ids = props.refIds?.length ? props.refIds : ["A", "B", "C"];
      return [
        { value: "", label: "全部查询" },
        ...ids.map((id) => ({ value: id, label: id }))
      ];
    });
    function onAdd(id) {
      if (id) emit("add", id);
    }
    function editorFor(id) {
      return loadTransformEditor(id);
    }
    function fieldsFor(id) {
      return getTransformerMeta(id)?.fields ?? [];
    }
    function helpFor(id) {
      const m = getTransformerMeta(id);
      return m?.help || m?.description || "";
    }
    function setOptionPath2(i, t2, path, value) {
      const next = { ...t2.options || {} };
      const parts = path.split(".");
      if (parts.length === 1) {
        next[path] = value;
      } else {
        let cur = next;
        for (let k = 0; k < parts.length - 1; k++) {
          const key = parts[k];
          if (/^\d+$/.test(parts[k + 1] ?? "")) {
            if (!Array.isArray(cur[key]))
              cur[key] = Array.isArray(cur[key]) ? [...cur[key]] : [];
          } else {
            cur[key] = cur[key] && typeof cur[key] === "object" ? { ...cur[key] } : {};
          }
          cur = cur[key];
        }
        const last = parts[parts.length - 1];
        if (/^\d+$/.test(last) && Array.isArray(cur)) {
          cur[Number(last)] = value;
        } else {
          cur[last] = value;
        }
      }
      emit("update", i, { options: next });
    }
    function setFilterRefId(i, _t, refId) {
      const v = String(refId ?? "");
      if (!v) {
        emit("update", i, { filter: void 0 });
        return;
      }
      emit("update", i, { filter: { id: "byRefId", options: { value: v } } });
    }
    function setTopic(i, topic) {
      const v = String(topic ?? "");
      emit("update", i, {
        topic: v === "annotations" ? "annotations" : v === "series" ? "series" : void 0
      });
    }
    function currentFilterRef(t2) {
      const f = t2.filter;
      if (!f || f.id !== "byRefId") return "";
      const opts = f.options || {};
      return String(opts.value ?? opts.refId ?? "");
    }
    function maxRows(frame) {
      let m = 0;
      for (const f of frame.fields || [])
        m = Math.max(m, Array.isArray(f.values) ? f.values.length : 0);
      return m;
    }
    function cell(f, ri) {
      const v = Array.isArray(f.values) ? f.values[ri] : void 0;
      if (v == null) return "";
      return String(v);
    }
    function asDataFrames(raw) {
      if (!raw?.length) return [];
      return raw.map((f, idx) => {
        if (f?.fields && typeof f.length === "number") {
          return createDataFrame({
            name: f.name,
            refId: f.refId,
            fields: (f.fields || []).map((field) => ({
              name: field.name || "field",
              type: field.type || "other",
              values: Array.isArray(field.values) ? [...field.values] : [],
              config: field.config ? { ...field.config } : {}
            }))
          });
        }
        return createDataFrame({
          name: f?.name || `Frame ${idx}`,
          fields: (f?.fields || []).map((field) => ({
            name: field.name || "field",
            type: field.type || "other",
            values: Array.isArray(field.values) ? [...field.values] : []
          }))
        });
      });
    }
    function toDebugFrames(frames) {
      return frames.map((f, i) => ({
        name: f.name || `Frame ${i}`,
        fields: (f.fields || []).map((field) => ({
          name: field.name,
          type: String(field.type ?? "other"),
          values: Array.isArray(field.values) ? field.values : []
        }))
      }));
    }
    function stepConfigs(endExclusive) {
      return props.transforms.slice(0, Math.max(0, endExclusive)).map((t2) => ({
        id: t2.id,
        options: t2.options || {},
        disabled: !!t2.disabled,
        filter: t2.filter
      }));
    }
    function debugInputFrames(stepIndex) {
      const base = asDataFrames(props.frames);
      if (!base.length) return [];
      if (stepIndex <= 0) return toDebugFrames(base);
      try {
        return toDebugFrames(applyTransformations(base, stepConfigs(stepIndex)));
      } catch {
        return toDebugFrames(base);
      }
    }
    function debugOutputFrames(stepIndex) {
      const base = asDataFrames(props.frames);
      if (!base.length) return [];
      const t2 = props.transforms[stepIndex];
      if (t2?.disabled) return debugInputFrames(stepIndex);
      try {
        return toDebugFrames(
          applyTransformations(base, stepConfigs(stepIndex + 1))
        );
      } catch {
        return debugInputFrames(stepIndex);
      }
    }
    function onDragStart(i, e) {
      dragFrom.value = i;
      e.dataTransfer?.setData("text/plain", String(i));
      if (e.dataTransfer) e.dataTransfer.effectAllowed = "move";
    }
    function onDrop(i, e) {
      e.preventDefault();
      const from = dragFrom.value;
      dragFrom.value = null;
      if (from == null || from === i) return;
      const dir = from < i ? 1 : -1;
      let cur = from;
      while (cur !== i) {
        emit("move", cur, dir);
        cur += dir;
      }
    }
    function onDragOver(e) {
      e.preventDefault();
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("section", _hoisted_1$1h, [
        isEmpty.value ? (openBlock(), createElementBlock("div", _hoisted_2$11, [
          _cache[7] || (_cache[7] = createElementVNode(
            "p",
            null,
            " 尚未应用转换。转换可在可视化前重塑查询结果（过滤、计算、整理字段等）。 ",
            -1
            /* CACHED */
          )),
          createVNode(unref(GButton), {
            variant: "primary",
            "test-id": "transform-add-empty",
            onClick: _cache[0] || (_cache[0] = ($event) => drawerOpen.value = true)
          }, {
            default: withCtx(() => [..._cache[6] || (_cache[6] = [
              createTextVNode(
                "添加转换",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ])) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createElementVNode("div", _hoisted_3$V, [
              createVNode(unref(GButton), {
                variant: "primary",
                "test-id": "transform-add",
                onClick: _cache[1] || (_cache[1] = ($event) => drawerOpen.value = true)
              }, {
                default: withCtx(() => [..._cache[8] || (_cache[8] = [
                  createTextVNode(
                    "添加转换",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }),
              createVNode(unref(GButton), {
                variant: "destructive",
                "test-id": "transform-clear-all",
                onClick: _cache[2] || (_cache[2] = ($event) => confirmClear.value = true)
              }, {
                default: withCtx(() => [..._cache[9] || (_cache[9] = [
                  createTextVNode(
                    "删除全部",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              })
            ]),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.transforms, (t2, i) => {
                return openBlock(), createElementBlock("div", {
                  key: i,
                  class: normalizeClass(["transform-card field-config-block", { disabled: t2.disabled }]),
                  "data-testid": `transform-${i}`,
                  "data-transform-id": t2.id,
                  draggable: "true",
                  onDragstart: ($event) => onDragStart(i, $event),
                  onDragover: onDragOver,
                  onDrop: ($event) => onDrop(i, $event)
                }, [
                  createElementVNode("header", null, [
                    _cache[16] || (_cache[16] = createElementVNode(
                      "span",
                      {
                        class: "drag",
                        title: "拖拽排序"
                      },
                      "⠿",
                      -1
                      /* CACHED */
                    )),
                    createElementVNode("strong", null, [
                      createTextVNode(
                        toDisplayString(i + 1) + ". " + toDisplayString(unref(transformLabel)(t2.id)) + " ",
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "span",
                        _hoisted_5$D,
                        "(" + toDisplayString(t2.id) + ")",
                        1
                        /* TEXT */
                      )
                    ]),
                    createElementVNode("div", _hoisted_6$x, [
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": `transform-filter-${i}`,
                        onClick: ($event) => toggleFilter(i),
                        title: "过滤"
                      }, {
                        default: withCtx(() => [..._cache[10] || (_cache[10] = [
                          createTextVNode(
                            "漏斗",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["test-id", "onClick"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": `transform-debug-${i}`,
                        onClick: ($event) => toggleDebug(i),
                        title: "调试"
                      }, {
                        default: withCtx(() => [..._cache[11] || (_cache[11] = [
                          createTextVNode(
                            "调试",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["test-id", "onClick"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": `transform-help-${i}`,
                        onClick: ($event) => toggleHelp(i),
                        title: "帮助"
                      }, {
                        default: withCtx(() => [..._cache[12] || (_cache[12] = [
                          createTextVNode(
                            "?",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["test-id", "onClick"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": "transform-move-up",
                        disabled: i === 0,
                        onClick: ($event) => emit("move", i, -1)
                      }, {
                        default: withCtx(() => [..._cache[13] || (_cache[13] = [
                          createTextVNode(
                            "上移",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["disabled", "onClick"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": "transform-move-down",
                        disabled: i === __props.transforms.length - 1,
                        onClick: ($event) => emit("move", i, 1)
                      }, {
                        default: withCtx(() => [..._cache[14] || (_cache[14] = [
                          createTextVNode(
                            "下移",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["disabled", "onClick"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": `transform-toggle-${i}`,
                        onClick: ($event) => emit("toggle", i)
                      }, {
                        default: withCtx(() => [
                          createTextVNode(
                            toDisplayString(t2.disabled ? "启用" : "禁用"),
                            1
                            /* TEXT */
                          )
                        ]),
                        _: 2
                        /* DYNAMIC */
                      }, 1032, ["test-id", "onClick"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        variant: "destructive",
                        onClick: ($event) => emit("remove", i)
                      }, {
                        default: withCtx(() => [..._cache[15] || (_cache[15] = [
                          createTextVNode(
                            "删除",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["onClick"])
                    ])
                  ]),
                  expandedFilter.value[i] ? (openBlock(), createElementBlock("div", {
                    key: 0,
                    class: "filter-row",
                    "data-testid": `transform-filter-row-${i}`
                  }, [
                    createElementVNode("label", null, [
                      _cache[17] || (_cache[17] = createTextVNode(
                        " 应用于查询 ",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(GSelect), {
                        value: currentFilterRef(t2),
                        options: refIdOptions.value,
                        onChange: (v) => setFilterRefId(i, t2, v)
                      }, null, 8, ["value", "options", "onChange"])
                    ]),
                    createElementVNode("label", null, [
                      _cache[18] || (_cache[18] = createTextVNode(
                        " 主题 ",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(GSelect), {
                        value: t2.topic || "series",
                        options: [
                          { value: "series", label: "series" },
                          { value: "annotations", label: "annotations" }
                        ],
                        onChange: (v) => setTopic(i, v)
                      }, null, 8, ["value", "onChange"])
                    ])
                  ], 8, _hoisted_7$s)) : createCommentVNode("v-if", true),
                  expandedHelp.value[i] ? (openBlock(), createElementBlock("div", {
                    key: 1,
                    class: "help",
                    "data-testid": `transform-help-body-${i}`
                  }, toDisplayString(helpFor(t2.id)), 9, _hoisted_8$l)) : createCommentVNode("v-if", true),
                  expandedDebug.value[i] ? (openBlock(), createElementBlock("div", {
                    key: 2,
                    class: "debug",
                    "data-testid": `transform-debug-body-${i}`
                  }, [
                    createElementVNode("div", _hoisted_10$g, [
                      _cache[19] || (_cache[19] = createElementVNode(
                        "h4",
                        null,
                        "输入帧",
                        -1
                        /* CACHED */
                      )),
                      !debugInputFrames(i).length ? (openBlock(), createElementBlock("div", _hoisted_11$e, " 无预览数据 ")) : createCommentVNode("v-if", true),
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(debugInputFrames(i), (frame, fi) => {
                          return openBlock(), createElementBlock("div", {
                            key: "in-" + fi,
                            class: "debug-frame",
                            "data-testid": "transform-debug-input-frame"
                          }, [
                            createElementVNode(
                              "div",
                              _hoisted_12$d,
                              toDisplayString(frame.name || "Frame " + fi) + " (" + toDisplayString((frame.fields || []).length) + " fields) ",
                              1
                              /* TEXT */
                            ),
                            frame.fields?.length ? (openBlock(), createElementBlock("table", _hoisted_13$d, [
                              createElementVNode("thead", null, [
                                createElementVNode("tr", null, [
                                  (openBlock(true), createElementBlock(
                                    Fragment,
                                    null,
                                    renderList(frame.fields, (f) => {
                                      return openBlock(), createElementBlock("th", {
                                        key: f.name
                                      }, [
                                        createTextVNode(
                                          toDisplayString(f.name) + " ",
                                          1
                                          /* TEXT */
                                        ),
                                        createElementVNode(
                                          "small",
                                          null,
                                          toDisplayString(f.type),
                                          1
                                          /* TEXT */
                                        )
                                      ]);
                                    }),
                                    128
                                    /* KEYED_FRAGMENT */
                                  ))
                                ])
                              ]),
                              createElementVNode("tbody", null, [
                                (openBlock(true), createElementBlock(
                                  Fragment,
                                  null,
                                  renderList(Math.min(5, maxRows(frame)), (ri) => {
                                    return openBlock(), createElementBlock("tr", { key: ri }, [
                                      (openBlock(true), createElementBlock(
                                        Fragment,
                                        null,
                                        renderList(frame.fields, (f) => {
                                          return openBlock(), createElementBlock(
                                            "td",
                                            {
                                              key: (f.name || "") + "-" + ri
                                            },
                                            toDisplayString(cell(f, ri)),
                                            1
                                            /* TEXT */
                                          );
                                        }),
                                        128
                                        /* KEYED_FRAGMENT */
                                      ))
                                    ]);
                                  }),
                                  128
                                  /* KEYED_FRAGMENT */
                                ))
                              ])
                            ])) : createCommentVNode("v-if", true)
                          ]);
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ]),
                    createElementVNode("div", _hoisted_14$d, [
                      _cache[20] || (_cache[20] = createElementVNode(
                        "h4",
                        null,
                        "输出帧",
                        -1
                        /* CACHED */
                      )),
                      t2.disabled ? (openBlock(), createElementBlock("p", _hoisted_15$b, "已禁用 — 透传输入")) : createCommentVNode("v-if", true),
                      !debugOutputFrames(i).length ? (openBlock(), createElementBlock("div", _hoisted_16$a, " 无输出帧 ")) : createCommentVNode("v-if", true),
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(debugOutputFrames(i), (frame, fi) => {
                          return openBlock(), createElementBlock("div", {
                            key: "out-" + fi,
                            class: "debug-frame",
                            "data-testid": "transform-debug-output-frame"
                          }, [
                            createElementVNode(
                              "div",
                              _hoisted_17$8,
                              toDisplayString(frame.name || "Frame " + fi) + " (" + toDisplayString((frame.fields || []).length) + " fields) ",
                              1
                              /* TEXT */
                            ),
                            frame.fields?.length ? (openBlock(), createElementBlock("table", _hoisted_18$8, [
                              createElementVNode("thead", null, [
                                createElementVNode("tr", null, [
                                  (openBlock(true), createElementBlock(
                                    Fragment,
                                    null,
                                    renderList(frame.fields, (f) => {
                                      return openBlock(), createElementBlock("th", {
                                        key: f.name
                                      }, [
                                        createTextVNode(
                                          toDisplayString(f.name) + " ",
                                          1
                                          /* TEXT */
                                        ),
                                        createElementVNode(
                                          "small",
                                          null,
                                          toDisplayString(f.type),
                                          1
                                          /* TEXT */
                                        )
                                      ]);
                                    }),
                                    128
                                    /* KEYED_FRAGMENT */
                                  ))
                                ])
                              ]),
                              createElementVNode("tbody", null, [
                                (openBlock(true), createElementBlock(
                                  Fragment,
                                  null,
                                  renderList(Math.min(5, maxRows(frame)), (ri) => {
                                    return openBlock(), createElementBlock("tr", { key: ri }, [
                                      (openBlock(true), createElementBlock(
                                        Fragment,
                                        null,
                                        renderList(frame.fields, (f) => {
                                          return openBlock(), createElementBlock(
                                            "td",
                                            {
                                              key: (f.name || "") + "-" + ri
                                            },
                                            toDisplayString(cell(f, ri)),
                                            1
                                            /* TEXT */
                                          );
                                        }),
                                        128
                                        /* KEYED_FRAGMENT */
                                      ))
                                    ]);
                                  }),
                                  128
                                  /* KEYED_FRAGMENT */
                                ))
                              ])
                            ])) : createCommentVNode("v-if", true)
                          ]);
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ])
                  ], 8, _hoisted_9$k)) : createCommentVNode("v-if", true),
                  withDirectives((openBlock(), createBlock(resolveDynamicComponent(editorFor(t2.id)), {
                    options: t2.options || {},
                    fields: fieldsFor(t2.id),
                    "transform-id": t2.id,
                    onChange: (path, value) => setOptionPath2(i, t2, path, value)
                  }, null, 40, ["options", "fields", "transform-id", "onChange"])), [
                    [vShow, !t2.disabled]
                  ])
                ], 42, _hoisted_4$I);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ],
          64
          /* STABLE_FRAGMENT */
        )),
        createVNode(TransformationPickerDrawer, {
          open: drawerOpen.value,
          "onUpdate:open": _cache[3] || (_cache[3] = ($event) => drawerOpen.value = $event),
          onAdd
        }, null, 8, ["open"]),
        createVNode(unref(GConfirmModal), {
          open: confirmClear.value,
          "onUpdate:open": _cache[4] || (_cache[4] = ($event) => confirmClear.value = $event),
          title: "删除全部转换",
          body: "确定删除此面板上的全部转换？此操作不可撤销。",
          "confirm-text": "删除全部",
          danger: "",
          onConfirm: _cache[5] || (_cache[5] = ($event) => emit("clear"))
        }, null, 8, ["open"])
      ]);
    };
  }
});
const TransformEditorTab = /* @__PURE__ */ _export_sfc(_sfc_main$1m, [["__scopeId", "data-v-b315bb25"]]);
const _hoisted_1$1g = {
  "data-testid": "field-config-editor",
  class: "field-config-editor"
};
const _hoisted_2$10 = ["data-testid"];
const _hoisted_3$U = { key: 0 };
const _hoisted_4$H = { key: 1 };
const _hoisted_5$C = {
  class: "override-props",
  "data-testid": "override-props"
};
const _hoisted_6$w = ["data-testid", "data-prop-id", "data-prop-editor"];
const _sfc_main$1l = /* @__PURE__ */ defineComponent({
  __name: "FieldOverridesEditor",
  props: {
    overrides: {}
  },
  emits: ["add", "remove", "update-matcher", "add-prop", "remove-prop", "set-prop-id", "set-prop-value", "set-prop-value-typed"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const __ovId = /* @__PURE__ */ new WeakMap();
    let __ovSeq = 0;
    function keyOf(obj) {
      if (obj && typeof obj === "object") {
        let id = __ovId.get(obj);
        if (id == null) {
          id = ++__ovSeq;
          __ovId.set(obj, id);
        }
        return id;
      }
      return -1;
    }
    const matcherOptions = computed(
      () => listOverridePickerMatchers().map((m) => ({ value: m.id, label: m.name }))
    );
    const GRAPH_CUSTOM_PROPS = [
      { value: "custom.drawStyle", label: "绘制样式" },
      { value: "custom.lineInterpolation", label: "线插值" },
      { value: "custom.lineWidth", label: "线宽" },
      { value: "custom.fillOpacity", label: "填充透明度" },
      { value: "custom.gradientMode", label: "渐变模式" },
      { value: "custom.spanNulls", label: "跨越空值" },
      { value: "custom.insertNulls", label: "插入空值" },
      { value: "custom.showPoints", label: "显示点" },
      { value: "custom.pointSize", label: "点大小" },
      { value: "custom.stacking", label: "堆叠" },
      { value: "custom.axisPlacement", label: "轴位置" },
      { value: "custom.axisLabel", label: "轴标签" },
      { value: "custom.axisSoftMin", label: "软最小值" },
      { value: "custom.axisSoftMax", label: "软最大值" },
      { value: "custom.scaleDistribution", label: "刻度分布" },
      { value: "custom.hideFrom", label: "隐藏" },
      { value: "custom.thresholdsStyle", label: "阈值样式" },
      { value: "custom.barAlignment", label: "柱对齐" },
      { value: "custom.barWidthFactor", label: "柱宽系数" },
      { value: "custom.lineStyle", label: "线型" }
    ];
    const propOptions = computed(() => [
      ...listStandardOverridePropertyOptions(),
      ...GRAPH_CUSTOM_PROPS
    ]);
    const FIELD_TYPES = [
      { value: "number", label: "number" },
      { value: "string", label: "string" },
      { value: "time", label: "time" },
      { value: "boolean", label: "boolean" },
      { value: "other", label: "other" }
    ];
    function propEditorKind(id) {
      if (id === "unit") return "unit";
      if (id === "color") return "fieldColor";
      if (id === "thresholds") return "thresholds";
      if (id === "mappings") return "mappings";
      if (id === "links") return "links";
      if (id === "filterable" || id === "fieldMinMax") return "boolean";
      if (id === "min" || id === "max" || id === "decimals" || id === "custom.lineWidth" || id === "custom.fillOpacity" || id === "custom.pointSize" || id === "custom.barWidthFactor" || id === "custom.axisSoftMin" || id === "custom.axisSoftMax") {
        return "number";
      }
      if (id.startsWith("custom.")) return "text";
      return "text";
    }
    function matcherOptionString(options) {
      if (options == null) return "";
      if (typeof options === "string" || typeof options === "number" || typeof options === "boolean") {
        return String(options);
      }
      if (typeof options === "object" && options && "names" in options) {
        const names = options.names;
        return Array.isArray(names) ? names.join(", ") : String(names ?? "");
      }
      try {
        return JSON.stringify(options);
      } catch {
        return String(options);
      }
    }
    function emitMatcherOptions(i, id, raw) {
      if (id === "byNames") {
        const names = raw.split(",").map((s) => s.trim()).filter(Boolean);
        emit("update-matcher", i, id, { names, mode: "include" });
        return;
      }
      emit("update-matcher", i, id, raw);
    }
    function emitTyped(i, pi, value) {
      emit("set-prop-value-typed", i, pi, value);
      const raw = value == null ? "" : typeof value === "object" ? JSON.stringify(value) : String(value);
      emit("set-prop-value", i, pi, raw);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1g, [
        _cache[8] || (_cache[8] = createElementVNode(
          "h4",
          { class: "subhead" },
          "覆盖规则",
          -1
          /* CACHED */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          "test-id": "add-override-btn",
          onClick: _cache[0] || (_cache[0] = ($event) => emit("add"))
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              "+ 添加字段覆盖",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        }),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.overrides, (o, i) => {
            return openBlock(), createElementBlock("div", {
              key: keyOf(o),
              class: "transform-card",
              "data-testid": `override-${i}`
            }, [
              createElementVNode("header", null, [
                createElementVNode(
                  "strong",
                  null,
                  "规则 " + toDisplayString(i + 1),
                  1
                  /* TEXT */
                ),
                createVNode(unref(GButton), {
                  size: "sm",
                  variant: "destructive",
                  onClick: ($event) => emit("remove", i)
                }, {
                  default: withCtx(() => [..._cache[2] || (_cache[2] = [
                    createTextVNode(
                      "删除",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["onClick"])
              ]),
              createElementVNode("label", null, [
                _cache[3] || (_cache[3] = createTextVNode(
                  "匹配器 ",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GSelect), {
                  value: o.matcher?.id ?? "byName",
                  options: matcherOptions.value,
                  "show-search": false,
                  onChange: ($event) => emit("update-matcher", i, String($event), o.matcher?.options)
                }, null, 8, ["value", "options", "onChange"])
              ]),
              (o.matcher?.id ?? "byName") === "byType" ? (openBlock(), createElementBlock("label", _hoisted_3$U, [
                _cache[4] || (_cache[4] = createTextVNode(
                  "字段类型 ",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GSelect), {
                  value: String(o.matcher?.options ?? "number"),
                  options: FIELD_TYPES,
                  onChange: ($event) => emit("update-matcher", i, "byType", String($event))
                }, null, 8, ["value", "onChange"])
              ])) : (openBlock(), createElementBlock("label", _hoisted_4$H, [
                _cache[5] || (_cache[5] = createTextVNode(
                  "匹配值 ",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  value: matcherOptionString(o.matcher?.options),
                  "onUpdate:value": ($event) => emitMatcherOptions(
                    i,
                    o.matcher?.id ?? "byName",
                    String($event ?? "")
                  )
                }, null, 8, ["value", "onUpdate:value"])
              ])),
              createElementVNode("div", _hoisted_5$C, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(o.properties ?? [], (prop, pi) => {
                    return openBlock(), createElementBlock("div", {
                      key: keyOf(prop),
                      class: "override-prop-row",
                      "data-testid": `override-prop-${pi}`,
                      "data-prop-id": prop.id,
                      "data-prop-editor": propEditorKind(prop.id)
                    }, [
                      createVNode(unref(GSelect), {
                        value: prop.id,
                        options: propOptions.value,
                        "show-search": true,
                        onChange: ($event) => emit("set-prop-id", i, Number(pi), String($event))
                      }, null, 8, ["value", "options", "onChange"]),
                      propEditorKind(prop.id) === "unit" ? (openBlock(), createBlock(unref(UnitPicker), {
                        key: 0,
                        "data-testid": "override-unit",
                        "model-value": String(prop.value ?? ""),
                        "onUpdate:modelValue": ($event) => emitTyped(i, Number(pi), $event)
                      }, null, 8, ["model-value", "onUpdate:modelValue"])) : propEditorKind(prop.id) === "fieldColor" ? (openBlock(), createBlock(unref(FieldColorEditor), {
                        key: 1,
                        "data-testid": "override-color",
                        "model-value": prop.value,
                        "onUpdate:modelValue": ($event) => emitTyped(i, Number(pi), $event)
                      }, null, 8, ["model-value", "onUpdate:modelValue"])) : propEditorKind(prop.id) === "thresholds" ? (openBlock(), createBlock(unref(ThresholdsEditor), {
                        key: 2,
                        "data-testid": "override-thresholds",
                        "model-value": prop.value,
                        "onUpdate:modelValue": ($event) => emitTyped(i, Number(pi), $event)
                      }, null, 8, ["model-value", "onUpdate:modelValue"])) : propEditorKind(prop.id) === "mappings" ? (openBlock(), createBlock(unref(ValueMappingsEditor), {
                        key: 3,
                        "data-testid": "override-mappings",
                        "model-value": prop.value,
                        "onUpdate:modelValue": ($event) => emitTyped(i, Number(pi), $event)
                      }, null, 8, ["model-value", "onUpdate:modelValue"])) : propEditorKind(prop.id) === "links" ? (openBlock(), createBlock(unref(DataLinksEditor), {
                        key: 4,
                        "data-testid": "override-links",
                        "model-value": prop.value ?? [],
                        "onUpdate:modelValue": ($event) => emitTyped(i, Number(pi), $event)
                      }, null, 8, ["model-value", "onUpdate:modelValue"])) : propEditorKind(prop.id) === "boolean" ? (openBlock(), createBlock(unref(_sfc_main$4v), {
                        key: 5,
                        "data-testid": "override-boolean",
                        checked: Boolean(prop.value),
                        "onUpdate:checked": ($event) => emitTyped(i, Number(pi), $event)
                      }, null, 8, ["checked", "onUpdate:checked"])) : propEditorKind(prop.id) === "number" ? (openBlock(), createBlock(unref(GInput), {
                        key: 6,
                        "data-testid": "override-number",
                        type: "number",
                        value: prop.value == null ? "" : String(prop.value),
                        "onUpdate:value": ($event) => emitTyped(
                          i,
                          Number(pi),
                          $event === "" ? void 0 : Number($event)
                        )
                      }, null, 8, ["value", "onUpdate:value"])) : (openBlock(), createBlock(unref(GInput), {
                        key: 7,
                        "data-testid": "override-text",
                        value: prop.value == null ? "" : typeof prop.value === "object" ? JSON.stringify(prop.value) : String(prop.value),
                        "onUpdate:value": ($event) => emit("set-prop-value", i, Number(pi), String($event ?? ""))
                      }, null, 8, ["value", "onUpdate:value"])),
                      createVNode(unref(GButton), {
                        size: "sm",
                        variant: "destructive",
                        onClick: ($event) => emit("remove-prop", i, Number(pi))
                      }, {
                        default: withCtx(() => [..._cache[6] || (_cache[6] = [
                          createTextVNode(
                            "×",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["onClick"])
                    ], 8, _hoisted_6$w);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                )),
                createVNode(unref(GButton), {
                  size: "sm",
                  "test-id": "add-override-prop",
                  onClick: ($event) => emit("add-prop", i)
                }, {
                  default: withCtx(() => [..._cache[7] || (_cache[7] = [
                    createTextVNode(
                      "+ 属性",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["onClick"])
              ])
            ], 8, _hoisted_2$10);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const FieldOverridesEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1l, [["__scopeId", "data-v-2c475dd7"]]);
const BUILTIN_GAZETTEER = {
  shanghai: { lat: 31.23, lon: 121.47 },
  beijing: { lat: 39.9, lon: 116.4 },
  shenzhen: { lat: 22.54, lon: 114.06 },
  hangzhou: { lat: 30.27, lon: 120.15 },
  guangzhou: { lat: 23.13, lon: 113.26 },
  chengdu: { lat: 30.57, lon: 104.07 },
  wuhan: { lat: 30.59, lon: 114.31 },
  nanjing: { lat: 32.06, lon: 118.8 },
  "new york": { lat: 40.71, lon: -74.01 },
  london: { lat: 51.51, lon: -0.13 },
  tokyo: { lat: 35.68, lon: 139.69 },
  paris: { lat: 48.86, lon: 2.35 },
  singapore: { lat: 1.35, lon: 103.82 },
  sydney: { lat: -33.87, lon: 151.21 },
  "san francisco": { lat: 37.77, lon: -122.42 }
};
function resolveGazetteerEntry(key, custom) {
  if (!key) return null;
  const k = String(key).trim().toLowerCase();
  if (custom && custom[k]) return custom[k];
  if (BUILTIN_GAZETTEER[k]) return BUILTIN_GAZETTEER[k];
  for (const [name, pt] of Object.entries(custom ?? {})) {
    if (name.includes(k) || k.includes(name)) return pt;
  }
  for (const [name, pt] of Object.entries(BUILTIN_GAZETTEER)) {
    if (name.includes(k) || k.includes(name)) return pt;
  }
  return null;
}
function parseGazetteerJson(raw) {
  if (!raw) return void 0;
  if (typeof raw === "object" && !Array.isArray(raw)) {
    const out = {};
    for (const [k, v] of Object.entries(raw)) {
      if (v && typeof v === "object" && Number.isFinite(Number(v.lat)) && Number.isFinite(Number(v.lon))) {
        out[String(k).toLowerCase()] = {
          lat: Number(v.lat),
          lon: Number(v.lon)
        };
      }
    }
    return out;
  }
  if (typeof raw === "string") {
    try {
      return parseGazetteerJson(JSON.parse(raw));
    } catch {
      return void 0;
    }
  }
  return void 0;
}
const BASE32 = "0123456789bcdefghjkmnpqrstuvwxyz";
function decodeGeohash(hash2) {
  if (!hash2 || typeof hash2 !== "string") return null;
  const h2 = hash2.toLowerCase().trim();
  if (!h2.length) return null;
  let even = true;
  let latMin = -90;
  let latMax = 90;
  let lonMin = -180;
  let lonMax = 180;
  for (const ch of h2) {
    const idx = BASE32.indexOf(ch);
    if (idx < 0) return null;
    for (let bit = 4; bit >= 0; bit--) {
      const bitVal = idx >> bit & 1;
      if (even) {
        const mid = (lonMin + lonMax) / 2;
        if (bitVal) lonMin = mid;
        else lonMax = mid;
      } else {
        const mid = (latMin + latMax) / 2;
        if (bitVal) latMin = mid;
        else latMax = mid;
      }
      even = !even;
    }
  }
  return { lat: (latMin + latMax) / 2, lon: (lonMin + lonMax) / 2 };
}
function findField(frame, names, fallbacks) {
  if (names) {
    for (const n of names) {
      if (!n) continue;
      const exact = frame.fields.find((f) => f.name === n);
      if (exact) return exact;
      const ci = frame.fields.find(
        (f) => f.name.toLowerCase() === n.toLowerCase()
      );
      if (ci) return ci;
    }
  }
  for (const re of fallbacks) {
    const f = frame.fields.find((fld) => re.test(fld.name));
    if (f) return f;
  }
  return void 0;
}
function resolveLocationPoints(frame, location2, layerMeta) {
  if (!frame?.fields?.length) return [];
  const mode2 = String(location2?.mode ?? "auto").toLowerCase();
  const valField = frame.fields.find(
    (f) => f.type === "number" && !/lat|lon|lng|x|y/i.test(f.name)
  ) ?? frame.fields.find((f) => f.type === "number");
  const labelField = findField(frame, void 0, [
    /name|label|city|host|service/i
  ]);
  if (mode2 === "geohash") {
    const gh = findField(
      frame,
      location2?.geohash ? [location2.geohash] : void 0,
      [/geohash|geo_hash/i]
    );
    if (!gh) return [];
    const out = [];
    for (let i = 0; i < gh.values.length; i++) {
      const decoded = decodeGeohash(String(gh.values[i] ?? ""));
      if (!decoded) continue;
      out.push({
        lon: decoded.lon,
        lat: decoded.lat,
        value: Number(valField?.values[i] ?? 1) || 1,
        label: labelField ? String(labelField.values[i] ?? "") : String(gh.values[i]),
        layerName: layerMeta?.name,
        layerType: layerMeta?.type
      });
    }
    return out;
  }
  if (mode2 === "lookup") {
    const lookupField = findField(
      frame,
      location2?.lookup ? [location2.lookup] : void 0,
      [/name|city|host|location|place|label|key/i]
    );
    if (!lookupField) return [];
    const custom = parseGazetteerJson(location2?.gazetteer);
    const out = [];
    for (let i = 0; i < lookupField.values.length; i++) {
      const key = String(lookupField.values[i] ?? "");
      const pt = resolveGazetteerEntry(key, custom);
      if (!pt) continue;
      out.push({
        lon: pt.lon,
        lat: pt.lat,
        value: Number(valField?.values[i] ?? 1) || 1,
        label: key,
        layerName: layerMeta?.name,
        layerType: layerMeta?.type
      });
    }
    return out;
  }
  if (mode2 === "coords" || mode2 === "auto") {
    const lat = findField(
      frame,
      location2?.latitude ? [location2.latitude] : void 0,
      mode2 === "coords" ? [/^lat(itude)?$/i, /lat/i] : [/lat/i, /^y$/i]
    ) ?? (mode2 === "auto" ? frame.fields.find((f) => f.name.toLowerCase() === "y") : void 0);
    const lon = findField(
      frame,
      location2?.longitude ? [location2.longitude] : void 0,
      mode2 === "coords" ? [/^lon(gitude)?$|^lng$/i, /lon|lng/i] : [/lon|lng/i, /^x$/i]
    ) ?? (mode2 === "auto" ? frame.fields.find((f) => f.name.toLowerCase() === "x") : void 0);
    if (lat && lon) {
      return lat.values.map((la, i) => ({
        lon: Number(lon.values[i]),
        lat: Number(la),
        value: Number(valField?.values[i] ?? 1) || 1,
        label: labelField ? String(labelField.values[i] ?? "") : `${Number(la).toFixed(2)},${Number(lon.values[i]).toFixed(2)}`,
        layerName: layerMeta?.name,
        layerType: layerMeta?.type
      }));
    }
    if (mode2 === "auto") {
      const gh = findField(
        frame,
        location2?.geohash ? [location2.geohash] : void 0,
        [/geohash/i]
      );
      if (gh) {
        return resolveLocationPoints(
          frame,
          { ...location2, mode: "geohash" },
          layerMeta
        );
      }
      const lookupField = findField(
        frame,
        location2?.lookup ? [location2.lookup] : void 0,
        [/name|city|host|location|place/i]
      );
      if (lookupField) {
        return resolveLocationPoints(
          frame,
          { ...location2, mode: "lookup" },
          layerMeta
        );
      }
    }
  }
  return [];
}
function matchGeomapFrameFilter(frame, filter2) {
  if (filter2 == null || filter2 === "") return true;
  if (typeof filter2 === "string") {
    const needle = filter2.trim();
    if (!needle) return true;
    const ref2 = String(frame.refId ?? "");
    const name = String(frame.name ?? "");
    if (needle.includes("|")) {
      const parts = needle.split("|").map((s) => s.trim()).filter(Boolean);
      return parts.includes(ref2) || parts.includes(name);
    }
    return ref2 === needle || name === needle;
  }
  if (typeof filter2 === "object") {
    const f = filter2;
    const id = String(f.id || "byRefId");
    const pattern = String(f.options ?? "");
    if (id === "byName" || id === "byFrameName") {
      return String(frame.name ?? "") === pattern;
    }
    return String(frame.refId ?? "") === pattern;
  }
  return true;
}
function framesForLayer(frames, layer, panelFilterData) {
  const filter2 = layer.filterData ?? panelFilterData;
  if (filter2 == null || filter2 === "") return frames;
  const filtered = frames.filter((fr) => matchGeomapFrameFilter(fr, filter2));
  return filtered.length ? filtered : frames;
}
function resolveAllLayerPoints(series, layers, panelFilterData) {
  const data = dataLayers(layers);
  const frames = series?.length ? series : [];
  return data.map((layer, idx) => {
    const scoped = framesForLayer(frames, layer, panelFilterData);
    const frame = scoped[Math.min(idx, Math.max(0, scoped.length - 1))] ?? scoped[0];
    const points = resolveLocationPoints(frame, layer.location, {
      name: layer.name,
      type: String(layer.type)
    });
    return { layer, points };
  });
}
function normalizeGeomapLayers(options = {}) {
  const raw = options.layers;
  if (Array.isArray(raw) && raw.length) {
    const layers = raw.map((l, i) => normalizeLayer(l, i));
    if (!layers.some((l) => l.type === "basemap")) {
      const basemapType2 = typeof options.basemap === "string" ? options.basemap : String(options.basemap?.type ?? "default");
      layers.unshift({
        type: "basemap",
        name: "底图",
        config: {
          basemapType: basemapType2 === "default" ? "carto" : basemapType2,
          theme: "auto",
          showLabels: true,
          ...options.basemap?.config ?? {}
        }
      });
    }
    return layers;
  }
  const basemapTypeRaw = typeof options.basemap === "string" ? options.basemap : String(options.basemap?.type ?? "default");
  const basemapType = basemapTypeRaw === "default" || !basemapTypeRaw ? "carto" : basemapTypeRaw;
  const dataLayer = {
    type: String(options.type ?? "markers"),
    name: "Layer 1",
    opacity: options.opacity != null ? Number(options.opacity) : 1,
    config: options.config ?? {},
    tooltip: true,
    location: { mode: "auto" }
  };
  const basemap = {
    type: "basemap",
    name: "底图",
    config: {
      basemapType,
      theme: "auto",
      showLabels: true,
      ...options.basemap?.config ?? {}
    }
  };
  return [basemap, dataLayer];
}
function normalizeLayer(raw, index2) {
  if (!raw || typeof raw !== "object") {
    return {
      type: "markers",
      name: `图层 ${index2 + 1}`,
      location: { mode: "auto" }
    };
  }
  const l = raw;
  const loc = l.location ?? { mode: "auto" };
  return {
    type: String(l.type ?? "markers"),
    name: typeof l.name === "string" ? l.name : `图层 ${index2 + 1}`,
    opacity: l.opacity == null ? 1 : Number(l.opacity),
    tooltip: l.tooltip !== false,
    location: {
      mode: loc.mode ?? "auto",
      latitude: loc.latitude,
      longitude: loc.longitude,
      geohash: loc.geohash,
      lookup: loc.lookup,
      gazetteer: loc.gazetteer
    },
    config: l.config ?? {},
    filterData: l.filterData
  };
}
function dataLayers(layers) {
  return layers.filter((l) => l.type !== "basemap");
}
function basemapLayer(layers) {
  return layers.find((l) => l.type === "basemap");
}
function serializeLayersIntoOptions(options, layers) {
  const base = basemapLayer(layers);
  const data = dataLayers(layers);
  const primary = data[0];
  return {
    ...options,
    layers,
    basemap: {
      type: String(
        base?.config?.basemapType ?? options.basemap?.type ?? "osm"
      ),
      config: base?.config ?? {}
    },
    type: primary?.type ?? options.type ?? "markers",
    opacity: primary?.opacity ?? options.opacity ?? 1,
    config: {
      ...options.config ?? {},
      ...primary?.config ?? {}
    }
  };
}
const _hoisted_1$1f = {
  class: "geomap-layers-editor",
  "data-testid": "geomap-layers-editor"
};
const _hoisted_2$$ = { class: "head" };
const _hoisted_3$T = ["data-testid"];
const _hoisted_4$G = { class: "layer-head" };
const _hoisted_5$B = { class: "row" };
const _hoisted_6$v = { class: "row" };
const _hoisted_7$r = {
  key: 0,
  class: "row"
};
const _hoisted_8$k = { class: "row" };
const _hoisted_9$j = {
  key: 0,
  class: "row cols"
};
const _hoisted_10$f = {
  key: 1,
  class: "row"
};
const _hoisted_11$d = {
  key: 2,
  class: "row cols"
};
const _hoisted_12$c = {
  key: 3,
  class: "row"
};
const _hoisted_13$c = { class: "row cols" };
const _hoisted_14$c = { class: "switch-row" };
const _sfc_main$1k = /* @__PURE__ */ defineComponent({
  __name: "GeomapLayersEditor",
  props: {
    options: {},
    onChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const layers = computed(() => normalizeGeomapLayers(props.options ?? {}));
    const typeOptions = [
      { label: "底图", value: "basemap" },
      { label: "标记", value: "markers" },
      { label: "热力", value: "heatmap" },
      { label: "路径", value: "route" },
      { label: "GeoJSON", value: "geojson" },
      { label: "照片", value: "photos" }
    ];
    const locationModes = [
      { label: "自动", value: "auto" },
      { label: "坐标字段", value: "coords" },
      { label: "Geohash", value: "geohash" },
      { label: "查找表", value: "lookup" }
    ];
    const basemapTypes = [
      { label: "OpenStreetMap", value: "osm" },
      { label: "XYZ 瓦片", value: "xyz" },
      { label: "无底图", value: "none" }
    ];
    function commit(next) {
      props.onChange(serializeLayersIntoOptions(props.options ?? {}, next));
    }
    function updateLayer(index2, patch) {
      const next = layers.value.map(
        (l, i) => i === index2 ? { ...l, ...patch } : l
      );
      commit(next);
    }
    function updateLocation(index2, patch) {
      const layer = layers.value[index2];
      updateLayer(index2, { location: { ...layer.location ?? {}, ...patch } });
    }
    function updateConfig(index2, patch) {
      const layer = layers.value[index2];
      updateLayer(index2, { config: { ...layer.config ?? {}, ...patch } });
    }
    function addLayer() {
      commit([
        ...layers.value,
        {
          type: "markers",
          name: `数据层 ${layers.value.length}`,
          opacity: 1,
          tooltip: true,
          location: { mode: "auto" },
          config: { radius: 6 }
        }
      ]);
    }
    function removeLayer(index2) {
      if (layers.value.length <= 1) return;
      commit(layers.value.filter((_, i) => i !== index2));
    }
    function moveLayer(index2, dir) {
      const j = index2 + dir;
      if (j < 0 || j >= layers.value.length) return;
      const next = [...layers.value];
      const tmp = next[index2];
      next[index2] = next[j];
      next[j] = tmp;
      commit(next);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1f, [
        createElementVNode("div", _hoisted_2$$, [
          _cache[1] || (_cache[1] = createElementVNode(
            "strong",
            null,
            "图层",
            -1
            /* CACHED */
          )),
          createVNode(unref(Button), {
            size: "small",
            type: "primary",
            "data-testid": "geomap-add-layer",
            onClick: addLayer
          }, {
            default: withCtx(() => [..._cache[0] || (_cache[0] = [
              createTextVNode(
                "添加图层",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(layers.value, (layer, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "layer-card",
              "data-testid": `geomap-layer-${i}`
            }, [
              createElementVNode("div", _hoisted_4$G, [
                createVNode(unref(Input), {
                  value: layer.name,
                  placeholder: "图层名称",
                  "data-testid": "geomap-layer-name",
                  "onUpdate:value": ($event) => updateLayer(i, { name: $event })
                }, null, 8, ["value", "onUpdate:value"]),
                createVNode(unref(Select), {
                  style: { "width": "120px" },
                  value: layer.type,
                  options: typeOptions,
                  "data-testid": "geomap-layer-type",
                  "onUpdate:value": ($event) => updateLayer(i, { type: String($event) })
                }, null, 8, ["value", "onUpdate:value"]),
                createVNode(unref(Button), {
                  size: "small",
                  disabled: i === 0,
                  onClick: ($event) => moveLayer(i, -1)
                }, {
                  default: withCtx(() => [..._cache[2] || (_cache[2] = [
                    createTextVNode(
                      "↑",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["disabled", "onClick"]),
                createVNode(unref(Button), {
                  size: "small",
                  disabled: i === layers.value.length - 1,
                  onClick: ($event) => moveLayer(i, 1)
                }, {
                  default: withCtx(() => [..._cache[3] || (_cache[3] = [
                    createTextVNode(
                      "↓",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["disabled", "onClick"]),
                createVNode(unref(Button), {
                  size: "small",
                  danger: "",
                  disabled: layers.value.length <= 1,
                  onClick: ($event) => removeLayer(i)
                }, {
                  default: withCtx(() => [..._cache[4] || (_cache[4] = [
                    createTextVNode(
                      "删除",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["disabled", "onClick"])
              ]),
              createElementVNode("div", _hoisted_5$B, [
                _cache[5] || (_cache[5] = createElementVNode(
                  "label",
                  null,
                  "不透明度",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(InputNumber), {
                  min: 0,
                  max: 1,
                  step: 0.1,
                  value: layer.opacity ?? 1,
                  "data-testid": "geomap-layer-opacity",
                  "onUpdate:value": ($event) => updateLayer(i, { opacity: Number($event ?? 1) })
                }, null, 8, ["value", "onUpdate:value"]),
                _cache[6] || (_cache[6] = createElementVNode(
                  "label",
                  null,
                  "提示",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(Switch), {
                  checked: layer.tooltip !== false,
                  "onUpdate:checked": (v) => updateLayer(i, { tooltip: v === true || v === "true" })
                }, null, 8, ["checked", "onUpdate:checked"])
              ]),
              layer.type === "basemap" ? (openBlock(), createElementBlock(
                Fragment,
                { key: 0 },
                [
                  createElementVNode("div", _hoisted_6$v, [
                    _cache[7] || (_cache[7] = createElementVNode(
                      "label",
                      null,
                      "底图类型",
                      -1
                      /* CACHED */
                    )),
                    createVNode(unref(Select), {
                      style: { "width": "160px" },
                      value: String(layer.config?.basemapType ?? "osm"),
                      options: basemapTypes,
                      "data-testid": "geomap-basemap-type",
                      "onUpdate:value": ($event) => updateConfig(i, { basemapType: $event })
                    }, null, 8, ["value", "onUpdate:value"])
                  ]),
                  String(layer.config?.basemapType) === "xyz" ? (openBlock(), createElementBlock("div", _hoisted_7$r, [
                    _cache[8] || (_cache[8] = createElementVNode(
                      "label",
                      null,
                      "XYZ URL",
                      -1
                      /* CACHED */
                    )),
                    createVNode(unref(Input), {
                      value: String(layer.config?.url ?? ""),
                      placeholder: "https://…/{z}/{x}/{y}.png",
                      "onUpdate:value": ($event) => updateConfig(i, { url: $event })
                    }, null, 8, ["value", "onUpdate:value"])
                  ])) : createCommentVNode("v-if", true)
                ],
                64
                /* STABLE_FRAGMENT */
              )) : (openBlock(), createElementBlock(
                Fragment,
                { key: 1 },
                [
                  createElementVNode("div", _hoisted_8$k, [
                    _cache[9] || (_cache[9] = createElementVNode(
                      "label",
                      null,
                      "位置模式",
                      -1
                      /* CACHED */
                    )),
                    createVNode(unref(Select), {
                      style: { "width": "140px" },
                      value: String(layer.location?.mode ?? "auto"),
                      options: locationModes,
                      "data-testid": "geomap-location-mode",
                      "onUpdate:value": ($event) => updateLocation(i, { mode: $event })
                    }, null, 8, ["value", "onUpdate:value"])
                  ]),
                  String(layer.location?.mode) === "coords" ? (openBlock(), createElementBlock("div", _hoisted_9$j, [
                    createElementVNode("div", null, [
                      _cache[10] || (_cache[10] = createElementVNode(
                        "label",
                        null,
                        "纬度字段",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(Input), {
                        value: String(layer.location?.latitude ?? ""),
                        placeholder: "纬度 lat",
                        "data-testid": "geomap-lat-field",
                        "onUpdate:value": ($event) => updateLocation(i, { latitude: $event })
                      }, null, 8, ["value", "onUpdate:value"])
                    ]),
                    createElementVNode("div", null, [
                      _cache[11] || (_cache[11] = createElementVNode(
                        "label",
                        null,
                        "经度字段",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(Input), {
                        value: String(layer.location?.longitude ?? ""),
                        placeholder: "经度 lon",
                        "data-testid": "geomap-lon-field",
                        "onUpdate:value": ($event) => updateLocation(i, { longitude: $event })
                      }, null, 8, ["value", "onUpdate:value"])
                    ])
                  ])) : createCommentVNode("v-if", true),
                  String(layer.location?.mode) === "geohash" ? (openBlock(), createElementBlock("div", _hoisted_10$f, [
                    _cache[12] || (_cache[12] = createElementVNode(
                      "label",
                      null,
                      "Geohash 字段",
                      -1
                      /* CACHED */
                    )),
                    createVNode(unref(Input), {
                      value: String(layer.location?.geohash ?? ""),
                      placeholder: "geohash 字段",
                      "data-testid": "geomap-geohash-field",
                      "onUpdate:value": ($event) => updateLocation(i, { geohash: $event })
                    }, null, 8, ["value", "onUpdate:value"])
                  ])) : createCommentVNode("v-if", true),
                  String(layer.location?.mode) === "lookup" ? (openBlock(), createElementBlock("div", _hoisted_11$d, [
                    createElementVNode("div", null, [
                      _cache[13] || (_cache[13] = createElementVNode(
                        "label",
                        null,
                        "查找字段",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(Input), {
                        value: String(layer.location?.lookup ?? ""),
                        placeholder: "城市 / 站点",
                        "data-testid": "geomap-lookup-field",
                        "onUpdate:value": ($event) => updateLocation(i, { lookup: $event })
                      }, null, 8, ["value", "onUpdate:value"])
                    ]),
                    createElementVNode("div", null, [
                      _cache[14] || (_cache[14] = createElementVNode(
                        "label",
                        null,
                        "地名表 (JSON)",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(Input), {
                        value: String(layer.location?.gazetteer ?? ""),
                        placeholder: '{"hq":{"lat":1,"lon":2}}',
                        "data-testid": "geomap-gazetteer-field",
                        "onUpdate:value": ($event) => updateLocation(i, { gazetteer: $event })
                      }, null, 8, ["value", "onUpdate:value"])
                    ])
                  ])) : createCommentVNode("v-if", true),
                  String(layer.type) === "geojson" ? (openBlock(), createElementBlock("div", _hoisted_12$c, [
                    _cache[15] || (_cache[15] = createElementVNode(
                      "label",
                      null,
                      "GeoJSON（内联 JSON）",
                      -1
                      /* CACHED */
                    )),
                    createVNode(unref(Input), {
                      value: String(layer.config?.geojson ?? layer.config?.src ?? ""),
                      placeholder: '{"type":"FeatureCollection","features":[]}',
                      "data-testid": "geomap-geojson-src",
                      "onUpdate:value": ($event) => updateConfig(i, { geojson: $event })
                    }, null, 8, ["value", "onUpdate:value"])
                  ])) : createCommentVNode("v-if", true),
                  createElementVNode("div", _hoisted_13$c, [
                    createElementVNode("div", null, [
                      _cache[16] || (_cache[16] = createElementVNode(
                        "label",
                        null,
                        "半径",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(InputNumber), {
                        min: 1,
                        max: 40,
                        value: Number(layer.config?.radius ?? 6),
                        "onUpdate:value": ($event) => updateConfig(i, { radius: Number($event ?? 6) })
                      }, null, 8, ["value", "onUpdate:value"])
                    ]),
                    createElementVNode("div", null, [
                      _cache[17] || (_cache[17] = createElementVNode(
                        "label",
                        null,
                        "颜色",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(Input), {
                        value: String(layer.config?.color ?? ""),
                        placeholder: "var(--grafana-primary)",
                        "onUpdate:value": ($event) => updateConfig(i, { color: $event })
                      }, null, 8, ["value", "onUpdate:value"])
                    ]),
                    createElementVNode("div", _hoisted_14$c, [
                      _cache[18] || (_cache[18] = createElementVNode(
                        "label",
                        null,
                        "显示标签",
                        -1
                        /* CACHED */
                      )),
                      createVNode(unref(Switch), {
                        checked: Boolean(layer.config?.showLabels),
                        "onUpdate:checked": (v) => updateConfig(i, { showLabels: v === true || v === "true" })
                      }, null, 8, ["checked", "onUpdate:checked"])
                    ])
                  ])
                ],
                64
                /* STABLE_FRAGMENT */
              ))
            ], 8, _hoisted_3$T);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const GeomapLayersEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1k, [["__scopeId", "data-v-d7bf9066"]]);
const _hoisted_1$1e = ["data-options-visible", "data-display-mode", "data-table-view"];
const _hoisted_2$_ = { class: "panel-editor__body" };
const _hoisted_3$S = ["data-display-mode"];
const _hoisted_4$F = {
  key: 0,
  class: "table-view",
  "data-testid": "panel-editor-table-view"
};
const _hoisted_5$A = { class: "tv-frame-meta" };
const _hoisted_6$u = {
  class: "tv-table",
  "data-testid": "panel-editor-table-grid"
};
const _hoisted_7$q = { class: "tv-type" };
const _hoisted_8$j = {
  key: 0,
  class: "tv-more"
};
const _hoisted_9$i = {
  key: 0,
  class: "tv-empty"
};
const _hoisted_10$e = {
  class: "panel-editor__data",
  "data-testid": "panel-editor-data"
};
const _hoisted_11$c = {
  class: "tabs",
  role: "tablist"
};
const _hoisted_12$b = {
  key: 2,
  class: "section alert-empty",
  "data-testid": "panel-alert-unsupported"
};
const _hoisted_13$b = { class: "options-tabs" };
const _hoisted_14$b = {
  key: 0,
  class: "section",
  "data-testid": "options-section"
};
const _hoisted_15$a = {
  class: "panel-frame-options",
  "data-testid": "panel-frame-options"
};
const _hoisted_16$9 = { class: "frame" };
const _hoisted_17$7 = {
  key: 4,
  class: "hint"
};
const _hoisted_18$7 = {
  key: 1,
  class: "section",
  "data-testid": "field-section",
  "data-field-config": "true"
};
const _hoisted_19$7 = {
  key: 1,
  class: "hint"
};
const _hoisted_20$6 = { class: "panel-editor__footer" };
const _sfc_main$1j = /* @__PURE__ */ defineComponent({
  ...{ inheritAttrs: false },
  __name: "PanelEditor",
  props: {
    panel: {},
    data: {},
    variables: {},
    session: {}
  },
  emits: ["back", "discard"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const localSession = props.session ? null : createPanelEditSession({
      panel: ensurePanelQuery(clonePanel(props.panel))
    });
    const activeSession = computed(
      () => props.session ?? localSession
    );
    if (activeSession.value.workingPanel) {
      const ensured = ensurePanelQuery(activeSession.value.workingPanel);
      if (ensured !== activeSession.value.workingPanel) {
        Object.assign(activeSession.value.workingPanel, ensured);
      }
    }
    const draft = computed({
      get() {
        return activeSession.value.workingPanel;
      },
      set(next) {
        const panel2 = ensurePanelQuery(next);
        const wp = activeSession.value.workingPanel;
        for (const key of Object.keys(wp)) {
          if (!(key in panel2)) {
            delete wp[key];
          }
        }
        Object.assign(wp, panel2);
        __recomputeDirty();
      }
    });
    const originalSnapshot = ref(activeSession.value.savedBaselineJson);
    let __dirtyValue = false;
    let __dirtyInited = false;
    let __dirtyTimer = null;
    const __dirtyTick = ref(0);
    const draftDirty = computed(() => {
      void __dirtyTick.value;
      if (!__dirtyInited) {
        __dirtyInited = true;
        __dirtyValue = activeSession.value.isDirty;
      }
      return __dirtyValue;
    });
    function __recomputeDirty() {
      if (__dirtyTimer) clearTimeout(__dirtyTimer);
      __dirtyTimer = setTimeout(() => {
        __dirtyTimer = null;
        __dirtyValue = activeSession.value.isDirty;
        __dirtyInited = true;
        __dirtyTick.value++;
      }, 150);
    }
    function __setDirtyFromSession() {
      __dirtyValue = activeSession.value.isDirty;
      __dirtyInited = true;
      __dirtyTick.value++;
    }
    onBeforeUnmount(() => {
      if (__dirtyTimer) {
        clearTimeout(__dirtyTimer);
        __dirtyTimer = null;
      }
    });
    const tab = ref("query");
    const optionsMode = ref("options");
    const activeQuery = ref(0);
    const parentDataRef = computed(() => props.data);
    const { previewData, previewLoading } = usePanelPreview({
      draft,
      parentData: parentDataRef
    });
    const {
      ui,
      saveUi,
      previewHostRef,
      previewStyle,
      previewPanelSize,
      setDisplayMode,
      toggleOptionsPane,
      toggleTableView,
      onSplitStart
    } = usePanelEditorLayout(draft);
    watch(
      () => props.panel,
      (p) => {
        if (props.session) return;
        draft.value = ensurePanelQuery(clonePanel(p));
        originalSnapshot.value = activeSession.value.savedBaselineJson;
      }
    );
    const plugin2 = computed(() => getPanelPlugin(draft.value.type));
    const fieldNamesFromData = computed(() => {
      const names = /* @__PURE__ */ new Set();
      for (const frame of props.data?.series ?? []) {
        for (const f of frame.fields ?? []) {
          if (f?.name) names.add(String(f.name));
        }
      }
      return [...names];
    });
    const fieldNameOptionsFromData = computed(
      () => getFieldNameOptions(previewData.value?.series ?? props.data?.series ?? [])
    );
    const dataFramesFromData = computed(
      () => previewData.value?.series ?? props.data?.series ?? []
    );
    const repeatVariableOptions = computed(() => {
      const names = (props.variables ?? []).map((v) => String(v.name || "")).filter(Boolean);
      return [
        { label: "禁用", value: "" },
        ...names.map((n) => ({ label: n, value: n }))
      ];
    });
    const templateVarNames = computed(() => {
      if (!Array.isArray(props.variables)) return [];
      return props.variables.map((v) => String(v.name || "")).filter(Boolean);
    });
    const templateVarProperties = computed(() => {
      const out = {};
      for (const v of props.variables ?? []) {
        const name = String(v?.name || "");
        if (!name) continue;
        out[name] = [name, `${name}.text`, `${name}.value`];
      }
      return out;
    });
    const optionDescriptors = computed(() => plugin2.value?.optionDescriptors ?? []);
    const fieldDescriptors = computed(
      () => plugin2.value?.fieldConfigDescriptors ?? []
    );
    const visualizations = computed(
      () => listPanelPlugins().map((p) => ({ id: p.meta.id, name: p.meta.name }))
    );
    const vizSelectOptions = computed(
      () => visualizations.value.map((v) => ({ label: v.name, value: v.id }))
    );
    const targets = computed(() => draft.value.targets ?? []);
    const activeTarget = computed(
      () => targets.value[activeQuery.value] ?? targets.value[0]
    );
    function targetDsType(t2) {
      const q = t2;
      return normalizeDsType(q?.datasource?.type) || normalizeDsType(draft.value.datasource?.type) || "grafana-testdata-datasource";
    }
    const QueryEditor2 = computed(
      () => getDataSourcePlugin(targetDsType(activeTarget.value))?.QueryEditor
    );
    const dsType = computed(() => targetDsType(activeTarget.value));
    const dsInstance = computed(() => {
      const q = activeTarget.value;
      const type = dsType.value;
      const uid = q?.datasource?.uid ?? draft.value.datasource?.uid ?? type;
      const name = q?.datasource?.name ?? draft.value.datasource?.name ?? type;
      const settings = resolveInstanceSettings({ uid, type, name });
      return {
        uid: settings.uid || uid,
        type: settings.type || type,
        name: settings.name || name,
        url: settings.url || "",
        jsonData: { ...settings.jsonData || {} },
        meta: { id: settings.type || type, name: settings.name || name }
      };
    });
    const dsApi = computed(() => {
      try {
        return resolveEditorDataSource({
          uid: dsInstance.value.uid,
          type: dsInstance.value.type,
          name: dsInstance.value.name
        });
      } catch {
        return null;
      }
    });
    const __dsApiCache = /* @__PURE__ */ new Map();
    function dsApiCacheKey(uid, url, dataMode) {
      return `${uid}|${url}|${String(dataMode ?? "")}`;
    }
    const queryRows = computed(
      () => targets.value.map((t2) => {
        const q = t2;
        const type = targetDsType(t2);
        const plugin22 = getDataSourcePlugin(type);
        const uid = q?.datasource?.uid ?? draft.value.datasource?.uid ?? type;
        const name = q?.datasource?.name ?? draft.value.datasource?.name ?? type;
        const settings = resolveInstanceSettings({ uid, type, name });
        const instance = {
          uid: settings.uid || uid,
          type: settings.type || type,
          name: settings.name || name,
          url: settings.url || "",
          jsonData: { ...settings.jsonData || {} },
          meta: { id: settings.type || type, name: settings.name || name }
        };
        const key = dsApiCacheKey(
          instance.uid,
          instance.url || "",
          instance.jsonData?.dataMode
        );
        let api = __dsApiCache.get(key) ?? null;
        if (!api) {
          try {
            api = resolveEditorDataSource({
              uid: instance.uid,
              type: instance.type,
              name: instance.name
            });
            __dsApiCache.set(key, api);
          } catch {
            api = null;
          }
        }
        return {
          refId: t2.refId,
          target: t2,
          dsType: type,
          hide: !!q?.hide,
          queryEditor: plugin22?.QueryEditor ?? null,
          dsInstance: instance,
          dsApi: api
        };
      })
    );
    const transformerIds = computed(() => {
      try {
        return listTransformerIds();
      } catch {
        return [...FALLBACK_TRANSFORMER_IDS];
      }
    });
    const transforms = computed(() => listTransforms(draft.value));
    const overrides = computed(() => listOverrides(draft.value));
    function setType(type) {
      draft.value = applyType(draft.value, type);
      ui.value.isPanelOptionsVisible = true;
      optionsMode.value = "options";
      saveUi();
    }
    function onGeomapLayers(next) {
      draft.value = { ...draft.value, options: next };
    }
    function onOptionPath(path, value) {
      draft.value = applyOptionPath(draft.value, path, value);
    }
    function onFramePath(path, value) {
      draft.value = { ...draft.value, [path]: value };
    }
    function onFieldPath(path, value) {
      draft.value = applyFieldPath(draft.value, path, value);
    }
    function onQueryChange(q) {
      draft.value = applyQueryAt(
        draft.value,
        targets.value,
        activeQuery.value,
        q
      );
    }
    function onQueryChangeAt(i, q) {
      draft.value = applyQueryAt(draft.value, targets.value, i, q);
    }
    function addQuery() {
      draft.value = addQueryTarget(
        draft.value,
        targets.value,
        dsType.value,
        {
          uid: dsInstance.value.uid,
          name: dsInstance.value.name
        }
      );
      const newIdx = (draft.value.targets?.length ?? 1) - 1;
      activeQuery.value = newIdx;
      const refId = draft.value.targets?.[newIdx]?.refId;
      if (refId) {
        nextTick(() => {
          document.querySelector(`[data-testid="query-row-${refId}"]`)?.scrollIntoView({ behavior: "smooth", block: "start" });
        });
      }
    }
    function changeActiveDatasource(ds2) {
      draft.value = changeQueryDatasource(
        draft.value,
        targets.value,
        activeQuery.value,
        ds2
      );
    }
    function changeDatasourceAt(i, ds2) {
      draft.value = changeQueryDatasource(
        draft.value,
        targets.value,
        i,
        ds2
      );
    }
    function runActiveQuery() {
      draft.value = bumpQueryRev(draft.value);
    }
    function duplicateQuery(i) {
      draft.value = duplicateQueryAt(draft.value, targets.value, i);
    }
    function removeQuery(i) {
      const r = removeQueryAt(
        draft.value,
        targets.value,
        i,
        activeQuery.value
      );
      draft.value = r.panel;
      activeQuery.value = r.activeIndex;
    }
    function toggleHide(i) {
      draft.value = toggleQueryHide(draft.value, targets.value, i);
    }
    function moveQuery(i, dir) {
      const r = moveQueryAt(draft.value, targets.value, i, dir);
      draft.value = r.panel;
      activeQuery.value = r.activeIndex;
    }
    function addTransform$1(id) {
      draft.value = addTransform(draft.value, transforms.value, id);
    }
    function updateTransform(i, patch) {
      draft.value = updateTransformAt(
        draft.value,
        transforms.value,
        i,
        patch
      );
    }
    function clearTransforms$1() {
      draft.value = clearTransforms(draft.value);
    }
    function removeTransform(i) {
      draft.value = removeTransformAt(draft.value, transforms.value, i);
    }
    function toggleTransform(i) {
      draft.value = toggleTransformAt(draft.value, transforms.value, i);
    }
    function moveTransform(i, dir) {
      draft.value = moveTransformAt(draft.value, transforms.value, i, dir);
    }
    function onXySeriesChange(patch) {
      draft.value = {
        ...draft.value,
        options: { ...draft.value.options ?? {}, ...patch }
      };
    }
    function setCanvasOptions(opts) {
      draft.value = { ...draft.value, options: opts };
    }
    function onCanvasOptions(opts) {
      setCanvasOptions(opts);
    }
    function addOverride() {
      draft.value = addFieldOverride(draft.value, overrides.value);
    }
    function updateOverrideMatcher(i, id, options) {
      draft.value = updateOverrideMatcherAt(
        draft.value,
        overrides.value,
        i,
        id,
        options
      );
    }
    function addOverrideProp(i) {
      draft.value = addOverridePropAt(draft.value, overrides.value, i);
    }
    function removeOverrideProp(i, pi) {
      draft.value = removeOverridePropAt(
        draft.value,
        overrides.value,
        i,
        pi
      );
    }
    function setOverridePropId(i, pi, id) {
      draft.value = setOverridePropIdAt(
        draft.value,
        overrides.value,
        i,
        pi,
        id
      );
    }
    function setOverridePropValue(i, pi, raw) {
      draft.value = setOverridePropValueAt(
        draft.value,
        overrides.value,
        i,
        pi,
        raw
      );
    }
    function removeOverride(i) {
      draft.value = removeOverrideAt(draft.value, overrides.value, i);
    }
    function backToDashboard2() {
      const panel2 = clonePanel(draft.value);
      emit("back", panel2, previewData.value);
    }
    function discardChanges() {
      emit("discard");
    }
    function getDraft() {
      return clonePanel(draft.value);
    }
    function markSaved(panel2) {
      if (panel2) {
        draft.value = ensurePanelQuery(panel2);
      }
      originalSnapshot.value = activeSession.value.savedBaselineJson;
      __setDirtyFromSession();
    }
    __expose({ getDraft, markSaved, draftDirty });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "panel-editor",
        "data-testid": "panel-editor",
        "data-grafana-layout": "panel-editor-3pane",
        "data-options-visible": unref(ui).isPanelOptionsVisible ? "1" : "0",
        "data-display-mode": unref(ui).mode,
        "data-table-view": unref(ui).tableViewEnabled ? "1" : "0"
      }, [
        createVNode(PanelEditorHeader, {
          title: draft.value.title || "",
          dirty: draftDirty.value,
          mode: unref(ui).mode,
          "table-view-enabled": unref(ui).tableViewEnabled,
          "options-visible": unref(ui).isPanelOptionsVisible,
          onBack: backToDashboard2,
          onSetMode: unref(setDisplayMode)
        }, {
          back: withCtx(() => [
            createVNode(unref(GButton), {
              "test-id": "panel-editor-back",
              size: "sm",
              title: "返回仪表盘（保留更改）",
              onClick: backToDashboard2
            }, {
              default: withCtx(() => [..._cache[10] || (_cache[10] = [
                createTextVNode(
                  " ← 返回仪表盘 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })
          ]),
          tools: withCtx(() => [
            createVNode(unref(GButton), {
              "test-id": "toggle-table-view",
              size: "sm",
              onClick: unref(toggleTableView)
            }, {
              default: withCtx(() => [
                createTextVNode(
                  toDisplayString(unref(ui).tableViewEnabled ? "图表预览" : "表格预览"),
                  1
                  /* TEXT */
                )
              ]),
              _: 1
              /* STABLE */
            }, 8, ["onClick"]),
            createVNode(unref(GButton), {
              "test-id": "toggle-options-pane",
              size: "sm",
              onClick: unref(toggleOptionsPane)
            }, {
              default: withCtx(() => [
                createTextVNode(
                  toDisplayString(unref(ui).isPanelOptionsVisible ? "隐藏选项" : "显示选项"),
                  1
                  /* TEXT */
                )
              ]),
              _: 1
              /* STABLE */
            }, 8, ["onClick"])
          ]),
          _: 1
          /* STABLE */
        }, 8, ["title", "dirty", "mode", "table-view-enabled", "options-visible", "onSetMode"]),
        createElementVNode("div", _hoisted_2$_, [
          createElementVNode(
            "div",
            {
              class: "panel-editor__main",
              style: normalizeStyle({
                marginRight: unref(ui).isPanelOptionsVisible ? unref(ui).rightPaneSize + "px" : "0"
              })
            },
            [
              createCommentVNode(" Top: visualization preview "),
              createElementVNode("div", {
                ref_key: "previewHostRef",
                ref: previewHostRef,
                class: "panel-editor__preview",
                "data-testid": "panel-editor-preview",
                "data-display-mode": unref(ui).mode,
                style: normalizeStyle({ flex: `0 0 ${unref(ui).topPaneSize * 100}%` })
              }, [
                createElementVNode(
                  "div",
                  {
                    class: "preview-inner",
                    "data-testid": "panel-editor-preview-inner",
                    style: normalizeStyle(unref(previewStyle))
                  },
                  [
                    createVNode(PanelHost, {
                      title: draft.value.title || "预览",
                      transparent: !!draft.value.transparent,
                      "panel-type": draft.value.type,
                      "panel-id": draft.value.id,
                      loading: unref(previewLoading) || unref(previewData)?.state === "Loading",
                      error: unref(previewData)?.error?.message,
                      data: unref(previewData),
                      options: draft.value.options || {},
                      "field-config": draft.value.fieldConfig || { defaults: {}, overrides: [] },
                      width: unref(previewPanelSize).width,
                      height: unref(previewPanelSize).height,
                      "time-range": unref(previewData)?.timeRange,
                      editable: false,
                      "can-edit": false,
                      "is-editing": true
                    }, {
                      default: withCtx(() => [
                        unref(ui).tableViewEnabled ? (openBlock(), createElementBlock("div", _hoisted_4$F, [
                          (openBlock(true), createElementBlock(
                            Fragment,
                            null,
                            renderList(unref(previewData)?.series ?? [], (frame, fi) => {
                              return openBlock(), createElementBlock("div", {
                                key: fi,
                                class: "tv-frame"
                              }, [
                                createElementVNode(
                                  "div",
                                  _hoisted_5$A,
                                  " frame " + toDisplayString(fi) + " · refId=" + toDisplayString(frame.refId || "—") + " · rows=" + toDisplayString(frame.length),
                                  1
                                  /* TEXT */
                                ),
                                createElementVNode("table", _hoisted_6$u, [
                                  createElementVNode("thead", null, [
                                    createElementVNode("tr", null, [
                                      (openBlock(true), createElementBlock(
                                        Fragment,
                                        null,
                                        renderList(frame.fields, (f) => {
                                          return openBlock(), createElementBlock("th", {
                                            key: f.name
                                          }, [
                                            createTextVNode(
                                              toDisplayString(f.name) + " ",
                                              1
                                              /* TEXT */
                                            ),
                                            createElementVNode(
                                              "span",
                                              _hoisted_7$q,
                                              toDisplayString(f.type),
                                              1
                                              /* TEXT */
                                            )
                                          ]);
                                        }),
                                        128
                                        /* KEYED_FRAGMENT */
                                      ))
                                    ])
                                  ]),
                                  createElementVNode("tbody", null, [
                                    (openBlock(true), createElementBlock(
                                      Fragment,
                                      null,
                                      renderList(Math.min(frame.length, 50), (ri) => {
                                        return openBlock(), createElementBlock("tr", { key: ri }, [
                                          (openBlock(true), createElementBlock(
                                            Fragment,
                                            null,
                                            renderList(frame.fields, (f) => {
                                              return openBlock(), createElementBlock(
                                                "td",
                                                {
                                                  key: f.name + "-" + ri
                                                },
                                                toDisplayString(f.values[ri - 1]),
                                                1
                                                /* TEXT */
                                              );
                                            }),
                                            128
                                            /* KEYED_FRAGMENT */
                                          ))
                                        ]);
                                      }),
                                      128
                                      /* KEYED_FRAGMENT */
                                    ))
                                  ])
                                ]),
                                frame.length > 50 ? (openBlock(), createElementBlock(
                                  "p",
                                  _hoisted_8$j,
                                  " … 仅显示前 50 行 / 共 " + toDisplayString(frame.length),
                                  1
                                  /* TEXT */
                                )) : createCommentVNode("v-if", true)
                              ]);
                            }),
                            128
                            /* KEYED_FRAGMENT */
                          )),
                          !unref(previewData)?.series?.length ? (openBlock(), createElementBlock("p", _hoisted_9$i, " 无数据帧 ")) : createCommentVNode("v-if", true)
                        ])) : createCommentVNode("v-if", true)
                      ]),
                      _: 1
                      /* STABLE */
                    }, 8, ["title", "transparent", "panel-type", "panel-id", "loading", "error", "data", "options", "field-config", "width", "height", "time-range"])
                  ],
                  4
                  /* STYLE */
                )
              ], 12, _hoisted_3$S),
              createElementVNode(
                "div",
                {
                  class: "split-v",
                  "data-testid": "split-vertical",
                  title: "拖拽调整预览高度",
                  onMousedown: _cache[0] || (_cache[0] = ($event) => unref(onSplitStart)("v", $event))
                },
                null,
                32
                /* NEED_HYDRATION */
              ),
              createCommentVNode(" Bottom: data tabs "),
              createElementVNode("div", _hoisted_10$e, [
                createElementVNode("div", _hoisted_11$c, [
                  createElementVNode(
                    "button",
                    {
                      type: "button",
                      role: "tab",
                      class: normalizeClass({ active: tab.value === "query" }),
                      "data-testid": "tab-query",
                      onClick: _cache[1] || (_cache[1] = ($event) => tab.value = "query")
                    },
                    " 查询 ",
                    2
                    /* CLASS */
                  ),
                  createElementVNode(
                    "button",
                    {
                      type: "button",
                      role: "tab",
                      class: normalizeClass({ active: tab.value === "transform" }),
                      "data-testid": "tab-transform",
                      onClick: _cache[2] || (_cache[2] = ($event) => tab.value = "transform")
                    },
                    " 转换 ",
                    2
                    /* CLASS */
                  ),
                  createElementVNode(
                    "button",
                    {
                      type: "button",
                      role: "tab",
                      class: normalizeClass({ active: tab.value === "alert" }),
                      "data-testid": "tab-alert",
                      onClick: _cache[3] || (_cache[3] = ($event) => tab.value = "alert")
                    },
                    " 告警 ",
                    2
                    /* CLASS */
                  )
                ]),
                tab.value === "query" ? (openBlock(), createBlock(QueryEditorTab, {
                  key: 0,
                  targets: targets.value,
                  rows: queryRows.value,
                  "active-query": activeQuery.value,
                  "active-target": activeTarget.value,
                  "query-editor": QueryEditor2.value,
                  "ds-type": dsType.value,
                  "ds-instance": dsInstance.value,
                  "ds-api": dsApi.value,
                  "onUpdate:activeQuery": _cache[4] || (_cache[4] = ($event) => activeQuery.value = $event),
                  onActivate: _cache[5] || (_cache[5] = ($event) => activeQuery.value = $event),
                  onAdd: addQuery,
                  onDuplicate: duplicateQuery,
                  onToggleHide: toggleHide,
                  onMove: moveQuery,
                  onRemove: removeQuery,
                  onChange: onQueryChange,
                  onChangeAt: onQueryChangeAt,
                  onChangeDatasource: changeActiveDatasource,
                  onChangeDatasourceAt: changeDatasourceAt,
                  onRunQuery: runActiveQuery
                }, null, 8, ["targets", "rows", "active-query", "active-target", "query-editor", "ds-type", "ds-instance", "ds-api"])) : tab.value === "transform" ? (openBlock(), createBlock(TransformEditorTab, {
                  key: 1,
                  transforms: transforms.value,
                  "transformer-ids": transformerIds.value,
                  "ref-ids": (draft.value.targets || []).map((q) => q.refId).filter(Boolean),
                  frames: unref(previewData)?.series ?? __props.data?.series ?? [],
                  onAdd: addTransform$1,
                  onUpdate: updateTransform,
                  onRemove: removeTransform,
                  onToggle: toggleTransform,
                  onMove: moveTransform,
                  onClear: clearTransforms$1
                }, null, 8, ["transforms", "transformer-ids", "ref-ids", "frames"])) : tab.value === "alert" ? (openBlock(), createElementBlock("section", _hoisted_12$b, [..._cache[11] || (_cache[11] = [
                  createElementVNode(
                    "h3",
                    null,
                    "告警",
                    -1
                    /* CACHED */
                  ),
                  createElementVNode(
                    "p",
                    null,
                    " 此面板编辑器对齐 Grafana PanelEditor 的 Alert 页。当前构建未启用统一告警（Unified Alerting）后端时， 不提供伪规则编辑器。可在仪表盘层接入 Alertmanager 数据源查看告警列表。 ",
                    -1
                    /* CACHED */
                  ),
                  createElementVNode(
                    "p",
                    { class: "hint" },
                    " 对照：grafana-main PanelEditorTabId.Alert / PanelNotSupported ",
                    -1
                    /* CACHED */
                  )
                ])])) : createCommentVNode("v-if", true)
              ])
            ],
            4
            /* STYLE */
          ),
          createCommentVNode(" Right: options pane "),
          unref(ui).isPanelOptionsVisible ? (openBlock(), createElementBlock(
            "aside",
            {
              key: 0,
              class: "panel-editor__options",
              "data-testid": "panel-editor-options",
              style: normalizeStyle({ width: unref(ui).rightPaneSize + "px" })
            },
            [
              createElementVNode(
                "div",
                {
                  class: "split-h",
                  "data-testid": "split-horizontal",
                  title: "拖拽调整选项宽度",
                  onMousedown: _cache[6] || (_cache[6] = ($event) => unref(onSplitStart)("h", $event))
                },
                null,
                32
                /* NEED_HYDRATION */
              ),
              createElementVNode("div", _hoisted_13$b, [
                createElementVNode(
                  "button",
                  {
                    type: "button",
                    class: normalizeClass({ active: optionsMode.value === "options" }),
                    "data-testid": "tab-options",
                    onClick: _cache[7] || (_cache[7] = ($event) => optionsMode.value = "options")
                  },
                  " 面板选项 ",
                  2
                  /* CLASS */
                ),
                createElementVNode(
                  "button",
                  {
                    type: "button",
                    class: normalizeClass({ active: optionsMode.value === "field" }),
                    "data-testid": "tab-field",
                    onClick: _cache[8] || (_cache[8] = ($event) => optionsMode.value = "field")
                  },
                  " 字段 ",
                  2
                  /* CLASS */
                )
              ]),
              optionsMode.value === "options" ? (openBlock(), createElementBlock("section", _hoisted_14$b, [
                createElementVNode("div", _hoisted_15$a, [
                  createElementVNode("label", _hoisted_16$9, [
                    _cache[12] || (_cache[12] = createTextVNode(
                      " 可视化 ",
                      -1
                      /* CACHED */
                    )),
                    createVNode(unref(GSelect), {
                      "test-id": "viz-select",
                      value: draft.value.type,
                      options: vizSelectOptions.value,
                      virtual: false,
                      onChange: _cache[9] || (_cache[9] = ($event) => setType(String($event ?? "")))
                    }, null, 8, ["value", "options"])
                  ]),
                  createVNode(PanelFrameOptions, {
                    panel: draft.value,
                    "repeat-variable-options": repeatVariableOptions.value,
                    "template-vars": templateVarNames.value,
                    "template-var-properties": templateVarProperties.value,
                    onChange: onFramePath
                  }, null, 8, ["panel", "repeat-variable-options", "template-vars", "template-var-properties"])
                ]),
                optionDescriptors.value.length ? (openBlock(), createBlock(OptionsPane, {
                  key: 0,
                  options: draft.value.options || {},
                  descriptors: optionDescriptors.value,
                  "field-names": fieldNamesFromData.value,
                  "field-name-options": fieldNameOptionsFromData.value,
                  "data-frames": dataFramesFromData.value,
                  "template-vars": templateVarNames.value,
                  "template-var-properties": templateVarProperties.value,
                  onChange: onOptionPath
                }, null, 8, ["options", "descriptors", "field-names", "field-name-options", "data-frames", "template-vars", "template-var-properties"])) : createCommentVNode("v-if", true),
                draft.value.type === "canvas" ? (openBlock(), createBlock(CanvasEditor, {
                  key: 1,
                  options: draft.value.options || {},
                  onChange: onCanvasOptions
                }, null, 8, ["options"])) : createCommentVNode("v-if", true),
                draft.value.type === "xychart" ? (openBlock(), createBlock(XYSeriesEditor, {
                  key: 2,
                  series: draft.value.options?.series,
                  dims: draft.value.options?.dims,
                  frames: props.data?.series ?? [],
                  onChange: onXySeriesChange
                }, null, 8, ["series", "dims", "frames"])) : createCommentVNode("v-if", true),
                draft.value.type === "geomap" ? (openBlock(), createBlock(GeomapLayersEditor, {
                  key: 3,
                  options: draft.value.options || {},
                  onChange: onGeomapLayers
                }, null, 8, ["options"])) : createCommentVNode("v-if", true),
                !optionDescriptors.value.length && draft.value.type !== "canvas" && draft.value.type !== "geomap" ? (openBlock(), createElementBlock(
                  "p",
                  _hoisted_17$7,
                  " 此可视化暂无注册选项：" + toDisplayString(draft.value.type),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ])) : (openBlock(), createElementBlock("section", _hoisted_18$7, [
                fieldDescriptors.value.length ? (openBlock(), createBlock(OptionsPane, {
                  key: 0,
                  "field-mode": "",
                  options: draft.value.fieldConfig?.defaults ?? {},
                  descriptors: fieldDescriptors.value,
                  "field-names": fieldNamesFromData.value,
                  "field-name-options": fieldNameOptionsFromData.value,
                  "data-frames": dataFramesFromData.value,
                  "template-vars": templateVarNames.value,
                  "template-var-properties": templateVarProperties.value,
                  onChange: onFieldPath
                }, null, 8, ["options", "descriptors", "field-names", "field-name-options", "data-frames", "template-vars", "template-var-properties"])) : (openBlock(), createElementBlock("p", _hoisted_19$7, "此可视化无字段配置")),
                createVNode(FieldOverridesEditor, {
                  overrides: overrides.value,
                  onAdd: addOverride,
                  onRemove: removeOverride,
                  onUpdateMatcher: updateOverrideMatcher,
                  onAddProp: addOverrideProp,
                  onRemoveProp: removeOverrideProp,
                  onSetPropId: setOverridePropId,
                  onSetPropValue: setOverridePropValue
                }, null, 8, ["overrides"])
              ]))
            ],
            4
            /* STYLE */
          )) : createCommentVNode("v-if", true)
        ]),
        createElementVNode("footer", _hoisted_20$6, [
          createVNode(unref(GButton), {
            "test-id": "panel-editor-cancel",
            onClick: discardChanges
          }, {
            default: withCtx(() => [..._cache[13] || (_cache[13] = [
              createTextVNode(
                "丢弃",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          }),
          createCommentVNode(" Grafana alias: L-VE / Playwright also look for panel-editor-discard "),
          createElementVNode("button", {
            type: "button",
            class: "sr-only",
            "data-testid": "panel-editor-discard",
            tabindex: "-1",
            "aria-hidden": "true",
            onClick: discardChanges
          }, " 丢弃 "),
          createVNode(unref(GButton), {
            "test-id": "panel-editor-apply",
            variant: "primary",
            onClick: backToDashboard2
          }, {
            default: withCtx(() => [..._cache[14] || (_cache[14] = [
              createTextVNode(
                "应用",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ])
      ], 8, _hoisted_1$1e);
    };
  }
});
const PanelEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1j, [["__scopeId", "data-v-de34cbbc"]]);
const _hoisted_1$1d = {
  key: 0,
  class: "variables-bar",
  "data-testid": "variables-bar",
  role: "toolbar",
  "aria-label": "模板变量"
};
const _hoisted_2$Z = ["data-var-type"];
const _hoisted_3$R = ["for"];
const _hoisted_4$E = ["data-type"];
const _hoisted_5$z = ["data-testid"];
const _sfc_main$1i = /* @__PURE__ */ defineComponent({
  __name: "VariablesBar",
  props: {
    variables: {}
  },
  emits: ["change", "adhoc-change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const visible = computed(() => props.variables.filter((v) => v.hide !== 2));
    const ADHOC_OPS = [
      { label: "=", value: "=" },
      { label: "!=", value: "!=" },
      { label: "=~", value: "=~" },
      { label: "!~", value: "!~" },
      { label: ">", value: ">" },
      { label: "<", value: "<" }
    ];
    function currentValue(v) {
      const val = v.current?.value;
      if (v.multi) {
        return Array.isArray(val) ? val.map(String) : val != null && val !== "" ? [String(val)] : [];
      }
      return Array.isArray(val) ? String(val[0] ?? "") : String(val ?? "");
    }
    function optionList(v) {
      const opts = (v.options ?? []).map((o) => ({
        label: String(o.text ?? o.value ?? ""),
        value: String(o.value ?? "")
      }));
      if (v.includeAll) {
        const allVal = v.allValue != null && String(v.allValue) !== "" ? String(v.allValue) : "/.*/";
        return [{ label: "全部", value: allVal }, ...opts];
      }
      return opts;
    }
    function onSelect(name, value, multi) {
      if (multi) {
        const arr = Array.isArray(value) ? value.map(String) : value != null && value !== "" ? [String(value)] : [];
        emit("change", name, arr);
      } else {
        emit("change", name, String(value ?? ""));
      }
    }
    function filtersOf(v) {
      const f = v.filters;
      return Array.isArray(f) ? f.map((x) => ({
        key: String(x.key ?? ""),
        operator: String(x.operator ?? "="),
        value: String(x.value ?? "")
      })) : [];
    }
    function updateFilter(v, index2, patch) {
      const next = filtersOf(v).map(
        (f, i) => i === index2 ? { ...f, ...patch } : f
      );
      emit("adhoc-change", v.name, next);
    }
    function addFilter(v) {
      emit("adhoc-change", v.name, [
        ...filtersOf(v),
        { key: "", operator: "=", value: "" }
      ]);
    }
    function removeFilter(v, index2) {
      emit(
        "adhoc-change",
        v.name,
        filtersOf(v).filter((_, i) => i !== index2)
      );
    }
    const TYPE_LABELS = {
      query: "查询",
      custom: "自定义",
      constant: "常量",
      datasource: "数据源",
      interval: "间隔",
      textbox: "文本框",
      adhoc: "Ad hoc",
      system: "系统",
      snapshot: "快照"
    };
    function typeLabel(type) {
      return TYPE_LABELS[type] || type;
    }
    const ADHOC_KEY_SUGGESTIONS = {
      prometheus: [
        "job",
        "instance",
        "namespace",
        "pod",
        "service",
        "container",
        "__name__"
      ],
      loki: ["job", "filename", "namespace", "pod", "app", "level", "service_name"],
      default: ["job", "instance", "namespace", "pod", "service"]
    };
    function adhocKeySuggestions(v) {
      const dsType = String(
        v.datasource?.type ?? v.datasource?.uid ?? ""
      );
      let keys = ADHOC_KEY_SUGGESTIONS.default;
      if (dsType.includes("prometheus") || dsType === "prometheus")
        keys = ADHOC_KEY_SUGGESTIONS.prometheus;
      else if (dsType.includes("loki")) keys = ADHOC_KEY_SUGGESTIONS.loki;
      return keys.map((k) => ({ value: k }));
    }
    return (_ctx, _cache) => {
      return visible.value.length ? (openBlock(), createElementBlock("div", _hoisted_1$1d, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(visible.value, (v) => {
            return openBlock(), createElementBlock("div", {
              key: v.name,
              class: "var-item",
              "data-var-type": v.type
            }, [
              createElementVNode("label", {
                for: `var-${v.name}`
              }, [
                createElementVNode(
                  "span",
                  null,
                  toDisplayString(v.label || v.name),
                  1
                  /* TEXT */
                ),
                createElementVNode("small", {
                  class: "var-type",
                  "data-type": v.type
                }, toDisplayString(typeLabel(v.type)), 9, _hoisted_4$E)
              ], 8, _hoisted_3$R),
              v.type === "adhoc" ? (openBlock(), createElementBlock("div", {
                key: 0,
                class: "adhoc",
                "data-testid": `var-adhoc-${v.name}`
              }, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(filtersOf(v), (f, i) => {
                    return openBlock(), createElementBlock("div", {
                      key: i,
                      class: "adhoc-row",
                      "data-testid": "adhoc-filter-row"
                    }, [
                      createVNode(unref(AutoComplete), {
                        value: f.key,
                        options: adhocKeySuggestions(v),
                        placeholder: "键",
                        size: "small",
                        class: "adhoc-key",
                        "data-testid": "adhoc-key",
                        "onUpdate:value": ($event) => updateFilter(v, i, { key: String($event ?? "") })
                      }, null, 8, ["value", "options", "onUpdate:value"]),
                      createVNode(unref(GSelect), {
                        value: f.operator,
                        options: ADHOC_OPS,
                        "show-search": false,
                        size: "small",
                        "test-id": "adhoc-op",
                        class: "adhoc-op",
                        onChange: ($event) => updateFilter(v, i, { operator: String($event ?? "=") })
                      }, null, 8, ["value", "onChange"]),
                      createVNode(unref(GInput), {
                        value: f.value,
                        placeholder: "值",
                        "test-id": "adhoc-value",
                        class: "adhoc-value",
                        "onUpdate:value": ($event) => updateFilter(v, i, { value: String($event ?? "") })
                      }, null, 8, ["value", "onUpdate:value"]),
                      createVNode(unref(GButton), {
                        size: "sm",
                        "test-id": "adhoc-remove",
                        onClick: ($event) => removeFilter(v, i)
                      }, {
                        default: withCtx(() => [..._cache[0] || (_cache[0] = [
                          createTextVNode(
                            "×",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["onClick"])
                    ]);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                )),
                createVNode(unref(GButton), {
                  size: "sm",
                  variant: "text",
                  class: "adhoc-add",
                  "test-id": "adhoc-add",
                  onClick: ($event) => addFilter(v)
                }, {
                  default: withCtx(() => [..._cache[1] || (_cache[1] = [
                    createTextVNode(
                      "+ 过滤条件",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }, 8, ["onClick"])
              ], 8, _hoisted_5$z)) : v.type === "textbox" || v.type === "constant" ? (openBlock(), createBlock(unref(GInput), {
                key: 1,
                id: `var-${v.name}`,
                class: "var-control",
                value: currentValue(v),
                disabled: v.type === "constant",
                "test-id": `var-${v.name}`,
                placeholder: v.label || v.name,
                "onUpdate:value": ($event) => emit("change", v.name, String($event ?? ""))
              }, null, 8, ["id", "value", "disabled", "test-id", "placeholder", "onUpdate:value"])) : (openBlock(), createBlock(unref(GSelect), {
                key: 2,
                id: `var-${v.name}`,
                class: "var-control",
                value: currentValue(v),
                options: optionList(v),
                virtual: (optionList(v)?.length ?? 0) > 50,
                mode: v.multi ? "multiple" : void 0,
                "test-id": `var-${v.name}`,
                "aria-label": v.label || v.name,
                placeholder: v.label || v.name,
                onChange: ($event) => onSelect(v.name, $event, !!v.multi)
              }, null, 8, ["id", "value", "options", "virtual", "mode", "test-id", "aria-label", "placeholder", "onChange"]))
            ], 8, _hoisted_2$Z);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ])) : createCommentVNode("v-if", true);
    };
  }
});
const VariablesBar = /* @__PURE__ */ _export_sfc(_sfc_main$1i, [["__scopeId", "data-v-9248381f"]]);
const _hoisted_1$1c = {
  class: "var-settings",
  "data-testid": "variables-settings"
};
const _hoisted_2$Y = { class: "actions" };
const _hoisted_3$Q = { class: "body" };
const _hoisted_4$D = {
  class: "list",
  "data-testid": "var-list"
};
const _hoisted_5$y = {
  key: 0,
  class: "empty"
};
const _hoisted_6$t = ["data-testid", "onClick"];
const _hoisted_7$p = {
  key: 0,
  class: "editor",
  "data-testid": "var-editor"
};
const _hoisted_8$i = { key: 0 };
const _hoisted_9$h = {
  key: 1,
  class: "adhoc-editor",
  "data-testid": "adhoc-filters-editor"
};
const _hoisted_10$d = { key: 2 };
const _hoisted_11$b = {
  key: 3,
  class: "refresh-row"
};
const _hoisted_12$a = {
  key: 0,
  class: "err",
  "data-testid": "var-refresh-error"
};
const _hoisted_13$a = {
  class: "meta",
  "data-testid": "var-option-count"
};
const _hoisted_14$a = {
  key: 4,
  class: "options-preview",
  "data-testid": "var-options-preview"
};
const _hoisted_15$9 = { class: "check" };
const _hoisted_16$8 = { class: "check" };
const _sfc_main$1h = /* @__PURE__ */ defineComponent({
  __name: "VariablesSettings",
  props: {
    variables: {}
  },
  emits: ["change", "close"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const selected = ref(0);
    const refreshing = ref(false);
    const refreshError = ref("");
    const datasourceList = ref(
      []
    );
    const current = computed(() => props.variables[selected.value] ?? null);
    const typeOptions = [
      { value: "query", label: "查询" },
      { value: "custom", label: "自定义" },
      { value: "constant", label: "常量" },
      { value: "textbox", label: "文本框" },
      { value: "interval", label: "间隔" },
      { value: "datasource", label: "数据源" },
      { value: "adhoc", label: "Ad hoc 过滤" }
    ];
    const hideOptions = [
      { value: 0, label: "显示" },
      { value: 1, label: "仅隐藏标签" },
      { value: 2, label: "隐藏变量" }
    ];
    const datasourceOptions = computed(() => [
      { value: "", label: "默认" },
      ...datasourceList.value.map((d) => ({
        value: d.uid,
        label: `${d.name} (${d.type})`
      }))
    ]);
    onMounted(async () => {
      const list = await listDataSources();
      datasourceList.value = list.length ? list.map((d) => ({ uid: d.uid, name: d.name, type: d.type })) : [
        { uid: "prometheus", name: "Prometheus", type: "prometheus" },
        {
          uid: "testdata",
          name: "TestData",
          type: "grafana-testdata-datasource"
        }
      ];
    });
    function patch(partial) {
      if (!current.value) return;
      const next = props.variables.map(
        (v, i) => i === selected.value ? { ...v, ...partial } : v
      );
      emit("change", next);
    }
    function addVariable() {
      const name = `var${props.variables.length + 1}`;
      emit("change", [
        ...props.variables,
        {
          name,
          type: "custom",
          label: name,
          hide: 0,
          multi: false,
          includeAll: false,
          current: { text: "A", value: "A" },
          options: [
            { text: "A", value: "A", selected: true },
            { text: "B", value: "B", selected: false },
            { text: "C", value: "C", selected: false }
          ],
          query: "A,B,C"
        }
      ]);
      selected.value = props.variables.length;
    }
    function removeSelected() {
      if (selected.value < 0) return;
      const next = props.variables.filter((_, i) => i !== selected.value);
      emit("change", next);
      selected.value = Math.max(0, selected.value - 1);
    }
    function onQueryOptions(text) {
      if (current.value?.type === "query") {
        patch({ query: text, definition: text });
        return;
      }
      const options = text.split(",").map((s) => s.trim()).filter(Boolean).map((v) => ({ text: v, value: v, selected: false }));
      patch({
        query: text,
        options,
        current: options[0] ? { text: options[0].text, value: options[0].value } : { text: "", value: "" }
      });
    }
    function resolveDs(ref2) {
      const list = datasourceList.value;
      const hit = list.find(
        (d) => ref2?.uid && d.uid === ref2.uid || ref2?.type && d.type === ref2.type
      ) || list[0] || { uid: "prometheus", name: "Prometheus", type: "prometheus" };
      const plugin2 = getDataSourcePlugin(hit.type);
      if (!plugin2?.createDataSource) return void 0;
      return plugin2.createDataSource({
        id: 1,
        uid: hit.uid,
        name: hit.name,
        type: hit.type,
        access: "proxy",
        jsonData: {},
        meta: plugin2.meta
      });
    }
    async function refreshAll() {
      refreshing.value = true;
      refreshError.value = "";
      try {
        let order;
        try {
          order = variableRefreshOrder(props.variables);
        } catch (e) {
          refreshError.value = e instanceof Error ? e.message : String(e);
          order = props.variables.map((v) => v.name);
        }
        let list = [...props.variables];
        for (const name of order) {
          const idx = list.findIndex((v) => v.name === name);
          if (idx < 0) continue;
          list[idx] = await refreshVariableOptions(
            list[idx],
            (ref2) => resolveDs(ref2)
          );
        }
        emit("change", list);
      } catch (e) {
        refreshError.value = e instanceof Error ? e.message : String(e);
      } finally {
        refreshing.value = false;
      }
    }
    async function refreshCurrent() {
      if (!current.value) return;
      refreshing.value = true;
      refreshError.value = "";
      try {
        const updated = await refreshVariableOptions(
          current.value,
          (ref2) => resolveDs(ref2)
        );
        if ((current.value.type === "query" || current.value.type === "custom") && !updated.options?.length && current.value.query) {
          const fallback = String(current.value.query).split(",").map((s) => s.trim()).filter(Boolean).map((v) => ({ text: v, value: v, selected: false }));
          if (fallback.length) {
            patch({
              options: fallback,
              current: { text: fallback[0].text, value: fallback[0].value }
            });
            return;
          }
        }
        const next = props.variables.map(
          (v, i) => i === selected.value ? updated : v
        );
        emit("change", next);
      } catch (e) {
        refreshError.value = e instanceof Error ? e.message : String(e);
      } finally {
        refreshing.value = false;
      }
    }
    function setDatasource(uid) {
      const hit = datasourceList.value.find((d) => d.uid === uid || d.name === uid);
      patch({
        datasource: hit ? { type: hit.type, uid: hit.uid } : { uid }
      });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1c, [
        createElementVNode("header", null, [
          _cache[13] || (_cache[13] = createElementVNode(
            "strong",
            null,
            "变量",
            -1
            /* CACHED */
          )),
          createElementVNode("div", _hoisted_2$Y, [
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": "var-add",
              onClick: addVariable
            }, {
              default: withCtx(() => [..._cache[10] || (_cache[10] = [
                createTextVNode(
                  "添加变量",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }),
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": "var-refresh-all",
              loading: refreshing.value,
              onClick: refreshAll
            }, {
              default: withCtx(() => [..._cache[11] || (_cache[11] = [
                createTextVNode(
                  "刷新全部",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["loading"]),
            createVNode(unref(GButton), {
              size: "sm",
              "test-id": "var-close",
              onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
            }, {
              default: withCtx(() => [..._cache[12] || (_cache[12] = [
                createTextVNode(
                  "关闭",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })
          ])
        ]),
        createElementVNode("div", _hoisted_3$Q, [
          createElementVNode("ul", _hoisted_4$D, [
            !__props.variables.length ? (openBlock(), createElementBlock("li", _hoisted_5$y, "暂无变量")) : createCommentVNode("v-if", true),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.variables, (v, i) => {
                return openBlock(), createElementBlock("li", {
                  key: v.name + i,
                  class: normalizeClass({ active: i === selected.value }),
                  "data-testid": `var-list-item-${v.name}`,
                  onClick: ($event) => selected.value = i
                }, [
                  createElementVNode(
                    "span",
                    null,
                    toDisplayString(v.label || v.name),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "small",
                    null,
                    toDisplayString(v.type),
                    1
                    /* TEXT */
                  )
                ], 10, _hoisted_6$t);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ]),
          current.value ? (openBlock(), createElementBlock("div", _hoisted_7$p, [
            createElementVNode("label", null, [
              _cache[14] || (_cache[14] = createTextVNode(
                " 名称 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                value: current.value.name,
                "test-id": "var-name",
                "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ name: String($event ?? "") }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("label", null, [
              _cache[15] || (_cache[15] = createTextVNode(
                " 标签 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                value: current.value.label || "",
                "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ label: String($event ?? "") }))
              }, null, 8, ["value"])
            ]),
            createElementVNode("label", null, [
              _cache[16] || (_cache[16] = createTextVNode(
                " 类型 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                value: current.value.type,
                options: typeOptions,
                "test-id": "var-type",
                "show-search": false,
                onChange: _cache[3] || (_cache[3] = ($event) => patch({ type: String($event) }))
              }, null, 8, ["value"])
            ]),
            current.value.type === "query" ? (openBlock(), createElementBlock("label", _hoisted_8$i, [
              _cache[17] || (_cache[17] = createTextVNode(
                " 数据源 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                "test-id": "var-datasource",
                value: current.value.datasource?.uid || "",
                options: datasourceOptions.value,
                onChange: _cache[4] || (_cache[4] = ($event) => setDatasource(String($event ?? "")))
              }, null, 8, ["value", "options"])
            ])) : createCommentVNode("v-if", true),
            current.value.type === "adhoc" ? (openBlock(), createElementBlock("div", _hoisted_9$h, [
              _cache[19] || (_cache[19] = createElementVNode(
                "header",
                null,
                "Ad hoc 过滤条件",
                -1
                /* CACHED */
              )),
              _cache[20] || (_cache[20] = createElementVNode(
                "p",
                { class: "hint" },
                " 在仪表盘顶部变量栏中编辑键/运算符/值；此处配置数据源。 ",
                -1
                /* CACHED */
              )),
              createElementVNode("label", null, [
                _cache[18] || (_cache[18] = createTextVNode(
                  " 数据源 ",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GSelect), {
                  value: current.value.datasource?.uid || current.value.datasource?.type || "",
                  options: datasourceOptions.value,
                  "test-id": "adhoc-ds",
                  onChange: _cache[5] || (_cache[5] = ($event) => patch({ datasource: { uid: String($event ?? "") } }))
                }, null, 8, ["value", "options"])
              ])
            ])) : createCommentVNode("v-if", true),
            current.value.type === "custom" || current.value.type === "query" || current.value.type === "interval" || current.value.type === "constant" ? (openBlock(), createElementBlock("label", _hoisted_10$d, [
              createTextVNode(
                toDisplayString(current.value.type === "query" ? "查询" : "选项 / 查询") + " ",
                1
                /* TEXT */
              ),
              createVNode(unref(GInput), {
                value: String(current.value.query ?? current.value.definition ?? ""),
                "test-id": "var-query",
                "onUpdate:value": _cache[6] || (_cache[6] = ($event) => onQueryOptions(String($event ?? "")))
              }, null, 8, ["value"])
            ])) : createCommentVNode("v-if", true),
            current.value.type === "query" || current.value.type === "custom" || current.value.type === "interval" ? (openBlock(), createElementBlock("div", _hoisted_11$b, [
              createVNode(unref(GButton), {
                size: "sm",
                "test-id": "var-refresh",
                loading: refreshing.value,
                onClick: refreshCurrent
              }, {
                default: withCtx(() => [
                  createTextVNode(
                    toDisplayString(refreshing.value ? "刷新中…" : "刷新选项"),
                    1
                    /* TEXT */
                  )
                ]),
                _: 1
                /* STABLE */
              }, 8, ["loading"]),
              refreshError.value ? (openBlock(), createElementBlock(
                "span",
                _hoisted_12$a,
                toDisplayString(refreshError.value),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              createElementVNode(
                "span",
                _hoisted_13$a,
                toDisplayString((current.value.options || []).length) + " 个选项",
                1
                /* TEXT */
              )
            ])) : createCommentVNode("v-if", true),
            current.value.options?.length ? (openBlock(), createElementBlock("ul", _hoisted_14$a, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(current.value.options.slice(0, 20), (o) => {
                  return openBlock(), createElementBlock(
                    "li",
                    {
                      key: String(o.value)
                    },
                    toDisplayString(o.text),
                    1
                    /* TEXT */
                  );
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])) : createCommentVNode("v-if", true),
            createElementVNode("label", _hoisted_15$9, [
              createVNode(unref(_sfc_main$4u), {
                checked: !!current.value.multi,
                "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => patch({ multi: $event }))
              }, null, 8, ["checked"]),
              _cache[21] || (_cache[21] = createTextVNode(
                " 多选 ",
                -1
                /* CACHED */
              ))
            ]),
            createElementVNode("label", _hoisted_16$8, [
              createVNode(unref(_sfc_main$4u), {
                checked: !!current.value.includeAll,
                "onUpdate:checked": _cache[8] || (_cache[8] = ($event) => patch({ includeAll: $event }))
              }, null, 8, ["checked"]),
              _cache[22] || (_cache[22] = createTextVNode(
                " 包含全部 ",
                -1
                /* CACHED */
              ))
            ]),
            createElementVNode("label", null, [
              _cache[23] || (_cache[23] = createTextVNode(
                " 隐藏 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GSelect), {
                value: Number(current.value.hide ?? 0),
                options: hideOptions,
                "show-search": false,
                onChange: _cache[9] || (_cache[9] = ($event) => patch({ hide: Number($event) }))
              }, null, 8, ["value"])
            ]),
            createVNode(unref(GButton), {
              size: "sm",
              variant: "destructive",
              "test-id": "var-remove",
              onClick: removeSelected
            }, {
              default: withCtx(() => [..._cache[24] || (_cache[24] = [
                createTextVNode(
                  "删除变量",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })
          ])) : createCommentVNode("v-if", true)
        ])
      ]);
    };
  }
});
const VariablesSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1h, [["__scopeId", "data-v-a6c92ba0"]]);
const _hoisted_1$1b = {
  class: "settings-pane",
  "data-testid": "settings-general"
};
const _hoisted_2$X = { class: "field" };
const _hoisted_3$P = { class: "field" };
const _hoisted_4$C = { class: "field" };
const _hoisted_5$x = { class: "field row" };
const _hoisted_6$s = ["checked"];
const _hoisted_7$o = { class: "field" };
const _hoisted_8$h = { class: "field" };
const _hoisted_9$g = { class: "field" };
const _hoisted_10$c = { class: "field" };
const _sfc_main$1g = /* @__PURE__ */ defineComponent({
  __name: "GeneralSettings",
  props: {
    model: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function set(key, value) {
      emit("change", { [key]: value });
    }
    const tagsText = computed(
      () => Array.isArray(props.model.tags) ? props.model.tags.join(", ") : ""
    );
    const graphTooltipOptions = [
      { label: "默认", value: 0 },
      { label: "共享十字线", value: 1 },
      { label: "共享提示", value: 2 }
    ];
    const weekStartOptions = [
      { label: "默认", value: "" },
      { label: "周一", value: "monday" },
      { label: "周六", value: "saturday" },
      { label: "周日", value: "sunday" }
    ];
    const timezoneOptions = [
      { label: "浏览器时区", value: "browser" },
      { label: "UTC", value: "utc" }
    ];
    const refreshOptions = [
      { label: "关闭", value: "" },
      ...defaultRefreshIntervals.map((v) => ({ label: v, value: v }))
    ];
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1b, [
        createElementVNode("label", _hoisted_2$X, [
          _cache[8] || (_cache[8] = createElementVNode(
            "span",
            null,
            "标题",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.model.title ?? ""),
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => set("title", $event))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_3$P, [
          _cache[9] || (_cache[9] = createElementVNode(
            "span",
            null,
            "描述",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: String(__props.model.description ?? ""),
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => set("description", $event))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_4$C, [
          _cache[10] || (_cache[10] = createElementVNode(
            "span",
            null,
            "标签（逗号分隔）",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            value: tagsText.value,
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => set(
              "tags",
              String($event ?? "").split(",").map((s) => s.trim()).filter(Boolean)
            ))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_5$x, [
          createElementVNode("input", {
            type: "checkbox",
            checked: __props.model.editable !== false,
            onChange: _cache[3] || (_cache[3] = ($event) => set("editable", $event.target.checked))
          }, null, 40, _hoisted_6$s),
          _cache[11] || (_cache[11] = createElementVNode(
            "span",
            null,
            "可编辑",
            -1
            /* CACHED */
          ))
        ]),
        createElementVNode("label", _hoisted_7$o, [
          _cache[12] || (_cache[12] = createElementVNode(
            "span",
            null,
            "Tooltip 共享",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: Number(__props.model.graphTooltip ?? 0),
            options: graphTooltipOptions,
            "show-search": false,
            onChange: _cache[4] || (_cache[4] = ($event) => set("graphTooltip", Number($event ?? 0)))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_8$h, [
          _cache[13] || (_cache[13] = createElementVNode(
            "span",
            null,
            "时区",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: String(__props.model.timezone ?? "browser"),
            options: timezoneOptions,
            "show-search": false,
            onChange: _cache[5] || (_cache[5] = ($event) => set("timezone", String($event ?? "browser")))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_9$g, [
          _cache[14] || (_cache[14] = createElementVNode(
            "span",
            null,
            "周起始",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: String(__props.model.weekStart ?? ""),
            options: weekStartOptions,
            "show-search": false,
            onChange: _cache[6] || (_cache[6] = ($event) => set("weekStart", String($event ?? "")))
          }, null, 8, ["value"])
        ]),
        createElementVNode("label", _hoisted_10$c, [
          _cache[15] || (_cache[15] = createElementVNode(
            "span",
            null,
            "自动刷新",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: String(__props.model.refresh ?? ""),
            options: refreshOptions,
            "show-search": false,
            onChange: _cache[7] || (_cache[7] = ($event) => set("refresh", String($event ?? "")))
          }, null, 8, ["value"])
        ])
      ]);
    };
  }
});
const GeneralSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1g, [["__scopeId", "data-v-3823011c"]]);
const _hoisted_1$1a = {
  class: "settings-pane",
  "data-testid": "settings-annotations"
};
const _hoisted_2$W = { class: "row" };
const _hoisted_3$O = ["checked", "onChange"];
const _sfc_main$1f = /* @__PURE__ */ defineComponent({
  __name: "AnnotationsSettings",
  props: {
    list: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const rows = computed(() => props.list ?? []);
    function update(i, patch) {
      const next = rows.value.map((r, idx) => idx === i ? { ...r, ...patch } : r);
      emit("change", next);
    }
    function remove(i) {
      emit(
        "change",
        rows.value.filter((_, idx) => idx !== i)
      );
    }
    function add() {
      emit("change", [
        ...rows.value,
        {
          name: `annotation-${rows.value.length + 1}`,
          enable: true,
          hide: false,
          iconColor: "rgba(0, 211, 255, 1)",
          datasource: { type: "grafana", uid: "-- Grafana --" }
        }
      ]);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1a, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (a, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "anno-row"
            }, [
              createVNode(unref(GInput), {
                value: String(a.name ?? ""),
                placeholder: "名称",
                "onUpdate:value": ($event) => update(i, { name: $event })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GInput), {
                value: String(a.iconColor ?? ""),
                placeholder: "颜色",
                "onUpdate:value": ($event) => update(i, { iconColor: $event })
              }, null, 8, ["value", "onUpdate:value"]),
              createElementVNode("label", _hoisted_2$W, [
                createElementVNode("input", {
                  type: "checkbox",
                  checked: a.hide === true,
                  onChange: ($event) => update(i, { hide: $event.target.checked })
                }, null, 40, _hoisted_3$O),
                _cache[0] || (_cache[0] = createTextVNode(
                  " 隐藏 ",
                  -1
                  /* CACHED */
                ))
              ]),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "destructive",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "删除",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          variant: "primary",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[2] || (_cache[2] = [
            createTextVNode(
              "添加注释",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const AnnotationsSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1f, [["__scopeId", "data-v-736c166c"]]);
const _hoisted_1$19 = {
  class: "settings-pane",
  "data-testid": "settings-links"
};
const _hoisted_2$V = { class: "row" };
const _hoisted_3$N = ["checked", "onChange"];
const _sfc_main$1e = /* @__PURE__ */ defineComponent({
  __name: "LinksSettings",
  props: {
    links: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const rows = computed(() => props.links ?? []);
    function update(i, patch) {
      emit(
        "change",
        rows.value.map((r, idx) => idx === i ? { ...r, ...patch } : r)
      );
    }
    function remove(i) {
      emit(
        "change",
        rows.value.filter((_, idx) => idx !== i)
      );
    }
    function add() {
      emit("change", [
        ...rows.value,
        {
          title: "链接",
          url: "https://",
          tooltip: "",
          icon: "external link",
          targetBlank: true,
          type: "link"
        }
      ]);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$19, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows.value, (l, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "link-row"
            }, [
              createVNode(unref(GInput), {
                value: String(l.title ?? ""),
                placeholder: "标题",
                "onUpdate:value": ($event) => update(i, { title: $event })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GInput), {
                value: String(l.url ?? ""),
                placeholder: "URL",
                "onUpdate:value": ($event) => update(i, { url: $event })
              }, null, 8, ["value", "onUpdate:value"]),
              createVNode(unref(GInput), {
                value: String(l.tooltip ?? ""),
                placeholder: "提示",
                "onUpdate:value": ($event) => update(i, { tooltip: $event })
              }, null, 8, ["value", "onUpdate:value"]),
              createElementVNode("label", _hoisted_2$V, [
                createElementVNode("input", {
                  type: "checkbox",
                  checked: l.targetBlank !== false,
                  onChange: ($event) => update(i, {
                    targetBlank: $event.target.checked
                  })
                }, null, 40, _hoisted_3$N),
                _cache[0] || (_cache[0] = createTextVNode(
                  " 新窗口 ",
                  -1
                  /* CACHED */
                ))
              ]),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "destructive",
                onClick: ($event) => remove(i)
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    "删除",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          variant: "primary",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[2] || (_cache[2] = [
            createTextVNode(
              "添加链接",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const LinksSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1e, [["__scopeId", "data-v-defce3b7"]]);
const _hoisted_1$18 = {
  class: "settings-pane",
  "data-testid": "settings-json-model"
};
const _sfc_main$1d = /* @__PURE__ */ defineComponent({
  __name: "JsonModelSettings",
  props: {
    json: {}
  },
  emits: ["apply"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const draft = ref(props.json);
    watch(
      () => props.json,
      (v) => {
        draft.value = v;
      }
    );
    function apply() {
      try {
        const raw = JSON.parse(draft.value);
        emit("apply", raw);
      } catch (e) {
        alert(e instanceof Error ? e.message : String(e));
      }
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$18, [
        withDirectives(createElementVNode(
          "textarea",
          {
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => draft.value = $event),
            class: "json-editor",
            "data-testid": "settings-json-textarea",
            spellcheck: "false"
          },
          null,
          512
          /* NEED_PATCH */
        ), [
          [vModelText, draft.value]
        ]),
        createVNode(unref(GButton), {
          variant: "primary",
          "test-id": "settings-json-apply",
          onClick: apply
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              "应用 JSON",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const JsonModelSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1d, [["__scopeId", "data-v-71a0d165"]]);
const _hoisted_1$17 = { class: "ds-modal" };
const _hoisted_2$U = { class: "ds-modal__toolbar" };
const _hoisted_3$M = {
  class: "ds-table",
  "data-testid": "ds-modal-table"
};
const _hoisted_4$B = { key: 0 };
const _hoisted_5$w = { class: "mono" };
const _hoisted_6$r = { class: "mono" };
const _hoisted_7$n = ["data-testid", "onClick"];
const _hoisted_8$g = { class: "actions" };
const _hoisted_9$f = {
  key: 0,
  class: "ds-form",
  "data-testid": "ds-modal-form"
};
const _hoisted_10$b = { class: "field" };
const _hoisted_11$a = { class: "field" };
const _hoisted_12$9 = { class: "field" };
const _hoisted_13$9 = { class: "field" };
const _hoisted_14$9 = { class: "field row" };
const _hoisted_15$8 = ["checked"];
const _hoisted_16$7 = {
  key: 0,
  class: "field"
};
const _hoisted_17$6 = { class: "field row" };
const _hoisted_18$6 = ["checked"];
const _hoisted_19$6 = {
  key: 1,
  class: "error",
  "data-testid": "ds-form-error"
};
const _hoisted_20$5 = { class: "form-actions" };
const _sfc_main$1c = /* @__PURE__ */ defineComponent({
  __name: "DatasourceConfigModal",
  props: {
    open: { type: Boolean },
    list: {}
  },
  emits: ["update:open", "save"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const draft = ref([]);
    const editingUid = ref(null);
    const form = ref(newEmbeddedDatasourceDraft());
    const formError = ref("");
    const typeOptions = computed(() => {
      const plugins = listDataSourcePlugins();
      const opts = plugins.map((p) => ({
        value: p.meta.id,
        label: `${p.meta.name || dsTypeLabel(p.meta.id)} (${p.meta.id})`
      }));
      if (!opts.length) {
        return [
          { value: "grafana-testdata-datasource", label: "TestData" },
          { value: "prometheus", label: "Prometheus" },
          { value: "signoz", label: "SigNoz" },
          {
            value: "alexanderzobnin-zabbix-datasource",
            label: "Zabbix"
          }
        ];
      }
      return opts;
    });
    const isEditing = computed(() => editingUid.value != null);
    watch(
      () => props.open,
      (open) => {
        if (!open) return;
        draft.value = sanitizeEmbeddedDatasources(props.list).map((d) => ({
          ...d
        }));
        editingUid.value = null;
        formError.value = "";
      }
    );
    function close() {
      emit("update:open", false);
    }
    function startAdd() {
      editingUid.value = "__new__";
      form.value = newEmbeddedDatasourceDraft(
        String(typeOptions.value[0]?.value ?? "grafana-testdata-datasource")
      );
      formError.value = "";
    }
    function startEdit(ds2) {
      editingUid.value = ds2.uid;
      form.value = { ...ds2, jsonData: { ...ds2.jsonData ?? {} } };
      formError.value = "";
    }
    function cancelForm() {
      editingUid.value = null;
      formError.value = "";
    }
    function removeAt(uid) {
      draft.value = draft.value.filter((d) => d.uid !== uid);
      if (editingUid.value === uid) cancelForm();
    }
    function setDefault(uid) {
      draft.value = draft.value.map((d) => ({
        ...d,
        isDefault: d.uid === uid
      }));
    }
    function saveForm() {
      const next = sanitizeEmbeddedDatasource(form.value);
      if (!next.uid) {
        formError.value = "UID 不能为空";
        return;
      }
      if (!next.type) {
        formError.value = "请选择类型";
        return;
      }
      if (!next.name) {
        formError.value = "名称不能为空";
        return;
      }
      const clash = draft.value.find(
        (d) => d.uid === next.uid && d.uid !== editingUid.value
      );
      if (clash || editingUid.value === "__new__" && draft.value.some((d) => d.uid === next.uid)) {
        formError.value = `UID 已存在: ${next.uid}`;
        return;
      }
      if (editingUid.value === "__new__") {
        if (next.isDefault) {
          draft.value = draft.value.map((d) => ({ ...d, isDefault: false }));
        }
        draft.value = [...draft.value, next];
      } else {
        draft.value = draft.value.map((d) => {
          if (d.uid !== editingUid.value) {
            return next.isDefault ? { ...d, isDefault: false } : d;
          }
          return next;
        });
      }
      editingUid.value = null;
      formError.value = "";
    }
    function onOk() {
      if (editingUid.value != null) {
        saveForm();
        if (editingUid.value != null) return;
      }
      emit("save", sanitizeEmbeddedDatasources(draft.value));
      emit("update:open", false);
    }
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(_sfc_main$4A), {
        open: __props.open,
        title: "配置数据源",
        width: 720,
        "ok-text": "应用",
        "cancel-text": "取消",
        "test-id": "datasource-config-modal",
        "onUpdate:open": _cache[7] || (_cache[7] = ($event) => emit("update:open", $event)),
        onOk,
        onCancel: close
      }, {
        default: withCtx(() => [
          createElementVNode("div", _hoisted_1$17, [
            createElementVNode("div", _hoisted_2$U, [
              _cache[9] || (_cache[9] = createElementVNode(
                "p",
                { class: "hint" },
                " 数据源随仪表盘配置一起保存（不含密钥）。密钥请走运行时凭据 / 环境变量。 ",
                -1
                /* CACHED */
              )),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "primary",
                "test-id": "ds-modal-add",
                disabled: editingUid.value != null,
                onClick: startAdd
              }, {
                default: withCtx(() => [..._cache[8] || (_cache[8] = [
                  createTextVNode(
                    " 新增 ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["disabled"])
            ]),
            createElementVNode("table", _hoisted_3$M, [
              _cache[13] || (_cache[13] = createElementVNode(
                "thead",
                null,
                [
                  createElementVNode("tr", null, [
                    createElementVNode("th", null, "名称"),
                    createElementVNode("th", null, "UID"),
                    createElementVNode("th", null, "类型"),
                    createElementVNode("th", null, "URL"),
                    createElementVNode("th", null, "默认"),
                    createElementVNode("th")
                  ])
                ],
                -1
                /* CACHED */
              )),
              createElementVNode("tbody", null, [
                !draft.value.length ? (openBlock(), createElementBlock("tr", _hoisted_4$B, [..._cache[10] || (_cache[10] = [
                  createElementVNode(
                    "td",
                    {
                      colspan: "6",
                      class: "empty"
                    },
                    "暂无数据源，点击「新增」添加",
                    -1
                    /* CACHED */
                  )
                ])])) : createCommentVNode("v-if", true),
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(draft.value, (ds2) => {
                    return openBlock(), createElementBlock("tr", {
                      key: ds2.uid,
                      "data-testid": "ds-modal-row"
                    }, [
                      createElementVNode(
                        "td",
                        null,
                        toDisplayString(ds2.name),
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "td",
                        _hoisted_5$w,
                        toDisplayString(ds2.uid),
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "td",
                        null,
                        toDisplayString(unref(dsTypeLabel)(ds2.type) || ds2.type),
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "td",
                        _hoisted_6$r,
                        toDisplayString(ds2.url || "—"),
                        1
                        /* TEXT */
                      ),
                      createElementVNode("td", null, [
                        createElementVNode("button", {
                          type: "button",
                          class: normalizeClass(["linkish", { on: ds2.isDefault }]),
                          "data-testid": `ds-default-${ds2.uid}`,
                          onClick: ($event) => setDefault(ds2.uid)
                        }, toDisplayString(ds2.isDefault ? "默认" : "设为默认"), 11, _hoisted_7$n)
                      ]),
                      createElementVNode("td", _hoisted_8$g, [
                        createVNode(unref(GButton), {
                          size: "sm",
                          "test-id": "ds-modal-edit",
                          onClick: ($event) => startEdit(ds2)
                        }, {
                          default: withCtx(() => [..._cache[11] || (_cache[11] = [
                            createTextVNode(
                              "编辑",
                              -1
                              /* CACHED */
                            )
                          ])]),
                          _: 1
                          /* STABLE */
                        }, 8, ["onClick"]),
                        createVNode(unref(GButton), {
                          size: "sm",
                          variant: "destructive",
                          "test-id": "ds-modal-delete",
                          onClick: ($event) => removeAt(ds2.uid)
                        }, {
                          default: withCtx(() => [..._cache[12] || (_cache[12] = [
                            createTextVNode(
                              "删除",
                              -1
                              /* CACHED */
                            )
                          ])]),
                          _: 1
                          /* STABLE */
                        }, 8, ["onClick"])
                      ])
                    ]);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])
            ]),
            isEditing.value ? (openBlock(), createElementBlock("div", _hoisted_9$f, [
              createElementVNode(
                "h4",
                null,
                toDisplayString(editingUid.value === "__new__" ? "新增数据源" : "编辑数据源"),
                1
                /* TEXT */
              ),
              createElementVNode("label", _hoisted_10$b, [
                _cache[14] || (_cache[14] = createElementVNode(
                  "span",
                  null,
                  "名称",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  value: form.value.name,
                  "test-id": "ds-form-name",
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => form.value.name = String($event ?? ""))
                }, null, 8, ["value"])
              ]),
              createElementVNode("label", _hoisted_11$a, [
                _cache[15] || (_cache[15] = createElementVNode(
                  "span",
                  null,
                  "UID",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  value: form.value.uid,
                  disabled: editingUid.value !== "__new__",
                  "test-id": "ds-form-uid",
                  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => form.value.uid = String($event ?? ""))
                }, null, 8, ["value", "disabled"])
              ]),
              createElementVNode("label", _hoisted_12$9, [
                _cache[16] || (_cache[16] = createElementVNode(
                  "span",
                  null,
                  "类型",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GSelect), {
                  value: form.value.type,
                  options: typeOptions.value,
                  "show-search": true,
                  "test-id": "ds-form-type",
                  onChange: _cache[2] || (_cache[2] = ($event) => form.value.type = String($event ?? form.value.type))
                }, null, 8, ["value", "options"])
              ]),
              createElementVNode("label", _hoisted_13$9, [
                _cache[17] || (_cache[17] = createElementVNode(
                  "span",
                  null,
                  "URL",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  value: form.value.url,
                  "test-id": "ds-form-url",
                  placeholder: "https://… 或 /proxy/path",
                  "onUpdate:value": _cache[3] || (_cache[3] = ($event) => form.value.url = String($event ?? ""))
                }, null, 8, ["value"])
              ]),
              createElementVNode("label", _hoisted_14$9, [
                createElementVNode("input", {
                  type: "checkbox",
                  checked: !!form.value.basicAuth,
                  "data-testid": "ds-form-basic-auth",
                  onChange: _cache[4] || (_cache[4] = ($event) => form.value.basicAuth = $event.target.checked)
                }, null, 40, _hoisted_15$8),
                _cache[18] || (_cache[18] = createElementVNode(
                  "span",
                  null,
                  "Basic Auth",
                  -1
                  /* CACHED */
                ))
              ]),
              form.value.basicAuth ? (openBlock(), createElementBlock("label", _hoisted_16$7, [
                _cache[19] || (_cache[19] = createElementVNode(
                  "span",
                  null,
                  "用户名",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  value: form.value.basicAuthUser || "",
                  "test-id": "ds-form-basic-user",
                  "onUpdate:value": _cache[5] || (_cache[5] = ($event) => form.value.basicAuthUser = String($event ?? ""))
                }, null, 8, ["value"])
              ])) : createCommentVNode("v-if", true),
              createElementVNode("label", _hoisted_17$6, [
                createElementVNode("input", {
                  type: "checkbox",
                  checked: !!form.value.isDefault,
                  "data-testid": "ds-form-default",
                  onChange: _cache[6] || (_cache[6] = ($event) => form.value.isDefault = $event.target.checked)
                }, null, 40, _hoisted_18$6),
                _cache[20] || (_cache[20] = createElementVNode(
                  "span",
                  null,
                  "设为默认数据源",
                  -1
                  /* CACHED */
                ))
              ]),
              formError.value ? (openBlock(), createElementBlock(
                "p",
                _hoisted_19$6,
                toDisplayString(formError.value),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true),
              createElementVNode("div", _hoisted_20$5, [
                createVNode(unref(GButton), {
                  size: "sm",
                  onClick: cancelForm
                }, {
                  default: withCtx(() => [..._cache[21] || (_cache[21] = [
                    createTextVNode(
                      "取消",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }),
                createVNode(unref(GButton), {
                  size: "sm",
                  variant: "primary",
                  "test-id": "ds-form-save",
                  onClick: saveForm
                }, {
                  default: withCtx(() => [..._cache[22] || (_cache[22] = [
                    createTextVNode(
                      "保存到列表",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })
              ])
            ])) : createCommentVNode("v-if", true)
          ])
        ]),
        _: 1
        /* STABLE */
      }, 8, ["open"]);
    };
  }
});
const DatasourceConfigModal = /* @__PURE__ */ _export_sfc(_sfc_main$1c, [["__scopeId", "data-v-07f934ac"]]);
const _hoisted_1$16 = {
  class: "settings-pane",
  "data-testid": "settings-datasources"
};
const _hoisted_2$T = { class: "head" };
const _hoisted_3$L = {
  key: 0,
  class: "list",
  "data-testid": "settings-ds-list"
};
const _hoisted_4$A = { class: "main" };
const _hoisted_5$v = {
  key: 0,
  class: "badge"
};
const _hoisted_6$q = { class: "meta" };
const _hoisted_7$m = { class: "mono" };
const _hoisted_8$f = { class: "mono" };
const _hoisted_9$e = {
  key: 1,
  class: "empty",
  "data-testid": "settings-ds-empty"
};
const _sfc_main$1b = /* @__PURE__ */ defineComponent({
  __name: "DatasourcesSettings",
  props: {
    list: {}
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    const modalOpen = ref(false);
    function onSave(list) {
      emit("change", list);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$16, [
        createElementVNode("div", _hoisted_2$T, [
          _cache[3] || (_cache[3] = createElementVNode(
            "div",
            null,
            [
              createElementVNode("h3", null, "数据源"),
              createElementVNode("p", { class: "sub" }, " 与仪表盘配置一并保存。查询编辑器从此列表选择实例。 ")
            ],
            -1
            /* CACHED */
          )),
          createVNode(unref(GButton), {
            variant: "primary",
            size: "sm",
            "test-id": "configure-datasources-btn",
            onClick: _cache[0] || (_cache[0] = ($event) => modalOpen.value = true)
          }, {
            default: withCtx(() => [..._cache[2] || (_cache[2] = [
              createTextVNode(
                " 配置数据源 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ]),
        __props.list.length ? (openBlock(), createElementBlock("ul", _hoisted_3$L, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(__props.list, (ds2) => {
              return openBlock(), createElementBlock("li", {
                key: ds2.uid,
                "data-testid": "settings-ds-item"
              }, [
                createElementVNode("div", _hoisted_4$A, [
                  createElementVNode(
                    "strong",
                    null,
                    toDisplayString(ds2.name),
                    1
                    /* TEXT */
                  ),
                  ds2.isDefault ? (openBlock(), createElementBlock("span", _hoisted_5$v, "默认")) : createCommentVNode("v-if", true)
                ]),
                createElementVNode("div", _hoisted_6$q, [
                  createElementVNode(
                    "span",
                    null,
                    toDisplayString(unref(dsTypeLabel)(ds2.type) || ds2.type),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_7$m,
                    toDisplayString(ds2.uid),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_8$f,
                    toDisplayString(ds2.url || "无 URL"),
                    1
                    /* TEXT */
                  )
                ])
              ]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : (openBlock(), createElementBlock("p", _hoisted_9$e, " 尚未绑定数据源。点击「配置数据源」新增。 ")),
        createVNode(DatasourceConfigModal, {
          open: modalOpen.value,
          "onUpdate:open": _cache[1] || (_cache[1] = ($event) => modalOpen.value = $event),
          list: __props.list,
          onSave
        }, null, 8, ["open", "list"])
      ]);
    };
  }
});
const DatasourcesSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1b, [["__scopeId", "data-v-dd8c00b0"]]);
const _hoisted_1$15 = {
  class: "dashboard-settings",
  "data-testid": "dashboard-settings"
};
const _hoisted_2$S = { class: "dashboard-settings__header" };
const _hoisted_3$K = { class: "dashboard-settings__body" };
const _hoisted_4$z = { class: "dashboard-settings__nav" };
const _hoisted_5$u = { class: "dashboard-settings__content" };
const _sfc_main$1a = /* @__PURE__ */ defineComponent({
  __name: "DashboardSettings",
  props: {
    document: {},
    json: {}
  },
  emits: ["close", "patch", "variables", "annotations", "links", "applyJson", "datasources"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const tab = ref("general");
    const generalModel = computed(() => props.document ?? {});
    const annotationList = computed(
      () => props.document?.annotations?.list ?? []
    );
    const linkList = computed(() => props.document?.links ?? []);
    const variableList = computed(
      () => props.document?.templating?.list ?? []
    );
    const datasourceList = computed(
      () => readEmbeddedDatasources(props.document)
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$15, [
        createElementVNode("header", _hoisted_2$S, [
          _cache[15] || (_cache[15] = createElementVNode(
            "h2",
            null,
            "仪表盘设置",
            -1
            /* CACHED */
          )),
          createVNode(unref(GButton), {
            size: "sm",
            variant: "text",
            onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
          }, {
            default: withCtx(() => [..._cache[14] || (_cache[14] = [
              createTextVNode(
                "关闭",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ]),
        createElementVNode("div", _hoisted_3$K, [
          createElementVNode("nav", _hoisted_4$z, [
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ active: tab.value === "general" }),
                "data-testid": "settings-tab-general",
                onClick: _cache[1] || (_cache[1] = ($event) => tab.value = "general")
              },
              " 常规 ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ active: tab.value === "annotations" }),
                "data-testid": "settings-tab-annotations",
                onClick: _cache[2] || (_cache[2] = ($event) => tab.value = "annotations")
              },
              " 注释 ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ active: tab.value === "variables" }),
                "data-testid": "settings-tab-variables",
                onClick: _cache[3] || (_cache[3] = ($event) => tab.value = "variables")
              },
              " 变量 ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ active: tab.value === "links" }),
                "data-testid": "settings-tab-links",
                onClick: _cache[4] || (_cache[4] = ($event) => tab.value = "links")
              },
              " 链接 ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ active: tab.value === "datasources" }),
                "data-testid": "settings-tab-datasources",
                onClick: _cache[5] || (_cache[5] = ($event) => tab.value = "datasources")
              },
              " 数据源 ",
              2
              /* CLASS */
            ),
            createElementVNode(
              "button",
              {
                type: "button",
                class: normalizeClass({ active: tab.value === "json" }),
                "data-testid": "settings-tab-json",
                onClick: _cache[6] || (_cache[6] = ($event) => tab.value = "json")
              },
              " JSON 模型 ",
              2
              /* CLASS */
            )
          ]),
          createElementVNode("div", _hoisted_5$u, [
            tab.value === "general" ? (openBlock(), createBlock(GeneralSettings, {
              key: 0,
              model: generalModel.value,
              onChange: _cache[7] || (_cache[7] = ($event) => emit("patch", $event))
            }, null, 8, ["model"])) : tab.value === "annotations" ? (openBlock(), createBlock(AnnotationsSettings, {
              key: 1,
              list: annotationList.value,
              onChange: _cache[8] || (_cache[8] = ($event) => emit("annotations", $event))
            }, null, 8, ["list"])) : tab.value === "variables" ? (openBlock(), createBlock(VariablesSettings, {
              key: 2,
              variables: variableList.value,
              onClose: _cache[9] || (_cache[9] = ($event) => tab.value = "general"),
              onChange: _cache[10] || (_cache[10] = ($event) => emit("variables", $event))
            }, null, 8, ["variables"])) : tab.value === "links" ? (openBlock(), createBlock(LinksSettings, {
              key: 3,
              links: linkList.value,
              onChange: _cache[11] || (_cache[11] = ($event) => emit("links", $event))
            }, null, 8, ["links"])) : tab.value === "datasources" ? (openBlock(), createBlock(DatasourcesSettings, {
              key: 4,
              list: datasourceList.value,
              onChange: _cache[12] || (_cache[12] = ($event) => emit("datasources", $event))
            }, null, 8, ["list"])) : (openBlock(), createBlock(JsonModelSettings, {
              key: 5,
              json: __props.json,
              onApply: _cache[13] || (_cache[13] = ($event) => emit("applyJson", $event))
            }, null, 8, ["json"]))
          ])
        ])
      ]);
    };
  }
});
const DashboardSettings = /* @__PURE__ */ _export_sfc(_sfc_main$1a, [["__scopeId", "data-v-ba848f14"]]);
const _hoisted_1$14 = {
  key: 0,
  class: "lib-root",
  "data-testid": "library-panels-root"
};
const _hoisted_2$R = {
  class: "lib-panel",
  "data-testid": "library-panels-drawer",
  role: "dialog",
  "aria-label": "面板库"
};
const _hoisted_3$J = {
  class: "lib",
  "data-testid": "library-panels"
};
const _hoisted_4$y = { class: "row" };
const _hoisted_5$t = {
  key: 0,
  class: "list"
};
const _hoisted_6$p = ["data-testid"];
const _hoisted_7$l = { class: "meta" };
const _hoisted_8$e = ["onClick"];
const _hoisted_9$d = {
  key: 1,
  "data-testid": "library-empty"
};
const _sfc_main$19 = /* @__PURE__ */ defineComponent({
  __name: "LibraryPanelsDrawer",
  props: {
    open: { type: Boolean }
  },
  emits: ["update:open", "add"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const items = ref([]);
    const filter2 = ref("");
    watch(
      () => props.open,
      (open) => {
        if (open) items.value = listLibraryPanels();
      },
      { immediate: true }
    );
    const filtered = computed(() => {
      const q = filter2.value.trim().toLowerCase();
      if (!q) return items.value;
      return items.value.filter(
        (i) => i.name.toLowerCase().includes(q) || i.uid.toLowerCase().includes(q)
      );
    });
    function refresh() {
      items.value = listLibraryPanels();
    }
    function close() {
      emit("update:open", false);
    }
    return (_ctx, _cache) => {
      return __props.open ? (openBlock(), createElementBlock("div", _hoisted_1$14, [
        createElementVNode("div", {
          class: "lib-backdrop",
          onClick: close
        }),
        createElementVNode("div", _hoisted_2$R, [
          createElementVNode("header", { class: "lib-header" }, [
            _cache[1] || (_cache[1] = createElementVNode(
              "strong",
              null,
              "面板库",
              -1
              /* CACHED */
            )),
            createElementVNode("button", {
              type: "button",
              "data-testid": "library-close",
              onClick: close
            }, " 关闭 ")
          ]),
          createElementVNode("div", _hoisted_3$J, [
            createElementVNode("div", _hoisted_4$y, [
              createVNode(unref(GInput), {
                value: filter2.value,
                "onUpdate:value": _cache[0] || (_cache[0] = ($event) => filter2.value = $event),
                "test-id": "library-filter",
                placeholder: "筛选面板库…"
              }, null, 8, ["value"]),
              createElementVNode("button", {
                type: "button",
                "data-testid": "library-refresh",
                onClick: refresh
              }, " 刷新 ")
            ]),
            filtered.value.length ? (openBlock(), createElementBlock("ul", _hoisted_5$t, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(filtered.value, (item) => {
                  return openBlock(), createElementBlock("li", {
                    key: item.uid,
                    class: "item",
                    "data-testid": `library-item-${item.uid}`
                  }, [
                    createElementVNode("div", null, [
                      createElementVNode(
                        "strong",
                        null,
                        toDisplayString(item.name),
                        1
                        /* TEXT */
                      ),
                      createElementVNode(
                        "div",
                        _hoisted_7$l,
                        toDisplayString(item.model.type) + " · v" + toDisplayString(item.version) + " · " + toDisplayString(item.uid),
                        1
                        /* TEXT */
                      )
                    ]),
                    createElementVNode("button", {
                      type: "button",
                      "data-testid": "library-add-btn",
                      onClick: ($event) => emit("add", item.uid)
                    }, " 添加到仪表盘 ", 8, _hoisted_8$e)
                  ], 8, _hoisted_6$p);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])) : (openBlock(), createElementBlock("p", _hoisted_9$d, " 暂无面板 yet. Save a panel from edit mode. "))
          ])
        ])
      ])) : createCommentVNode("v-if", true);
    };
  }
});
const LibraryPanelsDrawer = /* @__PURE__ */ _export_sfc(_sfc_main$19, [["__scopeId", "data-v-f3cea3fd"]]);
const _hoisted_1$13 = { class: "trp-label" };
const _hoisted_2$Q = {
  class: "trp-chevron",
  "aria-hidden": "true"
};
const _hoisted_3$I = ["value"];
const _hoisted_4$x = ["value"];
const _hoisted_5$s = {
  key: 0,
  class: "trp-pop",
  "data-testid": "time-absolute-panel",
  role: "dialog",
  "aria-label": "时间范围"
};
const _hoisted_6$o = { class: "trp-pop__grid" };
const _hoisted_7$k = {
  class: "trp-presets",
  "data-testid": "time-preset-list"
};
const _hoisted_8$d = {
  key: 0,
  class: "trp-history",
  "data-testid": "trp-history"
};
const _hoisted_9$c = ["onClick"];
const _hoisted_10$a = ["data-testid", "onClick"];
const _hoisted_11$9 = { class: "trp-absolute" };
const _hoisted_12$8 = { class: "raw-row" };
const _hoisted_13$8 = ["title"];
const _hoisted_14$8 = ["title"];
const _hoisted_15$7 = { class: "tz-label" };
const _hoisted_16$6 = { class: "trp-pop-actions" };
const HISTORY_KEY = "grafana-vue-time-history";
const _sfc_main$18 = /* @__PURE__ */ defineComponent({
  __name: "TimeRangePicker",
  props: {
    from: {},
    to: {},
    timezone: {}
  },
  emits: ["update:from", "update:to", "update:timezone", "change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const open = ref(false);
    const draftFrom = ref(props.from);
    const draftTo = ref(props.to);
    const draftRange = ref(null);
    const rootEl = ref(null);
    const relativePresets = [
      { label: "最近 5 分钟", from: "now-5m", to: "now" },
      { label: "最近 15 分钟", from: "now-15m", to: "now" },
      { label: "最近 30 分钟", from: "now-30m", to: "now" },
      { label: "最近 1 小时", from: "now-1h", to: "now" },
      { label: "最近 3 小时", from: "now-3h", to: "now" },
      { label: "最近 6 小时", from: "now-6h", to: "now" },
      { label: "最近 12 小时", from: "now-12h", to: "now" },
      { label: "最近 24 小时", from: "now-24h", to: "now" },
      { label: "最近 2 天", from: "now-2d", to: "now" },
      { label: "最近 7 天", from: "now-7d", to: "now" },
      { label: "最近 30 天", from: "now-30d", to: "now" },
      { label: "最近 90 天", from: "now-90d", to: "now" },
      { label: "最近 6 个月", from: "now-6M", to: "now" },
      { label: "最近 1 年", from: "now-1y", to: "now" },
      { label: "今天", from: "now/d", to: "now/d" },
      { label: "本周", from: "now/w", to: "now/w" },
      { label: "本月", from: "now/M", to: "now/M" },
      { label: "本年", from: "now/y", to: "now/y" }
    ];
    function loadHistory() {
      try {
        return JSON.parse(localStorage.getItem(HISTORY_KEY) ?? "[]");
      } catch {
        return [];
      }
    }
    function saveHistory(range) {
      try {
        const h2 = [
          range,
          ...loadHistory().filter(
            (r) => r.from !== range.from || r.to !== range.to
          )
        ].slice(0, 4);
        localStorage.setItem(HISTORY_KEY, JSON.stringify(h2));
      } catch {
      }
    }
    const recentHistory = ref(loadHistory());
    const absolutePresets = computed(() => [
      { label: "今天", value: [dayjs().startOf("day"), dayjs()] },
      {
        label: "昨天",
        value: [
          dayjs().subtract(1, "day").startOf("day"),
          dayjs().subtract(1, "day").endOf("day")
        ]
      },
      {
        label: "本周",
        value: [dayjs().startOf("week"), dayjs()]
      },
      {
        label: "本月",
        value: [dayjs().startOf("month"), dayjs()]
      },
      {
        label: "近 7 天",
        value: [dayjs().subtract(7, "day"), dayjs()]
      },
      {
        label: "近 30 天",
        value: [dayjs().subtract(30, "day"), dayjs()]
      }
    ]);
    const timezoneOptions = [
      { label: "浏览器时区", value: "browser" },
      { label: "UTC", value: "utc" }
    ];
    const display = computed(() => {
      const p = relativePresets.find(
        (x) => x.from === props.from && x.to === props.to
      );
      if (p) return p.label;
      if (/^\d{10,13}$/.test(props.from) && /^\d{10,13}$/.test(props.to)) {
        const a = parseTime(props.from);
        const b = parseTime(props.to);
        return `${a.format("MM-DD HH:mm")} → ${b.format("MM-DD HH:mm")}`;
      }
      return `${props.from} → ${props.to}`;
    });
    function parseTime(raw, fallback = dayjs()) {
      const s = String(raw ?? "").trim();
      if (!s) return fallback;
      if (/^now$/i.test(s)) return dayjs();
      const rel = s.match(/^now-(\d+)([smhdwMy])$/i);
      if (rel) {
        const n = Number(rel[1]);
        const u = rel[2];
        const map = {
          s: "second",
          m: "minute",
          h: "hour",
          d: "day",
          w: "week",
          M: "month",
          y: "year"
        };
        return dayjs().subtract(n, map[u] || "minute");
      }
      if (/^\d{10,13}$/.test(s)) {
        const n = Number(s);
        return dayjs(s.length === 10 ? n * 1e3 : n);
      }
      const d = dayjs(s);
      return d.isValid() ? d : fallback;
    }
    function syncDraftFromProps() {
      draftFrom.value = props.from;
      draftTo.value = props.to;
      draftRange.value = [parseTime(props.from), parseTime(props.to)];
    }
    function openPicker() {
      syncDraftFromProps();
      open.value = !open.value;
    }
    let _debounceTimer;
    function emitTimeRange(from, to) {
      clearTimeout(_debounceTimer);
      _debounceTimer = setTimeout(() => {
        saveHistory({ from, to });
        recentHistory.value = loadHistory();
        emit("update:from", from);
        emit("update:to", to);
        emit("change", from, to);
      }, 300);
    }
    function applyPreset(from, to) {
      draftFrom.value = from;
      draftTo.value = to;
      draftRange.value = [parseTime(from), parseTime(to)];
      emitTimeRange(from, to);
      open.value = false;
    }
    function onRangeChange(v) {
      if (!v || !v[0] || !v[1]) return;
      const a = dayjs(v[0]);
      const b = dayjs(v[1]);
      if (!a.isValid() || !b.isValid()) return;
      draftRange.value = [a, b];
      draftFrom.value = String(a.valueOf());
      draftTo.value = String(b.valueOf());
    }
    function applyAbsolute() {
      if (draftRange.value?.[0] && draftRange.value?.[1]) {
        const f = String(draftRange.value[0].valueOf());
        const t2 = String(draftRange.value[1].valueOf());
        draftFrom.value = f;
        draftTo.value = t2;
        emitTimeRange(f, t2);
      } else {
        emitTimeRange(draftFrom.value, draftTo.value);
      }
      open.value = false;
    }
    function cancel() {
      syncDraftFromProps();
      open.value = false;
    }
    function onDocClick(e) {
      if (!open.value || !rootEl.value) return;
      const t2 = e.target;
      const popup = document.querySelector(".ant-picker-dropdown");
      if (t2 && (rootEl.value.contains(t2) || popup?.contains(t2))) return;
      open.value = false;
    }
    function onKey(e) {
      if (e.key === "Escape" && open.value) open.value = false;
    }
    watch(
      () => [props.from, props.to],
      () => {
        if (!open.value) syncDraftFromProps();
      }
    );
    onMounted(() => {
      syncDraftFromProps();
      document.addEventListener("mousedown", onDocClick);
      document.addEventListener("keydown", onKey);
    });
    onBeforeUnmount(() => {
      clearTimeout(_debounceTimer);
      document.removeEventListener("mousedown", onDocClick);
      document.removeEventListener("keydown", onKey);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          ref_key: "rootEl",
          ref: rootEl,
          class: "trp",
          "data-testid": "time-range-picker"
        },
        [
          createVNode(unref(Button), {
            size: "small",
            class: normalizeClass(["trp-display", { open: open.value }]),
            "data-testid": "time-display",
            onClick: openPicker
          }, {
            default: withCtx(() => [
              createVNode(unref(GIcon), {
                name: "clock",
                size: 12
              }),
              createElementVNode(
                "span",
                _hoisted_1$13,
                toDisplayString(display.value),
                1
                /* TEXT */
              ),
              createElementVNode(
                "span",
                _hoisted_2$Q,
                toDisplayString(open.value ? "▴" : "▾"),
                1
                /* TEXT */
              )
            ]),
            _: 1
            /* STABLE */
          }, 8, ["class"]),
          createCommentVNode(" hidden selects for e2e / legacy tests "),
          createVNode(unref(Select), {
            class: "time-preset-hidden",
            size: "small",
            "data-testid": "time-preset",
            value: relativePresets.find((x) => x.from === draftFrom.value && x.to === draftTo.value) ? `${draftFrom.value}|${draftTo.value}` : void 0,
            options: relativePresets.map((p) => ({
              label: p.label,
              value: `${p.from}|${p.to}`
            })),
            style: { "width": "0", "height": "0", "opacity": "0", "position": "absolute", "pointer-events": "none" },
            "popup-class-name": "g-select-dropdown",
            "onUpdate:value": _cache[0] || (_cache[0] = (v) => {
              const s = String(v ?? "");
              const [f, t2] = s.split("|");
              if (f) applyPreset(f, t2 || "now");
            })
          }, null, 8, ["value", "options"]),
          createElementVNode("input", {
            type: "hidden",
            "data-testid": "time-from",
            value: draftFrom.value
          }, null, 8, _hoisted_3$I),
          createElementVNode("input", {
            type: "hidden",
            "data-testid": "time-to",
            value: draftTo.value
          }, null, 8, _hoisted_4$x),
          open.value ? (openBlock(), createElementBlock("div", _hoisted_5$s, [
            createElementVNode("div", _hoisted_6$o, [
              createElementVNode("div", _hoisted_7$k, [
                _cache[3] || (_cache[3] = createElementVNode(
                  "h4",
                  null,
                  "快速范围",
                  -1
                  /* CACHED */
                )),
                recentHistory.value.length ? (openBlock(), createElementBlock("div", _hoisted_8$d, [
                  _cache[2] || (_cache[2] = createElementVNode(
                    "div",
                    { class: "trp-section-label" },
                    "最近使用",
                    -1
                    /* CACHED */
                  )),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(recentHistory.value, (h2, hi) => {
                      return openBlock(), createElementBlock("button", {
                        key: hi,
                        type: "button",
                        class: "trp-preset",
                        "data-testid": "trp-history-item",
                        onClick: ($event) => applyPreset(h2.from, h2.to)
                      }, toDisplayString(h2.from) + " → " + toDisplayString(h2.to), 9, _hoisted_9$c);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ])) : createCommentVNode("v-if", true),
                (openBlock(), createElementBlock(
                  Fragment,
                  null,
                  renderList(relativePresets, (p) => {
                    return createElementVNode("button", {
                      key: p.from + p.to,
                      type: "button",
                      class: normalizeClass(["preset-item", { active: draftFrom.value === p.from && draftTo.value === p.to }]),
                      "data-testid": `time-preset-${p.from}`,
                      onClick: ($event) => applyPreset(p.from, p.to)
                    }, toDisplayString(p.label), 11, _hoisted_10$a);
                  }),
                  64
                  /* STABLE_FRAGMENT */
                ))
              ]),
              createElementVNode("div", _hoisted_11$9, [
                _cache[8] || (_cache[8] = createElementVNode(
                  "h4",
                  null,
                  "绝对时间（RangePicker）",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(RangePicker), {
                  class: "time-range-picker-abs",
                  "data-testid": "time-range-picker-abs",
                  "show-time": "",
                  size: "small",
                  value: draftRange.value,
                  presets: absolutePresets.value,
                  format: "YYYY-MM-DD HH:mm:ss",
                  "allow-clear": false,
                  style: { "width": "100%" },
                  "onUpdate:value": onRangeChange
                }, null, 8, ["value", "presets", "onUpdate:value"]),
                createElementVNode("div", _hoisted_12$8, [
                  createElementVNode("code", {
                    class: "raw",
                    title: draftFrom.value
                  }, toDisplayString(draftFrom.value), 9, _hoisted_13$8),
                  _cache[4] || (_cache[4] = createElementVNode(
                    "span",
                    { class: "sep" },
                    "→",
                    -1
                    /* CACHED */
                  )),
                  createElementVNode("code", {
                    class: "raw",
                    title: draftTo.value
                  }, toDisplayString(draftTo.value), 9, _hoisted_14$8)
                ]),
                createElementVNode("label", _hoisted_15$7, [
                  _cache[5] || (_cache[5] = createTextVNode(
                    " 时区 ",
                    -1
                    /* CACHED */
                  )),
                  createVNode(unref(Select), {
                    class: "tz-select",
                    size: "small",
                    "data-testid": "timezone-select",
                    value: __props.timezone || "browser",
                    options: timezoneOptions,
                    style: { "width": "100%" },
                    "popup-class-name": "g-select-dropdown",
                    "onUpdate:value": _cache[1] || (_cache[1] = ($event) => emit("update:timezone", String($event)))
                  }, null, 8, ["value"])
                ]),
                createElementVNode("div", _hoisted_16$6, [
                  createVNode(unref(Button), {
                    size: "small",
                    onClick: cancel
                  }, {
                    default: withCtx(() => [..._cache[6] || (_cache[6] = [
                      createTextVNode(
                        "取消",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  }),
                  createVNode(unref(Button), {
                    size: "small",
                    type: "primary",
                    "data-testid": "time-abs-apply",
                    onClick: applyAbsolute
                  }, {
                    default: withCtx(() => [..._cache[7] || (_cache[7] = [
                      createTextVNode(
                        "应用",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  })
                ])
              ])
            ])
          ])) : createCommentVNode("v-if", true)
        ],
        512
        /* NEED_PATCH */
      );
    };
  }
});
const TimeRangePicker = /* @__PURE__ */ _export_sfc(_sfc_main$18, [["__scopeId", "data-v-259474fc"]]);
const _hoisted_1$12 = ["data-interval"];
const _hoisted_2$P = { class: "refresh-picker__group" };
const _hoisted_3$H = {
  key: 0,
  class: "refresh-picker__run-label"
};
const _hoisted_4$w = ["aria-expanded", "aria-label", "title"];
const _hoisted_5$r = { class: "refresh-picker__interval-label" };
const _hoisted_6$n = {
  key: 0,
  class: "refresh-picker__menu",
  role: "listbox",
  "data-testid": "refresh-interval-menu"
};
const _hoisted_7$j = ["aria-selected", "data-testid", "onClick"];
const _sfc_main$17 = /* @__PURE__ */ defineComponent({
  __name: "RefreshPicker",
  props: {
    value: { default: "" },
    loading: { type: Boolean, default: false },
    intervals: { default: () => [...defaultRefreshIntervals] },
    iconOnly: { type: Boolean, default: false }
  },
  emits: ["refresh", "update:value", "interval-change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const open = ref(false);
    const rootEl = ref(null);
    const options = computed(() => {
      const list = props.intervals?.length ? props.intervals : [...defaultRefreshIntervals];
      return [
        { label: "关闭", value: "" },
        ...list.map((v) => ({ label: v, value: v }))
      ];
    });
    const currentLabel = computed(() => {
      const v = props.value ?? "";
      if (!v) return "关闭";
      const hit = options.value.find((o) => o.value === v);
      return hit?.label ?? v;
    });
    const intervalActive = computed(() => Boolean(props.value));
    function onRefresh() {
      emit("refresh");
    }
    function selectInterval(next) {
      open.value = false;
      emit("update:value", next);
      emit("interval-change", next);
    }
    function toggleMenu() {
      open.value = !open.value;
    }
    function onDocClick(ev) {
      if (!open.value) return;
      const t2 = ev.target;
      if (rootEl.value && t2 && !rootEl.value.contains(t2)) {
        open.value = false;
      }
    }
    function onKey(ev) {
      if (ev.key === "Escape") open.value = false;
    }
    onMounted(() => {
      document.addEventListener("mousedown", onDocClick);
      document.addEventListener("keydown", onKey);
    });
    onBeforeUnmount(() => {
      document.removeEventListener("mousedown", onDocClick);
      document.removeEventListener("keydown", onKey);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        ref_key: "rootEl",
        ref: rootEl,
        class: "refresh-picker",
        "data-testid": "refresh-picker",
        "data-interval": __props.value || "off"
      }, [
        createElementVNode("div", _hoisted_2$P, [
          createVNode(unref(GButton), {
            class: "refresh-picker__run",
            "test-id": "refresh-btn",
            loading: __props.loading,
            title: __props.loading ? "刷新中…" : "刷新仪表盘",
            onClick: onRefresh
          }, {
            default: withCtx(() => [
              createVNode(unref(GIcon), { name: "sync" }),
              !__props.iconOnly ? (openBlock(), createElementBlock(
                "span",
                _hoisted_3$H,
                toDisplayString(__props.loading ? "刷新中…" : "刷新"),
                1
                /* TEXT */
              )) : createCommentVNode("v-if", true)
            ]),
            _: 1
            /* STABLE */
          }, 8, ["loading", "title"]),
          createElementVNode("button", {
            type: "button",
            class: "refresh-picker__interval",
            "data-testid": "refresh-interval-btn",
            "aria-expanded": open.value,
            "aria-label": intervalActive.value ? "自动刷新间隔: " + currentLabel.value : "自动刷新已关闭，选择刷新间隔",
            title: intervalActive.value ? "设置自动刷新间隔" : "自动刷新关闭",
            onClick: toggleMenu
          }, [
            createElementVNode(
              "span",
              _hoisted_5$r,
              toDisplayString(currentLabel.value),
              1
              /* TEXT */
            ),
            _cache[0] || (_cache[0] = createElementVNode(
              "span",
              {
                class: "refresh-picker__caret",
                "aria-hidden": "true"
              },
              "▾",
              -1
              /* CACHED */
            ))
          ], 8, _hoisted_4$w)
        ]),
        open.value ? (openBlock(), createElementBlock("ul", _hoisted_6$n, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(options.value, (opt) => {
              return openBlock(), createElementBlock("li", {
                key: opt.value || "off",
                role: "option",
                "aria-selected": (__props.value || "") === opt.value,
                "data-testid": "refresh-interval-" + (opt.value || "off"),
                class: normalizeClass({
                  "refresh-picker__option": true,
                  "is-active": (__props.value || "") === opt.value
                }),
                onClick: ($event) => selectInterval(opt.value)
              }, toDisplayString(opt.label), 11, _hoisted_7$j);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$12);
    };
  }
});
const RefreshPicker = /* @__PURE__ */ _export_sfc(_sfc_main$17, [["__scopeId", "data-v-7030d7ba"]]);
const SEQ_MS = 800;
function resolveDashboardShortcut(ctx) {
  const now = ctx.now ?? Date.now();
  const key = ctx.key.toLowerCase();
  const panelId = ctx.panelId ?? null;
  if ((ctx.metaOrCtrl || false) && key === "s") {
    return { action: { type: "save" }, nextLastP: 0, nextLastD: 0 };
  }
  if (key === "escape") {
    if (ctx.editingPanel) return { action: null };
    if (ctx.viewingPanel) return { action: { type: "escapeView" } };
    return { action: null };
  }
  if (key === "p") {
    return { action: null, nextLastP: now, nextLastD: ctx.lastD };
  }
  if (key === "d" && !(ctx.lastP && now - ctx.lastP < SEQ_MS)) {
    return { action: null, nextLastD: now, nextLastP: ctx.lastP };
  }
  if (ctx.lastP && now - ctx.lastP < SEQ_MS) {
    if (key === "d" && panelId != null)
      return { action: { type: "duplicate", panelId }, nextLastP: 0 };
    if (key === "r" && panelId != null && ctx.editMode)
      return { action: { type: "remove", panelId }, nextLastP: 0 };
    if (key === "u")
      return {
        action: { type: "share", panelId: panelId ?? void 0, mode: "link" },
        nextLastP: 0
      };
    if (key === "e")
      return {
        action: { type: "share", panelId: panelId ?? void 0, mode: "embed" },
        nextLastP: 0
      };
    if (key === "s")
      return {
        action: {
          type: "share",
          panelId: panelId ?? void 0,
          mode: "snapshot"
        },
        nextLastP: 0
      };
    if (key === "l" && panelId != null)
      return { action: { type: "toggleLegend", panelId }, nextLastP: 0 };
    if (key === "x" && panelId != null)
      return { action: { type: "explore", panelId }, nextLastP: 0 };
  }
  if (ctx.lastD && now - ctx.lastD < SEQ_MS) {
    if (key === "r") return { action: { type: "refresh" }, nextLastD: 0 };
    if (key === "s") return { action: { type: "save" }, nextLastD: 0 };
  }
  if (key === "v" && !ctx.editMode) {
    if (ctx.viewingPanel) return { action: { type: "escapeView" } };
    if (panelId != null) return { action: { type: "view", panelId } };
  }
  if (key === "e" && panelId != null && ctx.editMode) {
    return { action: { type: "edit", panelId } };
  }
  if (key === "i" && panelId != null) {
    return { action: { type: "inspect", panelId } };
  }
  return { action: null, nextLastP: ctx.lastP, nextLastD: ctx.lastD };
}
const KEY = "grafana.dashboard.panelStyles";
function copyPanelStyles(panel2) {
  const payload = {
    fieldConfig: panel2.fieldConfig ? JSON.parse(
      JSON.stringify(panel2.fieldConfig)
    ) : void 0,
    options: panel2.options ? JSON.parse(JSON.stringify(panel2.options)) : {},
    transparent: !!panel2.transparent,
    type: panel2.type
  };
  try {
    if (typeof localStorage !== "undefined") {
      localStorage.setItem(KEY, JSON.stringify(payload));
    }
  } catch {
  }
  return payload;
}
function hasPanelStyles() {
  try {
    if (typeof localStorage === "undefined") return false;
    return !!localStorage.getItem(KEY);
  } catch {
    return false;
  }
}
function peekPanelStyles() {
  try {
    if (typeof localStorage === "undefined") return null;
    const raw = localStorage.getItem(KEY);
    if (!raw) return null;
    return JSON.parse(raw);
  } catch {
    return null;
  }
}
function pastePanelStyles(panel2) {
  const styles = peekPanelStyles();
  if (!styles) return panel2;
  const next = JSON.parse(JSON.stringify(panel2));
  if (styles.fieldConfig)
    next.fieldConfig = styles.fieldConfig;
  if (styles.options) {
    next.options = { ...next.options || {}, ...styles.options };
  }
  if (styles.transparent != null) next.transparent = styles.transparent;
  return next;
}
const _hoisted_1$11 = ["data-testid", "data-panel-editing"];
const _hoisted_2$O = {
  key: 0,
  class: "dashboard-page__header"
};
const _hoisted_3$G = { class: "dashboard-page__title" };
const _hoisted_4$v = {
  key: 1,
  class: "home-link",
  href: "/dashboards",
  "data-testid": "nav-dashboards",
  title: "仪表盘列表"
};
const _hoisted_5$q = {
  key: 2,
  class: "dirty",
  "data-testid": "dirty-indicator"
};
const _hoisted_6$m = { class: "dashboard-page__actions" };
const _hoisted_7$i = {
  key: 11,
  "data-testid": "library-open-flag"
};
const _hoisted_8$c = {
  key: 1,
  class: "menu-notice",
  "data-testid": "panel-menu-notice"
};
const _hoisted_9$b = {
  key: 2,
  "data-testid": "dashboard-loading"
};
const _hoisted_10$9 = {
  key: 3,
  "data-testid": "dashboard-error"
};
const _hoisted_11$8 = ["data-mode"];
const _hoisted_12$7 = {
  class: "dashboard-page__body",
  "data-testid": "dashboard-body"
};
const _hoisted_13$7 = {
  key: 0,
  class: "dashboard-empty",
  "data-testid": "dashboard-empty"
};
const _hoisted_14$7 = {
  key: 1,
  class: "dashboard-canvas",
  "data-testid": "dashboard-canvas"
};
const _hoisted_15$6 = {
  key: 0,
  class: "view-panel-bar",
  "data-testid": "view-panel-bar"
};
const _hoisted_16$5 = {
  class: "view-panel-label",
  "data-testid": "view-panel-title"
};
const _hoisted_17$5 = {
  key: 5,
  class: "library-inline",
  "data-testid": "library-inline"
};
const _hoisted_18$5 = ["data-testid"];
const _hoisted_19$5 = {
  key: 0,
  "data-testid": "library-inline-empty"
};
const _hoisted_20$4 = {
  key: 8,
  class: "dashboard-settings-host",
  "data-testid": "dashboard-settings-host"
};
const _hoisted_21$3 = {
  key: 9,
  class: "shot",
  "data-testid": "screenshot-preview"
};
const _hoisted_22$3 = ["src"];
const _sfc_main$16 = /* @__PURE__ */ defineComponent({
  __name: "DashboardPage",
  props: {
    uid: {},
    solo: { type: Boolean },
    embedded: { type: Boolean },
    editPanelId: {},
    viewPanelId: {},
    inspectPanelId: {},
    inspectTab: {}
  },
  emits: ["back", "request-mode", "saved", "save-error", "cancel"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const router = useRouter();
    const store2 = useDashboardStore();
    const {
      document: document2,
      dirty,
      editMode,
      loading,
      error,
      panelData,
      time,
      timezone,
      panels: panels2,
      title,
      canUndo,
      canRedo,
      refresh,
      isRefreshing
    } = storeToRefs(store2);
    const isSolo = computed(() => !!props.solo);
    const isViewPanel = computed(() => props.viewPanelId != null);
    const canMutateDashboard = computed(() => !props.embedded || editMode.value);
    const displayPanels = computed(() => {
      if (props.viewPanelId == null) return panels2.value;
      const p = panels2.value.find((x) => x.id === props.viewPanelId);
      if (!p) return [];
      const h2 = Math.max(p.gridPos?.h ?? 8, 18);
      return [{ ...p, gridPos: { x: 0, y: 0, w: 24, h: h2 } }];
    });
    const shareOpen = ref(false);
    const shareView = ref("link");
    const inspectOpen = ref(false);
    const inspectTabOverride = ref();
    const menuNotice = ref("");
    const libraryOpen = ref(false);
    const variablesSettingsOpen = ref(false);
    const dashboardSettingsOpen = ref(false);
    const libraryItems = ref([]);
    const screenshotUrl = ref(null);
    const panelEditSession = ref(null);
    const panelEditorRef = ref(null);
    async function saveDashboardFromPage() {
      try {
        if (panelEditSession.value && panelEditorRef.value) {
          const draft = panelEditorRef.value.getDraft();
          store2.updatePanel(draft);
          selectedPanel.value = draft;
          saveDashboardWhileEditing(panelEditSession.value, draft);
          await store2.save();
          panelEditorRef.value.markSaved(draft);
        } else {
          await store2.save();
        }
        emit(
          "saved",
          JSON.parse(store2.serializeDocument())
        );
      } catch (e) {
        emit("save-error", e instanceof Error ? e.message : String(e));
      }
    }
    const editingPanelId = ref(null);
    const selectedPanel = ref(null);
    const editingPanel = computed(() => {
      const id = editingPanelId.value;
      if (id == null) return null;
      return panels2.value.find((p) => Number(p.id) === Number(id)) ?? null;
    });
    const variables = computed(() => document2.value?.templating?.list ?? []);
    const replaceVars = (value) => {
      const scoped = buildScopedVars(variables.value);
      return replaceVariables(value, scoped);
    };
    function refreshLibraryItems() {
      libraryItems.value = listLibraryPanels();
    }
    watch(libraryOpen, (open) => {
      if (open) refreshLibraryItems();
    });
    const shortcutSeq = { lastP: 0, lastD: 0 };
    function onKeyDown(e) {
      const tag = e.target?.tagName?.toLowerCase();
      if (tag === "input" || tag === "textarea" || e.target?.isContentEditable)
        return;
      const { action, nextLastP, nextLastD } = resolveDashboardShortcut({
        key: e.key,
        metaOrCtrl: !!(e.metaKey || e.ctrlKey),
        shift: !!e.shiftKey,
        panelId: selectedPanel.value?.id ?? null,
        editMode: editMode.value,
        editingPanel: editingPanelId.value != null,
        viewingPanel: isViewPanel.value,
        lastP: shortcutSeq.lastP,
        lastD: shortcutSeq.lastD,
        now: Date.now()
      });
      if (nextLastP !== void 0) shortcutSeq.lastP = nextLastP;
      if (nextLastD !== void 0) shortcutSeq.lastD = nextLastD;
      if (!action) return;
      e.preventDefault();
      switch (action.type) {
        case "view":
          onPanelView(action.panelId);
          break;
        case "edit":
          onPanelEdit(action.panelId);
          break;
        case "inspect":
          openInspect(action.panelId);
          break;
        case "escapeEdit":
          cancelPanelEdit();
          break;
        case "escapeView":
          exitViewPanel();
          break;
        case "duplicate":
          store2.duplicateSelectedPanel(action.panelId);
          break;
        case "remove":
          store2.deletePanel(action.panelId);
          break;
        case "share":
          openShare(action.panelId, action.mode ?? "link");
          break;
        case "toggleLegend":
          onPanelToggleLegend(action.panelId);
          break;
        case "refresh":
          void store2.refreshAllPanels();
          break;
        case "save":
          void saveDashboardFromPage();
          break;
        case "explore":
          onPanelExplore(action.panelId);
          break;
      }
    }
    watch(
      () => document2.value?.datasources,
      () => {
        applyEmbeddedDatasources();
      },
      { deep: true }
    );
    onMounted(async () => {
      if (props.uid) await store2.loadByUid(props.uid);
      openEditPanelFromProp();
      openInspectFromProp();
      window.addEventListener("keydown", onKeyDown);
    });
    onBeforeUnmount(() => {
      window.removeEventListener("keydown", onKeyDown);
      if (!props.embedded) store2.dispose();
    });
    function openInspectFromProp() {
      const id = props.inspectPanelId;
      if (id == null) return;
      const panel2 = panels2.value.find((p) => p.id === id) ?? null;
      if (panel2) {
        selectedPanel.value = panel2;
        inspectOpen.value = true;
      }
    }
    function openEditPanelFromProp() {
      const id = props.editPanelId;
      if (id == null) return;
      store2.setEditMode(true);
      const panel2 = panels2.value.find((p) => Number(p.id) === Number(id)) ?? null;
      if (panel2) {
        selectedPanel.value = panel2;
        editingPanelId.value = Number(panel2.id);
        openedEditPanelIds.add(Number(panel2.id));
        if (!panelEditSession.value || Number(panelEditSession.value.panelId) !== Number(panel2.id)) {
          panelEditSession.value = openPanelEditSession(panel2, {
            isNewPanel: Boolean(panel2.isNew),
            isLibraryPanel: Boolean(
              panel2.libraryPanel
            )
          });
        }
      }
    }
    watch(
      () => props.editPanelId,
      () => openEditPanelFromProp()
    );
    const openedEditPanelIds = /* @__PURE__ */ new Set();
    watch(
      () => panels2.value.map((p) => p.id).join(","),
      () => {
        const id = props.editPanelId;
        if (id == null) return;
        if (openedEditPanelIds.has(Number(id))) return;
        if (editingPanelId.value != null) return;
        if (!panels2.value.some((p) => Number(p.id) === Number(id))) return;
        openEditPanelFromProp();
      }
    );
    watch(
      () => props.editPanelId,
      (id, prev) => {
        if (prev != null && Number(prev) !== Number(id)) {
          openedEditPanelIds.delete(Number(prev));
        }
        if (id == null) {
          openedEditPanelIds.clear();
        }
      }
    );
    watch(
      () => props.inspectPanelId,
      () => openInspectFromProp()
    );
    watch(
      () => props.uid,
      async (uid) => {
        if (uid) await store2.loadByUid(uid);
      }
    );
    function onAdhocChange(name, filters) {
      const list = (store2.document?.templating?.list ?? []).map(
        (v) => v.name === name ? {
          ...v,
          filters,
          current: {
            text: filters.map((f) => `${f.key}${f.operator}${f.value}`).join(","),
            value: JSON.stringify(filters)
          }
        } : v
      );
      store2.updateVariables(list);
    }
    function onVariablesChange(list) {
      if (!canMutateDashboard.value) return;
      store2.updateVariables(list);
      void store2.refreshVariables?.();
    }
    function openShare(panelId, mode2 = "link") {
      if (panelId != null) {
        selectedPanel.value = panels2.value.find((p) => p.id === panelId) ?? selectedPanel.value;
      }
      shareView.value = mode2;
      shareOpen.value = true;
    }
    function onPanelExplore(id) {
      openShare(id, "link");
      menuNotice.value = "探索路由尚未接入，已打开分享抽屉（带面板焦点）";
    }
    function onPanelCopy(id) {
      selectedPanel.value = panels2.value.find((p) => p.id === id) ?? null;
      store2.copySelectedPanel(id);
    }
    function onPanelToggleLegend(id) {
      if (!canMutateDashboard.value) return;
      const panel2 = panels2.value.find((p) => p.id === id);
      if (!panel2) return;
      const legend = panel2.options?.legend;
      const show = legend?.showLegend !== false;
      store2.updatePanel({
        ...panel2,
        options: {
          ...panel2.options || {},
          legend: { ...legend || {}, showLegend: !show }
        }
      });
    }
    function onPanelFullscreen(id) {
      onPanelView(id);
    }
    function onPanelHelp(id) {
      selectedPanel.value = panels2.value.find((p) => p.id === id) ?? null;
      inspectTabOverride.value = "help";
      inspectOpen.value = true;
    }
    function onPanelCopyStyles(id) {
      const panel2 = panels2.value.find((p) => p.id === id);
      if (!panel2) return;
      copyPanelStyles(panel2);
      menuNotice.value = "已复制面板样式";
      setTimeout(() => {
        if (menuNotice.value === "已复制面板样式") menuNotice.value = "";
      }, 2500);
    }
    function onPanelPasteStyles(id) {
      if (!canMutateDashboard.value) return;
      const panel2 = panels2.value.find((p) => p.id === id);
      if (!panel2 || !hasPanelStyles()) {
        menuNotice.value = "无可用样式剪贴板";
        setTimeout(() => {
          menuNotice.value = "";
        }, 2500);
        return;
      }
      store2.updatePanel(pastePanelStyles(panel2));
      menuNotice.value = "已粘贴面板样式";
      setTimeout(() => {
        if (menuNotice.value === "已粘贴面板样式") menuNotice.value = "";
      }, 2500);
    }
    function onPanelTimeSettings(id) {
      if (!canMutateDashboard.value) return;
      const panel2 = panels2.value.find((p) => p.id === id);
      if (!panel2) return;
      selectedPanel.value = panel2;
      const current = String(panel2.timeFrom ?? "");
      const next = typeof window !== "undefined" ? window.prompt("面板时间覆盖 (timeFrom，如 now-1h；留空清除)", current) : null;
      if (next === null) return;
      const updated = { ...panel2 };
      if (!next.trim()) delete updated.timeFrom;
      else updated.timeFrom = next.trim();
      store2.updatePanel(updated);
      menuNotice.value = updated.timeFrom ? `面板时间: ${updated.timeFrom}` : "已清除面板时间覆盖";
      setTimeout(() => {
        menuNotice.value = "";
      }, 2500);
      void store2.refreshPanel?.(updated);
    }
    function onPanelLibrary(id) {
      if (!canMutateDashboard.value) return;
      const name = typeof window !== "undefined" ? window.prompt(
        "库面板名称",
        panels2.value.find((p) => p.id === id)?.title || `Panel ${id}`
      ) : null;
      if (!name) return;
      const saved = store2.saveSelectedAsLibraryPanel(id, name);
      menuNotice.value = saved ? `已保存库面板: ${saved.name}` : "保存库面板失败";
      libraryItems.value = listLibraryPanels();
      setTimeout(() => {
        menuNotice.value = "";
      }, 2500);
    }
    function onPanelAlertRule(id) {
      selectedPanel.value = panels2.value.find((p) => p.id === id) ?? null;
      menuNotice.value = "告警：当前环境无 Alerting 后端，无法创建规则（Grafana 同场景隐藏/说明）";
      setTimeout(() => {
        menuNotice.value = "";
      }, 4e3);
    }
    function onPanelAction(action) {
      const id = Number(action.panelId);
      if (!canMutateDashboard.value && [
        "edit",
        "duplicate",
        "remove",
        "toggle-legend",
        "paste-styles",
        "time-settings",
        "library-panel",
        "unlink-library",
        "alert-rule"
      ].includes(action.type)) {
        if (action.type === "edit") emit("request-mode", "edit");
        return;
      }
      switch (action.type) {
        case "edit":
          onPanelEdit(id);
          break;
        case "view":
          onPanelView(id);
          break;
        case "inspect":
          openInspect(
            id,
            action.tab
          );
          break;
        case "duplicate":
          store2.duplicateSelectedPanel(id);
          break;
        case "remove":
          store2.deletePanel(id);
          break;
        case "share":
          openShare(
            id,
            action.mode ?? "link"
          );
          break;
        case "explore":
          onPanelExplore(id);
          break;
        case "copy":
          onPanelCopy(id);
          break;
        case "toggle-legend":
          onPanelToggleLegend(id);
          break;
        case "fullscreen":
          onPanelFullscreen(id);
          break;
        case "help":
          onPanelHelp(id);
          break;
        case "copy-styles":
          onPanelCopyStyles(id);
          break;
        case "paste-styles":
          onPanelPasteStyles(id);
          break;
        case "time-settings":
          onPanelTimeSettings(id);
          break;
        case "library-panel":
          onPanelLibrary(id);
          break;
        case "unlink-library":
          unlinkSelectedLibrary(id);
          break;
        case "alert-rule":
          onPanelAlertRule(id);
          break;
      }
    }
    function onPanelEdit(id) {
      if (!canMutateDashboard.value) {
        emit("request-mode", "edit");
        return;
      }
      const panel2 = panels2.value.find((p) => p.id === id) ?? null;
      selectedPanel.value = panel2;
      store2.setEditMode(true);
      editingPanelId.value = id;
      if (panel2) {
        panelEditSession.value = openPanelEditSession(panel2, {
          isNewPanel: Boolean(panel2.isNew),
          isLibraryPanel: Boolean(
            panel2.libraryPanel
          )
        });
      }
      try {
        router.replace({
          query: exclusiveEditViewQuery(
            { ...router.currentRoute.value.query },
            { panelId: id, mode: "edit" }
          )
        });
      } catch {
      }
    }
    function onPanelView(id) {
      if (props.viewPanelId != null && Number(props.viewPanelId) === Number(id)) {
        exitViewPanel();
        return;
      }
      selectedPanel.value = panels2.value.find((p) => p.id === id) ?? null;
      store2.setEditMode(false);
      editingPanelId.value = null;
      try {
        router.replace({
          query: {
            ...router.currentRoute.value.query,
            viewPanel: String(id),
            editPanel: void 0
          }
        });
      } catch {
      }
    }
    function exitViewPanel() {
      try {
        const q = { ...router.currentRoute.value.query };
        delete q.viewPanel;
        router.replace({ query: q });
      } catch {
      }
    }
    function onPanelClick(id) {
      selectedPanel.value = panels2.value.find((p) => p.id === id) ?? null;
    }
    function toggleEditMode() {
      const next = !editMode.value;
      if (props.embedded) {
        emit("request-mode", next ? "edit" : "preview");
        return;
      }
      store2.setEditMode(next);
      if (!next) {
        selectedPanel.value = null;
        editingPanelId.value = null;
      }
    }
    function openInspect(id, tab) {
      if (id != null)
        selectedPanel.value = panels2.value.find((p) => p.id === id) ?? selectedPanel.value;
      inspectTabOverride.value = tab || void 0;
      inspectOpen.value = true;
    }
    function applyPanel(panel2, lastData) {
      if (!canMutateDashboard.value) return;
      const live = panels2.value.find((p) => p.id === panel2.id) ?? panel2;
      const session = panelEditSession.value && String(panelEditSession.value.panelId) === String(panel2.id) ? panelEditSession.value : openPanelEditSession(live, {
        isNewPanel: Boolean(
          live.isNew || panel2.isNew
        )
      });
      const result = exitBack(session, panel2);
      store2.pushHistory();
      store2.updatePanel(result.panel);
      selectedPanel.value = result.panel;
      editingPanelId.value = null;
      panelEditSession.value = null;
      if (lastData && lastData.state && lastData.state !== "Loading") {
        store2.seedPanelData(result.panel.id, lastData);
      }
      void store2.refreshPanel(result.panel);
      try {
        const q = exclusiveEditViewQuery(
          { ...router.currentRoute.value.query },
          { panelId: result.panel.id, mode: "none" }
        );
        router.replace({ query: q });
      } catch {
      }
    }
    function cancelPanelEdit() {
      const panel2 = selectedPanel.value;
      const id = editingPanelId.value ?? panel2?.id ?? null;
      const live = id != null ? panels2.value.find((p) => p.id === id) ?? panel2 : panel2;
      const session = panelEditSession.value ?? (live ? openPanelEditSession(live, {
        isNewPanel: Boolean(live.isNew)
      }) : null);
      editingPanelId.value = null;
      if (session) {
        const result = exitDiscard(session);
        if (result.kind === "discard-delete") {
          store2.deletePanel(Number(result.panelId));
          selectedPanel.value = null;
        } else if (result.kind === "discard-restore") {
          store2.updatePanel(result.panel);
          selectedPanel.value = result.panel;
        }
        panelEditSession.value = null;
      } else if (panel2 && panel2.isNew && id != null) {
        store2.deletePanel(id);
        selectedPanel.value = null;
      }
      try {
        const q = exclusiveEditViewQuery(
          { ...router.currentRoute.value.query },
          { panelId: id ?? 0, mode: "none" }
        );
        router.replace({ query: q });
      } catch {
      }
    }
    function addPanelAndEdit(type = "timeseries") {
      if (!canMutateDashboard.value) return;
      store2.setEditMode(true);
      editingPanelId.value = null;
      panelEditSession.value = null;
      const id = store2.addPanel(type);
      if (id == null) return;
      const panel2 = panels2.value.find((p) => p.id === id) ?? null;
      selectedPanel.value = panel2;
      try {
        const q = exclusiveEditViewQuery(
          { ...router.currentRoute.value.query },
          { panelId: id, mode: "none" }
        );
        router.replace({ query: q });
      } catch {
      }
    }
    function unlinkSelectedLibrary(id) {
      if (!canMutateDashboard.value) return;
      const panelId = id ?? selectedPanel.value?.id;
      if (panelId == null) return;
      store2.unlinkLibraryPanel(panelId);
      selectedPanel.value = panels2.value.find((p) => p.id === panelId) ?? null;
    }
    function addFromLibrary(uid) {
      if (!canMutateDashboard.value) return;
      store2.addLibraryPanelToDashboard(uid);
      libraryOpen.value = false;
    }
    function applyEmbeddedDatasources(list) {
      store2.applyDocumentEmbeddedDatasources();
    }
    function onDashboardSettingsPatch(patch) {
      if (!canMutateDashboard.value) return;
      if (!document2.value) return;
      const next = { ...document2.value, ...patch };
      void store2.loadLocal(next);
    }
    function onDatasourcesChange(list) {
      if (!canMutateDashboard.value) return;
      store2.setEmbeddedDatasources(list);
    }
    function onAnnotationsChange(list) {
      if (!canMutateDashboard.value) return;
      if (!document2.value) return;
      const next = {
        ...document2.value,
        annotations: { ...document2.value.annotations || {}, list }
      };
      void store2.loadLocal(next);
    }
    function onLinksChange(links) {
      if (!canMutateDashboard.value) return;
      if (!document2.value) return;
      const next = { ...document2.value, links };
      void store2.loadLocal(next);
    }
    function onSettingsJsonApply(raw) {
      if (!canMutateDashboard.value) return;
      void store2.loadLocal(raw);
      dashboardSettingsOpen.value = false;
    }
    function onLayoutUpdated(next) {
      if (!canMutateDashboard.value) return;
      store2.updateLayout(next);
    }
    async function cancelEmbeddedEdit() {
      if (!props.embedded) return;
      editingPanelId.value = null;
      selectedPanel.value = null;
      panelEditSession.value = null;
      await store2.restoreSaved();
      store2.setEditMode(false);
      emit("cancel");
      emit("request-mode", "preview");
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["dashboard-page", {
          "dashboard-page--panel-editing": !!editingPanel.value,
          "dashboard-page--view-panel": isViewPanel.value
        }]),
        "data-testid": isSolo.value ? "dashboard-solo" : "dashboard-page",
        "data-panel-editing": editingPanel.value ? "1" : "0"
      }, [
        !isSolo.value ? (openBlock(), createElementBlock("header", _hoisted_2$O, [
          createElementVNode("div", _hoisted_3$G, [
            __props.embedded ? (openBlock(), createElementBlock("button", {
              key: 0,
              class: "home-link",
              type: "button",
              "data-testid": "nav-dashboards",
              title: "返回仪表盘列表",
              onClick: _cache[0] || (_cache[0] = ($event) => emit("back"))
            }, [
              createVNode(unref(ArrowLeftOutlined))
            ])) : (openBlock(), createElementBlock("a", _hoisted_4$v, [
              createVNode(unref(ArrowLeftOutlined))
            ])),
            createVNode(unref(GIcon), { name: "dashboard" }),
            createElementVNode(
              "h1",
              null,
              toDisplayString(unref(title) || "仪表盘"),
              1
              /* TEXT */
            ),
            unref(dirty) ? (openBlock(), createElementBlock("span", _hoisted_5$q, "●")) : createCommentVNode("v-if", true)
          ]),
          createElementVNode("div", _hoisted_6$m, [
            createVNode(TimeRangePicker, {
              from: unref(time).from,
              to: unref(time).to,
              timezone: unref(timezone),
              onChange: _cache[1] || (_cache[1] = (f, t2) => unref(store2).setTime(f, t2)),
              "onUpdate:from": _cache[2] || (_cache[2] = (f) => unref(store2).setTime(f, unref(time).to)),
              "onUpdate:to": _cache[3] || (_cache[3] = (t2) => unref(store2).setTime(unref(time).from, t2)),
              "onUpdate:timezone": unref(store2).setTimezone
            }, null, 8, ["from", "to", "timezone", "onUpdate:timezone"]),
            createVNode(RefreshPicker, {
              value: unref(refresh),
              loading: unref(isRefreshing),
              onRefresh: _cache[4] || (_cache[4] = ($event) => unref(store2).refreshAllPanels()),
              "onUpdate:value": unref(store2).setRefresh
            }, null, 8, ["value", "loading", "onUpdate:value"]),
            !isSolo.value && !__props.embedded ? (openBlock(), createBlock(unref(GButton), {
              key: 0,
              "test-id": "import-dashboard-btn",
              onClick: _cache[5] || (_cache[5] = ($event) => unref(router).push("/dashboard/import"))
            }, {
              default: withCtx(() => [..._cache[32] || (_cache[32] = [
                createTextVNode(
                  " 导入 JSON ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            !__props.embedded || unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 1,
              "test-id": "undo-btn",
              disabled: !unref(canUndo),
              onClick: _cache[6] || (_cache[6] = ($event) => unref(store2).undo())
            }, {
              default: withCtx(() => [..._cache[33] || (_cache[33] = [
                createTextVNode(
                  "撤销",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["disabled"])) : createCommentVNode("v-if", true),
            !__props.embedded || unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 2,
              "test-id": "redo-btn",
              disabled: !unref(canRedo),
              onClick: _cache[7] || (_cache[7] = ($event) => unref(store2).redo())
            }, {
              default: withCtx(() => [..._cache[34] || (_cache[34] = [
                createTextVNode(
                  "重做",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["disabled"])) : createCommentVNode("v-if", true),
            !__props.embedded || unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 3,
              "test-id": "variables-settings-btn",
              onClick: _cache[8] || (_cache[8] = ($event) => variablesSettingsOpen.value = true)
            }, {
              default: withCtx(() => [..._cache[35] || (_cache[35] = [
                createTextVNode(
                  " 变量 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            !__props.embedded || unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 4,
              "test-id": "dashboard-settings-btn",
              onClick: _cache[9] || (_cache[9] = ($event) => dashboardSettingsOpen.value = true)
            }, {
              default: withCtx(() => [..._cache[36] || (_cache[36] = [
                createTextVNode(
                  " 设置 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            createVNode(unref(GButton), {
              "test-id": "share-btn",
              onClick: _cache[10] || (_cache[10] = ($event) => openShare(null, "link"))
            }, {
              default: withCtx(() => [
                createVNode(unref(GIcon), { name: "share" }),
                _cache[37] || (_cache[37] = createTextVNode(
                  " 分享 ",
                  -1
                  /* CACHED */
                ))
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(unref(GButton), {
              "test-id": "inspect-btn",
              disabled: !selectedPanel.value,
              onClick: _cache[11] || (_cache[11] = ($event) => openInspect())
            }, {
              default: withCtx(() => [..._cache[38] || (_cache[38] = [
                createTextVNode(
                  " 检查 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["disabled"]),
            !__props.embedded || !unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 5,
              "test-id": "edit-btn",
              variant: unref(editMode) ? "primary" : "secondary",
              onClick: _cache[12] || (_cache[12] = ($event) => toggleEditMode())
            }, {
              default: withCtx(() => [
                createVNode(unref(GIcon), { name: "pen" }),
                createTextVNode(
                  " " + toDisplayString(unref(editMode) ? "查看" : "编辑"),
                  1
                  /* TEXT */
                )
              ]),
              _: 1
              /* STABLE */
            }, 8, ["variant"])) : createCommentVNode("v-if", true),
            __props.embedded && unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 6,
              "test-id": "cancel-edit-btn",
              onClick: _cache[13] || (_cache[13] = ($event) => cancelEmbeddedEdit())
            }, {
              default: withCtx(() => [..._cache[39] || (_cache[39] = [
                createTextVNode(
                  " 取消 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 7,
              "test-id": "add-panel-btn",
              onClick: _cache[14] || (_cache[14] = ($event) => addPanelAndEdit())
            }, {
              default: withCtx(() => [
                createVNode(unref(GIcon), { name: "plus" }),
                _cache[40] || (_cache[40] = createTextVNode(
                  " 添加面板 ",
                  -1
                  /* CACHED */
                ))
              ]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            unref(editMode) && selectedPanel.value ? (openBlock(), createBlock(unref(GButton), {
              key: 8,
              "test-id": "copy-panel-btn",
              onClick: _cache[15] || (_cache[15] = ($event) => unref(store2).copySelectedPanel(selectedPanel.value.id))
            }, {
              default: withCtx(() => [..._cache[41] || (_cache[41] = [
                createTextVNode(
                  " 复制 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            unref(editMode) && selectedPanel.value ? (openBlock(), createBlock(unref(GButton), {
              key: 9,
              "test-id": "dup-panel-btn",
              onClick: _cache[16] || (_cache[16] = ($event) => unref(store2).duplicateSelectedPanel(selectedPanel.value.id))
            }, {
              default: withCtx(() => [..._cache[42] || (_cache[42] = [
                createTextVNode(
                  " 复制面板 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 10,
              "test-id": "paste-panel-btn",
              onClick: _cache[17] || (_cache[17] = ($event) => unref(store2).pasteClipboardPanel())
            }, {
              default: withCtx(() => [..._cache[43] || (_cache[43] = [
                createTextVNode(
                  " 粘贴 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            createCommentVNode(' <GButton\n          v-if="editMode && selectedPanel"\n          test-id="save-library-btn"\n          @click="saveToLibrary"\n        >\n          存入库\n        </GButton>\n        <GButton v-if="editMode" test-id="library-btn" @click="openLibrary">\n          面板库\n        </GButton>\n        <GButton test-id="screenshot-btn" @click="takeScreenshot">\n          截图\n        </GButton> '),
            libraryOpen.value ? (openBlock(), createElementBlock("span", _hoisted_7$i, "面板库已打开")) : createCommentVNode("v-if", true),
            !__props.embedded || unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
              key: 12,
              "test-id": "save-btn",
              variant: "primary",
              loading: unref(store2).saving,
              disabled: unref(store2).saving || !unref(dirty) && !panelEditSession.value,
              onClick: _cache[18] || (_cache[18] = ($event) => saveDashboardFromPage())
            }, {
              default: withCtx(() => [
                createVNode(unref(GIcon), { name: "save" }),
                _cache[44] || (_cache[44] = createTextVNode(
                  " 保存 ",
                  -1
                  /* CACHED */
                ))
              ]),
              _: 1
              /* STABLE */
            }, 8, ["loading", "disabled"])) : createCommentVNode("v-if", true)
          ])
        ])) : createCommentVNode("v-if", true),
        menuNotice.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_8$c,
          toDisplayString(menuNotice.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        unref(loading) ? (openBlock(), createElementBlock("div", _hoisted_9$b, "加载中…")) : unref(error) ? (openBlock(), createElementBlock(
          "div",
          _hoisted_10$9,
          toDisplayString(unref(error)),
          1
          /* TEXT */
        )) : unref(document2) ? (openBlock(), createElementBlock("div", {
          key: 4,
          class: normalizeClass(["dashboard-page__shell", {
            "dashboard-page__shell--edit": unref(editMode) && !isSolo.value && !isViewPanel.value,
            "dashboard-page__shell--view": !unref(editMode) || isSolo.value || isViewPanel.value,
            "dashboard-page__shell--solo": isSolo.value,
            "dashboard-page__shell--view-panel": isViewPanel.value
          }]),
          "data-testid": "dashboard-shell",
          "data-mode": unref(editMode) && !isSolo.value && !isViewPanel.value ? "edit" : isViewPanel.value ? "view-panel" : isSolo.value ? "preview" : "view"
        }, [
          !isSolo.value ? (openBlock(), createBlock(VariablesBar, {
            key: 0,
            class: "dashboard-page__variables",
            variables: variables.value,
            onChange: _cache[19] || (_cache[19] = (name, value) => unref(store2).setVariable(name, value)),
            onAdhocChange
          }, null, 8, ["variables"])) : createCommentVNode("v-if", true),
          createElementVNode("div", _hoisted_12$7, [
            !unref(panels2).length ? (openBlock(), createElementBlock("div", _hoisted_13$7, [
              _cache[47] || (_cache[47] = createElementVNode(
                "h2",
                null,
                "空仪表盘",
                -1
                /* CACHED */
              )),
              _cache[48] || (_cache[48] = createElementVNode(
                "p",
                null,
                " 添加面板以开始可视化。离线模式下可使用 TestData 等内置数据源。 ",
                -1
                /* CACHED */
              )),
              unref(editMode) ? (openBlock(), createBlock(unref(GButton), {
                key: 0,
                "test-id": "empty-add-panel-btn",
                variant: "primary",
                onClick: _cache[20] || (_cache[20] = ($event) => addPanelAndEdit())
              }, {
                default: withCtx(() => [..._cache[45] || (_cache[45] = [
                  createTextVNode(
                    "添加面板",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              })) : (openBlock(), createBlock(unref(GButton), {
                key: 1,
                "test-id": "empty-enter-edit-btn",
                variant: "primary",
                onClick: _cache[21] || (_cache[21] = ($event) => toggleEditMode())
              }, {
                default: withCtx(() => [..._cache[46] || (_cache[46] = [
                  createTextVNode(
                    "进入编辑",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }))
            ])) : (openBlock(), createElementBlock("div", _hoisted_14$7, [
              isViewPanel.value ? (openBlock(), createElementBlock("div", _hoisted_15$6, [
                createVNode(unref(GButton), {
                  "test-id": "exit-view-panel-btn",
                  size: "sm",
                  onClick: _cache[22] || (_cache[22] = ($event) => exitViewPanel())
                }, {
                  default: withCtx(() => [..._cache[49] || (_cache[49] = [
                    createTextVNode(
                      " ← 返回仪表盘 ",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                }),
                createElementVNode(
                  "span",
                  _hoisted_16$5,
                  " 查看：" + toDisplayString(unref(panels2).find((p) => p.id === __props.viewPanelId)?.title || "面板"),
                  1
                  /* TEXT */
                ),
                __props.viewPanelId != null ? (openBlock(), createBlock(unref(GButton), {
                  key: 0,
                  "test-id": "view-panel-inspect-btn",
                  size: "sm",
                  onClick: _cache[23] || (_cache[23] = ($event) => openInspect(__props.viewPanelId))
                }, {
                  default: withCtx(() => [..._cache[50] || (_cache[50] = [
                    createTextVNode(
                      " 检查 ",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                __props.viewPanelId != null ? (openBlock(), createBlock(unref(GButton), {
                  key: 1,
                  "test-id": "view-panel-edit-btn",
                  size: "sm",
                  onClick: _cache[24] || (_cache[24] = ($event) => onPanelEdit(__props.viewPanelId))
                }, {
                  default: withCtx(() => [..._cache[51] || (_cache[51] = [
                    createTextVNode(
                      " 编辑 ",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true)
              ])) : createCommentVNode("v-if", true),
              createCommentVNode(" Shared grid for edit / preview / view — mode only toggles interaction chrome "),
              withDirectives(createVNode(DashboardGrid, {
                class: "dashboard-canvas__grid",
                panels: displayPanels.value,
                "panel-data": unref(panelData),
                editable: unref(editMode) && !isSolo.value && !isViewPanel.value,
                "is-viewing": isViewPanel.value,
                "selected-panel-id": selectedPanel.value?.id ?? null,
                "replace-variables": replaceVars,
                onLayoutUpdated,
                onPanelAction,
                onPanelClick
              }, null, 8, ["panels", "panel-data", "editable", "is-viewing", "selected-panel-id"]), [
                [vShow, !editingPanel.value]
              ]),
              unref(editMode) && editingPanel.value ? (openBlock(), createBlock(PanelEditor, {
                key: 1,
                ref_key: "panelEditorRef",
                ref: panelEditorRef,
                class: "dashboard-canvas__editor",
                panel: editingPanel.value,
                session: panelEditSession.value,
                data: editingPanel.value ? unref(panelData)[editingPanel.value.id] : void 0,
                variables: variables.value,
                "data-panel-editor-host": "1",
                onBack: applyPanel,
                onDiscard: cancelPanelEdit
              }, null, 8, ["panel", "session", "data", "variables"])) : createCommentVNode("v-if", true)
            ]))
          ])
        ], 10, _hoisted_11$8)) : createCommentVNode("v-if", true),
        createCommentVNode(" Inline library first so Ant Modal failures cannot abort this UI "),
        libraryOpen.value ? (openBlock(), createElementBlock("aside", _hoisted_17$5, [
          createElementVNode("header", null, [
            _cache[53] || (_cache[53] = createElementVNode(
              "strong",
              null,
              "面板库",
              -1
              /* CACHED */
            )),
            createVNode(unref(GButton), {
              "test-id": "library-inline-close",
              size: "sm",
              onClick: _cache[25] || (_cache[25] = ($event) => libraryOpen.value = false)
            }, {
              default: withCtx(() => [..._cache[52] || (_cache[52] = [
                createTextVNode(
                  "关闭",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })
          ]),
          createElementVNode("ul", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(libraryItems.value, (item) => {
                return openBlock(), createElementBlock("li", {
                  key: item.uid,
                  "data-testid": `library-inline-item-${item.uid}`
                }, [
                  createTextVNode(
                    toDisplayString(item.name) + " (" + toDisplayString(item.model.type) + ") ",
                    1
                    /* TEXT */
                  ),
                  createVNode(unref(GButton), {
                    size: "sm",
                    onClick: ($event) => addFromLibrary(item.uid)
                  }, {
                    default: withCtx(() => [..._cache[54] || (_cache[54] = [
                      createTextVNode(
                        "添加",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  }, 8, ["onClick"])
                ], 8, _hoisted_18$5);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ]),
          !libraryItems.value.length ? (openBlock(), createElementBlock("p", _hoisted_19$5, " 暂无面板 ")) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true),
        unref(document2) ? (openBlock(), createBlock(ShareDrawer, {
          key: 6,
          open: shareOpen.value,
          "onUpdate:open": _cache[26] || (_cache[26] = ($event) => shareOpen.value = $event),
          uid: unref(document2).uid || __props.uid || "local",
          from: unref(time).from,
          to: unref(time).to,
          "panel-id": selectedPanel.value?.id ?? void 0,
          "share-view": shareView.value
        }, null, 8, ["open", "uid", "from", "to", "panel-id", "share-view"])) : createCommentVNode("v-if", true),
        createVNode(PanelInspector, {
          open: inspectOpen.value,
          "onUpdate:open": _cache[27] || (_cache[27] = ($event) => inspectOpen.value = $event),
          "initial-tab": inspectTabOverride.value || props.inspectTab,
          panel: selectedPanel.value,
          data: selectedPanel.value ? unref(panelData)[selectedPanel.value.id] : void 0
        }, null, 8, ["open", "initial-tab", "panel", "data"]),
        createVNode(LibraryPanelsDrawer, {
          open: libraryOpen.value,
          "onUpdate:open": _cache[28] || (_cache[28] = ($event) => libraryOpen.value = $event),
          onAdd: addFromLibrary
        }, null, 8, ["open"]),
        variablesSettingsOpen.value && unref(document2) ? (openBlock(), createBlock(VariablesSettings, {
          key: 7,
          variables: unref(document2).templating?.list ?? [],
          "data-testid": "variables-settings-host",
          onClose: _cache[29] || (_cache[29] = ($event) => variablesSettingsOpen.value = false),
          onChange: onVariablesChange
        }, null, 8, ["variables"])) : createCommentVNode("v-if", true),
        dashboardSettingsOpen.value && unref(document2) ? (openBlock(), createElementBlock("div", _hoisted_20$4, [
          createVNode(DashboardSettings, {
            document: unref(document2),
            json: unref(store2).serializeDocument?.() ?? JSON.stringify(unref(document2), null, 2),
            onClose: _cache[30] || (_cache[30] = ($event) => dashboardSettingsOpen.value = false),
            onPatch: onDashboardSettingsPatch,
            onVariables: onVariablesChange,
            onAnnotations: onAnnotationsChange,
            onLinks: onLinksChange,
            onDatasources: onDatasourcesChange,
            onApplyJson: onSettingsJsonApply
          }, null, 8, ["document", "json"])
        ])) : createCommentVNode("v-if", true),
        screenshotUrl.value ? (openBlock(), createElementBlock("div", _hoisted_21$3, [
          createElementVNode("img", {
            src: screenshotUrl.value,
            alt: "仪表盘截图"
          }, null, 8, _hoisted_22$3),
          createVNode(unref(GButton), {
            onClick: _cache[31] || (_cache[31] = ($event) => screenshotUrl.value = null)
          }, {
            default: withCtx(() => [..._cache[55] || (_cache[55] = [
              createTextVNode(
                "关闭",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ])) : createCommentVNode("v-if", true)
      ], 10, _hoisted_1$11);
    };
  }
});
const DashboardPage = /* @__PURE__ */ _export_sfc(_sfc_main$16, [["__scopeId", "data-v-5b510e88"]]);
const _hoisted_1$10 = {
  class: "dashboard-viewer",
  "data-testid": "dashboard-viewer"
};
const _hoisted_2$N = {
  key: 0,
  class: "dashboard-viewer-toolbar"
};
const _hoisted_3$F = {
  key: 2,
  class: "dashboard-viewer__error",
  "data-testid": "dashboard-viewer-error"
};
const _sfc_main$15 = /* @__PURE__ */ defineComponent({
  __name: "DashboardViewer",
  props: {
    dashboard: {},
    datasources: { default: () => [] },
    theme: {},
    readonly: { type: Boolean, default: true }
  },
  emits: ["ready", "error", "submit"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    let _piniaInjectKey;
    function provideLocalPinia(pinia2) {
      const shim = {
        provide(key, _value) {
          if (typeof key === "symbol") _piniaInjectKey = key;
        },
        config: { globalProperties: {} },
        mixin() {
        },
        use() {
          return this;
        }
      };
      pinia2.install(shim);
      if (_piniaInjectKey) provide(_piniaInjectKey, pinia2);
      setActivePinia(pinia2);
    }
    const pinia = createPinia();
    const prevPinia = getActivePinia();
    provideLocalPinia(pinia);
    const store2 = useDashboardStore(pinia);
    const { document: document2, panelData, panels: panels2, time, timezone, error } = storeToRefs(store2);
    const mounted = ref(false);
    function registerViewerDatasource(ds2) {
      const runtime = getRuntimeDataSourceSettings(ds2.uid);
      const url = String(ds2.url || runtime?.url || "").trim();
      const jsonData = {
        ...runtime?.jsonData ?? {},
        ...ds2.jsonData ?? {}
      };
      const plugin2 = getDataSourcePlugin(ds2.type);
      if (!plugin2?.createDataSource) {
        store2.registerDataSource({
          id: 0,
          uid: ds2.uid,
          type: ds2.type,
          name: ds2.name,
          url,
          jsonData,
          query: async () => ({ data: [] })
        });
        return;
      }
      const api = plugin2.createDataSource({
        uid: ds2.uid,
        type: ds2.type,
        name: ds2.name,
        url,
        access: "proxy",
        basicAuth: ds2.basicAuth,
        basicAuthUser: ds2.basicAuthUser,
        jsonData: {
          ...jsonData,
          ...ds2.secureJsonData ?? {}
        },
        meta: plugin2.meta ?? {}
      });
      store2.registerDataSource({
        uid: ds2.uid,
        type: ds2.type,
        name: ds2.name,
        url,
        ...api
      });
    }
    async function loadDashboard(raw) {
      for (const ds2 of props.datasources ?? []) {
        try {
          registerViewerDatasource(ds2);
        } catch (e) {
          if (typeof console !== "undefined") {
            console.warn("[DashboardViewer] register datasource failed", e);
          }
        }
      }
      await store2.loadLocal(raw);
    }
    onMounted(async () => {
      setActivePinia(pinia);
      try {
        if (props.theme) {
          try {
            initTheme({ preference: props.theme });
          } catch {
          }
        }
        await loadDashboard(props.dashboard);
        mounted.value = true;
        emit("ready");
      } catch (e) {
        emit("error", e instanceof Error ? e.message : String(e));
      } finally {
        if (prevPinia) setActivePinia(prevPinia);
      }
    });
    watch(
      () => props.dashboard,
      async (next) => {
        if (!next) return;
        setActivePinia(pinia);
        try {
          await store2.loadLocal(next);
        } catch (e) {
          emit("error", e instanceof Error ? e.message : String(e));
        } finally {
          if (prevPinia) setActivePinia(prevPinia);
        }
      },
      { deep: false }
    );
    watch(
      () => props.datasources,
      (next) => {
        setActivePinia(pinia);
        for (const ds2 of next ?? []) registerViewerDatasource(ds2);
        if (prevPinia) setActivePinia(prevPinia);
      },
      { deep: false }
    );
    onBeforeUnmount(() => {
      setActivePinia(pinia);
      store2.dispose?.();
      store2.$dispose();
      pinia._e?.stop?.();
      if (prevPinia) setActivePinia(prevPinia);
    });
    const varList = computed(() => document2.value?.templating?.list ?? []);
    const replaceVars = (value) => replaceVariables(value, buildScopedVars(varList.value));
    function getJson() {
      setActivePinia(pinia);
      try {
        if (!store2.document) return {};
        const raw = store2.serializeDocument?.() ?? "{}";
        return JSON.parse(raw);
      } finally {
        if (prevPinia) setActivePinia(prevPinia);
      }
    }
    function getJsonString() {
      setActivePinia(pinia);
      try {
        return store2.serializeDocument?.() ?? "{}";
      } finally {
        if (prevPinia) setActivePinia(prevPinia);
      }
    }
    function handleSave() {
      emit("submit", getJson());
    }
    function onVariableChange(name, value) {
      setActivePinia(pinia);
      store2.setVariable?.(name, value);
      if (prevPinia) setActivePinia(prevPinia);
    }
    function onTimeChange(from, to) {
      setActivePinia(pinia);
      store2.setTime?.(from, to);
      if (prevPinia) setActivePinia(prevPinia);
    }
    __expose({ getJson, getJsonString });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$10, [
        !__props.readonly ? (openBlock(), createElementBlock("div", _hoisted_2$N, [
          createVNode(unref(GButton), {
            variant: "primary",
            "test-id": "dashboard-viewer-save",
            onClick: handleSave
          }, {
            default: withCtx(() => [..._cache[0] || (_cache[0] = [
              createTextVNode(
                "保存",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ])) : createCommentVNode("v-if", true),
        varList.value.length ? (openBlock(), createBlock(VariablesBar, {
          key: 1,
          variables: varList.value,
          onChange: onVariableChange
        }, null, 8, ["variables"])) : createCommentVNode("v-if", true),
        createVNode(TimeRangePicker, {
          from: unref(time).from,
          to: unref(time).to,
          timezone: unref(timezone),
          onChange: onTimeChange
        }, null, 8, ["from", "to", "timezone"]),
        createVNode(DashboardGrid, {
          panels: unref(panels2),
          "panel-data": unref(panelData),
          editable: !__props.readonly,
          "replace-variables": replaceVars
        }, null, 8, ["panels", "panel-data", "editable"]),
        unref(error) ? (openBlock(), createElementBlock(
          "div",
          _hoisted_3$F,
          toDisplayString(unref(error)),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const DashboardViewer = /* @__PURE__ */ _export_sfc(_sfc_main$15, [["__scopeId", "data-v-c8293d18"]]);
const _hoisted_1$$ = {
  class: "grafana-dashboard",
  "data-testid": "grafana-dashboard"
};
const _hoisted_2$M = {
  key: 0,
  class: "grafana-dashboard__error",
  "data-testid": "grafana-dashboard-error"
};
const _hoisted_3$E = {
  key: 2,
  "data-testid": "grafana-dashboard-loading"
};
const _sfc_main$14 = /* @__PURE__ */ defineComponent({
  __name: "GrafanaDashboard",
  props: {
    dashboard: {},
    mode: {},
    persist: { type: Function },
    datasources: {},
    theme: {}
  },
  emits: ["ready", "error", "saved", "cancel", "back", "update:mode"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    let piniaInjectKey;
    function provideLocalPinia(pinia2) {
      const shim = {
        provide(key) {
          if (typeof key === "symbol") piniaInjectKey = key;
        },
        config: { globalProperties: {} },
        mixin() {
        },
        use() {
          return this;
        }
      };
      pinia2.install(shim);
      if (piniaInjectKey) provide(piniaInjectKey, pinia2);
    }
    const pinia = createPinia();
    const hostPinia = getActivePinia();
    provideLocalPinia(pinia);
    const store2 = useDashboardStore(pinia);
    if (hostPinia) setActivePinia(hostPinia);
    async function withLocalPinia(task) {
      const previous = getActivePinia();
      setActivePinia(pinia);
      try {
        return await task();
      } finally {
        setActivePinia(previous);
      }
    }
    const mounted = ref(false);
    const loadError = ref("");
    let loadedDashboard = null;
    function registerDatasource(ds2) {
      const runtime = getRuntimeDataSourceSettings(ds2.uid);
      const url = String(ds2.url || runtime?.url || "").trim();
      const jsonData = {
        ...runtime?.jsonData ?? {},
        ...ds2.jsonData ?? {}
      };
      const plugin2 = getDataSourcePlugin(ds2.type);
      if (!plugin2?.createDataSource) {
        store2.registerDataSource({
          id: 0,
          uid: ds2.uid,
          type: ds2.type,
          name: ds2.name,
          url,
          jsonData,
          query: async () => ({ data: [] })
        });
        return;
      }
      const api = plugin2.createDataSource({
        uid: ds2.uid,
        type: ds2.type,
        name: ds2.name,
        url,
        access: "proxy",
        basicAuth: ds2.basicAuth,
        basicAuthUser: ds2.basicAuthUser,
        jsonData,
        secureJsonData: ds2.secureJsonData ?? {},
        meta: plugin2.meta ?? {}
      });
      store2.registerDataSource({
        uid: ds2.uid,
        type: ds2.type,
        name: ds2.name,
        url,
        ...api
      });
    }
    function applyTheme(theme) {
      if (!theme) return;
      try {
        initTheme({ preference: theme });
      } catch {
      }
    }
    async function loadDashboard(raw) {
      await withLocalPinia(async () => {
        try {
          await registerHeavyPlugins();
        } catch (err) {
          if (typeof console !== "undefined") {
            console.error("[GrafanaDashboard] heavy plugin registration failed", err);
          }
        }
        for (const datasource of props.datasources ?? []) {
          registerDatasource(datasource);
        }
        const embedded = readEmbeddedDatasources(raw);
        if (embedded.length) {
          registerEmbeddedDatasources(
            embedded,
            (api) => store2.registerDataSource(api)
          );
        }
        await store2.loadLocal(raw);
        store2.setEditMode(props.mode === "edit");
        loadedDashboard = raw;
      });
    }
    onMounted(async () => {
      store2.setPersistenceHandler((dashboard) => props.persist(dashboard));
      applyTheme(props.theme);
      try {
        await loadDashboard(props.dashboard);
        mounted.value = true;
        emit("ready");
      } catch (e) {
        loadError.value = e instanceof Error ? e.message : String(e);
        emit("error", { phase: "load", message: loadError.value });
      } finally {
        if (hostPinia) setActivePinia(hostPinia);
      }
    });
    watch(
      () => props.mode,
      (mode2) => {
        if (!mounted.value) return;
        void withLocalPinia(() => store2.setEditMode(mode2 === "edit"));
      }
    );
    watch(
      () => props.dashboard,
      async (dashboard) => {
        if (!mounted.value || dashboard === loadedDashboard) return;
        if (store2.dirty) {
          emit("error", {
            phase: "replace",
            message: "仪表盘存在未保存修改，已忽略外部数据替换"
          });
          return;
        }
        try {
          await loadDashboard(dashboard);
        } catch (e) {
          emit("error", {
            phase: "load",
            message: e instanceof Error ? e.message : String(e)
          });
        }
      }
    );
    watch(
      () => props.theme,
      (theme) => {
        if (mounted.value) applyTheme(theme);
      }
    );
    watch(
      () => props.datasources,
      (datasources2) => {
        if (!mounted.value) return;
        void withLocalPinia(() => {
          for (const datasource of datasources2 ?? [])
            registerDatasource(datasource);
        });
      },
      { deep: false }
    );
    function queryNumber(value) {
      const raw = Array.isArray(value) ? value[0] : value;
      if (raw == null || raw === "") return void 0;
      const number = Number(raw);
      return Number.isFinite(number) ? number : void 0;
    }
    const route = useRoute();
    const editPanelId = computed(() => queryNumber(route.query?.editPanel));
    const viewPanelId = computed(() => queryNumber(route.query?.viewPanel));
    const inspectPanelId = computed(() => queryNumber(route.query?.inspect));
    const inspectTab = computed(() => {
      const value = Array.isArray(route.query?.inspectTab) ? route.query?.inspectTab[0] : route.query?.inspectTab;
      return value == null || value === "" ? void 0 : String(value);
    });
    function getJson() {
      const previous = getActivePinia();
      setActivePinia(pinia);
      try {
        return JSON.parse(store2.serializeDocument());
      } finally {
        setActivePinia(previous);
      }
    }
    function getJsonString() {
      const previous = getActivePinia();
      setActivePinia(pinia);
      try {
        return store2.serializeDocument();
      } finally {
        setActivePinia(previous);
      }
    }
    async function discard2() {
      await withLocalPinia(() => store2.restoreSaved());
    }
    function handleSaved(dashboard) {
      emit("saved", dashboard);
    }
    function handleSaveError(message) {
      emit("error", { phase: "save", message });
    }
    __expose({ getJson, getJsonString, discard: discard2 });
    onBeforeUnmount(() => {
      const previous = getActivePinia();
      setActivePinia(pinia);
      store2.setPersistenceHandler(null);
      store2.dispose();
      store2.$dispose();
      pinia._e?.stop?.();
      setActivePinia(previous);
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$$, [
        loadError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_2$M,
          toDisplayString(loadError.value),
          1
          /* TEXT */
        )) : mounted.value ? (openBlock(), createBlock(DashboardPage, {
          key: 1,
          embedded: "",
          "edit-panel-id": editPanelId.value,
          "view-panel-id": viewPanelId.value,
          "inspect-panel-id": inspectPanelId.value,
          "inspect-tab": inspectTab.value,
          onBack: _cache[0] || (_cache[0] = ($event) => emit("back")),
          onRequestMode: _cache[1] || (_cache[1] = ($event) => emit("update:mode", $event)),
          onSaved: handleSaved,
          onSaveError: handleSaveError,
          onCancel: _cache[2] || (_cache[2] = ($event) => emit("cancel"))
        }, null, 8, ["edit-panel-id", "view-panel-id", "inspect-panel-id", "inspect-tab"])) : (openBlock(), createElementBlock("div", _hoisted_3$E, "加载中…"))
      ]);
    };
  }
});
const GrafanaDashboard = /* @__PURE__ */ _export_sfc(_sfc_main$14, [["__scopeId", "data-v-65c6e5fa"]]);
async function registerZabbixPlugin() {
  const [panelMod, dsMod] = await Promise.all([
    Promise.resolve().then(() => module$4),
    Promise.resolve().then(() => module$3)
  ]);
  if (dsMod.plugin) {
    registerDataSourcePlugin(dsMod.plugin);
  }
  if (panelMod.plugin) {
    registerPanelPlugin(panelMod.plugin);
  }
}
const register$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  registerZabbixPlugin
}, Symbol.toStringTag, { value: "Module" }));
const MAX_ENTRIES$1 = 500;
function stableSerialize$1(value) {
  if (value === void 0) return "undefined";
  if (value === null || typeof value !== "object") return JSON.stringify(value);
  if (Array.isArray(value)) return `[${value.map(stableSerialize$1).join(",")}]`;
  const obj = value;
  const keys = Object.keys(obj).filter((k) => obj[k] !== void 0).sort();
  return `{${keys.map((k) => `${JSON.stringify(k)}:${stableSerialize$1(obj[k])}`).join(",")}}`;
}
function serializeZabbixCacheKey(key) {
  return stableSerialize$1({
    uid: key.uid,
    majorVersion: key.majorVersion,
    method: key.method,
    params: key.params || {}
  });
}
class ZabbixMetadataCache {
  entries = /* @__PURE__ */ new Map();
  inflight = /* @__PURE__ */ new Map();
  load(key, ttlMs2, consumerSignal, loader) {
    const serialized = serializeZabbixCacheKey(key);
    const now = Date.now();
    const hit = this.entries.get(serialized);
    if (hit && hit.expiresAt > now) {
      hit.lastAccess = now;
      return Promise.resolve(hit.value);
    }
    const existing = this.inflight.get(serialized);
    if (existing) {
      existing.consumers += 1;
      return this.bindConsumer(existing, consumerSignal);
    }
    const controller = new AbortController();
    const inflight2 = {
      key: serialized,
      controller,
      consumers: 1,
      promise: Promise.resolve().then(() => {
        if (controller.signal.aborted) {
          throw new DOMException("Aborted", "AbortError");
        }
        return loader(controller.signal);
      }).then((value) => {
        if (controller.signal.aborted) {
          throw new DOMException("Aborted", "AbortError");
        }
        this.entries.set(serialized, {
          key: serialized,
          uid: key.uid,
          method: key.method,
          expiresAt: Date.now() + Math.max(0, ttlMs2),
          lastAccess: Date.now(),
          value
        });
        this.evictIfNeeded();
        return value;
      }).finally(() => {
        this.inflight.delete(serialized);
      })
    };
    this.inflight.set(serialized, inflight2);
    if (consumerSignal?.aborted) {
      inflight2.consumers -= 1;
      if (inflight2.consumers <= 0) inflight2.controller.abort();
      return Promise.reject(new DOMException("Aborted", "AbortError"));
    }
    return this.bindConsumer(inflight2, consumerSignal);
  }
  bindConsumer(inflight2, signal) {
    return new Promise((resolve, reject) => {
      let settled = false;
      const onAbort = () => {
        if (settled) return;
        settled = true;
        inflight2.consumers -= 1;
        if (inflight2.consumers <= 0) inflight2.controller.abort();
        reject(new DOMException("Aborted", "AbortError"));
      };
      if (signal) {
        if (signal.aborted) {
          onAbort();
          return;
        }
        signal.addEventListener("abort", onAbort, { once: true });
      }
      inflight2.promise.then(
        (v) => {
          if (settled) return;
          settled = true;
          signal?.removeEventListener("abort", onAbort);
          resolve(v);
        },
        (e) => {
          if (settled) return;
          settled = true;
          signal?.removeEventListener("abort", onAbort);
          reject(e);
        }
      );
    });
  }
  invalidate(uid, methods) {
    const set = new Set(methods);
    for (const [k, entry] of this.entries) {
      if (entry.uid === uid && set.has(entry.method)) this.entries.delete(k);
    }
  }
  clearUid(uid) {
    for (const [k, entry] of this.entries) {
      if (entry.uid === uid) this.entries.delete(k);
    }
    for (const [k, flight] of this.inflight) {
      if (k.includes(`"uid":${JSON.stringify(uid)}`) || k.includes(`"uid":"${uid}"`)) {
        flight.controller.abort();
        this.inflight.delete(k);
      }
    }
  }
  clear() {
    this.entries.clear();
    for (const flight of this.inflight.values()) flight.controller.abort();
    this.inflight.clear();
  }
  evictIfNeeded() {
    while (this.entries.size > MAX_ENTRIES$1) {
      let oldestKey = "";
      let oldest = Infinity;
      for (const [k, v] of this.entries) {
        if (v.lastAccess < oldest) {
          oldest = v.lastAccess;
          oldestKey = k;
        }
      }
      if (!oldestKey) break;
      this.entries.delete(oldestKey);
    }
  }
}
const READ_METHOD_LIST = [
  "alert.get",
  "apiinfo.version",
  "application.get",
  "discoveryrule.get",
  "event.get",
  "history.get",
  "host.get",
  "hostgroup.get",
  "item.get",
  "itemprototype.get",
  "problem.get",
  "proxy.get",
  "script.get",
  "service.get",
  "service.getsla",
  "sla.get",
  "sla.getsli",
  "trend.get",
  "trigger.get",
  "user.get",
  "usermacro.get",
  "valuemap.get"
];
const WRITE_METHOD_LIST = [
  "event.acknowledge",
  "script.execute"
];
const READ_METHODS = new Set(READ_METHOD_LIST);
const WRITE_METHODS = new Set(WRITE_METHOD_LIST);
function assertAllowedZabbixMethod(method) {
  if (!READ_METHODS.has(method) && !WRITE_METHODS.has(method)) {
    throw new Error(`Zabbix API method is not allowed: ${method}`);
  }
}
function parseZabbixVersion(version) {
  const parts = String(version || "0").split(".").map((x) => Number(x) || 0);
  return { major: parts[0] || 0, minor: parts[1] || 0, patch: parts[2] || 0 };
}
function getZabbixVersionCapabilities(version, overrides) {
  const { major, minor } = parseZabbixVersion(version);
  const ge = (maj, min = 0) => major > maj || major === maj && minor >= min;
  const supportsApiToken = ge(5, 4);
  const loginUserField = ge(5, 4) ? "username" : "user";
  const authCandidates = supportsApiToken ? ge(7, 0) ? ["body", "header"] : ["body"] : [];
  const triggerHostGroupsField = ge(7, 0) ? "selectHostGroups" : "selectGroups";
  const acknowledgesField = ge(7, 0) ? "selectAcknowledges" : "select_acknowledges";
  const proxyNameField = ge(7, 0) ? "name" : "host";
  const hostProxyIdField = ge(7, 0) ? "proxyid" : "proxy_hostid";
  const hostgroupRealHostsField = ge(6, 0) ? "with_hosts" : "real_hosts";
  const supportsApplications = !ge(5, 4);
  const supportsItemTags = ge(5, 4);
  const slaApi = ge(6, 0) ? "sla" : "legacy";
  return {
    version: String(version),
    major,
    minor,
    supportsApiToken,
    loginUserField,
    authCandidates,
    selectedAuthPlacement: overrides?.selectedAuthPlacement,
    triggerHostGroupsField,
    acknowledgesField,
    proxyNameField,
    hostProxyIdField,
    hostgroupRealHostsField,
    supportsApplications,
    supportsItemTags,
    slaApi
  };
}
function buildVersionedAuthRequest(caps2, method, params, token, id = 1, placementOverride) {
  const body = { jsonrpc: "2.0", id, method, params };
  const headers = {};
  if (!token)
    return { body, headers, placement: void 0 };
  if (!caps2.supportsApiToken) {
    return {
      body,
      headers,
      placement: void 0,
      rejected: true
    };
  }
  const placement = placementOverride || caps2.selectedAuthPlacement || caps2.authCandidates[0] || "body";
  if (placement === "header") {
    headers.Authorization = `Bearer ${token}`;
  } else {
    body.auth = token;
  }
  return { body, headers, placement };
}
function normalizeZabbixUrl(url) {
  const baseUrl2 = String(url || "").replace(/\/$/, "");
  const proxied = baseUrl2.startsWith("/zabbix-api") || baseUrl2.includes("api_jsonrpc.php");
  return { baseUrl: baseUrl2, path: proxied ? "" : "/api_jsonrpc.php" };
}
function buildAuthenticatedRequest(version, method, params, token, id = 1, placement) {
  const caps2 = getZabbixVersionCapabilities(
    version,
    placement ? { selectedAuthPlacement: placement } : void 0
  );
  const built = buildVersionedAuthRequest(
    caps2,
    method,
    params,
    token,
    id,
    placement
  );
  return { body: built.body, headers: built.headers };
}
class ZabbixRpcClient {
  url;
  uid;
  timeoutMs;
  maxBodyBytes;
  versionCache = null;
  tokenCache = null;
  nextId = 1;
  credential;
  forceNetwork;
  authPlacement = null;
  capsCache = null;
  authPlacementOverride = "auto";
  authPlacementPromise = null;
  constructor(opts) {
    this.url = opts.url;
    this.uid = opts.uid;
    this.timeoutMs = opts.timeoutMs ?? 3e4;
    this.maxBodyBytes = opts.maxBodyBytes ?? 1e7;
    this.credential = opts.credential;
    this.forceNetwork = opts.forceNetwork ?? true;
  }
  async getVersion(signal) {
    if (this.versionCache) return this.versionCache;
    const version = await this.rawCall(
      "apiinfo.version",
      {},
      null,
      signal
    );
    const vs = typeof version === "string" ? version : Array.isArray(version) ? "" : String(version ?? "");
    this.versionCache = vs && /^\d+/.test(vs) ? vs : "6.0.0";
    this.capsCache = getZabbixVersionCapabilities(this.versionCache, {
      selectedAuthPlacement: this.authPlacement || void 0
    });
    return this.versionCache;
  }
  getCapabilities() {
    return this.capsCache;
  }
  setAuthPlacementOverride(placement) {
    this.authPlacementOverride = placement;
    this.authPlacement = placement === "auto" ? null : placement;
    this.authPlacementPromise = null;
  }
  /** Probe hostgroup.get limit=1 to choose body vs header auth for the current token. */
  async resolveAuthPlacement(token, signal) {
    if (this.authPlacementOverride !== "auto" && this.authPlacement)
      return this.authPlacement;
    if (this.authPlacement) return this.authPlacement;
    if (this.authPlacementPromise) return this.authPlacementPromise;
    this.authPlacementPromise = this.doResolveAuthPlacement(token, signal).catch((error) => {
      this.authPlacementPromise = null;
      throw error;
    });
    return this.authPlacementPromise;
  }
  async doResolveAuthPlacement(token, signal) {
    if (this.authPlacementOverride !== "auto" && this.authPlacement)
      return this.authPlacement;
    if (this.authPlacement) return this.authPlacement;
    const version = await this.getVersion(signal);
    const caps2 = getZabbixVersionCapabilities(version);
    if (!caps2.supportsApiToken) {
      throw new DataSourceError(
        "AUTH_REQUIRED",
        "当前 Zabbix 版本不支持 API token"
      );
    }
    const candidates = caps2.authCandidates.length ? caps2.authCandidates : ["body"];
    let lastErr;
    for (const placement of candidates) {
      try {
        await this.rawCall(
          "hostgroup.get",
          { limit: 1, output: ["groupid"] },
          token,
          signal,
          version,
          placement
        );
        this.authPlacement = placement;
        this.capsCache = getZabbixVersionCapabilities(version, {
          selectedAuthPlacement: placement
        });
        return placement;
      } catch (e) {
        lastErr = e;
      }
    }
    throw lastErr instanceof DataSourceError ? lastErr : new DataSourceError("AUTH_REQUIRED", "无法确定 API token 认证位置");
  }
  async call(method, params = {}, signal) {
    assertAllowedZabbixMethod(method);
    if (method !== "apiinfo.version") {
      await this.ensureToken("6.0.0", signal);
    }
    const version = method === "apiinfo.version" ? "6.0.0" : await this.getVersion(signal);
    const token = method === "apiinfo.version" ? null : await this.ensureToken(version, signal);
    let placement;
    if (token) {
      const cred = this.credential === void 0 ? await getRuntimeCredential(this.uid) : this.credential;
      if (cred && (cred.kind === "bearer" || cred.kind === "apiKey")) {
        placement = await this.resolveAuthPlacement(token, signal);
      }
    }
    return this.rawCall(method, params, token, signal, version, placement);
  }
  async callWithFallback(method, params, fallback, timeoutMs, signal) {
    const ac = new AbortController();
    const timer = setTimeout(() => ac.abort(), Math.max(1, timeoutMs));
    const onOuterAbort = () => ac.abort();
    signal?.addEventListener("abort", onOuterAbort);
    try {
      return await this.call(method, params, ac.signal);
    } catch (e) {
      const isAbort = e?.name === "AbortError" || e?.code === "ERR_CANCELED";
      if (isAbort) return fallback;
      throw e;
    } finally {
      clearTimeout(timer);
      signal?.removeEventListener("abort", onOuterAbort);
    }
  }
  async ensureToken(version, signal) {
    if (this.tokenCache) return this.tokenCache;
    const cred = this.credential === void 0 ? await getRuntimeCredential(this.uid) : this.credential;
    if (!cred) {
      throw new DataSourceError(
        "AUTH_REQUIRED",
        "Zabbix 需要 runtime credential（token 或用户名密码）"
      );
    }
    if (cred.kind === "bearer" || cred.kind === "apiKey") {
      this.tokenCache = cred.value || null;
      if (!this.tokenCache) {
        throw new DataSourceError("AUTH_REQUIRED", "Zabbix API token 为空");
      }
      return this.tokenCache;
    }
    if (cred.kind === "basic" && cred.username && cred.password) {
      this.tokenCache = await this.login(
        version,
        cred.username,
        cred.password,
        signal
      );
      return this.tokenCache;
    }
    throw new DataSourceError(
      "AUTH_REQUIRED",
      "Zabbix 凭据类型不受支持或字段不完整"
    );
  }
  async login(version, username, password, signal) {
    const caps2 = getZabbixVersionCapabilities(version);
    const primaryField = caps2.loginUserField;
    const primary = primaryField === "username" ? { username, password } : { user: username, password };
    try {
      return await this.rawCall(
        "user.login",
        primary,
        null,
        signal,
        version
      );
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      const details = e instanceof DataSourceError ? JSON.stringify(e.details ?? {}) : "";
      if (/unexpected parameter|invalid parameter|unknown parameter|deprecated/i.test(
        `${msg} ${details}`
      )) {
        const alt = primaryField === "username" ? { user: username, password } : { username, password };
        return this.rawCall("user.login", alt, null, signal, version);
      }
      throw e;
    }
  }
  async rawCall(method, params, token, signal, version = "6.0.0", placement) {
    if (method !== "user.login" && method !== "apiinfo.version") {
      assertAllowedZabbixMethod(method);
    }
    const id = this.nextId++;
    const { baseUrl: baseUrl2, path } = normalizeZabbixUrl(this.url);
    const { body, headers } = buildAuthenticatedRequest(
      version,
      method,
      params,
      token,
      id,
      placement
    );
    try {
      const res = await datasourceHttp({
        baseUrl: baseUrl2,
        path,
        method: "POST",
        body,
        headers,
        uid: this.uid,
        signal,
        timeoutMs: this.timeoutMs,
        maxBodyBytes: this.maxBodyBytes,
        credential: null,
        forceNetwork: this.forceNetwork,
        isWrite: false,
        idempotent: method === "apiinfo.version" || method.endsWith(".get")
      });
      const data = res.data;
      if (!data || typeof data !== "object") {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Zabbix 返回无效 JSON-RPC 响应"
        );
      }
      if (data.error) {
        const message = [data.error.message, data.error.data].filter(Boolean).join(" — ") || "Zabbix RPC error";
        throw withDataSourceContext(
          new DataSourceError("UPSTREAM_ERROR", message, {
            upstreamCode: data.error.code
          }),
          {
            uid: this.uid,
            endpoint: `${baseUrl2}${path}`,
            upstreamCode: data.error.code
          }
        );
      }
      if (data.id != null && data.id !== id) {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Zabbix JSON-RPC id 不匹配"
        );
      }
      if (!("result" in data)) {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "Zabbix JSON-RPC 缺少 result"
        );
      }
      return data.result;
    } catch (e) {
      if (e instanceof DataSourceError) {
        throw withDataSourceContext(e, {
          uid: this.uid,
          endpoint: `${baseUrl2}${path}`
        });
      }
      throw withDataSourceContext(e, {
        uid: this.uid,
        endpoint: `${baseUrl2}${path}`
      });
    }
  }
}
function splitKeyParams(key) {
  const s = String(key || "");
  const open = s.indexOf("[");
  const close = s.lastIndexOf("]");
  if (open < 0 || close <= open) return [];
  const body = s.slice(open + 1, close);
  const parts = [];
  let cur = "";
  let depth = 0;
  let quote = null;
  for (let i = 0; i < body.length; i++) {
    const ch = body[i];
    if (quote) {
      if (ch === quote) quote = null;
      cur += ch;
      continue;
    }
    if (ch === '"' || ch === "'") {
      quote = ch;
      cur += ch;
      continue;
    }
    if (ch === "[") {
      depth++;
      cur += ch;
      continue;
    }
    if (ch === "]") {
      depth = Math.max(0, depth - 1);
      cur += ch;
      continue;
    }
    if (ch === "," && depth === 0) {
      parts.push(stripQuotes(cur.trim()));
      cur = "";
      continue;
    }
    cur += ch;
  }
  if (cur.length || body.endsWith(",")) parts.push(stripQuotes(cur.trim()));
  return parts;
}
function stripQuotes(v) {
  if (v.startsWith('"') && v.endsWith('"') || v.startsWith("'") && v.endsWith("'")) {
    return v.slice(1, -1);
  }
  return v;
}
function expandItemName(name, key) {
  const params = splitKeyParams(key);
  return String(name || "").replace(/\$([1-9])/g, (_, d) => {
    const idx = Number(d) - 1;
    return params[idx] != null ? params[idx] : `$${d}`;
  });
}
function expandItems(items) {
  return (items || []).map((it) => ({
    ...it,
    name: expandItemName(String(it.name || ""), String(it.key_ || ""))
  }));
}
function scopedValue(raw) {
  if (Array.isArray(raw)) return raw.map(String).join("|");
  if (raw && typeof raw === "object" && "value" in raw) {
    return scopedValue(raw.value);
  }
  return raw == null ? "" : String(raw);
}
function interpolateZabbixValue(value, vars) {
  return String(value || "").replace(
    /\$\{([A-Za-z_][\w]*)\}|\$([A-Za-z_][\w]*)|\[\[([A-Za-z_][\w]*)\]\]/g,
    (token, a, b, c) => {
      const name = a || b || c;
      return name in vars ? scopedValue(vars[name]) : token;
    }
  );
}
function isMatchAllZabbixFilter(filter2) {
  const source = String(filter2 || "").trim();
  if (!source || source === "*" || source === "$__all" || source === "/.*/" || source === "/^.*$/")
    return true;
  const m = source.match(/^\/(.*)\/([gimsuy]*)$/);
  if (!m) return false;
  const body = m[1];
  return body === ".*" || body === "^.*$" || body === ".+" || body === "";
}
function toApiSearchString(filter2) {
  const source = String(filter2 || "").trim();
  if (!source || isMatchAllZabbixFilter(source)) return void 0;
  if (/^\/.*\/[gimsuy]*$/.test(source)) return void 0;
  return source;
}
function zabbixFilterToApiSearch(filter2) {
  const source = String(filter2 || "").trim();
  if (!source || isMatchAllZabbixFilter(source)) return void 0;
  const plain2 = toApiSearchString(source);
  if (plain2) return plain2;
  const match = source.match(/^\/(.*)\/([gimsuy]*)$/);
  if (!match) return void 0;
  const body = match[1];
  const alts = body.split("|").map((part) => {
    let s = "";
    for (let i = 0; i < part.length; i++) {
      const ch = part[i];
      if (ch === "\\" && i + 1 < part.length) {
        s += part[i + 1];
        i += 1;
        continue;
      }
      if (/[A-Za-z0-9._:-]/.test(ch)) s += ch;
    }
    return s.trim();
  });
  const tokens = alts.filter((t2) => t2.length >= 2);
  if (!tokens.length) return void 0;
  tokens.sort((a, b) => b.length - a.length);
  return tokens[0];
}
function matchesZabbixFilter(value, filter2) {
  const source = String(filter2 || "").trim();
  if (isMatchAllZabbixFilter(source)) return true;
  const match = source.match(/^\/(.*)\/([gimsuy]*)$/);
  if (match) {
    try {
      return new RegExp(match[1], match[2].replace("g", "")).test(value);
    } catch {
      return false;
    }
  }
  return value.toLocaleLowerCase().includes(source.toLocaleLowerCase());
}
function interpolateFilter(filter2, vars) {
  return {
    filter: interpolateZabbixValue(String(filter2?.filter ?? ""), vars),
    ...filter2?.ids ? { ids: filter2.ids.map(String) } : {}
  };
}
function majorOf(version) {
  return Number(String(version).split(".")[0] || 6);
}
function minorOf(version) {
  return Number(String(version).split(".")[1] || 0);
}
function pageResult(rows, limit) {
  const list = Array.isArray(rows) ? rows : [];
  const truncated = limit > 0 && list.length >= limit;
  return {
    rows: list,
    complete: !truncated,
    truncated,
    limit
  };
}
function normalizeTriggerHostGroups(rows) {
  if (!Array.isArray(rows)) return [];
  return rows.map((row) => {
    if (row.hostgroups != null) {
      return { ...row, groups: row.hostgroups };
    }
    return row;
  });
}
const ITEM_OUTPUT = [
  "itemid",
  "name",
  "key_",
  "hostid",
  "value_type",
  "units",
  "delay",
  "status",
  "state",
  "valuemapid",
  "lastvalue",
  "lastclock"
];
class ZabbixApi {
  versionPromise = null;
  transport;
  uid;
  cache;
  metadataTtlMs;
  metadataPageLimit;
  /** Short in-flight/result cache so duplicate panels share trend/history RPCs. */
  trendHistoryCache = /* @__PURE__ */ new Map();
  static TREND_HISTORY_TTL_MS = 15e3;
  cachedTrendHistory(key, run) {
    const now = Date.now();
    const hit = this.trendHistoryCache.get(key);
    if (hit && now - hit.at < ZabbixApi.TREND_HISTORY_TTL_MS) {
      return hit.promise;
    }
    const promise = run().catch((e) => {
      this.trendHistoryCache.delete(key);
      throw e;
    });
    this.trendHistoryCache.set(key, { at: now, promise });
    return promise;
  }
  constructor(transportOrOpts) {
    if (typeof transportOrOpts.transport !== "undefined" && !transportOrOpts.call) {
      const opts = transportOrOpts;
      this.transport = opts.transport;
      this.uid = opts.uid || "";
      this.cache = opts.cache;
      this.metadataTtlMs = opts.metadataTtlMs ?? 36e5;
      this.metadataPageLimit = opts.metadataPageLimit ?? 1e3;
    } else {
      this.transport = transportOrOpts;
      this.uid = "";
      this.metadataTtlMs = 36e5;
      this.metadataPageLimit = 1e3;
    }
  }
  get pageLimit() {
    return this.metadataPageLimit;
  }
  get metaTimeoutMs() {
    return Math.max(5e3, Math.floor(this.metadataTtlMs / 3));
  }
  cachedCall(method, params, signal, fallback) {
    const run = (sharedSignal) => {
      const sig = sharedSignal ?? signal;
      if (fallback !== void 0) {
        return this.transport.callWithFallback(
          method,
          params,
          fallback,
          this.metaTimeoutMs,
          sig
        );
      }
      return this.transport.call(method, params, sig);
    };
    if (!this.cache || !this.uid) {
      return run(signal);
    }
    return this.version(signal).then((version) => {
      const majorVersion = Number(String(version).split(".")[0] || 6);
      return this.cache.load(
        { uid: this.uid, majorVersion, method, params },
        this.metadataTtlMs,
        signal,
        (sharedSignal) => run(sharedSignal)
      );
    });
  }
  version(signal) {
    if (!this.versionPromise) {
      this.versionPromise = this.transport.getVersion(signal).catch((error) => {
        this.versionPromise = null;
        throw error;
      });
    }
    return this.versionPromise;
  }
  async ver(signal) {
    return this.version(signal);
  }
  async getGroups(filter2, signal) {
    const params = {
      output: ["groupid", "name"],
      sortfield: "name",
      limit: this.metadataPageLimit
    };
    const search = toApiSearchString(filter2);
    if (search) params.search = { name: search };
    const rows = await this.cachedCall("hostgroup.get", params, signal, []);
    return pageResult(rows, this.metadataPageLimit);
  }
  async getHosts(groupids, filter2, hostTags = [], signal, evaltype = 0) {
    const version = await this.ver(signal);
    const caps2 = getZabbixVersionCapabilities(version);
    const params = {
      // Keep host list light — selectInventory/Interfaces extend freezes UI on large fleets
      output: [
        "hostid",
        "name",
        "host",
        "status",
        "maintenance_status",
        caps2.hostProxyIdField
      ],
      sortfield: "name",
      limit: this.metadataPageLimit,
      // Enabled + monitored only — alphabetical "111/1111" junk hosts often have 0 items.
      monitored: true,
      filter: { status: 0 }
    };
    if (groupids?.length) params.groupids = groupids;
    const search = toApiSearchString(filter2);
    if (search) params.search = { name: search };
    if (!search && !hostTags?.length) {
      params.with_monitored_items = true;
    }
    if (hostTags?.length) {
      params.tags = hostTags.map((t2) => ({
        tag: t2.tag,
        value: t2.value,
        operator: t2.operator
      }));
      params.evaltype = evaltype === 2 ? 2 : 0;
    }
    const rows = await this.cachedCall("host.get", params, signal, []);
    return pageResult(rows, this.metadataPageLimit);
  }
  async getApplications(hostids, filter2, signal) {
    const version = await this.ver(signal);
    const caps2 = getZabbixVersionCapabilities(version);
    if (!caps2.supportsApplications) {
      return pageResult([], this.metadataPageLimit);
    }
    const params = {
      output: "extend",
      sortfield: "name",
      limit: this.metadataPageLimit
    };
    if (hostids?.length) params.hostids = hostids;
    const search = toApiSearchString(filter2);
    if (search) params.search = { name: search };
    const rows = await this.cachedCall(
      "application.get",
      params,
      signal,
      []
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getDiscoveryRules(hostids, signal) {
    const params = {
      output: ["itemid", "name", "key_"],
      limit: this.metadataPageLimit
    };
    if (hostids?.length) params.hostids = hostids;
    const rows = await this.cachedCall(
      "discoveryrule.get",
      params,
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getItemPrototypes(discoveryRuleId, signal) {
    const params = {
      output: ["itemid", "name", "key_"],
      limit: this.metadataPageLimit
    };
    if (discoveryRuleId) params.discoveryids = [discoveryRuleId];
    const rows = await this.cachedCall(
      "itemprototype.get",
      params,
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  /**
   * Discovered items for LLD: always request selectItemDiscovery:'extend'.
   * Matching uses itemDiscovery.parent_itemid against selected prototype itemids
   * when provided; otherwise prototypeKeys match exact key_ of prototypes only when
   * parent relation is missing (INVALID_RESPONSE if relation required).
   */
  async getDiscoveredItems(hostids, discoveryRuleId, keyPrefixes, signal, opts) {
    const params = {
      output: "extend",
      selectTags: "extend",
      selectHosts: ["hostid", "name", "host"],
      selectItemDiscovery: "extend",
      limit: this.metadataPageLimit
    };
    if (hostids?.length) params.hostids = hostids;
    if (discoveryRuleId) params.discoveryids = [discoveryRuleId];
    const items = await this.transport.call("item.get", params, signal) || [];
    const prototypeIds = (opts?.prototypeIds || []).map(String).filter(Boolean);
    if (prototypeIds.length) {
      const matched = items.filter((it) => {
        const parent = String(it.itemDiscovery?.parent_itemid ?? "");
        return parent && prototypeIds.includes(parent);
      });
      const missingRelation = items.length > 0 && matched.length === 0 && items.every((it) => !it.itemDiscovery?.parent_itemid);
      if (missingRelation || opts?.requireParentRelation && items.some((it) => !it.itemDiscovery?.parent_itemid)) {
        throw new DataSourceError(
          "INVALID_RESPONSE",
          "discovered items missing itemDiscovery.parent_itemid; cannot match prototypes"
        );
      }
      return matched;
    }
    if (!keyPrefixes?.length) return items;
    return items.filter(
      (it) => keyPrefixes.some((p) => String(it.key_ || "").startsWith(p))
    );
  }
  async getDiscoveryRulesFull(hostids, signal) {
    const params = {
      output: "extend",
      limit: this.metadataPageLimit
    };
    if (hostids?.length) params.hostids = hostids;
    const rows = await this.cachedCall(
      "discoveryrule.get",
      params,
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getItemPrototypesFull(discoveryRuleId, signal) {
    const params = {
      output: "extend",
      limit: this.metadataPageLimit
    };
    if (discoveryRuleId) params.discoveryids = [discoveryRuleId];
    const rows = await this.cachedCall(
      "itemprototype.get",
      params,
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getItems(params, signal) {
    const version = await this.ver(signal);
    const body = {
      output: [...ITEM_OUTPUT],
      selectTags: "extend",
      selectHosts: ["hostid", "name", "host"],
      sortfield: "name",
      webitems: true,
      limit: this.metadataPageLimit,
      monitored: true
    };
    if (params.hostids?.length) body.hostids = params.hostids;
    if (params.groupids?.length) body.groupids = params.groupids;
    if (params.applicationids?.length && (majorOf(version) < 5 || majorOf(version) === 5 && minorOf(version) < 4)) {
      body.applicationids = params.applicationids;
    }
    const rawFilter = String(params.filter || "").trim();
    const searchToken = zabbixFilterToApiSearch(rawFilter);
    if (searchToken) {
      body.search = { name: searchToken, key_: searchToken };
      body.searchByAny = true;
      if (/[*%]/.test(searchToken)) {
        body.searchWildcardsEnabled = true;
      }
    }
    if (!params.showDisabled)
      body.filter = { ...body.filter, status: 0 };
    if (params.valueTypes?.length)
      body.filter = {
        ...body.filter,
        value_type: params.valueTypes
      };
    if (params.itemTag) {
      const [tag, ...rest] = params.itemTag.split(":");
      body.tags = [
        { tag: tag.trim(), value: rest.join(":").trim(), operator: 0 }
      ];
    }
    const cacheKey = `item.get|${JSON.stringify(body)}`;
    const rows = await this.cachedTrendHistory(
      cacheKey,
      () => this.cachedCall("item.get", body, signal, [])
    );
    return pageResult(
      expandItems(rows),
      this.metadataPageLimit
    );
  }
  async getItemsByIds(itemids, signal) {
    if (!itemids?.length) return [];
    const rows = await this.transport.call(
      "item.get",
      {
        itemids,
        output: [...ITEM_OUTPUT],
        selectTags: "extend",
        selectHosts: ["hostid", "name", "host"]
      },
      signal
    );
    return expandItems(rows || []);
  }
  async getHistory(itemids, history, from, to, signal, limit) {
    if (!itemids?.length) return [];
    const ids = [...itemids].map(String).sort();
    const key = `h|${ids.join(",")}|${history}|${from}|${to}|${limit ?? ""}`;
    return this.cachedTrendHistory(key, async () => {
      const params = {
        itemids: ids,
        history,
        time_from: from,
        time_till: to,
        output: ["itemid", "clock", "value", "ns"],
        sortfield: "clock",
        sortorder: "ASC"
      };
      if (limit != null && limit > 0) params.limit = limit;
      return this.transport.call(
        "history.get",
        params,
        signal
      );
    });
  }
  async getTrends(itemids, from, to, signal) {
    if (!itemids?.length) return [];
    const ids = [...itemids].map(String).sort();
    const key = `t|${ids.join(",")}|${from}|${to}`;
    return this.cachedTrendHistory(
      key,
      async () => this.transport.call(
        "trend.get",
        {
          itemids: ids,
          time_from: from,
          time_till: to,
          // Slim columns — extend freezes the browser on multi-item 7d windows.
          output: [
            "itemid",
            "clock",
            "value_min",
            "value_avg",
            "value_max",
            "num"
          ],
          sortfield: "clock",
          sortorder: "ASC",
          // Soft cap; loadHistory downsamples further per series.
          limit: 2e3
        },
        signal
      )
    );
  }
  async getTriggers(params, signal) {
    const version = await this.ver(signal);
    const caps2 = getZabbixVersionCapabilities(version);
    const body = { ...params };
    const groupSelect = body.selectHostGroups ?? body.selectGroups;
    if (groupSelect !== void 0) {
      delete body.selectGroups;
      delete body.selectHostGroups;
      body[caps2.triggerHostGroupsField] = groupSelect;
    }
    if (!body.limit && !body.countOutput) body.limit = this.metadataPageLimit;
    const raw = await this.transport.call("trigger.get", body, signal);
    if (body.countOutput) {
      if (typeof raw === "number") return raw;
      if (typeof raw === "string") return Number(raw) || 0;
      if (Array.isArray(raw)) return raw.length;
      return Number(raw) || 0;
    }
    const normalized = normalizeTriggerHostGroups(raw);
    return pageResult(normalized, Number(body.limit) || this.metadataPageLimit);
  }
  async getProblems(params, signal) {
    const version = await this.ver(signal);
    const body = {
      output: "extend",
      selectTags: "extend",
      sortfield: ["eventid"],
      sortorder: "DESC",
      ...params
    };
    delete body.selectHosts;
    const caps2 = getZabbixVersionCapabilities(version);
    delete body.selectAcknowledges;
    delete body.select_acknowledges;
    body[caps2.acknowledgesField] = "extend";
    return this.transport.call("problem.get", body, signal);
  }
  async getEvents(params, signal) {
    return this.transport.call("event.get", params, signal);
  }
  async getProxies(filter2, signal) {
    const version = await this.ver(signal);
    const caps2 = getZabbixVersionCapabilities(version);
    const nameField = caps2.proxyNameField;
    const params = {
      output: ["proxyid", nameField, "status"],
      limit: this.metadataPageLimit
    };
    if (filter2) params.search = { [nameField]: filter2 };
    const rows = await this.cachedCall("proxy.get", params, signal);
    return pageResult(rows, this.metadataPageLimit);
  }
  async getServices(signal) {
    const rows = await this.cachedCall(
      "service.get",
      { output: "extend", limit: this.metadataPageLimit },
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getSlas(serviceids, filter2, signal) {
    const version = await this.ver(signal);
    if (majorOf(version) >= 6) {
      const params2 = {
        output: "extend",
        limit: this.metadataPageLimit
      };
      if (serviceids?.length) params2.serviceids = serviceids;
      if (filter2) params2.search = { name: filter2 };
      const rows2 = await this.cachedCall("sla.get", params2, signal);
      return pageResult(rows2, this.metadataPageLimit);
    }
    const params = {};
    if (serviceids?.length) params.serviceids = serviceids;
    const rows = await this.transport.call(
      "service.getsla",
      params,
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getSli(params, signal) {
    const version = await this.ver(signal);
    if (majorOf(version) >= 6) {
      return this.transport.call("sla.getsli", params, signal);
    }
    return this.transport.call("service.getsla", params, signal);
  }
  async getMacros(hostids, filter2, signal) {
    const params = {
      output: "extend",
      limit: this.metadataPageLimit
    };
    if (hostids?.length) params.hostids = hostids;
    if (filter2) params.search = { macro: filter2 };
    const rows = await this.cachedCall("usermacro.get", params, signal);
    return pageResult(rows, this.metadataPageLimit);
  }
  async getValueMaps(signal) {
    const rows = await this.cachedCall(
      "valuemap.get",
      {
        output: "extend",
        selectMappings: "extend",
        limit: this.metadataPageLimit
      },
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getCurrentUser(signal) {
    const rows = await this.transport.call("user.get", { output: ["userid", "type", "roleid"] }, signal);
    return rows?.[0] ?? { userid: "" };
  }
  async getScripts(hostid, eventid, signal) {
    const params = {
      output: "extend",
      limit: this.metadataPageLimit
    };
    if (hostid) params.hostid = hostid;
    const rows = await this.cachedCall(
      "script.get",
      params,
      signal
    );
    return pageResult(rows, this.metadataPageLimit);
  }
  async getProblemDetail(eventid, signal) {
    if (!eventid) return null;
    const problems = await this.getProblems({ eventids: [eventid] }, signal);
    const problem = problems?.[0];
    if (!problem) return null;
    const triggerids = problem.objectid ? [String(problem.objectid)] : [];
    const version = await this.ver(signal);
    const caps2 = getZabbixVersionCapabilities(version);
    const triggersPage = triggerids.length ? await this.getTriggers(
      {
        triggerids,
        output: "extend",
        selectHosts: "extend",
        [caps2.triggerHostGroupsField]: "extend",
        selectItems: "extend",
        expandDescription: true,
        expandExpression: true
      },
      signal
    ) : pageResult([], this.metadataPageLimit);
    const triggerRows = typeof triggersPage === "number" ? [] : triggersPage.rows;
    const trigger = triggerRows[0] || {};
    const events = await this.getEvents(
      {
        eventids: [eventid],
        output: "extend",
        [caps2.acknowledgesField]: "extend",
        selectTags: "extend"
      },
      signal
    );
    const alerts = await this.transport.call(
      "alert.get",
      { eventids: [eventid], output: "extend" },
      signal
    );
    const groups = trigger.groups || trigger.hostgroups || [];
    return {
      ...problem,
      description: String(trigger.description ?? problem.name ?? ""),
      expression: String(trigger.expression ?? ""),
      opdata: String(trigger.opdata ?? ""),
      manual_close: trigger.manual_close != null ? String(trigger.manual_close) : problem.manual_close,
      hosts: trigger.hosts || problem.hosts || [],
      groups,
      items: trigger.items || [],
      tags: problem.tags || [],
      acknowledges: events?.[0]?.acknowledges || problem.acknowledges || [],
      events: events || [],
      alerts: alerts || []
    };
  }
  async acknowledgeEvent(payload, signal) {
    return this.transport.call("event.acknowledge", payload, signal);
  }
  async executeScript(payload, signal) {
    return this.transport.call("script.execute", payload, signal);
  }
}
function throwIfAborted(signal) {
  if (signal?.aborted) {
    throw new DataSourceError("CANCELLED", "数据源请求已取消");
  }
}
function historyPoints(itemid, from, to, count = 12) {
  const start = Number(from) || 0;
  const end = Number(to) || start + 3600;
  const step = Math.max(1, Math.floor((end - start) / Math.max(1, count - 1)));
  const points = [];
  for (let i = 0; i < count; i++) {
    const clock = String(start + i * step);
    points.push({ itemid, clock, ns: "0", value: String(10 + i) });
  }
  return points;
}
class OfflineZabbixTransport {
  constructor(scenario = "default") {
    this.scenario = scenario;
  }
  scenario;
  async getVersion(signal) {
    throwIfAborted(signal);
    if (this.scenario === "version-5") return "5.0.0";
    if (this.scenario === "version-6") return "6.0.0";
    if (this.scenario === "version-7") return "7.2.0";
    return "7.2.0";
  }
  async callWithFallback(method, params, fallback, _timeoutMs, signal) {
    try {
      return await this.call(method, params, signal);
    } catch (e) {
      const isAbort = e?.name === "AbortError" || e?.code === "ERR_CANCELED";
      if (isAbort) return fallback;
      throw e;
    }
  }
  async call(method, params = {}, signal) {
    throwIfAborted(signal);
    assertAllowedZabbixMethod(method);
    if (this.scenario === "error") {
      throw new DataSourceError(
        "UPSTREAM_ERROR",
        "offline fixture upstream error",
        { upstreamCode: 500 }
      );
    }
    if (this.scenario === "empty") {
      if (method === "apiinfo.version")
        return await this.getVersion(signal);
      return [];
    }
    switch (method) {
      case "apiinfo.version":
        return await this.getVersion(signal);
      case "hostgroup.get":
        return [
          { groupid: "g1", name: "Linux servers" },
          { groupid: "g2", name: "Windows servers" }
        ];
      case "host.get":
        return [
          { hostid: "h1", name: "web-01", host: "web-01", status: "0" },
          { hostid: "h2", name: "db-01", host: "db-01", status: "0" }
        ];
      case "application.get":
        return [{ applicationid: "a1", name: "CPU", hostid: "h1" }];
      case "item.get": {
        if (this.scenario === "partial") {
          return [
            {
              itemid: "i1",
              name: "CPU util",
              key_: "system.cpu.util",
              hostid: "h1",
              value_type: "0",
              units: "%",
              status: "0"
            }
          ];
        }
        return [
          {
            itemid: "i1",
            name: "CPU util",
            key_: "system.cpu.util",
            hostid: "h1",
            value_type: "0",
            units: "%",
            status: "0",
            tags: [{ tag: "env", value: "prod" }],
            hosts: [{ hostid: "h1", name: "web-01" }]
          },
          {
            itemid: "i2",
            name: "Agent version",
            key_: "agent.version",
            hostid: "h1",
            value_type: "1",
            status: "0"
          },
          {
            itemid: "i3",
            name: "System log",
            key_: "log[/var/log/syslog]",
            hostid: "h1",
            value_type: "2",
            status: "0"
          },
          {
            itemid: "i4",
            name: "Discovered FS",
            key_: "vfs.fs.size[/,pused]",
            hostid: "h1",
            value_type: "0",
            status: "0"
          }
        ];
      }
      case "discoveryrule.get":
        return [
          {
            itemid: "d1",
            name: "Mounted filesystem discovery",
            key_: "vfs.fs.discovery"
          }
        ];
      case "itemprototype.get":
        return [
          {
            itemid: "p1",
            ruleid: "d1",
            name: "Free disk space on {#FSNAME}",
            key_: "vfs.fs.size[{#FSNAME},pfree]"
          }
        ];
      case "history.get": {
        const itemids = params.itemids || ["i1"];
        const from = Number(params.time_from ?? 0);
        const to = Number(params.time_till ?? from + 3600);
        return itemids.flatMap((id) => historyPoints(id, from, to));
      }
      case "trend.get": {
        const itemids = params.itemids || ["i1"];
        const from = Number(params.time_from ?? 0);
        return itemids.map((itemid) => ({
          itemid,
          clock: String(from),
          num: "12",
          value_min: "1",
          value_avg: "5",
          value_max: "9"
        }));
      }
      case "problem.get":
        return [
          {
            eventid: "e1",
            objectid: "t1",
            name: "High CPU",
            severity: "3",
            clock: "1700000000",
            acknowledged: "0",
            hosts: [{ hostid: "h1", name: "web-01" }],
            tags: [{ tag: "scope", value: "availability" }]
          },
          {
            eventid: "e2",
            objectid: "t2",
            name: "Disk full",
            severity: "4",
            clock: "1700001000",
            acknowledged: "1",
            hosts: [{ hostid: "h2", name: "db-01" }],
            tags: []
          }
        ];
      case "event.get":
        return [
          {
            eventid: String(params.eventids?.[0] || "e1"),
            acknowledges: [{ acknowledgeid: "a1", message: "looking" }]
          }
        ];
      case "trigger.get":
        return [
          {
            triggerid: "t1",
            description: "High CPU",
            expression: "{web-01:system.cpu.util.last()}>90",
            opdata: "95%",
            hosts: [{ hostid: "h1", name: "web-01" }],
            groups: [{ groupid: "g1", name: "Linux servers" }],
            items: [
              {
                itemid: "i1",
                name: "CPU util",
                key_: "system.cpu.util",
                hostid: "h1",
                value_type: "0"
              }
            ]
          }
        ];
      case "alert.get":
        return [{ alertid: "al1", subject: "alert" }];
      case "service.get":
        return [{ serviceid: "s1", name: "Web SLA" }];
      case "sla.get":
      case "service.getsla":
        return [{ slaid: "sla1", name: "Availability", serviceid: "s1" }];
      case "sla.getsli":
        return [{ period: "1h", sli: 99.9 }];
      case "usermacro.get":
        return [{ hostmacroid: "m1", macro: "{$CPU.MAX}", value: "90" }];
      case "valuemap.get":
        return [
          {
            valuemapid: "vm1",
            name: "Service state",
            mappings: [{ value: "0", newvalue: "Down" }]
          }
        ];
      case "script.get":
        return [
          { scriptid: "sc1", name: "Ping", type: "0", execute_on: "0" }
        ];
      case "user.get":
        return [{ userid: "u1", type: "3", roleid: "r1" }];
      case "proxy.get":
        return [{ proxyid: "px1", host: "proxy-01", status: "5" }];
      case "event.acknowledge":
        return {
          eventids: params.eventids || [],
          preview: true
        };
      case "script.execute":
        return { response: "offline preview", preview: true };
      default:
        return [];
    }
  }
}
const DS_QUERY_SCHEMA = 12;
const DS_CONFIG_SCHEMA = 4;
const TYPE_MAP = {
  "0": "0",
  metrics: "0",
  "1": "1",
  services: "1",
  "2": "2",
  text: "2",
  "3": "3",
  itemid: "3",
  "4": "4",
  triggers: "4",
  "5": "5",
  problems: "5",
  "6": "6",
  macros: "6"
};
function normalizeZabbixQueryType(value) {
  const key = String(value ?? "0").toLowerCase();
  if (TYPE_MAP[key]) return TYPE_MAP[key];
  return key;
}
const filter = () => ({ filter: "" });
const DEFAULT_ZABBIX_QUERY = {
  refId: "A",
  schema: DS_QUERY_SCHEMA,
  queryType: "0",
  group: filter(),
  host: filter(),
  application: filter(),
  itemTag: filter(),
  item: filter(),
  proxy: filter(),
  trigger: filter(),
  tags: filter(),
  macro: filter(),
  itemids: "",
  textFilter: "",
  useCaptureGroups: false,
  itServiceFilter: "",
  slaFilter: "",
  slaProperty: "sli",
  slaInterval: "none",
  showProblems: "problems",
  countTriggersBy: "",
  functions: [],
  options: {
    useTrends: "default",
    acknowledged: 2,
    sortProblems: "default",
    limit: 1001
  }
};
const DEFAULT_ZABBIX_OPTIONS = {
  dataMode: "live",
  authPlacement: "auto",
  enableWrites: false,
  authType: "token",
  trends: true,
  trendsFrom: "7d",
  trendsRange: "4d",
  cacheTTL: "1h",
  metadataPageLimit: 1e3,
  historyPageLimit: 1e4,
  historyBatchSize: 100,
  historyConcurrency: 4,
  timeout: 3e4,
  queryTimeout: 6e4,
  dbConnectionEnable: false,
  disableReadOnlyUsersAck: false,
  disableDataAlignment: false,
  schema: DS_CONFIG_SCHEMA
};
const LEGACY_SLA_PROPERTY = {
  sla: "sli",
  okTime: "uptime",
  downtimeTime: "downtime",
  problemTime: "downtime"
};
const LEGACY_SLA_INTERVAL = {
  day: "1d",
  week: "1w",
  month: "1M",
  hour: "1h"
};
function mapLegacySLAProperty(value) {
  const s = String(value ?? "sli");
  return LEGACY_SLA_PROPERTY[s] ?? s;
}
function mapLegacySLAInterval(value) {
  const s = String(value ?? "none");
  return LEGACY_SLA_INTERVAL[s] ?? s;
}
function deepClone$3(v) {
  try {
    return structuredClone(v);
  } catch {
    return JSON.parse(JSON.stringify(v));
  }
}
function asFilter(value) {
  if (value && typeof value === "object" && !Array.isArray(value)) {
    const o = value;
    return {
      filter: String(o.filter ?? ""),
      ...o.name != null ? { name: String(o.name) } : {},
      ...Array.isArray(o.ids) ? { ids: o.ids.map(String) } : {}
    };
  }
  return { filter: "" };
}
function convertToRegex(str) {
  if (str) return `/${str}/`;
  return "/.*/";
}
function normalizeZabbixFunction(input) {
  const o = input && typeof input === "object" ? input : {};
  const def = o.def && typeof o.def === "object" ? o.def : {};
  let name = String(o.name ?? def.name ?? "unknown");
  if (name === "percentil") name = "percentile";
  const params = Array.isArray(o.params) ? o.params : [];
  const out = { name, params };
  if (o.text != null) out.text = String(o.text);
  if (o.added != null) out.added = Boolean(o.added);
  return out;
}
function fixTargetGroup(target) {
  if (Array.isArray(target.group)) {
    target.group = { filter: "" };
  }
}
function isGrafana2target(target) {
  const mode2 = target.mode;
  if (mode2 == null || mode2 === 0 || mode2 === 2) {
    const item = target.item;
    const host = target.host;
    if ((target.hostFilter || target.itemFilter || target.downsampleFunction || host && host.host) && item?.filter === void 0 && host?.filter === void 0) {
      return true;
    }
  }
  return false;
}
function migrateFrom2To3version(target) {
  const group = target.group && typeof target.group === "object" ? target.group : {};
  const host = target.host && typeof target.host === "object" ? target.host : {};
  const application = target.application && typeof target.application === "object" ? target.application : {};
  const item = target.item && typeof target.item === "object" ? target.item : {};
  const macro = target.macro && typeof target.macro === "object" ? target.macro : {};
  target.group = {
    filter: group.name === "*" ? "/.*/" : String(group.name ?? group.filter ?? "")
  };
  target.host = {
    filter: host.name === "*" ? convertToRegex(target.hostFilter) : String(host.name ?? host.filter ?? "")
  };
  target.application = {
    filter: application.name === "*" ? "" : String(application.name ?? application.filter ?? "")
  };
  target.item = {
    filter: item.name === "All" ? convertToRegex(target.itemFilter) : String(item.name ?? item.filter ?? "")
  };
  target.macro = {
    filter: macro.macro === "*" ? convertToRegex(target.macroFilter) : String(macro.macro ?? macro.filter ?? "")
  };
}
function migrateFunctions(target) {
  if (!Array.isArray(target.functions)) {
    target.functions = [];
    return;
  }
  target.functions = target.functions.map((f) => normalizeZabbixFunction(f));
}
function migrateQueryType(target) {
  if (target.queryType === void 0) {
    if (target.mode === "Metrics") {
      target.queryType = "0";
    } else if (target.mode !== void 0) {
      target.queryType = target.mode;
      delete target.mode;
    }
  }
  if (typeof target.queryType === "number") {
    target.queryType = String(target.queryType);
  }
  if (target.queryType != null) {
    target.queryType = normalizeZabbixQueryType(target.queryType);
  }
}
function migrateSLA(target) {
  if (normalizeZabbixQueryType(target.queryType) === "1" && !target.slaInterval) {
    target.slaInterval = "none";
  }
}
function migrateProblemSort(target) {
  const options = target.options && typeof target.options === "object" ? target.options : null;
  if (options?.sortProblems === "priority") {
    options.sortProblems = "severity";
  }
}
function migrateApplications(target) {
  if (!target.itemTag) {
    const application = target.application && typeof target.application === "object" ? target.application : {};
    const appFilter = String(application.filter ?? "");
    target.itemTag = { filter: appFilter ? `Application: ${appFilter}` : "" };
  }
}
function migrateSLAProperty(target) {
  if (target.slaProperty && typeof target.slaProperty === "object") {
    const prop = target.slaProperty.property;
    if (prop != null) target.slaProperty = String(prop);
  }
  if (target.slaProperty != null) {
    target.slaProperty = mapLegacySLAProperty(target.slaProperty);
  }
  if (target.slaInterval != null) {
    target.slaInterval = mapLegacySLAInterval(target.slaInterval);
  }
}
function migrateTriggersMode(target) {
  const triggers = target.triggers && typeof target.triggers === "object" ? target.triggers : null;
  if (!triggers) return;
  const options = {
    ...target.options && typeof target.options === "object" ? target.options : {}
  };
  if (triggers.minSeverity != null) {
    options.minSeverity = triggers.minSeverity;
    delete triggers.minSeverity;
  }
  if (triggers.count != null) {
    options.count = triggers.count;
    delete triggers.count;
  }
  target.options = options;
}
function migrateNewTriggersCountModes(target) {
  const schema = Number(target.schema ?? 0);
  if (schema >= 11) return;
  const qt = String(target.queryType ?? "");
  if (qt === "6") {
    target.queryType = "4";
    target.countTriggersBy = "items";
  } else if (qt === "7") {
    target.queryType = "4";
    target.countTriggersBy = "problems";
  } else if (qt === "8") {
    target.queryType = "6";
  }
}
function migrateProblemsSeverity(target) {
  const schema = Number(target.schema ?? 0);
  if (schema >= 12) return;
  const options = target.options && typeof target.options === "object" ? target.options : null;
  if (!options || options.minSeverity == null) return;
  const min = Number(options.minSeverity);
  options.severities = [0, 1, 2, 3, 4, 5].filter((v) => v >= min);
}
function migrateLld(target) {
  const hasNew = target.lld && typeof target.lld === "object" && String(target.lld.ruleId || "");
  const legacyRule = String(target.lldRuleId || "");
  const legacyKeys = Array.isArray(target.lldItemKeys) ? target.lldItemKeys.map(String) : [];
  const legacyName = target.lldRuleName != null ? String(target.lldRuleName) : void 0;
  const qtRaw = String(target.queryType || "").toLowerCase();
  const wasLldQueryType = qtRaw === "lld" || qtRaw === "7" || qtRaw === "8" && Boolean(hasNew || legacyRule || legacyKeys.length);
  if (hasNew) {
    const lld = target.lld;
    target.executionMode = target.executionMode || "lld";
    target.lld = {
      ruleId: String(lld.ruleId || ""),
      ruleName: lld.ruleName != null ? String(lld.ruleName) : void 0,
      prototypeIds: Array.isArray(lld.prototypeIds) ? lld.prototypeIds.map(String) : [],
      prototypeKeys: Array.isArray(lld.prototypeKeys) ? lld.prototypeKeys.map(String) : [],
      discoveredItemIds: Array.isArray(lld.discoveredItemIds) ? lld.discoveredItemIds.map(String) : void 0
    };
    if (wasLldQueryType) target.queryType = "0";
    return;
  }
  if (legacyRule || legacyKeys.length || wasLldQueryType) {
    target.executionMode = "lld";
    target.lld = {
      ruleId: legacyRule,
      ruleName: legacyName,
      prototypeIds: [],
      prototypeKeys: legacyKeys
    };
    if (wasLldQueryType) target.queryType = "0";
  } else if (!target.executionMode) {
    target.executionMode = "standard";
  }
}
function migrateZabbixQuery(input) {
  const target = deepClone$3(input);
  target.resultFormat = target.resultFormat || "time_series";
  fixTargetGroup(target);
  if (isGrafana2target(target)) {
    migrateFrom2To3version(target);
  }
  migrateFunctions(target);
  migrateQueryType(target);
  migrateSLA(target);
  migrateProblemSort(target);
  migrateApplications(target);
  migrateSLAProperty(target);
  migrateTriggersMode(target);
  migrateNewTriggersCountModes(target);
  migrateProblemsSeverity(target);
  migrateLld(target);
  target.schema = DS_QUERY_SCHEMA;
  const base = deepClone$3(DEFAULT_ZABBIX_QUERY);
  const qtCode = String(target.queryType ?? "0");
  if (!/^[0-6]$/.test(qtCode)) {
    throw new DataSourceError(
      "INVALID_QUERY",
      `不支持的 Zabbix queryType: ${qtCode}`
    );
  }
  return {
    ...base,
    ...target,
    group: asFilter(target.group ?? base.group),
    host: asFilter(target.host ?? base.host),
    application: asFilter(target.application ?? base.application),
    itemTag: asFilter(target.itemTag ?? base.itemTag),
    item: asFilter(target.item ?? base.item),
    proxy: asFilter(target.proxy ?? base.proxy),
    trigger: asFilter(target.trigger ?? base.trigger),
    tags: asFilter(target.tags ?? base.tags),
    macro: asFilter(target.macro ?? base.macro),
    itemids: String(target.itemids ?? base.itemids ?? ""),
    textFilter: String(target.textFilter ?? base.textFilter ?? ""),
    useCaptureGroups: Boolean(target.useCaptureGroups ?? base.useCaptureGroups),
    itServiceFilter: String(
      target.itServiceFilter ?? base.itServiceFilter ?? ""
    ),
    slaFilter: String(target.slaFilter ?? base.slaFilter ?? ""),
    slaProperty: String(target.slaProperty ?? base.slaProperty ?? "sli"),
    slaInterval: String(target.slaInterval ?? base.slaInterval ?? "none"),
    showProblems: target.showProblems ?? base.showProblems,
    functions: Array.isArray(target.functions) ? target.functions : [],
    options: {
      ...base.options,
      ...target.options && typeof target.options === "object" ? target.options : {}
    },
    queryType: normalizeZabbixQueryType(target.queryType ?? base.queryType),
    schema: DS_QUERY_SCHEMA,
    refId: String(target.refId ?? base.refId),
    executionMode: target.executionMode || "standard",
    lld: target.lld,
    lldRuleId: target.lldRuleId,
    lldRuleName: target.lldRuleName,
    lldItemKeys: target.lldItemKeys
  };
}
function migrateZabbixConfig(input, resolveUid) {
  const jsonData = deepClone$3(input);
  let error;
  if (jsonData.dbConnection && typeof jsonData.dbConnection === "object") {
    const db = jsonData.dbConnection;
    jsonData.dbConnectionEnable = Boolean(db.enable);
    if (!jsonData.dbConnectionDatasourceUID && Number(db.datasourceId) > 0) {
      const uid = resolveUid?.(Number(db.datasourceId));
      if (uid) jsonData.dbConnectionDatasourceUID = uid;
      else {
        error = {
          code: "DIRECT_DB_DATASOURCE_NOT_FOUND",
          message: `找不到 id 为 ${db.datasourceId} 的 Direct DB 数据源`
        };
      }
    }
    delete jsonData.dbConnection;
  }
  if (typeof jsonData.timeout === "string") {
    jsonData.timeout = jsonData.timeout === "" ? 0 : Number(jsonData.timeout);
  }
  if (!jsonData.dbConnectionDatasourceUID && Number(jsonData.dbConnectionDatasourceId) > 0) {
    const id = Number(jsonData.dbConnectionDatasourceId);
    const uid = resolveUid?.(id);
    if (!uid) {
      error = {
        code: "DIRECT_DB_DATASOURCE_NOT_FOUND",
        message: `找不到 id 为 ${id} 的 Direct DB 数据源`
      };
      delete jsonData.dbConnectionDatasourceUID;
    } else {
      jsonData.dbConnectionDatasourceUID = uid;
    }
  }
  delete jsonData.dbConnectionDatasourceId;
  jsonData.schema = DS_CONFIG_SCHEMA;
  const options = {
    ...DEFAULT_ZABBIX_OPTIONS,
    ...jsonData,
    schema: DS_CONFIG_SCHEMA
  };
  return error ? { options, error } : { options };
}
function prepareZabbixAnnotation(input) {
  const json = deepClone$3(input);
  const existing = json.target && typeof json.target === "object" ? json.target : {};
  const defaultTarget = {
    group: { filter: String(json.group ?? "") },
    host: { filter: String(json.host ?? "") },
    application: { filter: String(json.application ?? "") },
    trigger: { filter: String(json.trigger ?? "") },
    options: {
      minSeverity: json.minseverity ?? 0,
      showOkEvents: json.showOkEvents ?? false,
      hideAcknowledged: json.hideAcknowledged ?? false,
      showHostname: json.showHostname ?? false
    }
  };
  const existingOptions = existing.options && typeof existing.options === "object" ? existing.options : {};
  json.target = {
    ...defaultTarget,
    ...existing,
    fromAnnotations: true,
    options: {
      ...defaultTarget.options,
      ...existingOptions
    }
  };
  return json;
}
function pointKey(p) {
  return `${p.itemid}|${p.clock}|${p.ns ?? "0"}`;
}
function sortAndDedupeHistory(points) {
  const seen = /* @__PURE__ */ new Set();
  const out = [];
  const sorted = [...points].sort((a, b) => {
    if (a.itemid !== b.itemid)
      return String(a.itemid).localeCompare(String(b.itemid));
    const c = Number(a.clock) - Number(b.clock);
    if (c !== 0) return c;
    return Number(a.ns || 0) - Number(b.ns || 0);
  });
  for (const p of sorted) {
    const k = pointKey(p);
    if (seen.has(k)) continue;
    seen.add(k);
    out.push(p);
  }
  return out;
}
async function fetchHistoryRange(opts) {
  const pageLimit = Math.max(1, Math.floor(opts.pageLimit || 1e4));
  const maxRows = Math.max(1, Math.floor(opts.maxRows || pageLimit));
  const minSliceSec = Math.max(1, Math.floor(opts.minSliceSec ?? 1));
  let requests = 0;
  let truncated = false;
  async function loadSlice(fromSec, toSec) {
    if (opts.signal?.aborted) {
      const err = new Error("Aborted");
      err.name = "AbortError";
      throw err;
    }
    if (fromSec > toSec) return [];
    requests += 1;
    const rows = await opts.getHistory(
      opts.itemids,
      opts.history,
      fromSec,
      toSec,
      opts.signal,
      pageLimit
    ) || [];
    if (rows.length < pageLimit) {
      return rows;
    }
    const span = toSec - fromSec;
    if (span <= minSliceSec) {
      truncated = true;
      return rows.slice(0, pageLimit);
    }
    const mid = fromSec + Math.floor(span / 2);
    const left = await loadSlice(fromSec, mid);
    const right = await loadSlice(mid + 1, toSec);
    return left.concat(right);
  }
  const merged = sortAndDedupeHistory(
    await loadSlice(opts.fromSec, opts.toSec)
  );
  if (merged.length > maxRows) {
    truncated = true;
    return { points: merged.slice(0, maxRows), truncated: true, requests };
  }
  return { points: merged, truncated, requests };
}
async function mapPool(items, concurrency, worker) {
  const limit = Math.max(1, Math.floor(concurrency || 1));
  const results = new Array(items.length);
  let next = 0;
  async function run() {
    while (next < items.length) {
      const i = next++;
      results[i] = await worker(items[i], i);
    }
  }
  await Promise.all(
    Array.from({ length: Math.min(limit, items.length) }, () => run())
  );
  return results;
}
async function* fetchHistoryStream(opts) {
  const batchSize = Math.max(1, Math.floor(opts.batchSize || 25));
  const ids = opts.itemids.map(String);
  const accumulated = [];
  for (let i = 0; i < ids.length; i += batchSize) {
    if (opts.signal?.aborted) {
      const err = new Error("Aborted");
      err.name = "AbortError";
      throw err;
    }
    const batch = ids.slice(i, i + batchSize);
    const page = await opts.fetchBatch(batch) || [];
    accumulated.push(...page);
    const isLast = i + batchSize >= ids.length;
    yield {
      points: accumulated.slice(),
      partial: !isLast,
      batch
    };
  }
}
const MAX_RESOLVED_HOSTS = 20;
const MAX_RESOLVED_ITEMS = 24;
const MAX_RESOLVED_GROUPS = 80;
function assertBoundedHostScope(_query, _vars) {
}
function rowsOf$1(page) {
  if (Array.isArray(page)) return page;
  return page?.rows ?? [];
}
async function resolveGroups(api, query, vars, signal) {
  const f = interpolateFilter(query.group, vars);
  if (f.ids?.length) return f.ids.map((id) => ({ groupid: id, name: id }));
  const hostF = interpolateFilter(query.host, vars);
  if (isMatchAllZabbixFilter(f.filter) && !isMatchAllZabbixFilter(hostF.filter)) {
    return [];
  }
  const page = await api.getGroups(f.filter, signal);
  let rows = rowsOf$1(page).filter(
    (r) => matchesZabbixFilter(String(r.name || ""), f.filter)
  );
  if (rows.length > MAX_RESOLVED_GROUPS) {
    rows = rows.slice(0, MAX_RESOLVED_GROUPS);
  }
  return rows;
}
async function resolveHosts(api, query, vars, groupids, signal) {
  const f = interpolateFilter(query.host, vars);
  if (f.ids?.length)
    return f.ids.map((id) => ({ hostid: id, name: id, host: id }));
  const hostTags = (query.hostTags || []).map((t2) => ({
    ...t2,
    tag: interpolateZabbixValue(t2.tag, vars),
    value: interpolateZabbixValue(t2.value, vars)
  }));
  const page = await api.getHosts(groupids, f.filter, hostTags, signal);
  let rows = rowsOf$1(page).filter(
    (r) => matchesZabbixFilter(String(r.name || r.host || ""), f.filter)
  );
  if (rows.length > MAX_RESOLVED_HOSTS) {
    rows = rows.slice(0, MAX_RESOLVED_HOSTS);
  }
  return rows;
}
async function resolveApplications(api, query, vars, hostids, signal) {
  const f = interpolateFilter(query.application, vars);
  if (f.ids?.length)
    return f.ids.map((id) => ({ applicationid: id, name: id }));
  if (!f.filter) return [];
  const page = await api.getApplications(hostids, f.filter, signal);
  return rowsOf$1(page).filter(
    (r) => matchesZabbixFilter(String(r.name || ""), f.filter)
  );
}
async function resolveItems(api, query, vars, hostids, applicationids, signal, groupids) {
  if (query.executionMode === "lld" || query.lldRuleId || query.lld?.ruleId) {
    const ruleId = String(query.lld?.ruleId || query.lldRuleId || "");
    const keys = (query.lld?.prototypeKeys || query.lldItemKeys || []).map(
      (k) => interpolateZabbixValue(k, vars)
    );
    const prototypeIds = (query.lld?.prototypeIds || []).map(String);
    return api.getDiscoveredItems(hostids, ruleId, keys, signal, {
      prototypeIds
    });
  }
  const itemFilter = interpolateFilter(query.item, vars);
  const itemTag = interpolateZabbixValue(
    String(query.itemTag?.filter ?? ""),
    vars
  );
  if (itemFilter.ids?.length) {
    return api.getItemsByIds(itemFilter.ids, signal);
  }
  const page = await api.getItems(
    {
      hostids,
      applicationids,
      filter: itemFilter.filter,
      itemTag,
      showDisabled: Boolean(query.options?.showDisabledItems),
      ...groupids?.length && !hostids.length ? { groupids } : {}
    },
    signal
  );
  let rows = rowsOf$1(page).filter(
    (r) => matchesZabbixFilter(String(r.name || ""), itemFilter.filter) || matchesZabbixFilter(String(r.key_ || ""), itemFilter.filter)
  );
  rows.sort(
    (a, b) => Number(b.lastclock || 0) - Number(a.lastclock || 0)
  );
  if (rows.length > MAX_RESOLVED_ITEMS) {
    rows = rows.slice(0, MAX_RESOLVED_ITEMS);
  }
  return rows;
}
function clampLimit(n) {
  const v = Number(n ?? 100);
  if (!Number.isFinite(v)) return 100;
  return Math.min(1001, Math.max(1, Math.floor(v)));
}
function buildProblemsRequest(ctx, groupids, hostids, proxyids) {
  const opts = ctx.query.options || {};
  const show = ctx.query.showProblems || "problems";
  const params = {
    limit: clampLimit(opts.limit),
    output: "extend",
    selectTags: "extend"
  };
  if (groupids.length) params.groupids = groupids;
  if (hostids.length) params.hostids = hostids;
  if (proxyids?.length) params.proxyids = proxyids;
  if (opts.severities?.length) params.severities = opts.severities;
  else if (opts.minSeverity != null) {
    params.severities = [0, 1, 2, 3, 4, 5].filter(
      (s) => s >= Number(opts.minSeverity)
    );
  }
  if (opts.acknowledged === 0 || opts.acknowledged === 1) {
    params.acknowledged = Boolean(opts.acknowledged);
  }
  if (opts.hostsInMaintenance === false) params.maintenance = false;
  if (opts.hideAcknowledged) params.acknowledged = false;
  const tagsFilter = interpolateZabbixValue(
    String(ctx.query.tags?.filter || ""),
    ctx.scopedVars
  );
  if (tagsFilter) {
    params.tags = tagsFilter.split(",").map((part) => {
      const [tag, ...rest] = part.split(":");
      return { tag: tag.trim(), value: rest.join(":").trim(), operator: 0 };
    });
    params.evaltype = ctx.query.evaltype === "2" ? 2 : 0;
  }
  const triggerFilter = interpolateFilter(ctx.query.trigger, ctx.scopedVars);
  if (triggerFilter.filter) {
    params.search = { name: triggerFilter.filter };
    if (/[*%]/.test(triggerFilter.filter)) {
      params.searchWildcardsEnabled = true;
    }
  }
  if (opts.useTimeRange || show === "history") {
    params.time_from = Math.floor(
      (ctx.range.from instanceof Date ? ctx.range.from.getTime() : Number(ctx.range.from)) / 1e3
    );
    params.time_till = Math.floor(
      (ctx.range.to instanceof Date ? ctx.range.to.getTime() : Number(ctx.range.to)) / 1e3
    );
  }
  if (opts.sortProblems === "lastchange") {
    params.sortfield = ["eventid"];
  } else if (opts.sortProblems === "priority") {
    params.sortfield = ["severity", "eventid"];
    params.sortorder = "DESC";
  } else {
    params.sortfield = ["eventid"];
    params.sortorder = "DESC";
  }
  if (show === "history") {
    return {
      method: "event.get",
      params: {
        ...params,
        // event.get supports selectHosts; keep slim fields for table display.
        selectHosts: ["hostid", "name", "host"],
        object: 0,
        source: 0,
        value: opts.showOkEvents ? [0, 1] : 1
      }
    };
  }
  return {
    method: "problem.get",
    params: {
      ...params,
      recent: show === "recent"
      // never send selectHosts on problem.get
    }
  };
}
function sortProblems(rows, sortProblems2) {
  const list = [...rows];
  const mode2 = sortProblems2 || "default";
  list.sort((a, b) => {
    if (mode2 === "lastchange") {
      const c = Number(b.clock || 0) - Number(a.clock || 0);
      if (c !== 0) return c;
    } else if (mode2 === "priority") {
      const c = Number(b.severity || 0) - Number(a.severity || 0);
      if (c !== 0) return c;
      const t2 = Number(b.clock || 0) - Number(a.clock || 0);
      if (t2 !== 0) return t2;
    } else {
      const c = Number(b.severity || 0) - Number(a.severity || 0);
      if (c !== 0) return c;
      const t2 = Number(b.clock || 0) - Number(a.clock || 0);
      if (t2 !== 0) return t2;
    }
    return String(b.eventid || "").localeCompare(String(a.eventid || ""));
  });
  return list;
}
async function fetchHistoricalItemValues(ctx, rows) {
  const notices = [];
  const values = new Array(rows.length).fill(null);
  const concurrency = Number(ctx.settings.historyConcurrency) || 4;
  await mapPool(
    rows.map((r, index2) => ({ r, index: index2 })),
    concurrency,
    async ({ r, index: index2 }) => {
      try {
        const items = Array.isArray(r.items) ? r.items : [];
        const item = items[0];
        if (!item?.itemid) {
          values[index2] = null;
          return null;
        }
        const vt = Number(item.value_type ?? 0);
        const clock = Number(r.clock || 0);
        if (!clock) {
          values[index2] = null;
          return null;
        }
        const hist = await ctx.api.getHistory(
          [String(item.itemid)],
          vt,
          clock - 1,
          clock + 1,
          ctx.signal,
          1
        );
        const point = (hist || []).find((h2) => Number(h2.clock) <= clock) || hist?.[0];
        values[index2] = point?.value != null ? String(point.value) : null;
      } catch (e) {
        notices.push(
          `historical item value failed for event ${r.eventid}: ${e instanceof Error ? e.message : String(e)}`
        );
        values[index2] = null;
      }
      return null;
    }
  );
  return { values, notices };
}
async function enrichProblemsWithTriggers(ctx, rows) {
  if (!rows.length) return rows;
  const triggerids = [
    ...new Set(
      rows.map((r) => String(r.objectid || "")).filter((id) => id && id !== "0")
    )
  ];
  if (!triggerids.length) return rows;
  try {
    const page = await ctx.api.getTriggers(
      {
        triggerids,
        output: [
          "triggerid",
          "description",
          "comments",
          "priority",
          "value",
          "status",
          "state",
          "error",
          "url",
          "expression",
          "manual_close"
        ],
        selectHosts: ["hostid", "name", "host", "maintenance_status"],
        selectHostGroups: ["groupid", "name"],
        selectItems: ["itemid", "name", "key_", "lastvalue", "value_type"],
        expandDescription: true,
        limit: Math.min(1e3, Math.max(triggerids.length, 50))
      },
      ctx.signal
    );
    const list = Array.isArray(page) ? page : page?.rows || [];
    const byId2 = new Map(
      list.map((t2) => [String(t2.triggerid), t2])
    );
    return rows.map((r) => {
      const t2 = byId2.get(String(r.objectid));
      if (!t2) return r;
      const hosts = Array.isArray(r.hosts) && r.hosts.length ? r.hosts : t2.hosts;
      const groups = Array.isArray(r.groups) && r.groups.length ? r.groups : t2.groups || t2.hostgroups;
      const items = Array.isArray(r.items) && r.items.length ? r.items : t2.items;
      return {
        ...r,
        hosts: hosts || [],
        groups: groups || [],
        items: items || [],
        description: r.description || t2.description,
        comments: r.comments || t2.comments,
        url: r.url || t2.url,
        expression: r.expression || t2.expression,
        manual_close: r.manual_close ?? t2.manual_close
      };
    });
  } catch {
    return rows;
  }
}
async function executeProblemsQuery(ctx) {
  assertBoundedHostScope(ctx.query, ctx.scopedVars);
  const opts = ctx.query.options || {};
  const show = ctx.query.showProblems || "problems";
  let groupids = [];
  let hostids = [];
  let proxyids = [];
  const needsMeta = Boolean(ctx.query.group?.filter) || Boolean(ctx.query.host?.filter) || Boolean(ctx.query.group?.ids?.length) || Boolean(ctx.query.host?.ids?.length) || Boolean(ctx.query.proxy?.filter) || Boolean(ctx.query.tags?.filter) || Boolean(ctx.query.application?.filter) || Boolean(ctx.query.item?.filter) || Boolean(ctx.query.itemTag?.filter) || Boolean(ctx.query.trigger?.filter);
  if (needsMeta) {
    const hostF = interpolateFilter(ctx.query.host, ctx.scopedVars);
    const groupF = interpolateFilter(ctx.query.group, ctx.scopedVars);
    const groupAll = isMatchAllZabbixFilter(groupF.filter) && !groupF.ids?.length;
    const hostAll = isMatchAllZabbixFilter(hostF.filter) && !hostF.ids?.length;
    const groups = groupAll ? [] : await resolveGroups(ctx.api, ctx.query, ctx.scopedVars, ctx.signal);
    if (!hostAll) {
      const hosts = await resolveHosts(
        ctx.api,
        ctx.query,
        ctx.scopedVars,
        groups.map((g) => g.groupid),
        ctx.signal
      );
      hostids = hosts.map((h2) => String(h2.hostid));
    }
    groupids = groups.map((g) => g.groupid);
  }
  if (opts.hostProxy || ctx.query.proxy?.filter) {
    const proxyFilter = interpolateFilter(ctx.query.proxy, ctx.scopedVars);
    if (proxyFilter.filter || proxyFilter.ids?.length) {
      const proxies = await ctx.api.getProxies(
        proxyFilter.filter || "",
        ctx.signal
      );
      const rows2 = Array.isArray(proxies) ? proxies : proxies.rows || [];
      proxyids = rows2.map((p) => String(p.proxyid));
      if (proxyFilter.ids?.length) proxyids = proxyFilter.ids.map(String);
    }
  }
  const built = buildProblemsRequest(ctx, groupids, hostids, proxyids);
  let rows = [];
  if (built.method === "event.get") {
    rows = await ctx.api.getEvents(built.params, ctx.signal) || [];
  } else {
    rows = await ctx.api.getProblems(built.params, ctx.signal) || [];
  }
  rows = await enrichProblemsWithTriggers(ctx, rows);
  rows = sortProblems(rows, opts.sortProblems);
  const limit = clampLimit(opts.limit);
  const truncated = rows.length >= limit;
  if (truncated) rows = rows.slice(0, limit);
  let historicalValues = rows.map(() => null);
  let notices = [];
  if (opts.fetchHistoricalItemValue) {
    const enriched = await mapPool(
      rows,
      Number(ctx.settings.historyConcurrency) || 4,
      async (r) => {
        if (r.items?.length) return r;
        if (!r.objectid) return r;
        try {
          const triggers = await ctx.api.getTriggers(
            {
              triggerids: [String(r.objectid)],
              output: ["triggerid"],
              selectItems: [
                "itemid",
                "name",
                "key_",
                "value_type",
                "lastvalue"
              ]
            },
            ctx.signal
          );
          const list = Array.isArray(triggers) ? triggers : triggers?.rows || [];
          return { ...r, items: list[0]?.items || [] };
        } catch {
          return r;
        }
      }
    );
    rows = enriched;
    const hist = await fetchHistoricalItemValues(ctx, rows);
    historicalValues = hist.values;
    notices = hist.notices;
  }
  return [
    createDataFrame({
      refId: ctx.query.refId,
      meta: {
        source: "live",
        datasourceUid: ctx.instance.uid,
        datasourceName: ctx.instance.name,
        preferredVisualisationType: "table",
        truncated,
        mode: show,
        notices: notices.map((text) => ({ severity: "warning", text }))
      },
      fields: [
        {
          name: "eventid",
          type: "string",
          values: rows.map((r) => String(r.eventid ?? ""))
        },
        {
          name: "objectid",
          type: "string",
          values: rows.map((r) => String(r.objectid ?? ""))
        },
        {
          name: "clock",
          type: "time",
          values: rows.map((r) => Number(r.clock || 0) * 1e3)
        },
        {
          name: "r_clock",
          type: "time",
          values: rows.map(
            (r) => r.r_clock ? Number(r.r_clock) * 1e3 : null
          )
        },
        {
          name: "name",
          type: "string",
          values: rows.map((r) => String(r.name ?? ""))
        },
        {
          name: "severity",
          type: "number",
          values: rows.map((r) => Number(r.severity ?? 0))
        },
        {
          name: "acknowledged",
          type: "string",
          values: rows.map((r) => String(r.acknowledged ?? "0"))
        },
        {
          name: "status",
          type: "string",
          values: rows.map((r) => String(r.r_eventid ? "resolved" : "problem"))
        },
        {
          name: "hosts",
          type: "string",
          values: rows.map(
            (r) => (Array.isArray(r.hosts) ? r.hosts : []).map((h2) => String(h2?.name || h2?.host || h2?.hostid || "")).filter(Boolean).join(", ")
          )
        },
        {
          name: "groups",
          type: "string",
          values: rows.map(
            (r) => (Array.isArray(r.groups) ? r.groups : []).map((g) => String(g?.name || g?.groupid || "")).filter(Boolean).join(", ")
          )
        },
        {
          name: "items",
          type: "string",
          values: rows.map(
            (r) => (Array.isArray(r.items) ? r.items : []).map((i) => String(i?.name || i?.key_ || i?.itemid || "")).filter(Boolean).slice(0, 5).join(", ")
          )
        },
        {
          name: "tags",
          type: "string",
          values: rows.map(
            (r) => (Array.isArray(r.tags) ? r.tags : []).map(
              (tg) => `${tg?.tag ?? ""}${tg?.value != null && tg?.value !== "" ? ":" + tg.value : ""}`
            ).filter(Boolean).slice(0, 10).join(", ")
          )
        },
        {
          name: "acknowledges",
          type: "string",
          values: rows.map(
            (r) => String(
              (Array.isArray(r.acknowledges) ? r.acknowledges : []).length
            )
          )
        },
        {
          name: "suppression_data",
          type: "string",
          values: rows.map(
            (r) => String(
              (Array.isArray(r.suppression_data) ? r.suppression_data : []).length
            )
          )
        },
        {
          name: "suppressed",
          type: "string",
          values: rows.map((r) => String(r.suppressed ?? "0"))
        },
        {
          name: "manual_close",
          type: "string",
          values: rows.map((r) => String(r.manual_close ?? ""))
        },
        {
          name: "events",
          type: "string",
          values: rows.map(
            (r) => String((Array.isArray(r.events) ? r.events : []).length)
          )
        },
        {
          name: "alerts",
          type: "string",
          values: rows.map(
            (r) => String((Array.isArray(r.alerts) ? r.alerts : []).length)
          )
        },
        {
          name: "opdata",
          type: "string",
          values: rows.map((r) => String(r.opdata ?? ""))
        },
        {
          name: "expression",
          type: "string",
          values: rows.map((r) => String(r.expression ?? ""))
        },
        {
          name: "description",
          type: "string",
          values: rows.map((r) => String(r.description ?? r.name ?? ""))
        },
        {
          name: "historicalItemValue",
          type: "string",
          values: historicalValues
        }
      ]
    })
  ];
}
async function executeAnnotationQuery(args) {
  const ann = args.annotation || {};
  const query = {
    ...DEFAULT_ZABBIX_QUERY,
    refId: "Anno",
    queryType: "5",
    group: { filter: String(ann.group || ann.groupFilter || "") },
    host: { filter: String(ann.host || ann.hostFilter || "") },
    showProblems: ann.showOkEvents ? "history" : "history",
    options: {
      ...DEFAULT_ZABBIX_QUERY.options,
      useTimeRange: true,
      showOkEvents: Boolean(ann.showOkEvents),
      hideAcknowledged: Boolean(ann.hideAcknowledged),
      showHostname: ann.showHostname !== false,
      minSeverity: ann.minSeverity != null ? Number(ann.minSeverity) : void 0,
      limit: Number(ann.limit) || 100
    }
  };
  const ctx = {
    api: args.api,
    instance: args.instance,
    settings: args.settings || {},
    query,
    range: args.range,
    maxDataPoints: 1e3,
    intervalMs: 1e3,
    scopedVars: {},
    signal: args.signal
  };
  const frames = await executeProblemsQuery(ctx);
  const src = frames[0];
  if (!src) return [];
  const n = src.fields[0]?.values?.length || 0;
  const times = [];
  const ends = [];
  const texts = [];
  const tags = [];
  const eventIds = [];
  const severities = [];
  const hosts = [];
  const acked = [];
  const status = [];
  const dsUids = [];
  for (let i = 0; i < n; i++) {
    const get = (name2) => src.fields.find((f) => f.name === name2)?.values?.[i];
    times.push(Number(get("clock") || 0));
    const rClock = get("r_clock");
    ends.push(rClock != null && Number(rClock) > 0 ? Number(rClock) : null);
    const hostRaw = get("hosts");
    let hostLabel = "";
    if (typeof hostRaw === "string" && hostRaw.trim()) {
      const s = hostRaw.trim();
      if (s.startsWith("[")) {
        try {
          const arr = JSON.parse(s);
          hostLabel = arr?.[0]?.name || arr?.[0]?.host || String(arr?.[0] || "");
        } catch {
          hostLabel = s.split(",")[0].trim();
        }
      } else {
        hostLabel = s.split(",")[0].trim();
      }
    } else if (Array.isArray(hostRaw)) {
      hostLabel = String(
        hostRaw[0]?.name || hostRaw[0]?.host || hostRaw[0] || ""
      );
    }
    const name = String(get("name") || "");
    texts.push(
      ann.showHostname !== false && hostLabel ? `${hostLabel}: ${name}` : name
    );
    tags.push(String(get("tags") || ""));
    eventIds.push(String(get("eventid") || ""));
    severities.push(Number(get("severity") || 0));
    hosts.push(hostLabel);
    acked.push(String(get("acknowledged") || "0"));
    status.push(String(get("status") || ""));
    dsUids.push(String(args.instance.uid || ""));
  }
  return [
    createDataFrame({
      fields: [
        { name: "Time", type: "time", values: times },
        { name: "TimeEnd", type: "time", values: ends },
        { name: "Text", type: "string", values: texts },
        { name: "Tags", type: "string", values: tags },
        { name: "EventId", type: "string", values: eventIds },
        { name: "Severity", type: "number", values: severities },
        { name: "Host", type: "string", values: hosts },
        { name: "Acknowledged", type: "string", values: acked },
        { name: "Status", type: "string", values: status },
        { name: "DatasourceUid", type: "string", values: dsUids }
      ]
    })
  ];
}
const ZABBIX_VALUE_TYPES = {
  0: {
    valueType: 0,
    history: 0,
    name: "float",
    fieldType: "number",
    supportsTrends: true
  },
  1: {
    valueType: 1,
    history: 1,
    name: "character",
    fieldType: "string",
    supportsTrends: false
  },
  2: {
    valueType: 2,
    history: 2,
    name: "log",
    fieldType: "string",
    supportsTrends: false
  },
  3: {
    valueType: 3,
    history: 3,
    name: "unsigned",
    fieldType: "number",
    supportsTrends: true
  },
  4: {
    valueType: 4,
    history: 4,
    name: "text",
    fieldType: "string",
    supportsTrends: false
  },
  5: {
    valueType: 5,
    history: 5,
    name: "binary",
    fieldType: "string",
    supportsTrends: false
  }
};
const NAME_TO_CODE = {
  float: 0,
  character: 1,
  log: 2,
  unsigned: 3,
  text: 4,
  binary: 5,
  "0": 0,
  "1": 1,
  "2": 2,
  "3": 3,
  "4": 4,
  "5": 5
};
function resolveValueTypeSpec(input, opts) {
  if (input == null || input === "") {
    if (opts?.allowUnknownAsFloat) return ZABBIX_VALUE_TYPES[0];
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "item value_type is missing"
    );
  }
  if (typeof input === "number" && ZABBIX_VALUE_TYPES[input])
    return ZABBIX_VALUE_TYPES[input];
  const key = String(input).toLowerCase().trim();
  const code = NAME_TO_CODE[key];
  if (code != null && ZABBIX_VALUE_TYPES[code]) return ZABBIX_VALUE_TYPES[code];
  const n = Number(input);
  if (Number.isFinite(n) && ZABBIX_VALUE_TYPES[n]) return ZABBIX_VALUE_TYPES[n];
  if (opts?.allowUnknownAsFloat) return ZABBIX_VALUE_TYPES[0];
  throw new DataSourceError(
    "UNSUPPORTED_CAPABILITY",
    `unsupported Zabbix value_type: ${String(input)}`
  );
}
function mapHistoryRawValue(raw, spec) {
  if (raw == null || raw === "")
    return { value: null, valueRaw: raw == null ? null : "" };
  if (spec.name === "binary") {
    const s2 = String(raw);
    return { value: s2, valueRaw: s2, byteLength: s2.length };
  }
  if (spec.fieldType === "string") {
    const s2 = String(raw);
    return { value: s2, valueRaw: s2 };
  }
  if (typeof raw === "number") {
    if (!Number.isFinite(raw)) return { value: null, valueRaw: String(raw) };
    if (spec.name === "unsigned") {
      const s2 = String(Math.trunc(raw));
      if (!Number.isSafeInteger(raw)) {
        return {
          value: null,
          valueRaw: s2,
          notice: "unsigned exceeds JS safe integer; Value kept null"
        };
      }
      return { value: raw, valueRaw: s2 };
    }
    return { value: raw, valueRaw: String(raw) };
  }
  const s = String(raw).trim();
  if (!s) return { value: null, valueRaw: s };
  if (spec.name === "unsigned") {
    if (/^\d+$/.test(s)) {
      try {
        const bi = BigInt(s);
        if (bi > BigInt(Number.MAX_SAFE_INTEGER) || bi < BigInt(Number.MIN_SAFE_INTEGER)) {
          return {
            value: null,
            valueRaw: s,
            notice: "unsigned exceeds JS safe integer; Value kept null"
          };
        }
        const n2 = Number(bi);
        if (!Number.isSafeInteger(n2)) {
          return {
            value: null,
            valueRaw: s,
            notice: "unsigned exceeds JS safe integer; Value kept null"
          };
        }
        return { value: n2, valueRaw: s };
      } catch {
        return {
          value: null,
          valueRaw: s,
          notice: "unsigned parse failed; Value kept null"
        };
      }
    }
    return {
      value: null,
      valueRaw: s,
      notice: "unsigned parse failed; Value kept null"
    };
  }
  const n = Number(s);
  if (!Number.isFinite(n)) return { value: null, valueRaw: s };
  return { value: n, valueRaw: s };
}
function mapHistoryPoints(pts, spec) {
  const times = [];
  const values = [];
  const valueRaw = [];
  const ns = [];
  const timestamp = [];
  const source = [];
  const severity = [];
  const logeventid = [];
  const notices = [];
  for (const p of pts) {
    times.push(Number(p.clock) * 1e3 + Math.floor(Number(p.ns || 0) / 1e6));
    ns.push(p.ns == null ? null : String(p.ns));
    const raw = p.value_avg ?? p.value;
    const mapped = mapHistoryRawValue(raw, spec);
    if (mapped.notice) notices.push(mapped.notice);
    values.push(mapped.value);
    valueRaw.push(mapped.valueRaw);
    if (spec.name === "log") {
      timestamp.push(p.timestamp == null ? null : String(p.timestamp));
      source.push(p.source == null ? null : String(p.source));
      severity.push(p.severity == null ? null : String(p.severity));
      logeventid.push(p.logeventid == null ? null : String(p.logeventid));
    } else {
      timestamp.push(null);
      source.push(null);
      severity.push(null);
      logeventid.push(null);
    }
  }
  return {
    times,
    values,
    valueRaw,
    ns,
    log: { timestamp, source, severity, logeventid },
    notices,
    fieldType: spec.fieldType
  };
}
function parseIntervalMs(value) {
  const m = String(value || "").trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d|w|M)$/);
  if (!m) throw new DataSourceError("INVALID_QUERY", `非法 interval: ${value}`);
  const n = Number(m[1]);
  const unit = m[2];
  const scale = {
    ms: 1,
    s: 1e3,
    m: 6e4,
    h: 36e5,
    d: 864e5,
    w: 6048e5,
    M: 30 * 864e5
  };
  return n * scale[unit];
}
function finiteNumbers(values) {
  const out = [];
  for (const v of values) {
    if (v == null || v === "") continue;
    const n = typeof v === "number" ? v : Number(v);
    if (Number.isFinite(n)) out.push(n);
  }
  return out;
}
function percentileValue(values, p) {
  const nums = finiteNumbers(values).sort((a, b) => a - b);
  if (!nums.length) return null;
  const pct = Math.min(100, Math.max(0, p));
  const idx = (nums.length - 1) * (pct / 100);
  const lo = Math.floor(idx);
  const hi = Math.ceil(idx);
  if (lo === hi) return nums[lo];
  const w = idx - lo;
  return nums[lo] * (1 - w) + nums[hi] * w;
}
function aggregateValues(values, fn, percentile = 95) {
  if (fn === "percentile") return percentileValue(values, percentile);
  const nums = finiteNumbers(values);
  if (fn === "count") return nums.length;
  if (!nums.length) return null;
  switch (fn) {
    case "avg":
      return nums.reduce((a, b) => a + b, 0) / nums.length;
    case "min":
      return Math.min(...nums);
    case "max":
      return Math.max(...nums);
    case "sum":
      return nums.reduce((a, b) => a + b, 0);
    case "median":
      return percentileValue(nums, 50);
    case "first":
      return nums[0];
    case "last":
      return nums[nums.length - 1];
    default:
      return null;
  }
}
const FUNCTION_STAGES = {
  timeShift: "request",
  trendValue: "request",
  consolidateBy: "request",
  scale: "point",
  offset: "point",
  delta: "point",
  rate: "point",
  movingAverage: "point",
  exponentialMovingAverage: "point",
  percentile: "point",
  removeAboveValue: "point",
  removeBelowValue: "point",
  removeAbovePercentile: "point",
  removeBelowPercentile: "point",
  transformNull: "point",
  groupBy: "series",
  aggregateBy: "series",
  sumSeries: "series",
  percentileAgg: "series",
  top: "series",
  bottom: "series",
  sortSeries: "series",
  minSeries: "series",
  maxSeries: "series",
  avgSeries: "series",
  setAlias: "alias",
  setAliasByRegex: "alias",
  replaceAlias: "alias"
};
function parseTimeShiftMs(raw) {
  const s = String(raw || "0").trim();
  if (!s) return 0;
  if (s.startsWith("+")) return parseIntervalMs(s.slice(1));
  if (s.startsWith("-")) return -parseIntervalMs(s.slice(1));
  return -parseIntervalMs(s);
}
function planQueryFunctions(functions = []) {
  let timeShiftMs = 0;
  let trendValue = "avg";
  let consolidateBy = "";
  const postFetch = [];
  const stageByName = {};
  for (const fn of functions) {
    const stage = FUNCTION_STAGES[fn.name] || "point";
    stageByName[fn.name] = stage;
    if (fn.name === "timeShift") {
      timeShiftMs = parseTimeShiftMs(String(fn.params?.[0] ?? "0"));
      postFetch.push({
        name: "timeShift",
        params: [timeShiftMs === 0 ? "0s" : `${-timeShiftMs}ms`]
      });
      continue;
    }
    if (fn.name === "trendValue") {
      const v = String(
        fn.params?.[0] ?? "avg"
      );
      trendValue = ["avg", "min", "max", "sum", "count"].includes(v) ? v : "avg";
      continue;
    }
    if (fn.name === "consolidateBy") {
      consolidateBy = String(fn.params?.[0] ?? "avg");
      continue;
    }
    postFetch.push(fn);
  }
  return {
    timeShiftMs,
    displayShiftMs: -timeShiftMs,
    trendValue,
    consolidateBy,
    postFetchFunctions: postFetch,
    stageByName
  };
}
function applyPlanToRange(fromMs, toMs2, plan) {
  return {
    fromMs: fromMs + plan.timeShiftMs,
    toMs: toMs2 + plan.timeShiftMs
  };
}
function resolveAlignmentIntervalMs(args) {
  const candidates = [];
  if (args.intervalMs && args.intervalMs > 0)
    candidates.push(Math.floor(args.intervalMs));
  const range = Math.max(0, args.rangeToMs - args.rangeFromMs);
  const mdp = args.maxDataPoints && args.maxDataPoints > 0 ? args.maxDataPoints : 0;
  if (mdp > 0 && range > 0)
    candidates.push(Math.max(1, Math.floor(range / mdp)));
  if (args.itemDelay) {
    try {
      const d = String(args.itemDelay).trim();
      if (/^\d+$/.test(d)) candidates.push(Number(d) * 1e3);
      else candidates.push(parseIntervalMs(d));
    } catch {
    }
  }
  if (!candidates.length) {
    return range > 0 ? Math.max(1e3, Math.floor(range / 100)) : 1e3;
  }
  if (args.intervalMs && args.intervalMs > 0) {
    return Math.max(1, Math.floor(args.intervalMs));
  }
  return Math.max(1, Math.min(...candidates));
}
function sanitizeTagName(name) {
  return name.replace(/[^A-Za-z0-9_]/g, "_");
}
function aliasContext(series) {
  const host = series.item.hosts?.[0];
  const ctx = {
    __zbx_host_name: String(host?.name || host?.host || ""),
    __zbx_host_id: String(host?.hostid || series.item.hostid || ""),
    __zbx_item_name: String(series.item.name || ""),
    __zbx_item_id: String(series.item.itemid || ""),
    __zbx_item_key: String(series.item.key_ || "")
  };
  const tagMap = /* @__PURE__ */ new Map();
  for (const t2 of series.item.tags || []) {
    if (!t2.tag) continue;
    const key = sanitizeTagName(t2.tag);
    const list = tagMap.get(key) || [];
    list.push(String(t2.value ?? ""));
    tagMap.set(key, list);
  }
  for (const [k, vals] of tagMap) {
    ctx[`__zbx_item_tag_${k}`] = vals.join(", ");
  }
  return ctx;
}
function expand(template, ctx) {
  return String(template || "").replace(
    /\$([A-Za-z_][\w]*)/g,
    (token, name) => name in ctx ? ctx[name] : token
  );
}
function applyAliasFunction(series, name, params) {
  const ctx = aliasContext(series);
  const current = series.name || series.item.name || series.item.key_;
  if (name === "setAlias") {
    return { ...series, name: expand(String(params[0] ?? ""), ctx) };
  }
  if (name === "setAliasByRegex") {
    try {
      const re = new RegExp(String(params[0] ?? ""));
      const repl = String(params[1] ?? "");
      return { ...series, name: expand(current.replace(re, repl), ctx) };
    } catch {
      throw new DataSourceError("INVALID_QUERY", "setAliasByRegex 正则无效");
    }
  }
  if (name === "replaceAlias") {
    try {
      const re = new RegExp(String(params[0] ?? ""), "g");
      return {
        ...series,
        name: expand(current.replace(re, String(params[1] ?? "")), ctx)
      };
    } catch {
      throw new DataSourceError("INVALID_QUERY", "replaceAlias 正则无效");
    }
  }
  return series;
}
function bucketSeries(series, intervalMs, fn) {
  if (intervalMs <= 0) return series;
  const buckets = /* @__PURE__ */ new Map();
  for (const p of series.points) {
    const key = Math.floor(p.time / intervalMs) * intervalMs;
    const list = buckets.get(key) || [];
    list.push(
      typeof p.value === "number" ? p.value : p.value == null ? null : Number(p.value)
    );
    buckets.set(key, list);
  }
  const points = [...buckets.entries()].sort((a, b) => a[0] - b[0]).map(([time, values]) => ({ time, value: aggregateValues(values, fn) }));
  return { ...series, points };
}
function alignSeries(series, fromMs, toMs2, intervalMs) {
  if (intervalMs <= 0) return series;
  const map = /* @__PURE__ */ new Map();
  for (const p of series.points) {
    const key = Math.floor(p.time / intervalMs) * intervalMs;
    if (!map.has(key)) map.set(key, p.value);
  }
  const points = [];
  for (let t2 = Math.floor(fromMs / intervalMs) * intervalMs; t2 <= toMs2; t2 += intervalMs) {
    points.push({ time: t2, value: map.has(t2) ? map.get(t2) : null });
  }
  return { ...series, points };
}
function consolidateSeries(series, maxDataPoints, fn) {
  const max = Math.max(2, maxDataPoints || 2);
  if (series.points.length <= max) return series;
  const first = series.points[0].time;
  const last = series.points[series.points.length - 1].time;
  const intervalMs = Math.max(1, Math.ceil((last - first) / max));
  return bucketSeries(series, intervalMs, fn);
}
function buildValueMapLookup(valueMaps) {
  const map = /* @__PURE__ */ new Map();
  for (const vm of valueMaps || []) {
    const id = String(vm.valuemapid || "");
    if (!id) continue;
    map.set(id, [...vm.mappings || []]);
  }
  return map;
}
function mapSeriesValue(raw, valuemapid, lookup) {
  if (raw == null || !valuemapid) return raw;
  const table = lookup.get(String(valuemapid));
  if (!table) return raw;
  if (!Array.isArray(table)) {
    const key2 = String(raw);
    return key2 in table ? table[key2] : raw;
  }
  const key = String(raw);
  const num2 = typeof raw === "number" ? raw : Number(raw);
  for (const m of table) {
    const type = String(m.type ?? "0");
    if (type === "0" || m.type == null) {
      if (m.value != null && String(m.value) === key) return m.newvalue ?? raw;
      if (m.value && Number.isFinite(num2)) {
        const rangeMatch = String(m.value).match(
          /^(-?\d+(?:\.\d+)?)-(-?\d+(?:\.\d+)?)$/
        );
        if (rangeMatch) {
          const lo = Number(rangeMatch[1]);
          const hi = Number(rangeMatch[2]);
          if (num2 >= lo && num2 <= hi) return m.newvalue ?? raw;
        }
      }
    }
    if (type === "1" || type === "range") {
      const parts = String(m.value || "").split(/[,:]/);
      if (parts.length >= 2 && Number.isFinite(num2)) {
        const lo = Number(parts[0]);
        const hi = Number(parts[1]);
        if (num2 >= lo && num2 <= hi) return m.newvalue ?? raw;
      }
    }
    if (type === "2" || type === "regexp") {
      try {
        if (m.value && new RegExp(String(m.value)).test(key))
          return m.newvalue ?? raw;
      } catch {
      }
    }
    if (m.value != null && String(m.value) === key) return m.newvalue ?? raw;
  }
  return raw;
}
function emptyFrame(refId, notice) {
  const frame = createDataFrame({
    refId,
    fields: [
      { name: "Time", type: "time", values: [] },
      { name: "Value", type: "number", values: [] }
    ]
  });
  if (notice)
    frame.meta = { notices: [{ severity: "warning", text: notice }] };
  return frame;
}
function itemLabel(item) {
  const host = item.hosts?.[0]?.name || item.hosts?.[0]?.host || "";
  return host ? `${host}: ${item.name}` : item.name || item.key_;
}
function seriesToDataFrame(series, refId, datasourceUid, valueMaps) {
  const times = series.points.map((p) => p.time);
  let values = series.points.map((p) => p.value);
  if (valueMaps && series.item.valuemapid) {
    values = values.map(
      (v) => mapSeriesValue(v, series.item.valuemapid, valueMaps)
    );
  }
  const asString = values.some((v) => typeof v === "string");
  const display = series.name || itemLabel(series.item);
  const fields = [
    { name: "Time", type: "time", values: times },
    {
      name: "Value",
      type: asString ? "string" : "number",
      values: asString ? values.map((v) => v == null ? null : String(v)) : values.map((v) => v == null || v === "" ? null : Number(v)),
      labels: {
        itemid: series.item.itemid,
        item: series.item.name,
        host: series.item.hosts?.[0]?.name || ""
      },
      config: {
        displayNameFromDS: display,
        ...series.item.units ? { unit: series.item.units } : {}
      }
    }
  ];
  if (series.points.some((p) => p.valueRaw != null && p.valueRaw !== "")) {
    fields.push({
      name: "ValueRaw",
      type: "string",
      values: series.points.map(
        (p) => p.valueRaw == null ? null : String(p.valueRaw)
      )
    });
  }
  if (series.meta?.source === "trend") {
    fields.push(
      {
        name: "TrendMin",
        type: "number",
        values: series.points.map(
          (p) => p.value_min == null ? null : Number(p.value_min)
        )
      },
      {
        name: "TrendAvg",
        type: "number",
        values: series.points.map(
          (p) => p.value_avg == null ? null : Number(p.value_avg)
        )
      },
      {
        name: "TrendMax",
        type: "number",
        values: series.points.map(
          (p) => p.value_max == null ? null : Number(p.value_max)
        )
      },
      {
        name: "TrendNum",
        type: "number",
        values: series.points.map(
          (p) => p.num == null ? null : Number(p.num)
        )
      }
    );
  }
  if (series.points.some(
    (p) => p.logeventid != null || p.source != null || p.severity != null
  )) {
    fields.push(
      {
        name: "timestamp",
        type: "string",
        values: series.points.map((p) => p.timestamp ?? null)
      },
      {
        name: "source",
        type: "string",
        values: series.points.map((p) => p.source ?? null)
      },
      {
        name: "severity",
        type: "string",
        values: series.points.map((p) => p.severity ?? null)
      },
      {
        name: "logeventid",
        type: "string",
        values: series.points.map((p) => p.logeventid ?? null)
      },
      {
        name: "ns",
        type: "string",
        values: series.points.map((p) => p.ns ?? null)
      }
    );
  }
  const frame = createDataFrame({
    refId,
    name: display,
    fields
  });
  frame.meta = {
    ...frame.meta,
    source: "live",
    datasourceUid,
    custom: {
      source: "zabbix",
      itemid: series.item.itemid,
      datasourceUid
    },
    notices: (series.notices || []).map((text) => ({
      severity: "warning",
      text
    }))
  };
  return frame;
}
function seriesListToFrames(series, refId, datasourceUid, valueMaps) {
  return series.map(
    (s) => seriesToDataFrame(s, refId, datasourceUid, valueMaps)
  );
}
function seriesToFrames(series, refId) {
  return seriesListToFrames(series, refId, "");
}
function emptyItem(name) {
  return { itemid: name, name, key_: name, hostid: "", value_type: "0" };
}
function seriesScore(s, fn) {
  const v = aggregateValues(
    s.points.map((p) => p.value),
    fn
  );
  return v == null ? Number.NEGATIVE_INFINITY : v;
}
function sumSeries(list) {
  if (!list.length) return [];
  const indices = list.map((s) => {
    const m = /* @__PURE__ */ new Map();
    for (const p of s.points) m.set(p.time, p.value);
    return m;
  });
  const times = /* @__PURE__ */ new Set();
  for (const s of list) for (const p of s.points) times.add(p.time);
  const sorted = [...times].sort((a, b) => a - b);
  const points = sorted.map((time) => {
    let sum = 0;
    let any = false;
    for (const idx of indices) {
      const v = idx.get(time);
      if (v == null || v === "") continue;
      sum += Number(v);
      any = true;
    }
    return { time, value: any ? sum : null };
  });
  return [
    {
      item: emptyItem("sum"),
      name: "sum",
      points,
      meta: { derived: true, sources: list.map((s) => s.item.itemid) }
    }
  ];
}
function aggregateSeries(list, fn) {
  if (!list.length) return [];
  const indices = list.map((s) => {
    const m = /* @__PURE__ */ new Map();
    for (const p of s.points) m.set(p.time, p.value);
    return m;
  });
  const times = /* @__PURE__ */ new Set();
  for (const s of list) for (const p of s.points) times.add(p.time);
  const sorted = [...times].sort((a, b) => a - b);
  const points = sorted.map((time) => {
    const values = indices.map((idx) => idx.get(time) ?? null);
    return { time, value: aggregateValues(values, fn) };
  });
  return [
    {
      item: emptyItem(fn),
      name: fn,
      points,
      meta: { derived: true, sources: list.map((s) => s.item.itemid) }
    }
  ];
}
function aggregateAcrossSeries(list, interval, fn, percent) {
  if (!list.length) return [];
  const intervalMs = parseIntervalMs(interval || "1m");
  const buckets = /* @__PURE__ */ new Map();
  for (const s of list) {
    for (const p of s.points) {
      const key = Math.floor(p.time / intervalMs) * intervalMs;
      const arr = buckets.get(key) || [];
      arr.push(p.value == null || p.value === "" ? null : Number(p.value));
      buckets.set(key, arr);
    }
  }
  const points = [...buckets.entries()].sort((a, b) => a[0] - b[0]).map(([time, values]) => ({
    time,
    value: fn === "percentile" ? aggregateValues(values, "percentile", percent ?? 95) : aggregateValues(values, fn)
  }));
  return [
    {
      item: emptyItem(
        fn === "percentile" ? `percentileAgg(${percent})` : `aggregateBy(${fn})`
      ),
      name: fn === "percentile" ? `percentileAgg(${percent})` : `aggregateBy(${fn})`,
      points,
      meta: {
        derived: true,
        acrossSeries: true,
        sources: list.map((s) => s.item.itemid)
      }
    }
  ];
}
function percentileAgg(list, interval, percent) {
  return aggregateAcrossSeries(list, interval, "percentile", percent);
}
function aggregateByAcross(list, interval, fn) {
  return aggregateAcrossSeries(list, interval, fn);
}
function topSeries(list, n, by = "avg") {
  const scored = [...list].sort(
    (a, b) => seriesScore(b, by) - seriesScore(a, by)
  );
  return scored.slice(0, Math.max(0, Math.floor(n)));
}
function bottomSeries(list, n, by = "avg") {
  const scored = [...list].sort(
    (a, b) => seriesScore(a, by) - seriesScore(b, by)
  );
  return scored.slice(0, Math.max(0, Math.floor(n)));
}
function sortSeriesList(list, direction = "asc") {
  const dir = direction === "desc" ? -1 : 1;
  return [...list].sort((a, b) => {
    const na = (a.name || a.item.name || "").localeCompare(
      b.name || b.item.name || ""
    );
    if (na !== 0) return na * dir;
    return String(a.item.itemid).localeCompare(String(b.item.itemid)) * dir;
  });
}
function filterByName(list, pattern) {
  const re = new RegExp(pattern);
  return list.filter((s) => re.test(s.name || s.item.name || s.item.key_));
}
function timeShift(list, offsetMs) {
  return list.map((s) => ({
    ...s,
    points: s.points.map((p) => ({
      ...p,
      time: p.time + offsetMs,
      value: p.value
    }))
  }));
}
function clone(series, points = series.points) {
  return { ...series, points: points.map((p) => ({ ...p })) };
}
function transformGroupBy(series, interval, fn) {
  return bucketSeries(series, parseIntervalMs(interval), fn);
}
function transformScale(series, factor) {
  return clone(
    series,
    series.points.map((p) => ({
      time: p.time,
      value: p.value == null || p.value === "" ? null : Number(p.value) * factor
    }))
  );
}
function transformOffset(series, offset) {
  return clone(
    series,
    series.points.map((p) => ({
      time: p.time,
      value: p.value == null || p.value === "" ? null : Number(p.value) + offset
    }))
  );
}
function transformDelta(series) {
  const points = series.points.map((p, i) => {
    if (i === 0 || p.value == null || series.points[i - 1].value == null)
      return { time: p.time, value: null };
    return {
      time: p.time,
      value: Number(p.value) - Number(series.points[i - 1].value)
    };
  });
  return clone(series, points);
}
function transformRate(series) {
  let lastRate = null;
  const points = series.points.map((p, i) => {
    if (i === 0 || p.value == null || series.points[i - 1].value == null)
      return { time: p.time, value: null };
    const dt = (p.time - series.points[i - 1].time) / 1e3;
    if (dt <= 0) return { time: p.time, value: null };
    const curr = Number(p.value);
    const prev = Number(series.points[i - 1].value);
    if (curr < prev) return { time: p.time, value: lastRate };
    const rate = (curr - prev) / dt;
    lastRate = rate;
    return { time: p.time, value: rate };
  });
  return clone(series, points);
}
function transformMovingAverage(series, window2) {
  const w = Math.max(1, Math.floor(window2));
  const points = series.points.map((p, i) => {
    const slice = series.points.slice(Math.max(0, i - w + 1), i + 1).map((x) => x.value);
    return { time: p.time, value: aggregateValues(slice, "avg") };
  });
  return clone(series, points);
}
function transformExponentialMovingAverage(series, window2) {
  const n = Number(window2);
  let alpha2;
  let seedCount;
  if (Number.isFinite(n) && n > 0 && n < 1) {
    alpha2 = n;
    seedCount = Math.max(1, Math.ceil(1 / alpha2));
  } else {
    const w = Math.max(1, n || 1);
    alpha2 = 2 / (w + 1);
    seedCount = Math.max(1, Math.floor(w));
  }
  let prev = null;
  const seed = [];
  const points = series.points.map((p) => {
    if (p.value == null || p.value === "") return { time: p.time, value: null };
    const v = Number(p.value);
    if (prev == null) {
      seed.push(v);
      if (seed.length < seedCount) {
        if (seed.length === 1) {
          prev = v;
          return { time: p.time, value: v };
        }
        const sma2 = seed.reduce((a, b) => a + b, 0) / seed.length;
        prev = sma2;
        return { time: p.time, value: sma2 };
      }
      const sma = seed.reduce((a, b) => a + b, 0) / seed.length;
      prev = sma;
      return { time: p.time, value: sma };
    }
    prev = alpha2 * v + (1 - alpha2) * prev;
    return { time: p.time, value: prev };
  });
  return clone(series, points);
}
function transformPercentile(series, interval, p) {
  return bucketSeries(series, parseIntervalMs(interval), "avg").points ? (() => {
    const intervalMs = parseIntervalMs(interval);
    const buckets = /* @__PURE__ */ new Map();
    for (const pt of series.points) {
      const key = Math.floor(pt.time / intervalMs) * intervalMs;
      const list = buckets.get(key) || [];
      list.push(pt.value == null ? null : Number(pt.value));
      buckets.set(key, list);
    }
    const points = [...buckets.entries()].sort((a, b) => a[0] - b[0]).map(([time, values]) => ({
      time,
      value: aggregateValues(values, "percentile", p)
    }));
    return clone(series, points);
  })() : series;
}
function transformRemoveAboveValue(series, threshold) {
  return clone(
    series,
    series.points.map((p) => ({
      time: p.time,
      value: p.value != null && Number(p.value) > threshold ? null : p.value
    }))
  );
}
function transformRemoveBelowValue(series, threshold) {
  return clone(
    series,
    series.points.map((p) => ({
      time: p.time,
      value: p.value != null && Number(p.value) < threshold ? null : p.value
    }))
  );
}
function transformRemoveAbovePercentile(series, p) {
  const thr = aggregateValues(
    series.points.map((x) => x.value),
    "percentile",
    p
  );
  if (thr == null) return series;
  return transformRemoveAboveValue(series, thr);
}
function transformRemoveBelowPercentile(series, p) {
  const thr = aggregateValues(
    series.points.map((x) => x.value),
    "percentile",
    p
  );
  if (thr == null) return series;
  return transformRemoveBelowValue(series, thr);
}
function transformNull(series, fill) {
  return {
    ...series,
    points: series.points.map((p) => ({
      ...p,
      value: p.value == null || p.value === "" ? fill : p.value
    }))
  };
}
function applyTransformFunction(series, name, params) {
  switch (name) {
    case "groupBy":
      return transformGroupBy(
        series,
        String(params[0] || "1m"),
        String(params[1] || "avg")
      );
    case "scale":
      return transformScale(series, Number(params[0] ?? 1));
    case "offset":
      return transformOffset(series, Number(params[0] ?? 0));
    case "delta":
      return transformDelta(series);
    case "rate":
      return transformRate(series);
    case "movingAverage":
      return transformMovingAverage(series, Number(params[0] ?? 1));
    case "exponentialMovingAverage":
      return transformExponentialMovingAverage(series, Number(params[0] ?? 1));
    case "percentile":
      return transformPercentile(
        series,
        String(params[0] || "1m"),
        Number(params[1] ?? 95)
      );
    case "removeAboveValue":
      return transformRemoveAboveValue(series, Number(params[0]));
    case "removeBelowValue":
      return transformRemoveBelowValue(series, Number(params[0]));
    case "removeAbovePercentile":
      return transformRemoveAbovePercentile(series, Number(params[0] ?? 95));
    case "transformNull":
      return transformNull(series, Number(params[0] ?? 0));
    case "removeBelowPercentile":
      return transformRemoveBelowPercentile(series, Number(params[0] ?? 5));
    default:
      throw new DataSourceError(
        "INVALID_QUERY",
        `未知 transform 函数: ${name}`
      );
  }
}
const POINT_FNS = /* @__PURE__ */ new Set([
  "scale",
  "offset",
  "delta",
  "rate",
  "movingAverage",
  "exponentialMovingAverage",
  "percentile",
  "removeAboveValue",
  "removeBelowValue",
  "removeAbovePercentile",
  "removeBelowPercentile",
  "transformNull"
]);
function runProcessingPipeline(seriesList, opts) {
  let list = seriesList.map((s) => ({
    ...s,
    item: { ...s.item },
    name: s.name || s.item.name,
    notices: [...s.notices || []],
    meta: { ...s.meta || {} }
  }));
  const plan = planQueryFunctions(opts.query.functions || []);
  const functions = opts.functionsOverride || (opts.requestPlanApplied ? plan.postFetchFunctions : (opts.query.functions || []).filter(
    (f) => f.name !== "trendValue" && f.name !== "consolidateBy"
  ));
  const notices = [];
  const nonAlias = functions.filter(
    (f) => !["setAlias", "setAliasByRegex", "replaceAlias"].includes(f.name)
  );
  const aliasFns = functions.filter(
    (f) => ["setAlias", "setAliasByRegex", "replaceAlias"].includes(f.name)
  );
  const ordered = [...nonAlias, ...aliasFns];
  for (const fn of ordered) {
    try {
      if (POINT_FNS.has(fn.name)) {
        if (opts.allowNumericOnly === false) {
          notices.push(`函数 ${fn.name} 已跳过（非数值查询）`);
          continue;
        }
        list = list.map((s) => applyTransformFunction(s, fn.name, fn.params));
        continue;
      }
      if (fn.name === "groupBy") {
        list = list.map((s) => applyTransformFunction(s, "groupBy", fn.params));
        continue;
      }
      if (fn.name === "aggregateBy") {
        list = aggregateByAcross(
          list,
          String(fn.params[0] || "1m"),
          String(fn.params[1] || "avg")
        );
        continue;
      }
      if (fn.name === "sumSeries") {
        list = sumSeries(list);
        continue;
      }
      if (fn.name === "percentileAgg") {
        list = percentileAgg(
          list,
          String(fn.params[0] || "1m"),
          Number(fn.params[1] ?? 95)
        );
        continue;
      }
      if (fn.name === "top") {
        list = topSeries(
          list,
          Number(fn.params[0] ?? 5),
          String(fn.params[1] || "avg")
        );
        continue;
      }
      if (fn.name === "bottom") {
        list = bottomSeries(
          list,
          Number(fn.params[0] ?? 5),
          String(fn.params[1] || "avg")
        );
        continue;
      }
      if (fn.name === "sortSeries") {
        list = sortSeriesList(
          list,
          String(fn.params[0] || "asc") || "asc"
        );
        continue;
      }
      if (fn.name === "minSeries" || fn.name === "maxSeries" || fn.name === "avgSeries") {
        const agg = fn.name.replace("Series", "");
        list = aggregateSeries(list, agg === "avg" ? "avg" : agg);
        continue;
      }
      if (fn.name === "timeShift") {
        const raw = String(fn.params[0] || "0s");
        let signed;
        if (/^-?\d+(\.\d+)?ms$/i.test(raw)) {
          signed = Number(raw.replace(/ms$/i, ""));
        } else if (raw.startsWith("+")) {
          signed = parseIntervalMs(raw.slice(1));
        } else if (raw.startsWith("-")) {
          signed = -parseIntervalMs(raw.slice(1));
        } else {
          signed = -parseIntervalMs(raw);
        }
        list = timeShift(list, signed);
        continue;
      }
      if (fn.name === "setAlias" || fn.name === "setAliasByRegex" || fn.name === "replaceAlias") {
        list = list.map(
          (s) => applyAliasFunction(s, fn.name, fn.params)
        );
        continue;
      }
      if (fn.name === "filterByName" || fn.name === "excludeByName") {
        const pattern = String(fn.params[0] || ".*");
        list = fn.name === "excludeByName" ? list.filter(
          (s) => !new RegExp(pattern).test(s.name || s.item.name)
        ) : filterByName(list, pattern);
        continue;
      }
      if (fn.name === "trendValue" || fn.name === "consolidateBy") {
        continue;
      }
      notices.push(`未知函数 ${fn.name} 已忽略`);
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      notices.push(msg);
      if (e instanceof DataSourceError && e.code === "INVALID_QUERY") ;
    }
  }
  const consolidateFn = plan.consolidateBy || "avg";
  list = list.map(
    (s) => consolidateSeries(s, opts.maxDataPoints, consolidateFn)
  );
  const disableAlign = opts.disableDataAlignment || opts.query.options?.disableDataAlignment || false;
  if (!disableAlign && list.length) {
    const delay = list[0]?.item?.delay != null ? String(list[0].item.delay) : void 0;
    const intervalMs = resolveAlignmentIntervalMs({
      intervalMs: opts.intervalMs,
      rangeFromMs: opts.rangeFromMs,
      rangeToMs: opts.rangeToMs,
      maxDataPoints: opts.maxDataPoints,
      itemDelay: delay
    });
    list = list.map(
      (s) => alignSeries(s, opts.rangeFromMs, opts.rangeToMs, intervalMs)
    );
  }
  const useMap = Boolean(opts.query.options?.useZabbixValueMapping);
  const referenced = new Set(
    list.map((s) => String(s.item.valuemapid || "")).filter(Boolean)
  );
  const filteredMaps = (opts.valueMaps || []).filter(
    (vm) => referenced.has(String(vm.valuemapid || ""))
  );
  const lookup = useMap ? buildValueMapLookup(filteredMaps) : void 0;
  const frames = seriesListToFrames(
    list,
    opts.query.refId,
    opts.datasourceUid,
    lookup
  );
  if (notices.length && frames[0]) {
    const meta2 = frames[0].meta ||= {};
    meta2.notices = [
      ...meta2.notices || [],
      ...notices.map((text) => ({ severity: "warning", text }))
    ];
  }
  return frames;
}
async function runProcessingPipelineAsync(seriesList, opts, signal) {
  const canYield = typeof window !== "undefined" && typeof requestAnimationFrame === "function";
  function yield_() {
    if (!canYield) return;
    if (signal?.aborted) throw new DOMException("Aborted", "AbortError");
    return new Promise((r) => setTimeout(r, 0));
  }
  let list = seriesList.map((s) => ({
    ...s,
    item: { ...s.item },
    name: s.name || s.item.name,
    notices: [...s.notices || []],
    meta: { ...s.meta || {} }
  }));
  const plan = planQueryFunctions(opts.query.functions || []);
  const functions = opts.functionsOverride || plan.postFetchFunctions;
  const notices = [];
  const nonAlias = functions.filter(
    (f) => !["setAlias", "setAliasByRegex", "replaceAlias"].includes(f.name)
  );
  const aliasFns = functions.filter(
    (f) => ["setAlias", "setAliasByRegex", "replaceAlias"].includes(f.name)
  );
  const ordered = [...nonAlias, ...aliasFns];
  for (const fn of ordered) {
    try {
      if (POINT_FNS.has(fn.name)) {
        if (opts.allowNumericOnly === false) {
          notices.push(`函数 ${fn.name} 已跳过（非数值查询）`);
          continue;
        }
        list = list.map((s) => applyTransformFunction(s, fn.name, fn.params));
        await yield_();
        continue;
      }
      if (fn.name === "groupBy") {
        list = list.map((s) => applyTransformFunction(s, "groupBy", fn.params));
        await yield_();
        continue;
      }
      if (fn.name === "aggregateBy") {
        list = aggregateByAcross(list, String(fn.params[0] || "1m"), String(fn.params[1] || "avg"));
        await yield_();
        continue;
      }
      if (fn.name === "sumSeries") {
        list = sumSeries(list);
        await yield_();
        continue;
      }
      if (fn.name === "percentileAgg") {
        list = percentileAgg(list, String(fn.params[0] || "1m"), Number(fn.params[1] ?? 95));
        await yield_();
        continue;
      }
      if (fn.name === "top") {
        list = topSeries(list, Number(fn.params[0] ?? 5), String(fn.params[1] || "avg"));
        await yield_();
        continue;
      }
      if (fn.name === "bottom") {
        list = bottomSeries(list, Number(fn.params[0] ?? 5), String(fn.params[1] || "avg"));
        await yield_();
        continue;
      }
      if (fn.name === "sortSeries") {
        list = sortSeriesList(list, String(fn.params[0] || "asc") || "asc");
        continue;
      }
      if (fn.name === "minSeries" || fn.name === "maxSeries" || fn.name === "avgSeries") {
        const agg = fn.name.replace("Series", "");
        list = aggregateSeries(list, agg === "avg" ? "avg" : agg);
        await yield_();
        continue;
      }
      if (fn.name === "timeShift") {
        const raw = String(fn.params[0] || "0s");
        let signed;
        if (/^-?\d+(\.\d+)?ms$/i.test(raw)) signed = Number(raw.replace(/ms$/i, ""));
        else if (raw.startsWith("+")) signed = parseIntervalMs(raw.slice(1));
        else if (raw.startsWith("-")) signed = -parseIntervalMs(raw.slice(1));
        else signed = -parseIntervalMs(raw);
        list = timeShift(list, signed);
        continue;
      }
      if (fn.name === "setAlias" || fn.name === "setAliasByRegex" || fn.name === "replaceAlias") {
        list = list.map((s) => applyAliasFunction(s, fn.name, fn.params));
        continue;
      }
      if (fn.name === "filterByName" || fn.name === "excludeByName") {
        const pattern = String(fn.params[0] || ".*");
        list = fn.name === "excludeByName" ? list.filter((s) => !new RegExp(pattern).test(s.name || s.item.name)) : filterByName(list, pattern);
        continue;
      }
      if (fn.name === "trendValue" || fn.name === "consolidateBy") continue;
      notices.push(`未知函数 ${fn.name} 已忽略`);
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      notices.push(msg);
    }
  }
  if (signal?.aborted) throw new DOMException("Aborted", "AbortError");
  const consolidateFn = plan.consolidateBy || "avg";
  list = list.map((s) => consolidateSeries(s, opts.maxDataPoints, consolidateFn));
  await yield_();
  if (signal?.aborted) throw new DOMException("Aborted", "AbortError");
  const disableAlign = opts.disableDataAlignment || opts.query.options?.disableDataAlignment || false;
  if (!disableAlign && list.length) {
    const delay = list[0]?.item?.delay != null ? String(list[0].item.delay) : void 0;
    const intervalMs = resolveAlignmentIntervalMs({
      intervalMs: opts.intervalMs,
      rangeFromMs: opts.rangeFromMs,
      rangeToMs: opts.rangeToMs,
      maxDataPoints: opts.maxDataPoints,
      itemDelay: delay
    });
    list = list.map((s) => alignSeries(s, opts.rangeFromMs, opts.rangeToMs, intervalMs));
    await yield_();
  }
  if (signal?.aborted) throw new DOMException("Aborted", "AbortError");
  const useMap = Boolean(opts.query.options?.useZabbixValueMapping);
  const referenced = new Set(list.map((s) => String(s.item.valuemapid || "")).filter(Boolean));
  const filteredMaps = (opts.valueMaps || []).filter((vm) => referenced.has(String(vm.valuemapid || "")));
  const lookup = useMap ? buildValueMapLookup(filteredMaps) : void 0;
  const frames = seriesListToFrames(list, opts.query.refId, opts.datasourceUid, lookup);
  if (notices.length && frames[0]) {
    const meta2 = frames[0].meta ||= {};
    meta2.notices = [...meta2.notices || [], ...notices.map((text) => ({ severity: "warning", text }))];
  }
  return frames;
}
const DURATION_RE = /^(\d+(?:\.\d+)?)(ms|s|m|h|d|w)$/i;
const DURATION_SCALE = {
  ms: 1,
  s: 1e3,
  m: 6e4,
  h: 36e5,
  d: 864e5,
  w: 6048e5
};
function isValidDurationString(value) {
  return DURATION_RE.test(String(value || "").trim());
}
function parseDurationMs(value, fallback) {
  const m = String(value || "").trim().match(DURATION_RE);
  if (!m) return fallback;
  return Number(m[1]) * DURATION_SCALE[m[2].toLowerCase()];
}
function parseCacheTtlMs$1(raw, fallback = 36e5) {
  if (typeof raw === "number" && Number.isFinite(raw))
    return Math.max(0, Math.floor(raw));
  const s = String(raw ?? "").trim();
  if (!s) return fallback;
  if (!isValidDurationString(s)) return fallback;
  return parseDurationMs(s, fallback);
}
function shouldUseTrends(args) {
  if (args.query === "false") return false;
  if (!args.enabled && args.query !== "true") return false;
  if (args.query === "true") return args.enabled !== false;
  if (!args.enabled) return false;
  const oldEnough = args.fromMs < args.nowMs - parseDurationMs(args.trendsFrom, 7 * 864e5);
  const wideEnough = args.toMs - args.fromMs > parseDurationMs(args.trendsRange, 4 * 864e5);
  return oldEnough || wideEnough;
}
function pickTrendValue(point, mode2) {
  switch (mode2) {
    case "min":
      return Number(point.value_min);
    case "max":
      return Number(point.value_max);
    case "sum":
      return Number(point.value_avg) * Number(point.num || 0);
    case "count":
      return Number(point.num || 0);
    case "avg":
    default:
      return Number(point.value_avg);
  }
}
const RP_RE = /^[A-Za-z0-9_.:-]+$/;
function assertRetentionPolicy(rp) {
  const v = String(rp || "").trim();
  if (!v) return "";
  if (!RP_RE.test(v)) {
    throw new Error(`invalid Influx retention policy for Direct DB: ${v}`);
  }
  return v;
}
function buildInfluxHistoryQuery(args) {
  for (const id of args.itemids) {
    if (!/^\d+$/.test(id))
      throw new Error(`invalid itemid for Direct DB: ${id}`);
  }
  const rp = assertRetentionPolicy(args.retentionPolicy);
  const prefix = rp ? `"${rp}".` : "";
  const measurement = args.measurement === "history_uint" ? "history_uint" : "history";
  const agg = args.consolidateBy === "min" ? "min" : args.consolidateBy === "max" ? "max" : args.consolidateBy === "sum" ? "sum" : args.consolidateBy === "count" ? "count" : "mean";
  return `SELECT ${agg}("value") FROM ${prefix}"${measurement}" WHERE "itemid" =~ /^${args.itemids.join("|")}$/ AND time >= ${Number(args.fromSec)}s AND time <= ${Number(args.toSec)}s GROUP BY "itemid", time(1m) fill(none)`;
}
function rowsToSeries(rows, items, opts) {
  const byId2 = new Map(items.map((i) => [String(i.itemid), i]));
  const buckets = /* @__PURE__ */ new Map();
  for (const row of rows) {
    const id = String(row.itemid ?? "");
    if (!id) continue;
    const item = byId2.get(id);
    const spec = resolveValueTypeSpec(item?.value_type ?? 0, {
      allowUnknownAsFloat: !item
    });
    const t2 = Number(row.time);
    const time = !Number.isFinite(t2) ? 0 : t2 < 1e12 ? t2 * 1e3 : t2;
    const mapped = mapHistoryRawValue(row.value, spec);
    const point = {
      time,
      value: mapped.value,
      valueRaw: mapped.valueRaw
    };
    if (row.value_min != null) point.value_min = String(row.value_min);
    if (row.value_avg != null) point.value_avg = String(row.value_avg);
    if (row.value_max != null) point.value_max = String(row.value_max);
    if (row.num != null) point.num = String(row.num);
    const list = buckets.get(id) || [];
    list.push(point);
    buckets.set(id, list);
  }
  return [...buckets.entries()].map(([itemid, points]) => {
    const item = byId2.get(itemid) || {
      itemid,
      name: itemid,
      key_: itemid,
      hostid: "",
      value_type: "0"
    };
    points.sort((a, b) => a.time - b.time);
    return {
      item,
      name: item.name || item.key_ || itemid,
      points,
      meta: { source: opts?.source, itemid },
      notices: []
    };
  });
}
function quoteIds$1(itemids) {
  return itemids.map((id) => {
    if (!/^\d+$/.test(id))
      throw new Error(`invalid itemid for Direct DB: ${id}`);
    return `'${id}'`;
  }).join(",");
}
function aggFn$1(consolidateBy) {
  switch (String(consolidateBy || "avg").toLowerCase()) {
    case "min":
      return "MIN";
    case "max":
      return "MAX";
    case "sum":
      return "SUM";
    case "count":
      return "COUNT";
    case "avg":
    default:
      return "AVG";
  }
}
function historyTable$1(history) {
  return history === 3 ? "history_uint" : "history";
}
function trendsTable$1(history) {
  return history === 3 ? "trends_uint" : "trends";
}
function buildMysqlHistorySQL(args) {
  const ids = quoteIds$1(args.itemids);
  const bucket = Math.max(
    1,
    Math.floor((args.toSec - args.fromSec) / Math.max(1, args.maxDataPoints))
  );
  const agg = aggFn$1(args.consolidateBy);
  const table = historyTable$1(args.history);
  return [
    `SELECT CAST(itemid AS CHAR) AS itemid,`,
    `       (clock DIV ${bucket}) * ${bucket} AS time,`,
    `       CAST(${agg}(value) AS CHAR) AS value`,
    `FROM ${table}`,
    `WHERE itemid IN (${ids})`,
    `  AND clock >= ${Number(args.fromSec)}`,
    `  AND clock <= ${Number(args.toSec)}`,
    `GROUP BY itemid, time`,
    `ORDER BY time ASC`
  ].join("\n");
}
function buildMysqlTrendSQL(args) {
  const ids = quoteIds$1(args.itemids);
  const table = trendsTable$1(args.history);
  const col2 = args.trendValue === "min" ? "value_min" : args.trendValue === "max" ? "value_max" : args.trendValue === "count" ? "num" : args.trendValue === "sum" ? "(value_avg * num)" : "value_avg";
  return [
    `SELECT CAST(itemid AS CHAR) AS itemid,`,
    `       clock AS time,`,
    `       CAST(${col2} AS CHAR) AS value,`,
    `       CAST(value_min AS CHAR) AS value_min,`,
    `       CAST(value_avg AS CHAR) AS value_avg,`,
    `       CAST(value_max AS CHAR) AS value_max,`,
    `       CAST(num AS CHAR) AS num`,
    `FROM ${table}`,
    `WHERE itemid IN (${ids})`,
    `  AND clock >= ${Number(args.fromSec)}`,
    `  AND clock <= ${Number(args.toSec)}`,
    `ORDER BY time ASC`
  ].join("\n");
}
function quoteIds(itemids) {
  return itemids.map((id) => {
    if (!/^\d+$/.test(id))
      throw new Error(`invalid itemid for Direct DB: ${id}`);
    return `'${id}'`;
  }).join(",");
}
function aggFn(consolidateBy) {
  switch (String(consolidateBy || "avg").toLowerCase()) {
    case "min":
      return "MIN";
    case "max":
      return "MAX";
    case "sum":
      return "SUM";
    case "count":
      return "COUNT";
    case "avg":
    default:
      return "AVG";
  }
}
function historyTable(history) {
  return history === 3 ? "history_uint" : "history";
}
function trendsTable(history) {
  return history === 3 ? "trends_uint" : "trends";
}
function buildPostgresHistorySQL(args) {
  const ids = quoteIds(args.itemids);
  const bucket = Math.max(
    1,
    Math.floor((args.toSec - args.fromSec) / Math.max(1, args.maxDataPoints))
  );
  const agg = aggFn(args.consolidateBy);
  const table = historyTable(args.history);
  return [
    `SELECT itemid::text AS itemid,`,
    `       (clock / ${bucket}) * ${bucket} AS time,`,
    `       ${agg}(value)::text AS value`,
    `FROM ${table}`,
    `WHERE itemid IN (${ids})`,
    `  AND clock >= ${Number(args.fromSec)}`,
    `  AND clock <= ${Number(args.toSec)}`,
    `GROUP BY itemid, time`,
    `ORDER BY time ASC`
  ].join("\n");
}
function buildPostgresTrendSQL(args) {
  const ids = quoteIds(args.itemids);
  const table = trendsTable(args.history === 3 ? 3 : 0);
  const col2 = args.trendValue === "min" ? "value_min" : args.trendValue === "max" ? "value_max" : args.trendValue === "count" ? "num" : args.trendValue === "sum" ? "(value_avg * num)" : "value_avg";
  return [
    `SELECT itemid::text AS itemid,`,
    `       clock AS time,`,
    `       ${col2}::text AS value,`,
    `       value_min::text AS value_min,`,
    `       value_avg::text AS value_avg,`,
    `       value_max::text AS value_max,`,
    `       num::text AS num`,
    `FROM ${table}`,
    `WHERE itemid IN (${ids})`,
    `  AND clock >= ${Number(args.fromSec)}`,
    `  AND clock <= ${Number(args.toSec)}`,
    `ORDER BY time ASC`
  ].join("\n");
}
const DIRECT_DB_TYPE_RE = /(postgres|mysql|influx)/i;
const OFFLINE_OR_SEED_TYPE_RE = /(testdata|testData|grafana-testdata|datasource-test|offline|builtin|mock)/i;
function detectDirectDbDialect(type) {
  const t2 = String(type || "").toLowerCase();
  if (t2.includes("postgres")) return "postgres";
  if (t2.includes("mysql")) return "mysql";
  if (t2.includes("influx")) return "influx";
  return null;
}
function assertSafeIds(ids) {
  if (ids.some((id) => !/^\d+$/.test(id))) {
    throw new DataSourceError(
      "INVALID_QUERY",
      "Direct DB itemid must be numeric"
    );
  }
}
function resolveDirectDbGateway(uid) {
  const key = String(uid || "").trim();
  if (!key) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "Direct DB datasource UID is required"
    );
  }
  const matches = listRuntimeDataSources().filter(
    (d) => String(d?.uid || "") === key
  );
  if (matches.length > 1) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      `Direct DB datasource UID is not unique: ${key}`
    );
  }
  const ds2 = matches[0] || getRuntimeDataSource(key);
  if (!ds2) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      `Direct DB gateway missing for uid=${key}`
    );
  }
  if (typeof ds2.query !== "function") {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      `Direct DB gateway has no query capability: ${key}`
    );
  }
  const type = String(ds2.type || "");
  if (OFFLINE_OR_SEED_TYPE_RE.test(type) || ds2.offline === true || ds2.builtin === true) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      `Direct DB refuses offline/seed datasource type=${type || "unknown"}`
    );
  }
  if (ds2.dataMode === "fixture" || ds2.useFixture === true) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "Direct DB refuses fixture-mode SQL datasource"
    );
  }
  const dialect = detectDirectDbDialect(type);
  if (!dialect || !DIRECT_DB_TYPE_RE.test(type)) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      `不支持的 Direct DB 类型: ${type || "unknown"}`
    );
  }
  return { ds: ds2, dialect };
}
function rangeMs$2(ctx) {
  const from = ctx.range.from instanceof Date ? ctx.range.from.getTime() : Number(ctx.range.from);
  const to = ctx.range.to instanceof Date ? ctx.range.to.getTime() : Number(ctx.range.to);
  return { from, to };
}
function numericItemsOnly(items) {
  const out = [];
  for (const item of items) {
    const spec = resolveValueTypeSpec(item.value_type);
    if (spec.valueType !== 0 && spec.valueType !== 3) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        `Direct DB only supports numeric value_type 0/3, got ${spec.valueType} for item ${item.itemid}`
      );
    }
    out.push(item);
  }
  return out;
}
function buildDirectDbQueryText(args) {
  assertSafeIds(args.itemids);
  if (args.useTrends && args.history !== 0 && args.history !== 3) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "trends only for value_type 0/3"
    );
  }
  if (args.dialect === "postgres") {
    return args.useTrends ? buildPostgresTrendSQL({
      itemids: args.itemids,
      fromSec: args.fromSec,
      toSec: args.toSec,
      history: args.history,
      trendValue: args.trendValue
    }) : buildPostgresHistorySQL({
      itemids: args.itemids,
      fromSec: args.fromSec,
      toSec: args.toSec,
      history: args.history,
      consolidateBy: args.consolidateBy,
      maxDataPoints: args.maxDataPoints
    });
  }
  if (args.dialect === "mysql") {
    return args.useTrends ? buildMysqlTrendSQL({
      itemids: args.itemids,
      fromSec: args.fromSec,
      toSec: args.toSec,
      history: args.history,
      trendValue: args.trendValue
    }) : buildMysqlHistorySQL({
      itemids: args.itemids,
      fromSec: args.fromSec,
      toSec: args.toSec,
      history: args.history,
      consolidateBy: args.consolidateBy,
      maxDataPoints: args.maxDataPoints
    });
  }
  return buildInfluxHistoryQuery({
    itemids: args.itemids,
    fromSec: args.fromSec,
    toSec: args.toSec,
    retentionPolicy: args.retentionPolicy,
    measurement: args.history === 3 ? "history_uint" : "history",
    consolidateBy: args.consolidateBy
  });
}
function framesToRows(frames) {
  const rows = [];
  for (const frame of frames || []) {
    const fields = frame.fields || [];
    const itemField = fields.find((f) => /itemid/i.test(f.name));
    const timeField = fields.find((f) => f.name === "Time" || /^(time|clock)$/i.test(f.name)) || fields.find((f) => f.type === "time");
    const valueField2 = fields.find((f) => f.name === "Value" || /^value$/i.test(f.name)) || fields.find(
      (f) => /value/i.test(f.name) && !/itemid|min|max|avg|num/i.test(f.name)
    );
    const minF = fields.find((f) => /value_min/i.test(f.name));
    const avgF = fields.find((f) => /value_avg/i.test(f.name));
    const maxF = fields.find((f) => /value_max/i.test(f.name));
    const numF = fields.find((f) => /^num$/i.test(f.name));
    const n = Math.max(
      timeField?.values?.length || 0,
      valueField2?.values?.length || 0,
      itemField?.values?.length || 0
    );
    const labelItemid = frame.name || valueField2?.labels?.itemid;
    for (let i = 0; i < n; i++) {
      rows.push({
        itemid: String(itemField?.values?.[i] ?? labelItemid ?? ""),
        time: timeField?.values?.[i],
        value: valueField2?.values?.[i],
        value_min: minF?.values?.[i],
        value_avg: avgF?.values?.[i],
        value_max: maxF?.values?.[i],
        num: numF?.values?.[i]
      });
    }
  }
  return rows;
}
async function resolveDirectDbItems(ctx) {
  if (String(ctx.query.queryType) === "3" || ctx.query.itemids) {
    const ids = String(ctx.query.itemids || "").split(",").map((s) => s.trim()).filter(Boolean);
    assertSafeIds(ids);
    if (!ids.length) return [];
    const items2 = await ctx.api.getItemsByIds(ids, ctx.signal);
    return numericItemsOnly(items2);
  }
  const groups = await resolveGroups(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    ctx.signal
  );
  const hosts = await resolveHosts(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    groups.map((g) => String(g.groupid)),
    ctx.signal
  );
  const apps = await resolveApplications(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    hosts.map((h2) => String(h2.hostid)),
    ctx.signal
  );
  const items = await resolveItems(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    hosts.map((h2) => String(h2.hostid)),
    apps.map((a) => String(a.applicationid || a)),
    ctx.signal
  );
  return numericItemsOnly(items);
}
async function executeDirectDbQuery(ctx) {
  if (!ctx.settings.dbConnectionEnable) return null;
  if (!ctx.settings.dbConnectionDatasourceUID) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "Direct DB enabled but datasource UID missing"
    );
  }
  const { ds: ds2, dialect } = resolveDirectDbGateway(
    ctx.settings.dbConnectionDatasourceUID
  );
  const plan = planQueryFunctions(ctx.query.functions || []);
  const { from, to } = rangeMs$2(ctx);
  const shifted = applyPlanToRange(from, to, plan);
  const fromSec = Math.floor(shifted.fromMs / 1e3);
  const toSec = Math.floor(shifted.toMs / 1e3);
  const items = await resolveDirectDbItems(ctx);
  if (!items.length) return [];
  const useTrends = shouldUseTrends({
    fromMs: shifted.fromMs,
    toMs: shifted.toMs,
    nowMs: Date.now(),
    query: ctx.query.options?.useTrends || "default",
    enabled: ctx.settings.trends !== false,
    trendsFrom: ctx.settings.trendsFrom || "7d",
    trendsRange: ctx.settings.trendsRange || "4d"
  });
  const groups = /* @__PURE__ */ new Map();
  for (const item of items) {
    const spec = resolveValueTypeSpec(item.value_type);
    const hist = spec.history === 3 ? 3 : 0;
    if (useTrends && !spec.supportsTrends) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        `Direct DB trends unsupported for value_type ${spec.valueType}`
      );
    }
    const list = groups.get(hist) || [];
    list.push(item);
    groups.set(hist, list);
  }
  const maxDataPoints = Math.min(1e4, ctx.maxDataPoints || 1e3);
  const allRows = [];
  const lastQueryTexts = [];
  for (const [history, group] of groups) {
    const itemids = group.map((i) => String(i.itemid));
    const rawQuery = buildDirectDbQueryText({
      dialect,
      itemids,
      history,
      fromSec,
      toSec,
      useTrends,
      trendValue: plan.trendValue,
      consolidateBy: plan.consolidateBy || void 0,
      maxDataPoints,
      retentionPolicy: ctx.settings.dbConnectionRetentionPolicy
    });
    lastQueryTexts.push(rawQuery);
    const result = await ds2.query(
      {
        requestId: `zabbix-direct-${ctx.query.refId}-${history}`,
        targets: [
          {
            refId: ctx.query.refId,
            rawSql: rawQuery,
            format: "table",
            query: rawQuery
          }
        ],
        range: {
          from: new Date(shifted.fromMs),
          to: new Date(shifted.toMs),
          raw: ctx.range.raw
        },
        maxDataPoints
      },
      ctx.signal
    );
    allRows.push(...framesToRows(result?.data || []));
  }
  const series = rowsToSeries(allRows, items, {
    source: "direct-db"
  }).map((s) => ({
    ...s,
    meta: {
      ...s.meta || {},
      dialect,
      lineage: "direct-db",
      requestPlan: {
        timeShiftMs: plan.timeShiftMs,
        trendValue: plan.trendValue,
        consolidateBy: plan.consolidateBy
      },
      queryTexts: lastQueryTexts
    }
  }));
  return runProcessingPipeline(series, {
    query: ctx.query,
    rangeFromMs: from,
    rangeToMs: to,
    maxDataPoints,
    intervalMs: ctx.intervalMs,
    datasourceUid: ctx.instance.uid,
    disableDataAlignment: ctx.settings.disableDataAlignment,
    requestPlanApplied: true,
    functionsOverride: plan.postFetchFunctions
  });
}
function resolveLldSelection(query) {
  if (query.executionMode === "lld" && query.lld?.ruleId) {
    return {
      ruleId: String(query.lld.ruleId),
      ruleName: query.lld.ruleName,
      prototypeIds: [...query.lld.prototypeIds || []].map(String),
      prototypeKeys: [...query.lld.prototypeKeys || []].map(String),
      discoveredItemIds: query.lld.discoveredItemIds?.map(String)
    };
  }
  if (query.lldRuleId) {
    return {
      ruleId: String(query.lldRuleId),
      ruleName: query.lldRuleName,
      prototypeIds: [],
      prototypeKeys: [...query.lldItemKeys || []].map(String)
    };
  }
  if (query.executionMode === "lld") {
    return {
      ruleId: "",
      prototypeIds: [],
      prototypeKeys: []
    };
  }
  return null;
}
function assertLldSelection(sel) {
  if (!sel.ruleId) {
    throw new DataSourceError(
      "INVALID_QUERY",
      "LLD ruleId is required when executionMode is lld"
    );
  }
  if (!sel.prototypeIds.length && !sel.prototypeKeys.length && !sel.discoveredItemIds?.length) {
    throw new DataSourceError(
      "INVALID_QUERY",
      "LLD requires prototypeIds, prototypeKeys, or discoveredItemIds"
    );
  }
}
async function resolveLldDiscoveredItems(ctx, sel) {
  assertLldSelection(sel);
  const groups = await resolveGroups(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    ctx.signal
  );
  const hosts = await resolveHosts(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    groups.map((g) => g.groupid),
    ctx.signal
  );
  const hostids = hosts.map((h2) => String(h2.hostid));
  let prototypeIds = [...sel.prototypeIds];
  if (!prototypeIds.length && sel.prototypeKeys.length) {
    const protos = await ctx.api.getItemPrototypesFull(sel.ruleId, ctx.signal);
    const rows = Array.isArray(protos) ? protos : protos.rows || [];
    const keySet = new Set(sel.prototypeKeys);
    prototypeIds = rows.filter((p) => keySet.has(String(p.key_))).map((p) => String(p.itemid));
  }
  if (sel.discoveredItemIds?.length) {
    const items2 = await ctx.api.getItemsByIds(
      sel.discoveredItemIds,
      ctx.signal
    );
    return { items: items2, ruleId: sel.ruleId, prototypeIds };
  }
  const items = await ctx.api.getDiscoveredItems(
    hostids,
    sel.ruleId,
    sel.prototypeKeys,
    ctx.signal,
    { prototypeIds, requireParentRelation: prototypeIds.length > 0 }
  );
  for (const it of items) {
    it.__lld = {
      ruleId: sel.ruleId,
      prototypeId: it.itemDiscovery?.parent_itemid,
      discoveredItemId: it.itemid,
      hostId: it.hostid,
      matchingBasis: "itemDiscovery.parent_itemid"
    };
  }
  return { items, ruleId: sel.ruleId, prototypeIds };
}
function rangeMs$1(ctx) {
  const from = ctx.range.from instanceof Date ? ctx.range.from.getTime() : Number(ctx.range.from);
  const to = ctx.range.to instanceof Date ? ctx.range.to.getTime() : Number(ctx.range.to);
  return { from, to };
}
function historyPageLimit(ctx) {
  const n = Number(ctx.settings.historyPageLimit);
  return Number.isFinite(n) && n > 0 ? Math.floor(n) : 1e4;
}
function historyBatchSize(ctx) {
  const n = Number(ctx.settings.historyBatchSize);
  return Number.isFinite(n) && n > 0 ? Math.floor(n) : 100;
}
const MAX_HISTORY_SERIES = 8;
const MAX_HISTORY_SERIES_UNSCOPED = 3;
const MAX_HISTORY_POINTS = 4e3;
async function loadHistoryForItems(ctx, items, opts) {
  if (!items.length) return [];
  const seriesCap = Math.max(
    1,
    Math.min(
      opts?.maxSeries ?? MAX_HISTORY_SERIES,
      MAX_HISTORY_SERIES
    )
  );
  const itemList = items.length > seriesCap ? items.slice(0, seriesCap) : items;
  const plan = planQueryFunctions(ctx.query.functions || []);
  const { from, to } = rangeMs$1(ctx);
  const shifted = applyPlanToRange(from, to, plan);
  const fromSec = Math.floor(shifted.fromMs / 1e3);
  const toSec = Math.floor(shifted.toMs / 1e3);
  const trendsQuery = ctx.query.options?.useTrends || "default";
  const useTrends = shouldUseTrends({
    fromMs: shifted.fromMs,
    toMs: shifted.toMs,
    nowMs: Date.now(),
    query: trendsQuery,
    enabled: ctx.settings.trends !== false,
    trendsFrom: ctx.settings.trendsFrom || "7d",
    trendsRange: ctx.settings.trendsRange || "4d"
  });
  const trendMode = opts?.trendValue || plan.trendValue || "avg";
  const pageLimit = Math.min(historyPageLimit(ctx), 2e3);
  const batchSize = Math.min(historyBatchSize(ctx), 25);
  const perSeries = Math.max(64, Number(ctx.maxDataPoints || 500) || 500);
  const maxRows = Math.min(MAX_HISTORY_POINTS, perSeries * itemList.length);
  const byType = /* @__PURE__ */ new Map();
  for (const item of itemList) {
    const spec = resolveValueTypeSpec(item.value_type);
    const list = byType.get(spec.history) || [];
    list.push(item);
    byType.set(spec.history, list);
  }
  const series = [];
  for (const [history, group] of byType) {
    const spec = resolveValueTypeSpec(history);
    const ids = group.map((i) => i.itemid);
    const appendResult = (result) => {
      for (const item of group.filter((g) => result.batch.includes(g.itemid))) {
        if (result.kind === "trend") {
          const rows = (result.trends || []).filter(
            (t2) => String(t2.itemid) === String(item.itemid)
          );
          let points = rows.map((t2) => ({
            time: Number(t2.clock) * 1e3,
            value: pickTrendValue(t2, trendMode),
            valueRaw: String(t2.value_avg ?? t2.value_min ?? ""),
            value_min: t2.value_min,
            value_avg: t2.value_avg,
            value_max: t2.value_max,
            num: t2.num
          })).sort((a, b) => a.time - b.time);
          const maxPts = Math.max(64, Math.min(perSeries, 240));
          if (points.length > maxPts) {
            const step = Math.ceil(points.length / maxPts);
            points = points.filter(
              (_, i) => i % step === 0 || i === points.length - 1
            );
          }
          series.push({
            item,
            points,
            meta: {
              source: "trend",
              trendValue: trendMode,
              value_types: ["min", "avg", "max", "num"]
            }
          });
        } else {
          const hist = result.page.points.filter(
            (h2) => String(h2.itemid) === String(item.itemid)
          );
          const mapped = mapHistoryPoints(hist, spec);
          const points = mapped.times.map((time, idx) => ({
            time,
            value: mapped.values[idx] ?? null,
            valueRaw: mapped.valueRaw[idx] ?? null,
            ns: mapped.ns[idx] ?? void 0,
            timestamp: mapped.log.timestamp[idx] ?? void 0,
            source: mapped.log.source[idx] ?? void 0,
            severity: mapped.log.severity[idx] ?? void 0,
            logeventid: mapped.log.logeventid[idx] ?? void 0
          }));
          series.push({
            item,
            points,
            notices: [
              ...mapped.notices || [],
              ...result.page.truncated ? ["history result truncated: page limit or maxRows reached"] : []
            ],
            meta: {
              source: "history",
              truncated: result.page.truncated,
              history
            }
          });
        }
      }
      opts?.onPartial?.(series.slice());
    };
    for await (const _chunk of fetchHistoryStream({
      itemids: ids,
      batchSize,
      signal: ctx.signal,
      fetchBatch: async (batch) => {
        if (useTrends && !spec.supportsTrends) {
          if (trendsQuery === "true") {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              `trends are not supported for value_type ${spec.valueType} (${spec.name})`
            );
          }
        }
        let result;
        if (useTrends && spec.supportsTrends) {
          const trends = await ctx.api.getTrends(
            batch,
            fromSec,
            toSec,
            ctx.signal
          );
          if (Array.isArray(trends) && trends.length > 0) {
            result = { kind: "trend", batch, trends };
          }
        }
        if (!result) {
          const page = await fetchHistoryRange({
            itemids: batch,
            history,
            fromSec,
            toSec,
            pageLimit,
            maxRows: Math.min(maxRows, perSeries * batch.length),
            signal: ctx.signal,
            getHistory: (itemids, h2, f, t2, signal, limit) => ctx.api.getHistory(itemids, h2, f, t2, signal, limit)
          });
          result = { kind: "history", batch, page };
        }
        appendResult(result);
        return result.kind === "history" ? result.page.points : [];
      }
    })) {
    }
  }
  return series;
}
async function executeMetricsQuery(ctx) {
  const directIds = (ctx.query.item?.ids || []).map(String).filter(Boolean);
  let items;
  const lldSel = resolveLldSelection(ctx.query);
  if (!directIds.length && !lldSel) {
    assertBoundedHostScope(ctx.query, ctx.scopedVars);
  }
  if (lldSel) {
    const resolved = await resolveLldDiscoveredItems(ctx, lldSel);
    items = resolved.items;
    if (!items.length) {
      return [emptyFrame(ctx.query.refId, "LLD 未匹配到 discovered items")];
    }
  } else if (directIds.length) {
    items = await ctx.api.getItemsByIds(directIds, ctx.signal);
    if (!items.length) {
      return [emptyFrame(ctx.query.refId, "item.ids 未找到监控项")];
    }
  } else {
    const hostF2 = interpolateFilter(ctx.query.host, ctx.scopedVars);
    const groupF2 = interpolateFilter(ctx.query.group, ctx.scopedVars);
    const hostAll = isMatchAllZabbixFilter(hostF2.filter) && !hostF2.ids?.length;
    const groupAll = isMatchAllZabbixFilter(groupF2.filter) && !groupF2.ids?.length;
    let hostids = [];
    let itemGroupids;
    if (!hostAll) {
      const groups = await resolveGroups(
        ctx.api,
        ctx.query,
        ctx.scopedVars,
        ctx.signal
      );
      const hosts = await resolveHosts(
        ctx.api,
        ctx.query,
        ctx.scopedVars,
        groups.map((g) => String(g.groupid)),
        ctx.signal
      );
      hostids = hosts.map((h2) => String(h2.hostid));
    } else if (!groupAll) {
      const groups = await resolveGroups(
        ctx.api,
        ctx.query,
        ctx.scopedVars,
        ctx.signal
      );
      if (groups.length) {
        itemGroupids = groups.map((g) => String(g.groupid));
      }
    }
    const apps = await resolveApplications(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      hostids,
      ctx.signal
    );
    items = await resolveItems(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      hostids,
      apps.map((a) => String(a.applicationid || a)),
      ctx.signal,
      itemGroupids
    );
  }
  if (!items.length) {
    return [emptyFrame(ctx.query.refId, "未匹配到监控项")];
  }
  const plan = planQueryFunctions(ctx.query.functions || []);
  const hostF = interpolateFilter(ctx.query.host, ctx.scopedVars);
  const groupF = interpolateFilter(ctx.query.group, ctx.scopedVars);
  const unscoped = isMatchAllZabbixFilter(hostF.filter) && !hostF.ids?.length || isMatchAllZabbixFilter(groupF.filter) && !groupF.ids?.length;
  const series = await loadHistoryForItems(ctx, items, {
    trendValue: plan.trendValue,
    maxSeries: unscoped ? MAX_HISTORY_SERIES_UNSCOPED : MAX_HISTORY_SERIES,
    onPartial: ctx.onPartialData ? (partialSeries) => {
      try {
        void buildFramesAsync(
          {
            series: partialSeries,
            refId: ctx.query.refId,
            datasourceUid: ctx.instance.uid,
            requestId: `partial-${ctx.query.refId}`
          },
          ctx.signal
        ).then((partialFrames) => {
          if (!ctx.signal?.aborted) ctx.onPartialData?.(partialFrames);
        }).catch(() => {
        });
      } catch {
      }
    } : void 0
  });
  const { from, to } = rangeMs$1(ctx);
  const pipelineOpts = {
    query: {
      ...ctx.query,
      functions: plan.postFetchFunctions
    },
    rangeFromMs: from,
    rangeToMs: to,
    maxDataPoints: ctx.maxDataPoints,
    intervalMs: ctx.intervalMs,
    datasourceUid: ctx.instance.uid,
    disableDataAlignment: Boolean(directIds.length) || Boolean(lldSel) || ctx.settings.disableDataAlignment || ctx.query.options?.disableDataAlignment,
    functionsOverride: plan.postFetchFunctions,
    requestPlanApplied: true
  };
  let frames;
  try {
    frames = await runProcessingPipelineAsync(series, pipelineOpts, ctx.signal);
  } catch (e) {
    if (e?.name === "AbortError") throw e;
    frames = runProcessingPipeline(series, pipelineOpts);
  }
  if (lldSel) {
    for (const f of frames) {
      const meta2 = f.meta ||= {};
      meta2.lld = {
        ruleId: lldSel.ruleId,
        ruleName: lldSel.ruleName,
        prototypeIds: lldSel.prototypeIds,
        prototypeKeys: lldSel.prototypeKeys
      };
    }
  }
  return frames;
}
function partialOpts(ctx) {
  if (!ctx.onPartialData) return void 0;
  return {
    onPartial: (partialSeries) => {
      try {
        ctx.onPartialData?.(seriesToFrames(partialSeries, ctx.query.refId));
      } catch {
      }
    }
  };
}
function parseItemIds(raw) {
  const ids = String(raw || "").split(",").map((v) => v.trim()).filter(Boolean);
  if (!ids.length)
    throw new DataSourceError("INVALID_QUERY", "itemids cannot be empty");
  if (ids.some((id) => !/^\d+$/.test(id)))
    throw new DataSourceError("INVALID_QUERY", "itemid must be numeric");
  if (ids.length > 500)
    throw new DataSourceError("INVALID_QUERY", "item count exceeds 500");
  return [...new Set(ids)];
}
async function executeItemIdQuery(ctx) {
  const rawIds = String(ctx.query.itemids || "").trim();
  if (rawIds) {
    const ids = parseItemIds(rawIds);
    const items2 = await ctx.api.getItemsByIds(ids, ctx.signal);
    const series2 = await loadHistoryForItems(ctx, items2, partialOpts(ctx));
    return seriesToFrames(series2, ctx.query.refId);
  }
  const itemF = interpolateFilter(ctx.query.item, ctx.scopedVars);
  if (itemF.ids?.length) {
    const items2 = await ctx.api.getItemsByIds(itemF.ids, ctx.signal);
    const series2 = await loadHistoryForItems(ctx, items2, partialOpts(ctx));
    return seriesToFrames(series2, ctx.query.refId);
  }
  if (!itemF.filter) {
    throw new DataSourceError("INVALID_QUERY", "itemids cannot be empty");
  }
  const hostF = interpolateFilter(ctx.query.host, ctx.scopedVars);
  const groupF = interpolateFilter(ctx.query.group, ctx.scopedVars);
  const hostAll = isMatchAllZabbixFilter(hostF.filter) && !hostF.ids?.length;
  const groupAll = isMatchAllZabbixFilter(groupF.filter) && !groupF.ids?.length;
  let hostids = [];
  let itemGroupids;
  if (!hostAll) {
    const groups = await resolveGroups(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      ctx.signal
    );
    const hosts = await resolveHosts(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      groups.map((g) => String(g.groupid)),
      ctx.signal
    );
    hostids = hosts.map((h2) => String(h2.hostid));
  } else if (!groupAll) {
    const groups = await resolveGroups(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      ctx.signal
    );
    if (groups.length) itemGroupids = groups.map((g) => String(g.groupid));
  }
  const items = await resolveItems(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    hostids,
    [],
    ctx.signal,
    itemGroupids
  );
  const series = await loadHistoryForItems(ctx, items, partialOpts(ctx));
  return seriesToFrames(series, ctx.query.refId);
}
function isSecretMacro(row) {
  const t2 = String(row.type ?? "0");
  if (t2 === "1" || t2 === "2") return true;
  if ((row.value == null || row.value === "") && String(row.macro || "").includes("SECRET"))
    return true;
  return false;
}
function maskMacroValue(row) {
  if (isSecretMacro(row)) {
    return { value: "******", masked: true, secret: true };
  }
  return { value: String(row.value ?? ""), masked: false, secret: false };
}
async function executeMacrosQuery(ctx) {
  assertBoundedHostScope(ctx.query, ctx.scopedVars);
  const hostF = interpolateFilter(ctx.query.host, ctx.scopedVars);
  const groupF = interpolateFilter(ctx.query.group, ctx.scopedVars);
  const groupAll = isMatchAllZabbixFilter(groupF.filter) && !groupF.ids?.length;
  const hostAll = isMatchAllZabbixFilter(hostF.filter) && !hostF.ids?.length;
  const groups = groupAll ? [] : await resolveGroups(ctx.api, ctx.query, ctx.scopedVars, ctx.signal);
  let hosts = [];
  if (!hostAll) {
    hosts = await resolveHosts(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      groups.map((g) => String(g.groupid)),
      ctx.signal
    );
  }
  const macroFilter = interpolateFilter(ctx.query.macro, ctx.scopedVars);
  const page = await ctx.api.getMacros(
    hosts.map((h2) => String(h2.hostid)),
    macroFilter.filter,
    ctx.signal
  );
  const rows = Array.isArray(page) ? page : page.rows || [];
  const hostMap = new Map(hosts.map((h2) => [String(h2.hostid), h2]));
  rows.map((r) => {
    const m = maskMacroValue(r);
    return { macro: r.macro, type: r.type, masked: m.masked };
  });
  return [
    createDataFrame({
      refId: ctx.query.refId,
      fields: [
        {
          name: "Host",
          type: "string",
          values: rows.map(
            (r) => String(
              hostMap.get(String(r.hostid))?.name || r.hostid || (r.hostid ? "" : "Global")
            )
          )
        },
        {
          name: "HostId",
          type: "string",
          values: rows.map((r) => String(r.hostid ?? ""))
        },
        {
          name: "MacroId",
          type: "string",
          values: rows.map(
            (r) => String(r.hostmacroid || r.globalmacroid || r.macroid || "")
          )
        },
        {
          name: "Macro",
          type: "string",
          values: rows.map((r) => String(r.macro ?? ""))
        },
        {
          name: "Value",
          type: "string",
          values: rows.map((r) => maskMacroValue(r).value)
        },
        {
          name: "Type",
          type: "string",
          values: rows.map((r) => String(r.type ?? "0"))
        },
        {
          name: "Description",
          type: "string",
          values: rows.map((r) => String(r.description ?? ""))
        },
        {
          name: "Masked",
          type: "boolean",
          values: rows.map((r) => maskMacroValue(r).masked)
        },
        {
          name: "Scope",
          type: "string",
          values: rows.map(
            (r) => r.globalmacroid || !r.hostid && r.hostmacroid == null ? "global" : "host"
          )
        }
      ]
    })
  ];
}
function resolveSlaPeriodSeconds(slaInterval, rangeFromSec, rangeToSec) {
  const span = Math.max(1, rangeToSec - rangeFromSec);
  const key = String(slaInterval).toLowerCase();
  const map = {
    none: span,
    hour: 3600,
    day: 86400,
    week: 604800,
    month: 2592e3,
    quarter: 7776e3,
    year: 31536e3
  };
  let periodSeconds = map[key];
  if (periodSeconds == null) {
    const ms = parseDurationMs(key, Number.NaN);
    periodSeconds = Number.isFinite(ms) ? Math.max(1, Math.floor(ms / 1e3)) : span;
  }
  const periods = Math.max(1, Math.ceil(span / periodSeconds));
  return {
    periodFrom: rangeFromSec,
    periodTo: rangeToSec,
    periods,
    periodSeconds
  };
}
function numOrNull(v) {
  if (v == null || v === "") return null;
  const n = Number(v);
  return Number.isFinite(n) ? n : null;
}
async function executeServicesQuery(ctx) {
  const serviceFilter2 = interpolateZabbixValue(
    ctx.query.itServiceFilter || "",
    ctx.scopedVars
  );
  const slaFilter = interpolateZabbixValue(
    ctx.query.slaFilter || "",
    ctx.scopedVars
  );
  const property = String(ctx.query.slaProperty || "sli");
  const servicesPage = await ctx.api.getServices(ctx.signal);
  const services = Array.isArray(servicesPage) ? servicesPage : servicesPage.rows || [];
  const filtered = services.filter(
    (s) => !serviceFilter2 || String(s.name || "").includes(serviceFilter2)
  );
  const serviceids = filtered.map((s) => String(s.serviceid));
  const slasPage = await ctx.api.getSlas(serviceids, slaFilter, ctx.signal);
  const slas = Array.isArray(slasPage) ? slasPage : slasPage.rows || [];
  const from = Math.floor(
    (ctx.range.from instanceof Date ? ctx.range.from.getTime() : Number(ctx.range.from)) / 1e3
  );
  const to = Math.floor(
    (ctx.range.to instanceof Date ? ctx.range.to.getTime() : Number(ctx.range.to)) / 1e3
  );
  const period = resolveSlaPeriodSeconds(
    ctx.query.slaInterval || "none",
    from,
    to
  );
  const times = [];
  const serviceNames = [];
  const serviceIds = [];
  const slaNames = [];
  const slaIds = [];
  const props = [];
  const values = [];
  const sliCol = [];
  const uptimeCol = [];
  const downtimeCol = [];
  const errorBudgetCol = [];
  const notices = [];
  const rows = slas.length ? slas : filtered.map((s) => ({
    slaid: s.serviceid,
    name: s.name,
    serviceid: s.serviceid,
    sla: s.sla ?? s.status
  }));
  for (const sla of rows) {
    if (slaFilter && !String(sla.name || "").includes(slaFilter)) continue;
    let sli = numOrNull(sla.sli);
    let uptime = numOrNull(sla.uptime);
    let downtime = numOrNull(sla.downtime);
    let errorBudget = numOrNull(
      sla.error_budget ?? sla.errorBudget
    );
    let value = numOrNull(sla[property]);
    if (value == null && property === "sla")
      value = numOrNull(sla.sla ?? sla.slo);
    try {
      const sliRes = await ctx.api.getSli(
        {
          slaid: sla.slaid,
          serviceids: sla.serviceid ? [sla.serviceid] : void 0,
          period_from: period.periodFrom,
          period_to: period.periodTo,
          periods: period.periods
        },
        ctx.signal
      );
      const first = Array.isArray(sliRes) ? sliRes[0] : sliRes;
      if (first && typeof first === "object") {
        if (first.sli != null) {
          const raw = first.sli;
          sli = numOrNull(Array.isArray(raw) ? raw[0] : raw);
        }
        if (first.uptime != null) {
          const raw = first.uptime;
          uptime = numOrNull(Array.isArray(raw) ? raw[0] : raw);
        }
        if (first.downtime != null) {
          const raw = first.downtime;
          downtime = numOrNull(Array.isArray(raw) ? raw[0] : raw);
        }
        const eb = first.error_budget ?? first.errorBudget;
        if (eb != null) errorBudget = numOrNull(Array.isArray(eb) ? eb[0] : eb);
      }
      if (property === "sli" && sli != null) value = sli;
      else if (property === "uptime" && uptime != null) value = uptime;
      else if (property === "downtime" && downtime != null) value = downtime;
      else if (property === "error_budget" || property === "errorBudget")
        value = errorBudget;
      else if (value == null && sli != null) value = sli;
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      notices.push(`sla.getsli failed for ${sla.slaid || sla.name}: ${msg}`);
      if (value === 0 && sla[property] == null && sla.sli == null && sla.sla == null) {
        value = null;
      }
    }
    const svc = filtered.find((s) => String(s.serviceid) === String(sla.serviceid)) || filtered[0] || {};
    times.push(to * 1e3);
    serviceNames.push(String(svc.name || sla.service_name || ""));
    serviceIds.push(String(svc.serviceid || sla.serviceid || ""));
    slaNames.push(String(sla.name || ""));
    slaIds.push(String(sla.slaid || ""));
    props.push(property);
    values.push(value);
    sliCol.push(sli);
    uptimeCol.push(uptime);
    downtimeCol.push(downtime);
    errorBudgetCol.push(errorBudget);
  }
  const frame = createDataFrame({
    refId: ctx.query.refId,
    fields: [
      { name: "Time", type: "time", values: times },
      { name: "Service", type: "string", values: serviceNames },
      { name: "ServiceId", type: "string", values: serviceIds },
      { name: "Sla", type: "string", values: slaNames },
      { name: "SlaId", type: "string", values: slaIds },
      { name: "Property", type: "string", values: props },
      { name: "Value", type: "number", values },
      { name: "SLI", type: "number", values: sliCol },
      { name: "Uptime", type: "number", values: uptimeCol },
      { name: "Downtime", type: "number", values: downtimeCol },
      { name: "ErrorBudget", type: "number", values: errorBudgetCol },
      {
        name: "PeriodSeconds",
        type: "number",
        values: times.map(() => period.periodSeconds)
      }
    ]
  });
  if (notices.length) {
    frame.meta = {
      notices: notices.map((text) => ({ severity: "warning", text }))
    };
  }
  return [frame];
}
function compileTextFilter(textFilter) {
  const source = String(textFilter || "").trim();
  if (!source) return { match: () => true };
  const slash = source.match(/^\/(.*)\/([gimsuy]*)$/);
  if (slash) {
    try {
      const re = new RegExp(slash[1], slash[2].replace(/g/g, ""));
      return { match: (value) => re.test(value) };
    } catch (e) {
      throw new DataSourceError(
        "INVALID_QUERY",
        `invalid textFilter regex: ${e instanceof Error ? e.message : String(e)}`
      );
    }
  }
  return {
    match: (value) => {
      if (matchesZabbixFilter(value, source)) return true;
      if (/[\\^$*+?[\]{}|]/.test(source)) {
        try {
          return new RegExp(source).test(value);
        } catch {
          return false;
        }
      }
      return false;
    }
  };
}
function extractText(value, textFilter, useCaptureGroups) {
  const source = String(textFilter || "").trim();
  const raw = String(value ?? "");
  if (!useCaptureGroups || !source) return raw;
  const slash = source.match(/^\/(.*)\/([gimsuy]*)$/);
  try {
    const re = slash ? new RegExp(slash[1], slash[2].replace(/g/g, "")) : new RegExp(source);
    const m = re.exec(raw);
    if (!m) return raw;
    if (m[1] != null) return m[1];
    return m[0] ?? raw;
  } catch {
    return raw;
  }
}
function isEmptySkipped(value, skipEmpty) {
  if (!skipEmpty) return false;
  if (value === "0") return false;
  return value === "" || value == null;
}
async function executeTextQuery(ctx) {
  assertBoundedHostScope(ctx.query, ctx.scopedVars);
  const hostF = interpolateFilter(ctx.query.host, ctx.scopedVars);
  const groupF = interpolateFilter(ctx.query.group, ctx.scopedVars);
  const hostAll = isMatchAllZabbixFilter(hostF.filter) && !hostF.ids?.length;
  const groupAll = isMatchAllZabbixFilter(groupF.filter) && !groupF.ids?.length;
  let hostids = [];
  let itemGroupids;
  if (!hostAll) {
    const groups = await resolveGroups(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      ctx.signal
    );
    const hosts = await resolveHosts(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      groups.map((g) => String(g.groupid)),
      ctx.signal
    );
    hostids = hosts.map((h2) => String(h2.hostid));
  } else if (!groupAll) {
    const groups = await resolveGroups(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      ctx.signal
    );
    if (groups.length) itemGroupids = groups.map((g) => String(g.groupid));
  }
  const apps = await resolveApplications(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    hostids,
    ctx.signal
  );
  let items = await resolveItems(
    ctx.api,
    ctx.query,
    ctx.scopedVars,
    hostids,
    apps.map((a) => String(a.applicationid || a)),
    ctx.signal,
    itemGroupids
  );
  items = items.filter((i) => ["1", "2", "4"].includes(String(i.value_type)));
  const from = Math.floor(
    (ctx.range.from instanceof Date ? ctx.range.from.getTime() : Number(ctx.range.from)) / 1e3
  );
  const to = Math.floor(
    (ctx.range.to instanceof Date ? ctx.range.to.getTime() : Number(ctx.range.to)) / 1e3
  );
  const textFilter = String(ctx.query.textFilter || "");
  const skipEmpty = Boolean(ctx.query.options?.skipEmptyValues);
  const filter2 = compileTextFilter(textFilter);
  const times = [];
  const values = [];
  const hostCol = [];
  const itemCol = [];
  const itemIdCol = [];
  const valueTypeCol = [];
  const nsCol = [];
  const timestampCol = [];
  const sourceCol = [];
  const severityCol = [];
  const logeventidCol = [];
  const eventIdCol = [];
  for (const item of items) {
    const history = Number(item.value_type);
    const rows = await ctx.api.getHistory(
      [item.itemid],
      history,
      from,
      to,
      ctx.signal
    );
    for (const row of rows) {
      const rawValue = row.value == null ? "" : String(row.value);
      if (isEmptySkipped(rawValue, skipEmpty)) continue;
      if (!filter2.match(rawValue)) continue;
      const value = extractText(
        rawValue,
        textFilter,
        Boolean(ctx.query.useCaptureGroups)
      );
      const ns = row.ns == null ? null : String(row.ns);
      const nsNum = Number(row.ns || 0);
      times.push(Number(row.clock) * 1e3 + Math.floor(nsNum / 1e6));
      values.push(value);
      hostCol.push(item.hosts?.[0]?.name || item.hosts?.[0]?.host || "");
      itemCol.push(item.name);
      itemIdCol.push(item.itemid);
      valueTypeCol.push(String(item.value_type));
      nsCol.push(ns);
      if (String(item.value_type) === "2") {
        timestampCol.push(row.timestamp == null ? null : String(row.timestamp));
        sourceCol.push(row.source == null ? null : String(row.source));
        severityCol.push(row.severity == null ? null : String(row.severity));
        const logeventid = row.logeventid == null ? null : String(row.logeventid);
        logeventidCol.push(logeventid);
        eventIdCol.push(logeventid);
      } else {
        timestampCol.push(null);
        sourceCol.push(null);
        severityCol.push(null);
        logeventidCol.push(null);
        eventIdCol.push(null);
      }
    }
  }
  const order = times.map((_, i) => i).sort((a, b) => times[a] - times[b]);
  const pick = (arr) => order.map((i) => arr[i]);
  if (ctx.query.resultFormat === "table") {
    const lastByItem = /* @__PURE__ */ new Map();
    for (let i = 0; i < itemIdCol.length; i++) {
      lastByItem.set(itemIdCol[i], {
        host: hostCol[i],
        item: itemCol[i],
        key: String(
          items.find((it) => it.itemid === itemIdCol[i])?.key_ || ""
        ),
        value: values[i]
      });
    }
    const rows = [...lastByItem.values()];
    return [
      createDataFrame({
        refId: ctx.query.refId,
        fields: [
          { name: "Host", type: "string", values: rows.map((r) => r.host) },
          { name: "Item", type: "string", values: rows.map((r) => r.item) },
          { name: "Key", type: "string", values: rows.map((r) => r.key) },
          {
            name: "Last value",
            type: "string",
            values: rows.map((r) => r.value)
          }
        ]
      })
    ];
  }
  return [
    createDataFrame({
      refId: ctx.query.refId,
      fields: [
        { name: "Time", type: "time", values: pick(times) },
        { name: "Value", type: "string", values: pick(values) },
        { name: "Host", type: "string", values: pick(hostCol) },
        { name: "Item", type: "string", values: pick(itemCol) },
        { name: "ItemId", type: "string", values: pick(itemIdCol) },
        { name: "value_type", type: "string", values: pick(valueTypeCol) },
        { name: "ns", type: "string", values: pick(nsCol) },
        { name: "timestamp", type: "string", values: pick(timestampCol) },
        { name: "source", type: "string", values: pick(sourceCol) },
        { name: "severity", type: "string", values: pick(severityCol) },
        { name: "logeventid", type: "string", values: pick(logeventidCol) },
        { name: "EventId", type: "string", values: pick(eventIdCol) }
      ]
    })
  ];
}
function buildTriggerGetParams(ctx, groupids, hostids) {
  const opts = ctx.query.options || {};
  const nested = ctx.query.triggers || {
    minSeverity: 0,
    acknowledged: 2,
    count: false
  };
  const params = {
    // Slim payload: full selectHosts/Items/LastEvent extend freezes table panels on large fleets
    output: [
      "triggerid",
      "description",
      "priority",
      "lastchange",
      "value",
      "status",
      "state",
      "comments",
      "expression",
      "manual_close"
    ],
    selectHosts: ["hostid", "name"],
    selectTags: "extend",
    expandDescription: true,
    monitored: true,
    skipDependent: true,
    limit: 200
  };
  if (groupids.length) params.groupids = groupids;
  if (hostids.length) params.hostids = hostids;
  const show = ctx.query.showProblems || "problems";
  if (show === "problems")
    params.filter = { ...params.filter, value: 1 };
  else if (show === "recent" || show === "history")
    params.filter = { ...params.filter, value: [0, 1] };
  const minSeverity = opts.minSeverity ?? nested.minSeverity;
  if (minSeverity != null && Number(minSeverity) > 0) {
    params.min_severity = Number(minSeverity);
  }
  const ack = opts.acknowledged ?? nested.acknowledged;
  if (ack === 0 || ack === 1) {
    params.withLastEventUnacknowledged = ack === 0;
    params.only_true = true;
  }
  if (opts.hostsInMaintenance === false) params.maintenance = false;
  if (opts.useTimeRange) {
    params.lastChangeSince = Math.floor(
      (ctx.range.from instanceof Date ? ctx.range.from.getTime() : Number(ctx.range.from)) / 1e3
    );
    params.lastChangeTill = Math.floor(
      (ctx.range.to instanceof Date ? ctx.range.to.getTime() : Number(ctx.range.to)) / 1e3
    );
  }
  const triggerFilter = interpolateFilter(ctx.query.trigger, ctx.scopedVars);
  if (triggerFilter.filter)
    params.search = { description: triggerFilter.filter };
  if (triggerFilter.ids?.length) params.triggerids = triggerFilter.ids;
  const tagsFilter = interpolateZabbixValue(
    String(ctx.query.tags?.filter || ""),
    ctx.scopedVars
  );
  if (tagsFilter) {
    params.tags = tagsFilter.split(",").map((part) => {
      const [tag, ...rest] = part.split(":");
      return { tag: tag.trim(), value: rest.join(":").trim(), operator: 0 };
    });
    params.evaltype = ctx.query.evaltype === "2" ? 2 : 0;
  }
  const limit = Number(opts.limit ?? 100);
  if (Number.isFinite(limit) && limit > 0)
    params.limit = Math.min(1001, Math.floor(limit));
  let countMode = "";
  if (ctx.query.countTriggersBy === "items" || ctx.query.countTriggersBy === "problems") {
    countMode = ctx.query.countTriggersBy;
    params.countOutput = true;
  } else if (opts.count || nested.count) {
    countMode = "problems";
    params.countOutput = true;
  }
  return { params, countMode };
}
async function executeTriggersQuery(ctx) {
  assertBoundedHostScope(ctx.query, ctx.scopedVars);
  const hostF = interpolateFilter(ctx.query.host, ctx.scopedVars);
  const groupF = interpolateFilter(ctx.query.group, ctx.scopedVars);
  const groupAll = isMatchAllZabbixFilter(groupF.filter) && !groupF.ids?.length;
  const hostAll = isMatchAllZabbixFilter(hostF.filter) && !hostF.ids?.length;
  const groups = groupAll ? [] : await resolveGroups(ctx.api, ctx.query, ctx.scopedVars, ctx.signal);
  let hostids = [];
  if (!hostAll) {
    const hosts = await resolveHosts(
      ctx.api,
      ctx.query,
      ctx.scopedVars,
      groups.map((g) => g.groupid),
      ctx.signal
    );
    hostids = hosts.map((h2) => String(h2.hostid));
  }
  const { params, countMode } = buildTriggerGetParams(
    ctx,
    groups.map((g) => g.groupid),
    hostids
  );
  if (countMode === "items" || ctx.query.countTriggersBy === "items") {
    try {
      const itemGroupids = hostAll && !groupAll && groups.length ? groups.map((g) => String(g.groupid)) : void 0;
      const items = await resolveItems(
        ctx.api,
        ctx.query,
        ctx.scopedVars,
        hostids,
        [],
        ctx.signal,
        itemGroupids
      );
      const itemids = items.map((i) => String(i.itemid)).filter(Boolean);
      if (itemids.length) params.itemids = itemids;
    } catch {
    }
  }
  const result = await ctx.api.getTriggers(params, ctx.signal);
  if (countMode) {
    const count = typeof result === "number" ? result : Array.isArray(result) ? result.length : Number(result?.rows?.length ?? 0);
    return [
      createDataFrame({
        refId: ctx.query.refId,
        fields: [
          { name: "Time", type: "time", values: [Date.now()] },
          {
            name: "Value",
            type: "number",
            values: [count],
            labels: { countBy: countMode }
          }
        ]
      })
    ];
  }
  const list = Array.isArray(result) ? result : result?.rows || [];
  return [
    createDataFrame({
      refId: ctx.query.refId,
      meta: {
        source: "live",
        datasourceUid: ctx.instance.uid,
        truncated: Boolean(result?.truncated)
      },
      fields: [
        {
          name: "triggerid",
          type: "string",
          values: list.map((r) => String(r.triggerid ?? ""))
        },
        {
          name: "description",
          type: "string",
          values: list.map((r) => String(r.description ?? ""))
        },
        {
          name: "priority",
          type: "number",
          values: list.map((r) => Number(r.priority ?? 0))
        },
        {
          name: "lastchange",
          type: "time",
          values: list.map((r) => Number(r.lastchange || 0) * 1e3)
        },
        {
          name: "value",
          type: "string",
          values: list.map((r) => String(r.value ?? ""))
        },
        {
          name: "status",
          type: "string",
          values: list.map((r) => String(r.status ?? ""))
        },
        {
          name: "state",
          type: "string",
          values: list.map((r) => String(r.state ?? ""))
        },
        {
          name: "comments",
          type: "string",
          values: list.map((r) => String(r.comments ?? ""))
        },
        {
          name: "expression",
          type: "string",
          values: list.map((r) => String(r.expression ?? ""))
        },
        {
          name: "manual_close",
          type: "string",
          values: list.map((r) => String(r.manual_close ?? ""))
        },
        {
          name: "hosts",
          type: "string",
          values: list.map(
            (r) => (Array.isArray(r.hosts) ? r.hosts : []).map((h2) => String(h2?.name || h2?.host || h2?.hostid || "")).filter(Boolean).join(", ")
          )
        },
        {
          name: "groups",
          type: "string",
          values: list.map(
            (r) => (Array.isArray(r.groups) ? r.groups : Array.isArray(r.hostgroups) ? r.hostgroups : []).map((g) => String(g?.name || g?.groupid || "")).filter(Boolean).join(", ")
          )
        },
        {
          name: "items",
          type: "string",
          values: list.map(
            (r) => (Array.isArray(r.items) ? r.items : []).map((i) => String(i?.name || i?.key_ || i?.itemid || "")).filter(Boolean).slice(0, 5).join(", ")
          )
        },
        {
          name: "tags",
          type: "string",
          values: list.map(
            (r) => (Array.isArray(r.tags) ? r.tags : []).map(
              (tg) => `${tg?.tag ?? ""}${tg?.value != null && tg?.value !== "" ? ":" + tg.value : ""}`
            ).filter(Boolean).slice(0, 10).join(", ")
          )
        },
        {
          name: "lastEvent",
          type: "string",
          values: list.map((r) => {
            const e = r.lastEvent || {};
            if (!e || typeof e !== "object") return "";
            return String(e.eventid || e.clock || "");
          })
        }
      ]
    })
  ];
}
async function executeZabbixQuery(ctx) {
  const queryType = normalizeZabbixQueryType(
    ctx.query.queryType
  );
  if ((queryType === "0" || queryType === "3") && ctx.settings.dbConnectionEnable) {
    try {
      const direct = await executeDirectDbQuery(ctx);
      if (direct) return direct;
    } catch (e) {
      throw e instanceof DataSourceError ? e : new DataSourceError(
        "INVALID_QUERY",
        e instanceof Error ? e.message : String(e)
      );
    }
  }
  switch (queryType) {
    case "0":
      return executeMetricsQuery(ctx);
    case "1":
      return executeServicesQuery(ctx);
    case "2":
      return executeTextQuery(ctx);
    case "3":
      return executeItemIdQuery(ctx);
    case "4":
      return executeTriggersQuery(ctx);
    case "5":
      return executeProblemsQuery(ctx);
    case "6":
      return executeMacrosQuery(ctx);
    default: {
      const _exhaustive = queryType;
      throw new DataSourceError(
        "INVALID_QUERY",
        `未知 queryType: ${String(_exhaustive)}`
      );
    }
  }
}
async function runTargetPool(tasks, options) {
  const concurrency = Math.max(1, Math.floor(options.concurrency || 1));
  const results = /* @__PURE__ */ new Map();
  let next = 0;
  let running = 0;
  let rejected = null;
  if (options.signal?.aborted) {
    throw new DOMException("Aborted", "AbortError");
  }
  return new Promise((resolve, reject) => {
    const onAbort = () => {
      rejected = new DOMException("Aborted", "AbortError");
      finishIfDone();
    };
    options.signal?.addEventListener("abort", onAbort, { once: true });
    function finishIfDone() {
      if (rejected) {
        options.signal?.removeEventListener("abort", onAbort);
        reject(rejected);
        return;
      }
      if (running === 0 && next >= tasks.length) {
        options.signal?.removeEventListener("abort", onAbort);
        resolve(
          tasks.map((t2) => ({
            refId: t2.refId,
            value: results.get(t2.refId)
          }))
        );
      }
    }
    function pump() {
      if (rejected) {
        finishIfDone();
        return;
      }
      while (running < concurrency && next < tasks.length) {
        const idx = next++;
        const task = tasks[idx];
        running += 1;
        void task.run().then((value) => {
          if (rejected) return;
          results.set(task.refId, value);
          try {
            options.onPartial?.(task.refId, value);
          } catch {
          }
        }).catch((err) => {
          if (!rejected) rejected = err;
        }).finally(() => {
          running -= 1;
          if (rejected) {
            finishIfDone();
          } else {
            pump();
            finishIfDone();
          }
        });
      }
      finishIfDone();
    }
    if (!tasks.length) {
      resolve([]);
      return;
    }
    pump();
  });
}
function parseZabbixVariableQuery(query) {
  const t2 = String(query || "").trim();
  if (/^hostgroup(\.get)?$/i.test(t2)) return { queryType: "group" };
  if (/^host(\.get)?$/i.test(t2) && !/^hostgroup/i.test(t2))
    return { queryType: "host" };
  if (/^item(\.get)?$/i.test(t2)) return { queryType: "item" };
  if (/^application(\.get)?$/i.test(t2)) return { queryType: "application" };
  if (/^proxy(\.get)?$/i.test(t2)) return { queryType: "proxy" };
  if (/^service(\.get)?$/i.test(t2)) return { queryType: "service" };
  if (/^sla(\.get)?$/i.test(t2)) return { queryType: "sla" };
  if (/^trigger(\.get)?$/i.test(t2)) return { queryType: "trigger" };
  if (/^usermacro(\.get)?$/i.test(t2) || /^macro$/i.test(t2))
    return { queryType: "macro" };
  if (t2.startsWith("{") && t2.endsWith("}")) {
    try {
      return JSON.parse(t2);
    } catch {
    }
  }
  const [kind2, ...rest] = t2.split(":");
  if (kind2 === "group") return { queryType: "group", filter: rest.join(":") };
  if (kind2 === "host")
    return {
      queryType: "host",
      group: rest[0],
      filter: rest.slice(1).join(":")
    };
  if (kind2 === "application")
    return {
      queryType: "application",
      group: rest[0],
      host: rest[1],
      filter: rest.slice(2).join(":")
    };
  if (kind2 === "item")
    return {
      queryType: "item",
      group: rest[0],
      host: rest[1],
      filter: rest.slice(2).join(":")
    };
  if (kind2 === "itemTag")
    return { queryType: "itemTag", filter: rest.join(":") };
  if (kind2 === "macro") return { queryType: "macro", filter: rest.join(":") };
  if (kind2 === "proxy") return { queryType: "proxy", filter: rest.join(":") };
  if (kind2 === "service")
    return { queryType: "service", filter: rest.join(":") };
  if (kind2 === "sla") return { queryType: "sla", filter: rest.join(":") };
  if (kind2 === "trigger")
    return { queryType: "trigger", filter: rest.join(":") };
  if (kind2 === "itemValues")
    return {
      queryType: "itemValues",
      item: rest[0],
      filter: rest.slice(1).join(":")
    };
  if (kind2 === "lldRule" || kind2 === "discoveryRule")
    return {
      queryType: "lldRule",
      host: rest[0],
      filter: rest.slice(1).join(":")
    };
  if (kind2 === "itemPrototype" || kind2 === "prototype")
    return {
      queryType: "itemPrototype",
      item: rest[0],
      filter: rest.slice(1).join(":")
    };
  return { queryType: "group", filter: t2 };
}
function splitTemplateQuery(query) {
  const t2 = String(query || "").trim();
  if (!t2) return [];
  const braced = t2.match(/\{[^}]*\}/g);
  if (braced?.length) return braced.map((s) => s.slice(1, -1));
  if (t2.includes(".") && !t2.includes(":") && !t2.startsWith("/")) {
    return t2.split(".");
  }
  return [t2];
}
function parseLegacyVariableQuery(query) {
  const raw = String(query || "").trim();
  if (!raw) return { queryType: "group", filter: "" };
  if (raw.startsWith("{") && raw.endsWith("}") && raw.includes("queryType")) {
    try {
      return JSON.parse(raw);
    } catch {
    }
  }
  const isBrace = /\{[^}]+\}/.test(raw);
  const isDotted = !isBrace && raw.includes(".") && !raw.includes(":") && !/^hostgroup|^host\.|^item/i.test(raw);
  if (!isBrace && !isDotted) {
    return parseZabbixVariableQuery(raw);
  }
  const parts = splitTemplateQuery(raw).map((p) => p === "*" ? "/.*/" : p);
  if (parts.length >= 4) {
    return {
      queryType: "item",
      group: parts[0] || "/.*/",
      host: parts[1] || "/.*/",
      application: parts[2] || "/.*/",
      filter: parts[3] || "/.*/",
      legacy: true,
      legacyRaw: raw
    };
  }
  if (parts.length === 3) {
    return {
      queryType: "application",
      group: parts[0] || "/.*/",
      host: parts[1] || "/.*/",
      filter: parts[2] || "/.*/",
      legacy: true,
      legacyRaw: raw
    };
  }
  if (parts.length === 2) {
    return {
      queryType: "host",
      group: parts[0] || "/.*/",
      filter: parts[1] || "/.*/",
      legacy: true,
      legacyRaw: raw
    };
  }
  return {
    queryType: "group",
    filter: parts[0] || "/.*/",
    legacy: true,
    legacyRaw: raw
  };
}
function rowsOf(page) {
  if (Array.isArray(page)) return page;
  return page?.rows || [];
}
async function executeZabbixVariableQuery(api, query, scopedVars = {}, signal) {
  const classicMethod = typeof query === "string" && /\.get$/i.test(String(query).trim());
  const q = typeof query === "string" ? parseZabbixVariableQuery(query) : query;
  const preferId = classicMethod || Boolean(q.preferId);
  const base = { ...DEFAULT_ZABBIX_QUERY };
  const filter2 = interpolateZabbixValue(q.filter || "", scopedVars);
  if (q.queryType === "group") {
    base.group = { filter: filter2 };
    const rows = await resolveGroups(api, base, scopedVars, signal);
    return rows.map((r) => ({
      text: r.name,
      value: preferId ? String(r.groupid ?? r.name) : String(r.name),
      id: r.groupid
    }));
  }
  if (q.queryType === "host") {
    base.group = { filter: interpolateZabbixValue(q.group || "", scopedVars) };
    base.host = { filter: filter2 };
    const groups = await resolveGroups(api, base, scopedVars, signal);
    const hosts = await resolveHosts(
      api,
      base,
      scopedVars,
      groups.map((g) => g.groupid),
      signal
    );
    return hosts.map((h2) => ({
      text: String(h2.name || h2.host),
      value: preferId ? String(h2.hostid ?? h2.name ?? h2.host) : String(h2.name || h2.host),
      id: String(h2.hostid)
    }));
  }
  if (q.queryType === "application") {
    base.group = { filter: interpolateZabbixValue(q.group || "", scopedVars) };
    base.host = { filter: interpolateZabbixValue(q.host || "", scopedVars) };
    base.application = { filter: filter2 };
    const groups = await resolveGroups(api, base, scopedVars, signal);
    const hosts = await resolveHosts(
      api,
      base,
      scopedVars,
      groups.map((g) => g.groupid),
      signal
    );
    const appsPage = await api.getApplications(
      hosts.map((h2) => String(h2.hostid)),
      base.application.filter,
      signal
    );
    return rowsOf(appsPage).filter(
      (a) => matchesZabbixFilter(String(a.name || ""), base.application.filter)
    ).map((a) => ({
      text: String(a.name),
      value: String(a.name),
      id: String(a.applicationid)
    }));
  }
  if (q.queryType === "item" || q.queryType === "itemTag" || q.queryType === "hostTag") {
    base.group = { filter: interpolateZabbixValue(q.group || "", scopedVars) };
    base.host = { filter: interpolateZabbixValue(q.host || "", scopedVars) };
    base.application = {
      filter: interpolateZabbixValue(q.application || "", scopedVars)
    };
    base.item = { filter: q.queryType === "item" ? filter2 : "" };
    if (q.showDisabled)
      base.options = { ...base.options, showDisabledItems: true };
    const groups = await resolveGroups(api, base, scopedVars, signal);
    const hosts = await resolveHosts(
      api,
      base,
      scopedVars,
      groups.map((g) => g.groupid),
      signal
    );
    const items = await resolveItems(
      api,
      base,
      scopedVars,
      hosts.map((h2) => String(h2.hostid)),
      [],
      signal
    );
    if (q.queryType === "itemTag" || q.queryType === "hostTag") {
      const seen = /* @__PURE__ */ new Set();
      const out = [];
      for (const it of items) {
        for (const tag of it.tags || []) {
          const pair = `${tag.tag}:${tag.value ?? ""}`;
          if (seen.has(pair)) continue;
          if (filter2 && !matchesZabbixFilter(pair, filter2) && !matchesZabbixFilter(tag.tag, filter2))
            continue;
          seen.add(pair);
          out.push({ text: pair, value: pair, id: pair });
        }
      }
      return out;
    }
    return items.map((i) => ({
      text: String(i.name),
      value: preferId ? String(i.itemid) : String(i.name),
      id: String(i.itemid)
    }));
  }
  if (q.queryType === "macro") {
    base.group = { filter: interpolateZabbixValue(q.group || "", scopedVars) };
    base.host = { filter: interpolateZabbixValue(q.host || "", scopedVars) };
    const groups = await resolveGroups(api, base, scopedVars, signal);
    const hosts = await resolveHosts(
      api,
      base,
      scopedVars,
      groups.map((g) => g.groupid),
      signal
    );
    const page = await api.getMacros(
      hosts.map((h2) => String(h2.hostid)),
      filter2,
      signal
    );
    return rowsOf(page).filter(
      (m) => !filter2 || matchesZabbixFilter(String(m.macro || ""), filter2)
    ).map((m) => {
      const masked = maskMacroValue(m);
      return {
        text: String(m.macro),
        // never expose secret values as selectable value
        value: masked.secret ? String(m.macro) : String(m.macro),
        id: String(m.hostmacroid || m.globalmacroid || m.macro)
      };
    });
  }
  if (q.queryType === "proxy") {
    const page = await api.getProxies(filter2, signal);
    return rowsOf(page).filter(
      (p) => !filter2 || matchesZabbixFilter(String(p.name || p.host || ""), filter2)
    ).map((p) => {
      const name = String(p.name || p.host || p.proxyid);
      return {
        text: name,
        value: preferId ? String(p.proxyid) : name,
        id: String(p.proxyid)
      };
    });
  }
  if (q.queryType === "service") {
    const page = await api.getServices(signal);
    return rowsOf(page).filter(
      (s) => !filter2 || matchesZabbixFilter(String(s.name || ""), filter2)
    ).map((s) => ({
      text: String(s.name),
      value: preferId ? String(s.serviceid) : String(s.name),
      id: String(s.serviceid)
    }));
  }
  if (q.queryType === "sla") {
    const page = await api.getSlas(q.serviceids || [], filter2, signal);
    return rowsOf(page).filter(
      (s) => !filter2 || matchesZabbixFilter(String(s.name || s.slaid || ""), filter2)
    ).map((s) => ({
      text: String(s.name || s.slaid),
      value: preferId ? String(s.slaid) : String(s.name || s.slaid),
      id: String(s.slaid)
    }));
  }
  if (q.queryType === "trigger") {
    base.group = { filter: interpolateZabbixValue(q.group || "", scopedVars) };
    base.host = { filter: interpolateZabbixValue(q.host || "", scopedVars) };
    const groups = await resolveGroups(api, base, scopedVars, signal);
    const hosts = await resolveHosts(
      api,
      base,
      scopedVars,
      groups.map((g) => g.groupid),
      signal
    );
    const result = await api.getTriggers(
      {
        hostids: hosts.map((h2) => String(h2.hostid)),
        groupids: groups.map((g) => g.groupid),
        search: filter2 ? { description: filter2 } : void 0,
        output: ["triggerid", "description"]
      },
      signal
    );
    const rows = typeof result === "number" ? [] : Array.isArray(result) ? result : result.rows || [];
    return rows.map((t2) => ({
      text: String(t2.description || t2.triggerid),
      value: preferId ? String(t2.triggerid) : String(t2.description || t2.triggerid),
      id: String(t2.triggerid)
    }));
  }
  if (q.queryType === "itemValues") {
    const itemids = String(q.item || "").split(",").map((s) => s.trim()).filter(Boolean);
    if (!itemids.length) return [];
    const items = await api.getItemsByIds(itemids, signal);
    const limit = Math.min(1e3, Math.max(1, Number(q.limit) || 100));
    const to = Number(q.to) || Math.floor(Date.now() / 1e3);
    const from = Number(q.from) || to - 3600;
    const out = [];
    const seen = /* @__PURE__ */ new Set();
    for (const item of items) {
      const hist = await api.getHistory(
        [item.itemid],
        Number(item.value_type || 0),
        from,
        to,
        signal,
        limit
      );
      for (const p of hist || []) {
        const raw = p.value == null ? "" : String(p.value);
        const key = `${item.itemid}:${p.clock}:${p.ns ?? "0"}`;
        if (seen.has(raw) && raw !== "0") {
          continue;
        }
        if (seen.has(raw) && raw === "0") {
          if (out.some((o) => o.value === "0")) continue;
        }
        if (raw !== "0") seen.add(raw);
        else seen.add("0");
        if (filter2 && !matchesZabbixFilter(raw, filter2)) continue;
        out.push({
          text: raw,
          value: raw,
          id: key
        });
        if (out.length >= limit) break;
      }
      if (out.length >= limit) break;
    }
    return out;
  }
  if (q.queryType === "lldRule") {
    base.group = { filter: interpolateZabbixValue(q.group || "", scopedVars) };
    base.host = { filter: interpolateZabbixValue(q.host || "", scopedVars) };
    const groups = await resolveGroups(api, base, scopedVars, signal);
    const hosts = await resolveHosts(
      api,
      base,
      scopedVars,
      groups.map((g) => g.groupid),
      signal
    );
    const page = await api.getDiscoveryRules(
      hosts.map((h2) => String(h2.hostid)),
      signal
    );
    return rowsOf(page).filter(
      (r) => !filter2 || matchesZabbixFilter(String(r.name || r.key_ || ""), filter2)
    ).map((r) => ({
      text: String(r.name || r.key_),
      value: preferId ? String(r.itemid) : String(r.name || r.key_),
      id: String(r.itemid)
    }));
  }
  if (q.queryType === "itemPrototype") {
    const ruleId = interpolateZabbixValue(q.item || q.ruleId || "", scopedVars);
    if (!ruleId) return [];
    const page = await api.getItemPrototypes(ruleId, signal);
    return rowsOf(page).filter(
      (r) => !filter2 || matchesZabbixFilter(String(r.name || r.key_ || ""), filter2)
    ).map((r) => ({
      text: String(r.name || r.key_),
      value: preferId ? String(r.itemid) : String(r.key_ || r.name),
      id: String(r.itemid)
    }));
  }
  return [];
}
const ZABBIX_CAPABILITIES = {
  signals: ["metrics"],
  query: true,
  health: true,
  metadata: true,
  variables: true,
  annotations: true,
  exemplars: false,
  streaming: false,
  queryLanguages: ["zabbix-json-rpc"]
};
const metadataCache = new ZabbixMetadataCache();
function mergeSignals(a, b) {
  if (!a) return b;
  if (!b) return a;
  if (typeof AbortSignal !== "undefined" && "any" in AbortSignal && typeof AbortSignal.any === "function") {
    return AbortSignal.any([a, b]);
  }
  const c = new AbortController();
  const abort = () => c.abort();
  a.addEventListener("abort", abort);
  b.addEventListener("abort", abort);
  return c.signal;
}
function createZabbixDataSource(instance, meta2) {
  const settingsResult = migrateZabbixConfig(
    instance.jsonData || {}
  );
  const settings = settingsResult.options;
  const url = String(
    instance.url || getRuntimeDataSourceSettings(instance.uid)?.url || ""
  ).replace(/\/$/, "");
  const dataMode = settings.dataMode === "fixture" ? "fixture" : "live";
  const useFixture = dataMode === "fixture";
  const transport = useFixture ? new OfflineZabbixTransport("default") : new ZabbixRpcClient({
    url,
    uid: instance.uid,
    timeoutMs: settings.timeout || 3e4,
    // allow network even when dashboard CRUD is offline
    forceNetwork: true
  });
  if (!useFixture && transport instanceof ZabbixRpcClient) {
    transport.setAuthPlacementOverride(
      settings.authPlacement || "auto"
    );
  }
  const api = new ZabbixApi({
    transport,
    uid: instance.uid,
    cache: metadataCache,
    metadataTtlMs: parseCacheTtlMs$1(settings.cacheTTL),
    metadataPageLimit: Number(settings.metadataPageLimit) || 1e3
  });
  function buildContext(query2, range, request, signal) {
    return {
      api,
      instance,
      settings,
      query: query2,
      range,
      maxDataPoints: request.maxDataPoints || 1e3,
      intervalMs: request.intervalMs || 1e3,
      scopedVars: request.scopedVars || {},
      signal,
      onPartialData: request.onPartialData
    };
  }
  async function query(request, signal) {
    const timeoutMs = settings.queryTimeout || 6e4;
    const timeoutCtrl = new AbortController();
    let timedOut = false;
    const timer = setTimeout(() => {
      timedOut = true;
      timeoutCtrl.abort();
    }, timeoutMs);
    const merged = mergeSignals(signal, timeoutCtrl.signal);
    try {
      const tasks = (request.targets || []).filter((target) => !target.hide).map((target) => {
        const migrated = migrateZabbixQuery(target);
        if (target.useTrends != null && migrated.options) {
          migrated.options.useTrends = String(
            target.useTrends
          );
        }
        return {
          refId: String(migrated.refId || "A"),
          run: async () => {
            try {
              const part = await executeZabbixQuery(
                buildContext(migrated, request.range, request, merged)
              );
              return normalizeDataFrames(part, {
                refId: migrated.refId,
                source: "zabbix",
                datasourceUid: instance.uid,
                signal: "metrics",
                requestId: request.requestId
              });
            } catch (e) {
              if (timedOut) {
                throw new DataSourceError(
                  "TIMEOUT",
                  `数据源请求在 ${timeoutMs}ms 后超时`
                );
              }
              throw withDataSourceContext(e, {
                uid: instance.uid,
                refId: migrated.refId
              });
            }
          }
        };
      });
      const concurrency = Math.min(
        4,
        Math.max(1, Number(settings.historyConcurrency ?? 2) || 2)
      );
      const settled = await runTargetPool(tasks, {
        concurrency,
        signal: merged,
        onPartial: (refId, value) => {
          try {
            request.onPartialData?.(value);
          } catch {
          }
          void refId;
        }
      });
      const frames = [];
      for (const item of settled) {
        frames.push(...item.value || []);
      }
      return { data: frames };
    } catch (e) {
      if (timedOut)
        throw new DataSourceError(
          "TIMEOUT",
          `数据源请求在 ${timeoutMs}ms 后超时`
        );
      if (e instanceof DataSourceError) throw e;
      throw withDataSourceContext(e, { uid: instance.uid });
    } finally {
      clearTimeout(timer);
    }
  }
  async function listHostGroups(filter2 = "") {
    const groups = await resolveGroups(
      api,
      migrateZabbixQuery({ group: { filter: filter2 } }),
      {},
      void 0
    );
    return groups.map((g) => ({ text: g.name, value: g.name, id: g.groupid }));
  }
  async function listHosts(groupFilter = "") {
    const q = migrateZabbixQuery({
      group: { filter: groupFilter },
      host: { filter: "" }
    });
    const groups = await resolveGroups(api, q, {});
    const hosts = await resolveHosts(
      api,
      q,
      {},
      groups.map((g) => g.groupid)
    );
    return hosts.map((h2) => ({
      text: String(h2.name || h2.host),
      value: String(h2.name || h2.host),
      id: String(h2.hostid)
    }));
  }
  async function listItems(hostFilter = "") {
    const q = migrateZabbixQuery({
      host: { filter: hostFilter },
      item: { filter: "" }
    });
    const hosts = await resolveHosts(api, q, {}, []);
    const hostids = hosts.map((h2) => String(h2.hostid));
    const items = await resolveItems(api, q, {}, hostids, []);
    return items.map((i) => ({ text: i.name, value: i.name, id: i.itemid }));
  }
  async function testDatasource(signal) {
    if (useFixture) {
      return { status: "success", message: "Zabbix fixture mode 可用" };
    }
    try {
      const version = await api.version(signal);
      await api.getGroups("", signal);
      const caps2 = api.transport?.getCapabilities?.() || null;
      return {
        status: "success",
        message: `Zabbix ${version} 认证成功`,
        details: {
          version,
          authMode: caps2?.selectedAuthPlacement || caps2?.authCandidates?.[0],
          capabilities: caps2 ? {
            supportsApiToken: caps2.supportsApiToken,
            loginUserField: caps2.loginUserField,
            slaApi: caps2.slaApi,
            triggerHostGroupsField: caps2.triggerHostGroupsField
          } : void 0
        }
      };
    } catch (e) {
      return {
        status: "error",
        message: e?.message || String(e)
      };
    }
  }
  async function metricFindQuery(query2, signal, context) {
    return executeZabbixVariableQuery(
      api,
      query2,
      context?.scopedVars || {},
      signal
    );
  }
  async function annotationQuery(request, signal) {
    return executeAnnotationQuery({
      api,
      range: request.range,
      annotation: request.annotation,
      instance,
      signal
    });
  }
  async function getMetadata(request, signal) {
    const withPage = (base, page) => ({
      ...base,
      complete: page.complete,
      truncated: page.truncated
    });
    switch (request.type) {
      case "groups": {
        const page = await api.getGroups(request.filter, signal);
        return withPage(
          {
            type: "groups",
            values: page.rows.map((g) => ({
              text: String(g.name),
              value: String(g.name),
              id: String(g.groupid)
            }))
          },
          page
        );
      }
      case "hosts": {
        const page = await api.getHosts(
          request.groupids,
          request.filter,
          request.hostTags,
          signal
        );
        return withPage(
          {
            type: "hosts",
            values: page.rows.map((h2) => ({
              text: String(h2.name || h2.host),
              value: String(h2.name || h2.host),
              id: String(h2.hostid)
            }))
          },
          page
        );
      }
      case "applications": {
        const page = await api.getApplications(
          request.hostids,
          request.filter,
          signal
        );
        return withPage(
          {
            type: "applications",
            values: page.rows.map((a) => ({
              text: String(a.name),
              value: String(a.name),
              id: String(a.applicationid)
            }))
          },
          page
        );
      }
      case "items": {
        const page = await api.getItems(
          {
            hostids: request.hostids,
            applicationids: request.applicationids,
            filter: request.filter,
            itemTag: request.itemTag,
            showDisabled: request.showDisabled
          },
          signal
        );
        return withPage(
          {
            type: "items",
            values: page.rows.map((i) => ({
              text: i.name,
              value: i.name,
              id: i.itemid
            }))
          },
          page
        );
      }
      case "discoveryRules": {
        const page = await api.getDiscoveryRules(request.hostids, signal);
        return withPage(
          {
            type: "discoveryRules",
            values: page.rows.map((r) => ({
              text: r.name,
              value: r.itemid,
              id: r.itemid
            }))
          },
          page
        );
      }
      case "itemPrototypes": {
        const page = await api.getItemPrototypes(
          request.discoveryRuleId,
          signal
        );
        return withPage(
          {
            type: "itemPrototypes",
            values: page.rows.map((r) => ({
              text: r.name,
              value: r.key_,
              id: r.itemid
            }))
          },
          page
        );
      }
      case "triggers": {
        const pageOrCount = await api.getTriggers(
          {
            hostids: request.hostids,
            search: request.filter ? { description: request.filter } : void 0,
            output: "extend",
            selectGroups: "extend"
          },
          signal
        );
        const page = typeof pageOrCount === "number" ? { rows: [], complete: true, truncated: false } : pageOrCount;
        return withPage(
          {
            type: "triggers",
            values: page.rows.map((t2) => ({
              text: String(t2.description || t2.triggerid),
              value: String(t2.description || t2.triggerid),
              id: String(t2.triggerid)
            }))
          },
          page
        );
      }
      case "proxies": {
        const page = await api.getProxies(request.filter, signal);
        return withPage(
          {
            type: "proxies",
            values: page.rows.map((p) => {
              const name = String(p.name || p.host || p.proxyid);
              return { text: name, value: name, id: String(p.proxyid) };
            })
          },
          page
        );
      }
      case "services": {
        const page = await api.getServices(signal);
        return withPage(
          {
            type: "services",
            values: page.rows.map((s) => ({
              text: String(s.name),
              value: String(s.name),
              id: String(s.serviceid)
            }))
          },
          page
        );
      }
      case "slas": {
        const page = await api.getSlas(
          request.serviceids,
          request.filter,
          signal
        );
        return withPage(
          {
            type: "slas",
            values: page.rows.map((s) => ({
              text: String(s.name || s.slaid),
              value: String(s.name || s.slaid),
              id: String(s.slaid)
            }))
          },
          page
        );
      }
      case "macros": {
        const page = await api.getMacros(
          request.hostids,
          request.filter,
          signal
        );
        return withPage(
          {
            type: "macros",
            values: page.rows.map((m) => ({
              text: String(m.macro),
              value: String(m.macro),
              id: String(m.hostmacroid || m.macro)
            }))
          },
          page
        );
      }
      case "scripts": {
        const page = await api.getScripts(
          request.hostid,
          request.eventid,
          signal
        );
        return withPage({ type: "scripts", values: page.rows }, page);
      }
      case "problemDetail": {
        const value = await api.getProblemDetail(request.eventid, signal);
        return { type: "problemDetail", value };
      }
      case "actionCapabilities": {
        const user = useFixture ? { type: "3" } : await api.getCurrentUser(signal);
        const readOnly = settings.disableReadOnlyUsersAck && String(user.type) === "1";
        return {
          type: "actionCapabilities",
          value: {
            canAcknowledge: !readOnly,
            canClose: !readOnly,
            canChangeSeverity: !readOnly,
            canExecuteScripts: !readOnly,
            readOnly,
            reason: useFixture ? "fixture preview" : void 0
          }
        };
      }
      default: {
        const _never = request;
        throw new DataSourceError(
          "INVALID_QUERY",
          `未知 metadata 请求: ${JSON.stringify(_never)}`
        );
      }
    }
  }
  function liveWritesAllowed() {
    if (typeof process !== "undefined" && process.env && process.env.ZABBIX_LIVE_WRITES === "1") {
      return true;
    }
    return false;
  }
  async function mutate(request) {
    if (!settings.enableWrites) {
      return {
        status: "blocked",
        message: "数据源未开启 enableWrites"
      };
    }
    if (!useFixture && !liveWritesAllowed()) {
      return {
        status: "blocked",
        message: "未设置 ZABBIX_LIVE_WRITES=1"
      };
    }
    if (request.action === "zabbix.acknowledge") {
      if (useFixture) {
        return {
          status: "success",
          message: "fixture preview",
          data: { eventids: request.payload?.eventids || [], preview: true }
        };
      }
      const data = await api.acknowledgeEvent(
        request.payload || {},
        request.signal
      );
      metadataCache.invalidate(instance.uid, [
        "problem.get",
        "event.get",
        "user.get"
      ]);
      return { status: "success", message: "已确认", data };
    }
    if (request.action === "zabbix.executeScript") {
      const scriptid = String(request.payload?.scriptid ?? "").trim();
      if (!scriptid) {
        return {
          status: "blocked",
          message: "scriptid 必填（禁止默认 scriptid=1）"
        };
      }
      if (useFixture) {
        return {
          status: "success",
          message: "fixture preview",
          data: { response: "fixture preview", preview: true, scriptid }
        };
      }
      const data = await api.executeScript(
        request.payload || {},
        request.signal
      );
      return { status: "success", message: "脚本已执行", data };
    }
    throw new DataSourceError(
      "INVALID_QUERY",
      `不支持的动作: ${request.action}`
    );
  }
  function dispose() {
    metadataCache.clearUid(instance.uid);
  }
  return {
    id: instance.id,
    uid: instance.uid,
    type: instance.type || meta2.id,
    name: instance.name,
    capabilities: ZABBIX_CAPABILITIES,
    /** Surface write flag for panel four-way gate. */
    enableWrites: Boolean(settings.enableWrites),
    query,
    testDatasource,
    metricFindQuery,
    annotationQuery,
    getMetadata,
    mutate,
    dispose,
    // legacy helpers used by editors/tests
    listHostGroups,
    listHosts,
    listItems,
    api
  };
}
const ALLOWED_TAGS = /* @__PURE__ */ new Set([
  "b",
  "i",
  "em",
  "strong",
  "br",
  "p",
  "span",
  "code",
  "pre",
  "ul",
  "ol",
  "li"
]);
function sanitizeProblemHtml(input, allowDangerousHTML) {
  const raw = String(input || "");
  if (!raw) return "";
  let s = raw.replace(/<\s*(script|style)[^>]*>[\s\S]*?<\s*\/\s*\1\s*>/gi, "").replace(/\son\w+\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/gi, "").replace(/javascript:/gi, "");
  if (allowDangerousHTML) return s;
  s = s.replace(/<\/?([a-zA-Z0-9]+)(\s[^>]*)?>/g, (full, tag) => {
    const t2 = String(tag).toLowerCase();
    if (!ALLOWED_TAGS.has(t2)) return "";
    if (full.startsWith("</")) return `</${t2}>`;
    if (t2 === "br") return "<br/>";
    return `<${t2}>`;
  });
  return s;
}
const CURRENT_SCHEMA_VERSION = 8;
const DEFAULT_SEVERITY = [
  { priority: 0, severity: "未分类", color: "rgb(108, 108, 108)", show: true },
  { priority: 1, severity: "信息", color: "rgb(120, 158, 183)", show: true },
  { priority: 2, severity: "警告", color: "rgb(175, 180, 36)", show: true },
  { priority: 3, severity: "一般严重", color: "rgb(255, 137, 30)", show: true },
  { priority: 4, severity: "严重", color: "rgb(255, 101, 72)", show: true },
  { priority: 5, severity: "灾难", color: "rgb(215, 0, 0)", show: true }
];
const DEFAULT_PROBLEMS_OPTIONS = {
  schemaVersion: 8,
  layout: "table",
  hostField: true,
  hostTechNameField: false,
  hostGroups: false,
  hostProxy: false,
  showTags: true,
  statusField: true,
  statusIcon: false,
  severityField: true,
  ackField: true,
  ageField: false,
  opdataField: false,
  descriptionField: true,
  descriptionAtNewLine: false,
  showDatasourceName: false,
  hostsInMaintenance: true,
  showTriggers: "all triggers",
  sortProblems: "lastchange",
  fontSize: "100%",
  pageSize: 10,
  problemTimeline: true,
  highlightBackground: false,
  highlightNewEvents: false,
  highlightNewerThan: "1h",
  customLastChangeFormat: false,
  lastChangeFormat: "",
  resizedColumns: [],
  allowDangerousHTML: false,
  triggerSeverity: DEFAULT_SEVERITY.map((s) => ({ ...s })),
  okEventColor: "rgb(56, 189, 113)",
  ackEventColor: "rgb(56, 219, 156)",
  markAckEvents: false,
  customTagColumns: "",
  allowAcknowledge: false,
  allowUnacknowledge: false,
  allowClose: false,
  allowChangeSeverity: false,
  allowSuppress: false,
  allowUnsuppress: false,
  allowExecuteScripts: false,
  showDetails: true
};
const ZABBIX_PANEL_ID = "alexanderzobnin-zabbix-triggers-panel";
const ZABBIX_DATASOURCE_ID = "alexanderzobnin-zabbix-datasource";
async function registerSigNozPlugin() {
  const [panelMod, dsMod] = await Promise.all([
    Promise.resolve().then(() => module$2),
    Promise.resolve().then(() => module$1)
  ]);
  if (dsMod.plugin) {
    registerDataSourcePlugin(dsMod.plugin);
  }
  if (panelMod.plugin) {
    registerPanelPlugin(panelMod.plugin);
  }
}
const register = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  registerSigNozPlugin
}, Symbol.toStringTag, { value: "Module" }));
const refreshInflight = /* @__PURE__ */ new Map();
function jwtExpiry(token) {
  if (!token) return null;
  try {
    const part = token.split(".")[1];
    if (!part) return null;
    const b64 = part.replace(/-/g, "+").replace(/_/g, "/");
    const padded = b64 + "=".repeat((4 - b64.length % 4) % 4);
    const json = typeof atob === "function" ? atob(padded) : Buffer.from(padded, "base64").toString("utf8");
    const payload = JSON.parse(json);
    return typeof payload.exp === "number" ? payload.exp * 1e3 : null;
  } catch {
    return null;
  }
}
function isHttp401(err) {
  if (!err) return false;
  const e = err;
  if (e?.status === 401 || e?.statusCode === 401) return true;
  if (e?.code === "AUTH_REQUIRED" || e?.code === "AUTH_REJECTED") return true;
  const msg = String(e?.message || e || "");
  return /\b401\b|unauthorized|AUTH_REQUIRED|session expired/i.test(msg);
}
function unwrapData(body) {
  if (!body || typeof body !== "object") return body;
  if (body.data && typeof body.data === "object") return body.data;
  return body;
}
function assertJsonObject(data, label) {
  if (!data || typeof data !== "object" || Array.isArray(data)) {
    throw new DataSourceError(
      "AUTH_REJECTED",
      `${label} returned non-JSON object (possible SPA HTML)`
    );
  }
  const s = JSON.stringify(data).slice(0, 200).toLowerCase();
  if (s.includes("<!doctype") || s.includes("<html")) {
    throw new DataSourceError(
      "AUTH_REJECTED",
      `${label} returned HTML instead of JSON`
    );
  }
  return data;
}
async function loadLatestSessionCredential(uid, fallback) {
  try {
    const latest = asSessionCredential(await getRuntimeCredential(uid));
    if (latest) {
      return {
        ...fallback,
        ...latest,
        kind: "session",
        // Keep password only if rememberPassword (or latest still has it)
        password: latest.password ?? fallback.password,
        email: latest.email ?? fallback.email,
        orgID: latest.orgID ?? fallback.orgID,
        rememberPassword: latest.rememberPassword ?? fallback.rememberPassword
      };
    }
  } catch {
  }
  return fallback;
}
async function refreshSession(ctx, http = datasourceHttp) {
  const existing = refreshInflight.get(ctx.uid);
  if (existing) return existing;
  const promise = doRefreshSession(ctx, http).finally(() => {
    if (refreshInflight.get(ctx.uid) === promise) {
      refreshInflight.delete(ctx.uid);
    }
  });
  refreshInflight.set(ctx.uid, promise);
  return promise;
}
async function doRefreshSession(ctx, http) {
  const c = await loadLatestSessionCredential(ctx.uid, ctx.credential);
  const base = {
    uid: ctx.uid,
    baseUrl: ctx.baseUrl,
    forceNetwork: true,
    signal: ctx.signal
  };
  if (c.refreshToken && c.value) {
    try {
      const r = await http({
        ...base,
        path: "/api/v2/sessions/rotate",
        method: "POST",
        headers: { Authorization: `Bearer ${c.value}` },
        body: { refreshToken: c.refreshToken },
        credential: null
      });
      const body = assertJsonObject(unwrapData(r.data), "sessions/rotate");
      const accessToken2 = String(body.accessToken || body.accessJwt || "");
      const refreshToken2 = String(
        body.refreshToken || body.refreshJwt || c.refreshToken || ""
      );
      if (!accessToken2) {
        throw new DataSourceError(
          "AUTH_REJECTED",
          "sessions/rotate missing accessToken"
        );
      }
      const next2 = {
        ...c,
        kind: "session",
        value: accessToken2,
        refreshToken: refreshToken2
      };
      setRuntimeCredential(ctx.uid, next2);
      return next2;
    } catch {
    }
  }
  if (!c.email || !c.password) {
    throw new DataSourceError("AUTH_REQUIRED", "SigNoz 会话已过期,请重新登录");
  }
  let orgID = c.orgID;
  try {
    const ctxResp = await http({
      ...base,
      method: "GET",
      path: "/api/v2/sessions/context",
      query: { email: c.email, ref: `${ctx.baseUrl.replace(/\/$/, "")}/login` },
      credential: null
    });
    const body = assertJsonObject(unwrapData(ctxResp.data), "sessions/context");
    const orgs = body.orgs || body.organizations || [];
    if (!orgID && orgs[0]) {
      orgID = String(orgs[0].id || orgs[0].orgId || orgs[0].orgID || "");
    }
  } catch {
  }
  if (!orgID) {
    throw new DataSourceError(
      "AUTH_REQUIRED",
      "SigNoz 登录需要 orgID,请在配置中填写 Organization ID 或重新登录"
    );
  }
  const login = await http({
    ...base,
    path: "/api/v2/sessions/email_password",
    method: "POST",
    body: { email: c.email, password: c.password, orgID },
    credential: null
  });
  const loginBody = assertJsonObject(
    unwrapData(login.data),
    "sessions/email_password"
  );
  const accessToken = String(
    loginBody.accessToken || loginBody.accessJwt || ""
  );
  const refreshToken = String(
    loginBody.refreshToken || loginBody.refreshJwt || ""
  );
  if (!accessToken) {
    throw new DataSourceError(
      "AUTH_REJECTED",
      "email_password login missing accessToken"
    );
  }
  const next = {
    kind: "session",
    value: accessToken,
    refreshToken: refreshToken || void 0,
    orgID,
    email: c.email,
    password: c.rememberPassword ? c.password : void 0,
    rememberPassword: c.rememberPassword
  };
  setRuntimeCredential(ctx.uid, next);
  return next;
}
async function withAuthRetry(fn, ctx, http = datasourceHttp) {
  let cred = await loadLatestSessionCredential(ctx.uid, ctx.credential);
  const exp = jwtExpiry(cred.value);
  if (exp && exp - Date.now() < 5 * 6e4) {
    cred = await refreshSession({ ...ctx, credential: cred }, http);
  }
  try {
    return await fn();
  } catch (e) {
    if (!isHttp401(e)) throw e;
    cred = await refreshSession(
      {
        ...ctx,
        credential: await loadLatestSessionCredential(ctx.uid, cred)
      },
      http
    );
    return await fn();
  }
}
function asSessionCredential(cred) {
  if (!cred) return null;
  if (cred.kind === "session") return cred;
  if (cred.kind === "bearer" && cred.refreshToken) {
    return { ...cred, kind: "session" };
  }
  return null;
}
function labelKey(labels) {
  if (!labels || !Object.keys(labels).length) return "";
  const entries = Object.entries(labels).filter(([k]) => k !== "__name__").sort(([a], [b]) => a.localeCompare(b));
  return JSON.stringify(Object.fromEntries(entries));
}
function fieldLabels(field) {
  const raw = field?.labels;
  if (!raw || typeof raw !== "object") return {};
  const out = {};
  for (const [k, v] of Object.entries(raw)) {
    if (k === "__name__") continue;
    out[k] = String(v);
  }
  return out;
}
function frameMetaLabels(frame) {
  const metaLabels = frame.meta?.custom?.labels || frame.meta?.labels;
  if (metaLabels && typeof metaLabels === "object" && !Array.isArray(metaLabels)) {
    const out = {};
    for (const [k, v] of Object.entries(metaLabels)) {
      if (k === "__name__") continue;
      out[k] = String(v);
    }
    return out;
  }
  return {};
}
function seriesFromFrames(input) {
  if (!input) return [];
  const frames = Array.isArray(input) ? input : [input];
  const series = [];
  for (const fr of frames) {
    const times = fr.fields.find((f) => f.type === "time" || f.name === "Time")?.values || [];
    const valueFields = fr.fields.filter(
      (f) => f.type === "number" || f.name !== "Time" && f.type !== "time" && f.type !== "string"
    );
    if (!valueFields.length) continue;
    for (const vf of valueFields) {
      const labels = { ...frameMetaLabels(fr), ...fieldLabels(vf) };
      series.push({
        labels,
        times,
        values: vf.values || []
      });
    }
  }
  return series;
}
function emptyErrorFrame(name, text, code = "FORMULA_ERROR") {
  return createDataFrame({
    refId: name,
    name,
    fields: [
      { name: "Time", type: "time", values: [] },
      { name: "Value", type: "number", values: [] }
    ],
    meta: {
      notices: [{ severity: "error", text: `[${code}] ${text}` }],
      custom: { formulaError: code }
    }
  });
}
function evaluateLocalFormula(expression, framesByName, name) {
  const deps = expression.match(/\b[A-Z][A-Z0-9_]*\b/g) ?? [];
  const uniqueDeps = Array.from(new Set(deps));
  for (const d of uniqueDeps) {
    if (!framesByName.has(d)) {
      return emptyErrorFrame(
        name,
        `公式 ${name} 依赖 ${d} 失败`,
        "FORMULA_MISSING_DEP"
      );
    }
  }
  const byDep = /* @__PURE__ */ new Map();
  let multi = false;
  const firstKeys = [];
  for (const d of uniqueDeps) {
    const series = seriesFromFrames(framesByName.get(d));
    if (!series.length) {
      return emptyErrorFrame(
        name,
        `公式 ${name} 依赖 ${d} 无序列`,
        "FORMULA_EMPTY_SERIES"
      );
    }
    if (series.length > 1) multi = true;
    const keys = series.map((s) => labelKey(s.labels));
    if (!firstKeys.length) firstKeys.push(...keys);
    else if (keys.join("|") !== firstKeys.join("|")) multi = true;
    if (series.some((s) => Object.keys(s.labels).length) && series.length > 1)
      multi = true;
    byDep.set(d, series);
  }
  const allSingle = uniqueDeps.every((d) => (byDep.get(d) || []).length === 1);
  const singleKeys = uniqueDeps.map(
    (d) => labelKey((byDep.get(d) || [])[0]?.labels)
  );
  const sameOrEmpty = new Set(singleKeys).size <= 1;
  if (allSingle && sameOrEmpty && !multi) {
    return evaluateSingleSeries(expression, uniqueDeps, byDep, name);
  }
  if (allSingle && !sameOrEmpty) {
    return emptyErrorFrame(
      name,
      "公式依赖的序列标签不一致，无法配对",
      "FORMULA_LABEL_MISMATCH"
    );
  }
  const keySets = uniqueDeps.map(
    (d) => new Set((byDep.get(d) || []).map((s) => labelKey(s.labels)))
  );
  let intersection = new Set(keySets[0] || []);
  for (let i = 1; i < keySets.length; i++) {
    intersection = new Set([...intersection].filter((k) => keySets[i].has(k)));
  }
  const union = /* @__PURE__ */ new Set();
  for (const s of keySets) for (const k of s) union.add(k);
  const missing = [];
  for (const k of union) {
    if (!intersection.has(k)) missing.push(k || "(empty)");
  }
  if (!intersection.size) {
    return emptyErrorFrame(
      name,
      "公式依赖的序列标签不一致，无法配对",
      "FORMULA_LABEL_MISMATCH"
    );
  }
  const firstDep = uniqueDeps[0];
  const firstSeries = byDep.get(firstDep) || [];
  const matched = [...intersection].sort();
  const fields = [];
  let times = [];
  const notices = [];
  if (missing.length) {
    notices.push({
      severity: "error",
      text: `[FORMULA_LABEL_MISMATCH] 部分标签未在全部依赖中出现: ${missing.slice(0, 5).join(", ")}`
    });
  }
  for (const key of matched) {
    const envSeries = {};
    for (const d of uniqueDeps) {
      const hit = (byDep.get(d) || []).find((s) => labelKey(s.labels) === key);
      if (!hit) {
        return emptyErrorFrame(
          name,
          `标签 ${key || "(empty)"} 缺少依赖 ${d}`,
          "FORMULA_LABEL_MISMATCH"
        );
      }
      envSeries[d] = hit;
    }
    const base = envSeries[firstDep];
    if (!times.length) times = base.times;
    const values = [];
    for (let i = 0; i < times.length; i++) {
      const env = {};
      let ok2 = true;
      for (const d of uniqueDeps) {
        const v = Number(envSeries[d].values[i]);
        if (!Number.isFinite(v)) {
          ok2 = false;
          break;
        }
        env[d] = v;
      }
      if (!ok2) {
        values.push(null);
        continue;
      }
      try {
        values.push(evalArithmetic(expression, env));
      } catch {
        values.push(null);
      }
    }
    const labels = firstSeries.find((s) => labelKey(s.labels) === key)?.labels || {};
    const display = Object.keys(labels).length ? Object.entries(labels).map(([k, v]) => `${k}=${v}`).join(", ") : name;
    fields.push({
      name: matched.length === 1 ? name : display,
      type: "number",
      values,
      labels,
      config: { displayNameFromDS: display }
    });
  }
  return createDataFrame({
    refId: name,
    name,
    fields: [{ name: "Time", type: "time", values: times }, ...fields],
    meta: notices.length ? { notices } : void 0
  });
}
function evaluateSingleSeries(expression, deps, byDep, name) {
  const first = (byDep.get(deps[0] || "") || [])[0];
  const times = first?.times || [];
  const values = [];
  for (let i = 0; i < times.length; i++) {
    const env = {};
    let ok2 = true;
    for (const d of deps) {
      const s = (byDep.get(d) || [])[0];
      const v = Number(s?.values[i]);
      if (!Number.isFinite(v)) {
        ok2 = false;
        break;
      }
      env[d] = v;
    }
    if (!ok2) {
      values.push(null);
      continue;
    }
    try {
      values.push(evalArithmetic(expression, env));
    } catch {
      values.push(null);
    }
  }
  const labels = first?.labels || {};
  return createDataFrame({
    refId: name,
    name,
    fields: [
      { name: "Time", type: "time", values: times },
      {
        name,
        type: "number",
        values,
        labels: Object.keys(labels).length ? labels : void 0
      }
    ]
  });
}
function evalArithmetic(expr, env) {
  const tokens = expr.match(
    /[A-Z][A-Z0-9_]*|\d+(\.\d+)?|<=|>=|==|!=|<|>|[+\-*/()]/g
  );
  if (!tokens) throw new Error("empty");
  let i = 0;
  function peek() {
    return tokens[i];
  }
  function next() {
    return tokens[i++];
  }
  function parseComparison() {
    let v2 = parseExpr();
    while (peek() === "<" || peek() === ">" || peek() === "<=" || peek() === ">=" || peek() === "==" || peek() === "!=") {
      const op = next();
      const r = parseExpr();
      let ok2 = false;
      if (op === "<") ok2 = v2 < r;
      else if (op === ">") ok2 = v2 > r;
      else if (op === "<=") ok2 = v2 <= r;
      else if (op === ">=") ok2 = v2 >= r;
      else if (op === "==") ok2 = v2 === r;
      else if (op === "!=") ok2 = v2 !== r;
      v2 = ok2 ? 1 : 0;
    }
    return v2;
  }
  function parseExpr() {
    let v2 = parseTerm();
    while (peek() === "+" || peek() === "-") {
      const op = next();
      const r = parseTerm();
      v2 = op === "+" ? v2 + r : v2 - r;
    }
    return v2;
  }
  function parseTerm() {
    let v2 = parseFactor();
    while (peek() === "*" || peek() === "/") {
      const op = next();
      const r = parseFactor();
      v2 = op === "*" ? v2 * r : v2 / r;
    }
    return v2;
  }
  function parseFactor() {
    const t2 = next();
    if (t2 === "(") {
      const v2 = parseComparison();
      if (next() !== ")") throw new Error("paren");
      return v2;
    }
    if (t2 === "-") return -parseFactor();
    if (/^\d/.test(t2)) return Number(t2);
    if (env[t2] == null) throw new Error(`unknown ${t2}`);
    return env[t2];
  }
  const v = parseComparison();
  if (i !== tokens.length) throw new Error("trailing");
  return v;
}
function validateFormulaExpression(expression, availableNames, formulaNames = []) {
  const expr = String(expression || "").trim();
  if (!expr) return { ok: false, message: "表达式不能为空" };
  const refs = expr.match(/\b[A-Z][A-Z0-9_]*\b/g) ?? [];
  if (!refs.length) return { ok: false, message: "缺少查询引用" };
  const available = new Set(availableNames);
  for (const r of refs) {
    if (!available.has(r)) return { ok: false, message: `缺少引用 ${r}` };
  }
  const current = formulaNames.length ? formulaNames[formulaNames.length - 1] : "";
  if (current && refs.includes(current)) {
    return { ok: false, message: "循环引用" };
  }
  return { ok: true };
}
function detectFormulaCycle(formulas) {
  const map = new Map(formulas.map((f) => [f.name, f.expression]));
  const formulaSet = new Set(formulas.map((f) => f.name));
  const deps = (name) => {
    const expr = map.get(name) || "";
    return (expr.match(/\b[A-Z][A-Z0-9_]*\b/g) ?? []).filter(
      (r) => formulaSet.has(r)
    );
  };
  const visited = /* @__PURE__ */ new Set();
  const stack = /* @__PURE__ */ new Set();
  function dfs(n) {
    if (stack.has(n)) return true;
    if (visited.has(n)) return false;
    visited.add(n);
    stack.add(n);
    for (const d of deps(n)) {
      if (dfs(d)) return true;
    }
    stack.delete(n);
    return false;
  }
  for (const f of formulas) {
    if (dfs(f.name)) return f.name;
  }
  return null;
}
function schemaSummaryOf(value, depth = 0) {
  if (depth > 4) return "...";
  if (value == null) return String(value);
  if (Array.isArray(value)) return `array(${value.length})`;
  if (typeof value !== "object") return typeof value;
  const keys = Object.keys(value).slice(0, 20);
  return `{${keys.map((k) => `${k}:${schemaSummaryOf(value[k], depth + 1)}`).join(",")}}`;
}
function asWarnings(v) {
  if (v == null) return void 0;
  if (Array.isArray(v)) return v.map(String);
  return [String(v)];
}
function normalizeType(t2) {
  const s = t2.toLowerCase();
  if (s.includes("matrix") || s.includes("time_series") || s === "series")
    return "time_series";
  if (s.includes("vector") || s.includes("scalar")) return "scalar";
  if (s.includes("raw_stream") || s === "stream") return "raw_stream";
  if (s.includes("raw")) return "raw";
  if (s.includes("trace")) return "trace";
  if (s.includes("distribution") || s.includes("histogram"))
    return "distribution";
  return "unknown";
}
function inferType(data, list) {
  const explicit = String(
    data.resultType ?? data.type ?? data.requestType ?? ""
  ).toLowerCase();
  if (explicit) {
    const n = normalizeType(explicit);
    if (n !== "unknown") return n;
    if (!["", "matrix", "vector", "success"].includes(explicit))
      return "unknown";
  }
  const first = list[0];
  if (!first) return "unknown";
  if (first.aggregations || first.series || first.values || first.timestamps)
    return "time_series";
  if (first.spans || first.traceID || first.traceId || first.list)
    return "trace";
  if (first.columns && first.data) return "scalar";
  if (first.rows || first.nextCursor != null) return "raw";
  return list.length ? "time_series" : "unknown";
}
function extractSignozEnvelope(body, profile = "native", opts) {
  if (body == null || typeof body !== "object") {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "SigNoz response is not an object"
    );
  }
  const root = body;
  if (profile === "argus" || profile === "flat") {
    const status2 = root.status != null ? String(root.status) : root.code != null ? String(root.code) : void 0;
    if (status2 && /error|fail/i.test(status2) && status2 !== "200") {
      throw new DataSourceError("INVALID_RESPONSE", `SigNoz status=${status2}`);
    }
    const outer = root.data && typeof root.data === "object" ? root.data : root;
    const nested2 = outer.data && typeof outer.data === "object" ? outer.data : null;
    const data = nested2 || outer;
    const results = data.results ?? data.result ?? outer.results ?? outer.result ?? [];
    const list2 = Array.isArray(results) ? results : results != null ? [results] : [];
    return {
      status: status2,
      type: inferType(outer, list2) || inferType(data, list2),
      results: list2,
      warning: asWarnings(root.warning ?? outer.warning ?? data.warning),
      meta: {
        ...typeof outer.meta === "object" && outer.meta ? outer.meta : {},
        ...typeof data.meta === "object" && data.meta ? data.meta : {}
      },
      raw: body,
      schemaSummary: schemaSummaryOf(body)
    };
  }
  if (!("data" in root) && !("result" in root)) {
    throw new DataSourceError(
      "UNSUPPORTED_RESPONSE_SHAPE",
      `missing data envelope; schema=${schemaSummaryOf(body)}`
    );
  }
  const dataLayer = root.data && typeof root.data === "object" ? root.data : null;
  if (!dataLayer) {
    throw new DataSourceError(
      "UNSUPPORTED_RESPONSE_SHAPE",
      `missing data object; schema=${schemaSummaryOf(body)}`
    );
  }
  const status = root.status != null ? String(root.status) : dataLayer.status != null ? String(dataLayer.status) : void 0;
  if (status && /error|fail/i.test(status) && status.toLowerCase() !== "success") {
    throw new DataSourceError("INVALID_RESPONSE", `SigNoz status=${status}`, {
      upstreamCode: status
    });
  }
  const nested = dataLayer.data && typeof dataLayer.data === "object" ? dataLayer.data : null;
  let resultsRaw;
  let typeSource = dataLayer;
  if (nested && (nested.results != null || nested.result != null)) {
    resultsRaw = nested.results ?? nested.result;
    typeSource = { ...dataLayer, ...nested };
  } else if (opts?.strictV5) {
    if (dataLayer.results != null && nested == null) {
      throw new DataSourceError(
        "UNSUPPORTED_RESPONSE_SHAPE",
        `Native V5 requires data.data.results, not data.results; schema=${schemaSummaryOf(body)}`
      );
    }
    resultsRaw = dataLayer.result;
    if (resultsRaw == null) {
      throw new DataSourceError(
        "UNSUPPORTED_RESPONSE_SHAPE",
        `missing data.data.results; schema=${schemaSummaryOf(body)}`
      );
    }
  } else {
    resultsRaw = dataLayer.result ?? dataLayer.results;
  }
  if (resultsRaw == null) {
    throw new DataSourceError(
      "UNSUPPORTED_RESPONSE_SHAPE",
      `missing results; schema=${schemaSummaryOf(body)}`
    );
  }
  const list = Array.isArray(resultsRaw) ? resultsRaw : [resultsRaw];
  const type = inferType(typeSource, list);
  const known = /* @__PURE__ */ new Set([
    "status",
    "data",
    "type",
    "resultType",
    "result",
    "results",
    "meta",
    "warning",
    "error"
  ]);
  const extras = {};
  for (const [k, v] of Object.entries(dataLayer)) {
    if (!known.has(k)) extras[k] = v;
  }
  return {
    status,
    type,
    results: list,
    warning: asWarnings(root.warning ?? dataLayer.warning ?? nested?.warning),
    meta: {
      ...typeof dataLayer.meta === "object" && dataLayer.meta ? dataLayer.meta : {},
      ...nested && typeof nested.meta === "object" && nested.meta ? nested.meta : {},
      resultType: dataLayer.resultType ?? dataLayer.type
    },
    extras: Object.keys(extras).length ? extras : void 0,
    raw: body,
    schemaSummary: schemaSummaryOf(body)
  };
}
function schemaSummary(value) {
  return schemaSummaryOf(value);
}
function liveMeta$3(extra = {}) {
  return { source: "live", preferredVisualisationType: "table", ...extra };
}
function labelsToRecord$1(labels) {
  const out = {};
  if (Array.isArray(labels)) {
    for (const l of labels) {
      const name = String(
        l?.key?.name ?? l?.name ?? ""
      ).trim();
      if (name) out[name] = String(l?.value ?? "");
    }
  } else if (labels && typeof labels === "object") {
    for (const [k, v] of Object.entries(labels)) out[k] = String(v);
  }
  return out;
}
function emptyScalarFrame(opts, extraMeta = {}) {
  return createDataFrame({
    refId: opts.refId,
    name: String(extraMeta.queryName || "scalar"),
    meta: liveMeta$3({
      requestType: "scalar",
      empty: true,
      warnings: opts.warnings,
      ...extraMeta
    }),
    fields: [{ name: "Value", type: "number", values: [] }]
  });
}
function asArray$1(v) {
  return Array.isArray(v) ? v : [];
}
function isColumnsDataShape(r) {
  if (!r || typeof r !== "object") return false;
  if ("columns" in r || "data" in r) return true;
  if (r.table && typeof r.table === "object") return true;
  return false;
}
function isAggSeriesShape(r) {
  if (!r || typeof r !== "object") return false;
  if ("aggregations" in r) return true;
  if (Array.isArray(r.series)) return true;
  return false;
}
function isPromVectorShape(r) {
  if (!r || typeof r !== "object") return false;
  return Array.isArray(r.value) && r.value.length >= 2 && (r.metric != null || r.labels != null);
}
function fieldFromValues(name, values) {
  const isNum = values.every(
    (v) => v == null || typeof v === "number" || typeof v === "string" && v !== "" && Number.isFinite(Number(v))
  );
  return {
    name,
    type: isNum ? "number" : "string",
    values: isNum ? values.map((v) => v == null || v === "" ? null : Number(v)) : values.map((v) => v == null ? null : String(v))
  };
}
function mapColumnsDataResult(r, qi, opts) {
  const table = r?.table && typeof r.table === "object" ? r.table : r;
  const cols = asArray$1(table.columns);
  const rows = asArray$1(table.data ?? table.rows);
  const isObjectRows = rows.length > 0 && rows.every(
    (row) => row != null && typeof row === "object" && !Array.isArray(row)
  );
  if (isObjectRows) {
    const fieldNames = cols.length > 0 ? cols.map(
      (c, ci) => typeof c === "string" ? c : String(c?.name || c?.title || c?.id || `col${ci}`)
    ) : Array.from(
      new Set(
        rows.flatMap(
          (row) => Object.keys(
            row?.data && typeof row.data === "object" ? row.data : row
          )
        )
      )
    );
    const fields2 = fieldNames.map((name) => {
      const values = rows.map((row) => {
        const obj = row?.data && typeof row.data === "object" ? row.data : row;
        return obj?.[name] ?? null;
      });
      return fieldFromValues(name, values);
    });
    return createDataFrame({
      refId: opts.refId,
      name: String(r.queryName || r.name || `scalar-${qi}`),
      meta: liveMeta$3({
        requestType: "scalar",
        shape: "columns",
        queryName: r.queryName,
        empty: !fields2.length || fields2.every(
          (f) => !Array.isArray(f.values) || f.values.length === 0
        ) || void 0,
        warnings: opts.warnings
      }),
      fields: fields2.length ? fields2 : [{ name: "Value", type: "number", values: [] }]
    });
  }
  const matrixRows = rows.map(
    (row) => Array.isArray(row) ? row : []
  );
  const fields = cols.map((c, ci) => {
    const name = typeof c === "string" ? c : String(c?.name || c?.title || `col${ci}`);
    const values = matrixRows.map(
      (row) => ci < row.length ? row[ci] : null
    );
    return fieldFromValues(name, values);
  });
  return createDataFrame({
    refId: opts.refId,
    name: String(r.queryName || r.name || `scalar-${qi}`),
    meta: liveMeta$3({
      requestType: "scalar",
      shape: "columns",
      queryName: r.queryName,
      empty: !fields.length || fields.every(
        (f) => !Array.isArray(f.values) || f.values.length === 0
      ) || void 0,
      warnings: opts.warnings
    }),
    fields: fields.length ? fields : [{ name: "Value", type: "number", values: [] }]
  });
}
function mapAggSeriesResult(result, ri, opts) {
  const frames = [];
  const aggs = Array.isArray(result.aggregations) ? result.aggregations : result.series ? [{ series: result.series }] : [];
  aggs.forEach((agg, ai) => {
    const seriesList = asArray$1(agg?.series);
    seriesList.forEach((s, si) => {
      const labels = labelsToRecord$1(s.labels);
      const rawVal = s.values?.[0]?.value ?? s.value ?? s.values?.[0] ?? null;
      const n = rawVal == null || rawVal === "" ? null : Number(rawVal);
      const name = String(
        agg.alias || result.queryName || labels.__name__ || `A${ri}_${ai}_${si}`
      );
      frames.push(
        createDataFrame({
          refId: opts.refId,
          name,
          meta: liveMeta$3({
            requestType: "scalar",
            shape: "aggregations",
            aggregationIndex: ai,
            alias: agg.alias,
            queryName: result.queryName,
            labels,
            unit: agg.unit || agg.meta?.unit || s.unit,
            warnings: opts.warnings
          }),
          fields: [
            {
              name: "Value",
              type: "number",
              values: [Number.isFinite(n) ? n : null],
              labels,
              config: { displayNameFromDS: name }
            },
            {
              name: "ValueRaw",
              type: "string",
              values: [rawVal == null ? null : String(rawVal)]
            }
          ]
        })
      );
    });
  });
  return frames;
}
function mapPromVectorResult(r, i, opts) {
  const labels = labelsToRecord$1(r.metric ?? r.labels);
  const rawVal = Array.isArray(r.value) ? r.value[1] : r.value;
  const n = rawVal == null || rawVal === "" ? null : Number(rawVal);
  const name = String(
    labels.__name__ || r.queryName || opts.refId || `vector-${i}`
  );
  return createDataFrame({
    refId: opts.refId,
    name,
    meta: liveMeta$3({
      requestType: "scalar",
      shape: "prom_vector",
      labels,
      warnings: opts.warnings
    }),
    fields: [
      {
        name: "Value",
        type: "number",
        values: [Number.isFinite(n) ? n : null],
        labels,
        config: { displayNameFromDS: name }
      },
      {
        name: "ValueRaw",
        type: "string",
        values: [rawVal == null ? null : String(rawVal)]
      }
    ]
  });
}
function mapScalarResponse(results, opts) {
  if (!results.length) {
    return [emptyScalarFrame(opts)];
  }
  const frames = [];
  results.forEach((raw, qi) => {
    const r = raw;
    if (r == null || typeof r !== "object") {
      frames.push(emptyScalarFrame(opts, { index: qi }));
      return;
    }
    if (isColumnsDataShape(r)) {
      frames.push(mapColumnsDataResult(r, qi, opts));
      return;
    }
    if (isAggSeriesShape(r)) {
      const mapped = mapAggSeriesResult(r, qi, opts);
      if (mapped.length) frames.push(...mapped);
      else
        frames.push(
          emptyScalarFrame(opts, {
            shape: "aggregations",
            queryName: r.queryName
          })
        );
      return;
    }
    if (isPromVectorShape(r)) {
      frames.push(mapPromVectorResult(r, qi, opts));
      return;
    }
    if (r.queryName != null || r.name != null) {
      frames.push(
        emptyScalarFrame(opts, {
          shape: "empty",
          queryName: r.queryName ?? r.name,
          index: qi
        })
      );
      return;
    }
    throw new DataSourceError(
      "UNSUPPORTED_RESPONSE_SHAPE",
      `scalar results match neither aggregations.series nor columns/data shape; keys=${JSON.stringify(
        Object.keys(r).slice(0, 12)
      )}`
    );
  });
  return frames.length ? frames : [emptyScalarFrame(opts)];
}
function liveMeta$2(extra = {}) {
  return { source: "live", preferredVisualisationType: "logs", ...extra };
}
function toMs$2(v) {
  const n = Number(v ?? 0);
  if (!Number.isFinite(n) || n <= 0) return 0;
  return n < 1e12 ? n * 1e3 : n;
}
function mapRawRows(results, opts) {
  const frames = [];
  for (const result of results) {
    const r = result;
    const rows = Array.isArray(r?.rows) ? r.rows : Array.isArray(r?.data) ? r.data : Array.isArray(r) ? r : [];
    const keySet = /* @__PURE__ */ new Set([
      "timestamp",
      "body",
      "severity",
      "trace_id",
      "span_id",
      "service",
      "resources_string",
      "attributes_string"
    ]);
    for (const row of rows) {
      if (row && typeof row === "object") {
        for (const k of Object.keys(row)) keySet.add(k);
        if (row.data && typeof row.data === "object") {
          for (const k of Object.keys(row.data)) keySet.add(`data.${k}`);
        }
      }
    }
    const keys = [...keySet];
    const colValues = {};
    for (const k of keys) colValues[k] = [];
    for (const row of rows) {
      const o = row && typeof row === "object" ? row : {};
      for (const k of keys) {
        if (k.startsWith("data.")) {
          colValues[k].push(o.data ? o.data[k.slice(5)] : null);
        } else {
          colValues[k].push(o[k] ?? null);
        }
      }
    }
    const times = rows.map(
      (row) => toMs$2(row?.timestamp ?? row?.time ?? row?.ts)
    );
    const lines = rows.map(
      (row) => String(
        row?.body ?? row?.message ?? row?.line ?? (typeof row === "string" ? row : JSON.stringify(row ?? ""))
      )
    );
    const fields = [
      { name: "Time", type: "time", values: times },
      { name: "Line", type: "string", values: lines },
      {
        name: "severity",
        type: "string",
        values: rows.map(
          (row) => String(row?.severity ?? row?.level ?? "")
        )
      },
      {
        name: "traceId",
        type: "string",
        values: rows.map(
          (row) => String(row?.trace_id ?? row?.traceId ?? "")
        )
      },
      {
        name: "spanId",
        type: "string",
        values: rows.map(
          (row) => String(row?.span_id ?? row?.spanId ?? "")
        )
      },
      {
        name: "service",
        type: "string",
        values: rows.map(
          (row) => String(
            row?.service ?? row?.resources_string?.["service.name"] ?? row?.["service.name"] ?? ""
          )
        )
      }
    ];
    for (const k of keys) {
      if ([
        "timestamp",
        "body",
        "message",
        "line",
        "severity",
        "level",
        "trace_id",
        "traceId",
        "span_id",
        "spanId",
        "service"
      ].includes(k)) {
        continue;
      }
      fields.push({
        name: k,
        type: "string",
        values: colValues[k].map(
          (v) => v == null ? null : typeof v === "string" ? v : JSON.stringify(v)
        )
      });
    }
    frames.push(
      createDataFrame({
        refId: opts.refId,
        name: String(r?.queryName || (opts.stream ? "raw_stream" : "raw")),
        meta: liveMeta$2({
          requestType: opts.stream ? "raw_stream" : "raw",
          queryName: r?.queryName,
          nextCursor: r?.nextCursor ?? r?.cursor ?? null,
          selectFields: r?.selectFields,
          rowCount: rows.length,
          warnings: opts.warnings
        }),
        fields
      })
    );
  }
  if (!frames.length) {
    frames.push(
      createDataFrame({
        refId: opts.refId,
        name: opts.stream ? "raw_stream" : "raw",
        meta: liveMeta$2({
          requestType: opts.stream ? "raw_stream" : "raw",
          empty: true
        }),
        fields: [
          { name: "Time", type: "time", values: [] },
          { name: "Line", type: "string", values: [] }
        ]
      })
    );
  }
  return frames;
}
function mapRawResponse(body, opts) {
  const b = body;
  const results = b?.data?.data?.results ?? b?.data?.results ?? b?.results;
  if (Array.isArray(results)) return mapRawRows(results, opts);
  if (Array.isArray(b?.data?.result)) return mapRawRows(b.data.result, opts);
  if (Array.isArray(b?.logs)) {
    return mapRawRows([{ rows: b.logs }], { ...opts, stream: false });
  }
  if (Array.isArray(b?.traces)) {
    return mapRawRows([{ rows: b.traces }], { ...opts, stream: false });
  }
  if (Array.isArray(b?.rows)) {
    return mapRawRows([{ rows: b.rows }], { ...opts, stream: false });
  }
  return [
    createDataFrame({
      refId: opts.refId,
      name: "raw",
      meta: {
        source: "live",
        preferredVisualisationType: opts.signal === "logs" ? "logs" : void 0,
        notices: [
          {
            severity: "warning",
            text: "raw mapper: unstructured payload retained as JSON column"
          }
        ]
      },
      fields: [
        {
          name: "raw",
          type: "string",
          values: [
            typeof body === "string" ? body : JSON.stringify(body ?? null)
          ]
        }
      ]
    })
  ];
}
function mapRawStreamResponse(results, opts) {
  return mapRawRows(results, { ...opts, stream: true });
}
function liveMeta$1(extra = {}) {
  return { source: "live", preferredVisualisationType: "histogram", ...extra };
}
function mapDistributionResponse(results, opts) {
  if (!opts.experimentalDistribution) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "distribution 仅实验能力，需要 experimentalDistribution=VERIFIED"
    );
  }
  const list = Array.isArray(results) ? results : results != null ? [results] : [];
  const frames = [];
  for (const result of list) {
    const r = result;
    const bucketsDirect = r?.buckets || r?.data?.buckets;
    const aggs = r?.aggregations || r?.data?.aggregations || [];
    const seriesBuckets = [];
    if (Array.isArray(bucketsDirect)) {
      seriesBuckets.push({ labels: {}, buckets: bucketsDirect });
    }
    for (const agg of aggs) {
      for (const s of agg?.series || []) {
        if (Array.isArray(s?.buckets) || Array.isArray(s?.values)) {
          seriesBuckets.push({
            labels: labelsOf(s?.labels),
            buckets: s.buckets || s.values
          });
        }
      }
    }
    for (const s of r?.series || []) {
      if (Array.isArray(s?.buckets) || Array.isArray(s?.values)) {
        seriesBuckets.push({
          labels: labelsOf(s?.labels),
          buckets: s.buckets || s.values
        });
      }
    }
    for (const series of seriesBuckets) {
      const bounds = [];
      const counts = [];
      for (const b of series.buckets || []) {
        const le = Number(b?.le ?? b?.upperBound ?? b?.bound ?? b?.[0]);
        const count = Number(b?.count ?? b?.value ?? b?.[1]);
        if (!Number.isFinite(le) || !Number.isFinite(count)) continue;
        bounds.push(le);
        counts.push(count);
      }
      if (!bounds.length) continue;
      const labelStr = Object.entries(series.labels || {}).map(([k, v]) => `${k}=${v}`).join(", ");
      frames.push(
        createDataFrame({
          refId: opts.refId,
          name: labelStr || "histogram",
          meta: liveMeta$1({
            preferredVisualisationType: "histogram",
            requestType: "distribution",
            labels: series.labels
          }),
          fields: [
            {
              name: "le",
              type: "number",
              values: bounds,
              config: { displayNameFromDS: "le" }
            },
            {
              name: "count",
              type: "number",
              values: counts,
              labels: series.labels,
              config: { displayNameFromDS: "count" }
            }
          ]
        })
      );
    }
  }
  if (frames.length) return frames;
  return [
    createDataFrame({
      refId: opts.refId,
      name: "distribution",
      meta: liveMeta$1({
        preferredVisualisationType: "histogram",
        requestType: "distribution",
        empty: true,
        notices: [
          { severity: "warning", text: "distribution response had no buckets" }
        ]
      }),
      fields: [
        { name: "le", type: "number", values: [] },
        { name: "count", type: "number", values: [] }
      ]
    })
  ];
}
function labelsOf(raw) {
  if (!raw) return {};
  if (Array.isArray(raw)) {
    const out = {};
    for (const l of raw) {
      const k = l?.key?.name || l?.key || l?.name;
      if (k) out[String(k)] = String(l?.value ?? "");
    }
    return out;
  }
  if (typeof raw === "object") {
    const out = {};
    for (const [k, v] of Object.entries(raw)) {
      if (k === "__name__") continue;
      out[k] = String(v);
    }
    return out;
  }
  return {};
}
const ALL_MODES = ["builder", "promql", "clickhouse_sql"];
const BUILDER_ONLY = ["builder"];
const PROMQL_ONLY = ["promql"];
const EMPTY_MODES = {
  metrics: [],
  logs: [],
  traces: []
};
function defaultIsHealthy(status, data) {
  if (status < 200 || status >= 300) return false;
  if (data == null || typeof data !== "object") return true;
  const o = data;
  if ("success" in o && o.success === false) return false;
  if ("ok" in o && o.ok === false) return false;
  if ("status" in o) {
    const s = String(o.status).toLowerCase();
    if (s === "error" || s === "failed") return false;
  }
  if ("error" in o && o.error != null && String(o.error).trim() !== "")
    return false;
  return true;
}
const SIGNOZ_PROFILES = {
  "prometheus-compatible": {
    id: "prometheus-compatible",
    signals: ["metrics"],
    formulaServerSide: false,
    supportsServerFormula: false,
    queryModesBySignal: { metrics: PROMQL_ONLY, logs: [], traces: [] },
    isHealthy: defaultIsHealthy,
    endpoints: {
      metricsQuery: { path: "/api/v1/query_range", method: "GET" },
      health: { path: "/api/v1/status/buildinfo", method: "GET" }
    }
  },
  "signoz-v3": {
    id: "signoz-v3",
    signals: ["metrics", "logs", "traces"],
    formulaServerSide: true,
    supportsServerFormula: true,
    queryModesBySignal: {
      metrics: ALL_MODES,
      logs: BUILDER_ONLY,
      traces: BUILDER_ONLY
    },
    isHealthy: defaultIsHealthy,
    endpoints: {
      metricsQuery: { path: "/api/v3/query_range", method: "POST" },
      logsQuery: { path: "/api/v3/query_range", method: "POST" },
      tracesQuery: { path: "/api/v3/query_range", method: "POST" },
      traceById: { path: "/api/v1/traces/{id}", method: "GET" },
      metadata: { path: "/api/v1/services", method: "POST" },
      services: { path: "/api/v1/services", method: "POST" },
      health: { path: "/api/v1/health", method: "GET" },
      liveTail: { path: "/api/v3/logs/livetail", method: "GET" },
      liveTailLegacy: { path: "/api/v1/logs/tail", method: "GET" },
      exportRaw: { path: "/api/v1/export_raw_data", method: "POST" }
    }
  },
  "signoz-v5": {
    id: "signoz-v5",
    signals: ["metrics", "logs", "traces"],
    formulaServerSide: true,
    supportsServerFormula: true,
    credentialModes: ["signozApiKey", "bearer", "session", "proxy", "headers"],
    defaultCredentialHeader: "SIGNOZ-API-KEY",
    queryModesBySignal: {
      metrics: ALL_MODES,
      logs: ALL_MODES,
      traces: BUILDER_ONLY
    },
    isHealthy: defaultIsHealthy,
    endpoints: {
      metricsQuery: { path: "/api/v5/query_range", method: "POST" },
      logsQuery: { path: "/api/v5/query_range", method: "POST" },
      tracesQuery: { path: "/api/v5/query_range", method: "POST" },
      // default health order: v2 then v1 (verified deployments)
      health: { path: "/api/v2/healthz", method: "GET" },
      healthCandidates: [
        { path: "/api/v2/healthz", method: "GET" },
        { path: "/api/v1/health", method: "GET" }
      ],
      version: { path: "/api/v1/version", method: "GET" },
      metricsList: { path: "/api/v2/metrics", method: "GET" },
      metadata: { path: "/api/v2/metrics", method: "GET" },
      fieldsKeys: { path: "/api/v1/fields/keys", method: "GET" },
      fieldsValues: { path: "/api/v1/fields/values", method: "GET" },
      attributeKeys: { path: "/api/v1/fields/keys", method: "GET" },
      attributeValues: { path: "/api/v1/fields/values", method: "GET" },
      services: { path: "/api/v2/services", method: "POST" },
      alertsQuery: { path: "/api/v1/rules", method: "GET" },
      variablesQuery: { path: "/api/v2/variables/query", method: "POST" },
      traceById: { path: "/api/v4/traces/{id}", method: "GET" },
      // liveTail SSE candidate — capability gated until Content-Type verified live
      liveTail: { path: "/api/v3/logs/livetail", method: "GET" },
      liveTailLegacy: { path: "/api/v1/logs/tail", method: "GET" },
      exportRaw: { path: "/api/v1/export_raw_data", method: "POST" }
    }
  },
  "argus-v5": {
    id: "argus-v5",
    signals: ["metrics", "logs", "traces"],
    formulaServerSide: true,
    supportsServerFormula: true,
    // Argus host rewrites SigNoz under /api/apm/* and uses Bearer session token.
    credentialModes: ["bearer", "proxy", "headers", "signozApiKey", "session"],
    defaultCredentialHeader: "Authorization",
    queryModesBySignal: {
      metrics: ALL_MODES,
      logs: ALL_MODES,
      traces: BUILDER_ONLY
    },
    isHealthy: defaultIsHealthy,
    endpoints: {
      metricsQuery: { path: "/api/apm/v5/query_range", method: "POST" },
      logsQuery: { path: "/api/apm/v5/query_range", method: "POST" },
      tracesQuery: { path: "/api/apm/v5/query_range", method: "POST" },
      health: { path: "/api/apm/v1/health", method: "GET" },
      healthCandidates: [
        { path: "/api/apm/v1/health", method: "GET" },
        { path: "/api/apm/v2/healthz", method: "GET" }
      ],
      version: { path: "/api/apm/v1/version", method: "GET" },
      metricsList: { path: "/api/apm/v2/metrics", method: "GET" },
      metadata: { path: "/api/apm/v2/metrics", method: "GET" },
      fieldsKeys: { path: "/api/apm/v1/fields/keys", method: "GET" },
      fieldsValues: { path: "/api/apm/v1/fields/values", method: "GET" },
      attributeKeys: { path: "/api/apm/v1/fields/keys", method: "GET" },
      attributeValues: { path: "/api/apm/v1/fields/values", method: "GET" },
      services: { path: "/api/apm/v2/services", method: "POST" },
      alertsQuery: { path: "/api/apm/v1/rules", method: "GET" },
      variablesQuery: { path: "/api/apm/v2/variables/query", method: "POST" },
      traceById: { path: "/api/apm/v4/traces/{id}", method: "GET" },
      liveTail: { path: "/api/apm/v3/logs/livetail", method: "GET" },
      liveTailLegacy: { path: "/api/apm/v1/logs/tail", method: "GET" },
      exportRaw: { path: "/api/apm/v1/export_raw_data", method: "POST" }
    }
  },
  "signoz-v4": {
    id: "signoz-v4",
    signals: ["metrics", "logs", "traces"],
    formulaServerSide: true,
    supportsServerFormula: true,
    queryModesBySignal: {
      metrics: ALL_MODES,
      logs: BUILDER_ONLY,
      traces: BUILDER_ONLY
    },
    isHealthy: defaultIsHealthy,
    endpoints: {
      metricsQuery: { path: "/api/v4/query_range", method: "POST" },
      logsQuery: { path: "/api/v4/query_range", method: "POST" },
      tracesQuery: { path: "/api/v4/query_range", method: "POST" },
      health: { path: "/api/v1/health", method: "GET" }
    }
  },
  custom: {
    id: "custom",
    signals: [],
    formulaServerSide: false,
    supportsServerFormula: false,
    queryModesBySignal: { ...EMPTY_MODES },
    isHealthy: defaultIsHealthy,
    endpoints: {}
  }
};
function isV5WireProfile(id) {
  const p = String(id || "");
  return p === "signoz-v5" || p === "argus-v5";
}
function resolveSigNozProfile(options) {
  let id = String(options?.apiProfile || "signoz-v5");
  const base = SIGNOZ_PROFILES[id] || SIGNOZ_PROFILES["signoz-v3"];
  if (id !== "custom") {
    return {
      ...base,
      endpoints: { ...base.endpoints },
      queryModesBySignal: { ...base.queryModesBySignal },
      isHealthy: base.isHealthy || defaultIsHealthy
    };
  }
  const endpoints = {};
  if (options?.customMetricsPath)
    endpoints.metricsQuery = {
      path: options.customMetricsPath,
      method: "POST"
    };
  if (options?.customLogsPath)
    endpoints.logsQuery = { path: options.customLogsPath, method: "POST" };
  if (options?.customTracesPath)
    endpoints.tracesQuery = { path: options.customTracesPath, method: "POST" };
  if (options?.customAlertsPath)
    endpoints.alertsQuery = { path: options.customAlertsPath, method: "POST" };
  if (options?.customTraceByIdPath)
    endpoints.traceById = { path: options.customTraceByIdPath, method: "GET" };
  if (options?.customMetadataPath)
    endpoints.metadata = { path: options.customMetadataPath, method: "GET" };
  if (options?.customHealthPath)
    endpoints.health = { path: options.customHealthPath, method: "GET" };
  if (options?.customAcknowledgePath)
    endpoints.acknowledge = {
      path: options.customAcknowledgePath,
      method: "POST"
    };
  if (options?.customResolvePath)
    endpoints.resolve = { path: options.customResolvePath, method: "POST" };
  const signals = [];
  const queryModesBySignal = {
    metrics: [],
    logs: [],
    traces: []
  };
  if (endpoints.metricsQuery) {
    signals.push("metrics");
    queryModesBySignal.metrics = ALL_MODES;
  }
  if (endpoints.logsQuery) {
    signals.push("logs");
    queryModesBySignal.logs = BUILDER_ONLY;
  }
  if (endpoints.tracesQuery) {
    signals.push("traces");
    queryModesBySignal.traces = BUILDER_ONLY;
  }
  return {
    id: "custom",
    signals,
    formulaServerSide: false,
    supportsServerFormula: false,
    queryModesBySignal,
    isHealthy: defaultIsHealthy,
    endpoints
  };
}
function buildCustomHealthSignature(url, options) {
  const payload = {
    url: String(url || "").replace(/\/+$/, ""),
    apiProfile: options.apiProfile || "custom",
    credentialKind: options.credentialKind || "",
    credentialHeaderName: options.credentialHeaderName || "",
    fetchCredentials: options.fetchCredentials || "",
    customHealthPath: options.customHealthPath || "",
    customMetricsPath: options.customMetricsPath || "",
    customLogsPath: options.customLogsPath || "",
    customTracesPath: options.customTracesPath || "",
    customAlertsPath: options.customAlertsPath || "",
    customTraceByIdPath: options.customTraceByIdPath || "",
    customMetadataPath: options.customMetadataPath || "",
    customMetricsListPath: options.customMetricsListPath || "",
    customFieldsKeysPath: options.customFieldsKeysPath || "",
    customFieldsValuesPath: options.customFieldsValuesPath || "",
    customAcknowledgePath: options.customAcknowledgePath || "",
    customResolvePath: options.customResolvePath || ""
  };
  return JSON.stringify(payload);
}
function isSuccessfulActionResponse(status, data) {
  return defaultIsHealthy(status, data);
}
function modesForSignal(profile, signal) {
  return profile.queryModesBySignal?.[signal] || [];
}
function isModeAllowed(profile, signal, mode2) {
  return modesForSignal(profile, signal).includes(mode2);
}
function normalizeStatus(raw) {
  if (raw == null || raw === "") return "unset";
  const s = String(raw).toLowerCase().trim();
  if (s === "ok" || s === "success" || s === "unset" || s === "0" || s === "status_code_unset" || s === "status_ok" || s === "statuscode.ok" || s === "status_code_ok") {
    if (s === "unset" || s === "0" || s === "status_code_unset") return "unset";
    return "ok";
  }
  if (s === "error" || s === "err" || s === "failed" || s === "1" || s === "2" || s === "status_code_error" || s === "status_error" || s === "statuscode.error") {
    return "error";
  }
  if (typeof raw === "number") {
    if (raw === 0) return "unset";
    if (raw === 1) return "ok";
    if (raw === 2) return "error";
  }
  return "unset";
}
function statusFor(t2) {
  if (t2.status != null && String(t2.status).trim() !== "") {
    return normalizeStatus(t2.status);
  }
  const errCount = Number(t2.errorCount ?? 0);
  if (Number.isFinite(errCount) && errCount > 0) return "error";
  if (t2.hasError === true || t2.hasError === 1 || t2.hasError === "true") {
    return "error";
  }
  return "ok";
}
function asRecord(v) {
  if (v == null) return {};
  if (typeof v === "object" && !Array.isArray(v)) {
    return { ...v };
  }
  if (typeof v === "string" && v.trim()) {
    try {
      const parsed = JSON.parse(v);
      if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
        return parsed;
      }
    } catch {
    }
  }
  return {};
}
function asObjectArray(v) {
  if (Array.isArray(v)) {
    return v.map((item) => {
      if (item && typeof item === "object" && !Array.isArray(item)) {
        return { ...item };
      }
      if (typeof item === "string") {
        try {
          const parsed = JSON.parse(item);
          if (parsed && typeof parsed === "object" && !Array.isArray(parsed)) {
            return parsed;
          }
        } catch {
          return { value: item };
        }
      }
      return { value: item };
    });
  }
  if (typeof v === "string" && v.trim()) {
    try {
      const parsed = JSON.parse(v);
      if (Array.isArray(parsed)) return asObjectArray(parsed);
      if (parsed && typeof parsed === "object") {
        return [parsed];
      }
    } catch {
      return [];
    }
  }
  return [];
}
function pickString(...vals) {
  for (const v of vals) {
    if (v == null || v === "") continue;
    return String(v);
  }
  return "";
}
function toDurationNs(span) {
  const nano = span.durationNs ?? span.duration_nano ?? span.durationNano ?? span.duration_nanos;
  if (nano != null && nano !== "") {
    if (typeof nano === "bigint") return nano.toString();
    if (typeof nano === "number" && Number.isFinite(nano)) {
      return String(Math.trunc(nano));
    }
    const s = String(nano).trim();
    if (/^\d+$/.test(s)) return s;
  }
  const ms = span.durationMs ?? span.duration_ms ?? span.duration ?? span.latency;
  if (ms != null && ms !== "") {
    const n = Number(ms);
    if (Number.isFinite(n)) {
      if (n > 1e12) return String(Math.trunc(n));
      return String(Math.round(n * 1e6));
    }
  }
  return "0";
}
function coerceEpochMs(raw, unitHint) {
  if (raw == null || raw === "") return 0;
  if (typeof raw === "string" && /^\d+$/.test(raw)) {
    if (unitHint === "ms" || raw.length >= 12 && raw.length <= 13) {
      const n3 = Number(raw);
      return Number.isFinite(n3) ? n3 : 0;
    }
    if (unitHint === "ns" || raw.length >= 16) {
      const ms = Number(raw.slice(0, -6));
      return Number.isFinite(ms) ? ms : 0;
    }
    if (unitHint === "us" || raw.length === 14 || raw.length === 15) {
      const n3 = Number(raw);
      return Number.isFinite(n3) ? Math.floor(n3 / 1e3) : 0;
    }
    const n2 = Number(raw);
    if (!Number.isFinite(n2)) return 0;
    if (unitHint === "s" || n2 > 0 && n2 < 1e11) return Math.floor(n2 * 1e3);
    return n2;
  }
  const n = Number(raw);
  if (!Number.isFinite(n)) return 0;
  if (unitHint === "ms") return n;
  if (unitHint === "ns" || n > 1e16) return Math.floor(n / 1e6);
  if (unitHint === "us" || n > 1e14) return Math.floor(n / 1e3);
  if (unitHint === "s" || n > 0 && n < 1e11) return Math.floor(n * 1e3);
  return n;
}
function toStartTimeMs(span) {
  if (span.startTimeMs != null && span.startTimeMs !== "") {
    return coerceEpochMs(span.startTimeMs, "ms");
  }
  if (span.startTimeUnixNano != null || span.startTimeUnixNanoStr != null || span.startTimeNano != null) {
    return coerceEpochMs(
      span.startTimeUnixNano ?? span.startTimeUnixNanoStr ?? span.startTimeNano,
      "ns"
    );
  }
  const raw = span.startTime ?? span.start_time ?? span.timestamp ?? span.time_unix;
  return coerceEpochMs(raw);
}
function toDurationMsFromNs(durationNs) {
  if (!durationNs || !/^\d+$/.test(durationNs)) return 0;
  if (durationNs.length <= 6) return Number(durationNs) / 1e6;
  const whole = Number(durationNs.slice(0, -6));
  const frac = Number(durationNs.slice(-6)) / 1e6;
  return (Number.isFinite(whole) ? whole : 0) + (Number.isFinite(frac) ? frac : 0);
}
function normalizeSpan(raw) {
  const span = raw && typeof raw === "object" && !Array.isArray(raw) ? raw : {};
  const durationNs = toDurationNs(span);
  const tagsOrAttrs = span.attributes ?? span.tags ?? span.spanAttributes;
  const resource = span.resource ?? span.process ?? (span.process && typeof span.process === "object" ? span.process.tags : void 0);
  return {
    traceId: pickString(span.traceId, span.traceID, span.trace_id),
    spanId: pickString(span.spanId, span.span_id, span.id, span.spanID),
    parentSpanId: pickString(
      span.parentSpanId,
      span.parent_span_id,
      span.parentId,
      span.parent_id
    ) || void 0,
    startTimeMs: toStartTimeMs(span),
    durationNs,
    durationMs: toDurationMsFromNs(durationNs),
    serviceName: pickString(
      span.serviceName,
      span.service,
      span.service_name,
      span.resource?.service?.name,
      span.resource?.["service.name"]
    ),
    operationName: pickString(
      span.operationName,
      span.name,
      span.operation,
      span.spanName
    ),
    status: statusFor({
      status: span.status ?? (typeof span.statusCode !== "undefined" ? span.statusCode : span.status?.code),
      errorCount: span.errorCount ?? span.error_count,
      hasError: span.hasError ?? span.has_error
    }),
    resource: asRecord(resource),
    attributes: asRecord(tagsOrAttrs),
    events: asObjectArray(span.events ?? span.logs),
    links: asObjectArray(span.links),
    references: asObjectArray(span.references)
  };
}
function baseMeta(opts, semanticKind, extra = {}) {
  return {
    source: "signoz",
    preferredVisualisationType: semanticKind === "trace.detail" ? "trace" : "table",
    signal: "traces",
    requestType: "trace",
    ...opts.datasourceUid ? { datasourceUid: opts.datasourceUid } : {},
    ...opts.profile ? { profile: opts.profile } : {},
    ...opts.requestId ? { requestId: opts.requestId } : {},
    custom: {
      source: "signoz",
      signal: "traces",
      semanticKind,
      complete: true,
      truncated: false,
      ...opts.datasourceUid ? { datasourceUid: opts.datasourceUid } : {},
      ...opts.profile ? { profile: opts.profile } : {},
      ...opts.requestId ? { requestId: opts.requestId } : {}
    },
    ...opts.warnings?.length ? { warnings: opts.warnings } : {},
    ...extra
  };
}
function spansToDetailFrame(spans, opts, extraMeta = {}) {
  return createDataFrame({
    refId: opts.refId,
    name: "trace",
    meta: baseMeta(opts, "trace.detail", extraMeta),
    fields: [
      { name: "traceId", type: "string", values: spans.map((s) => s.traceId) },
      { name: "spanId", type: "string", values: spans.map((s) => s.spanId) },
      {
        name: "parentSpanId",
        type: "string",
        values: spans.map((s) => s.parentSpanId ?? "")
      },
      {
        name: "operationName",
        type: "string",
        values: spans.map((s) => s.operationName)
      },
      // Grafana TraceView also reads `name`
      {
        name: "name",
        type: "string",
        values: spans.map((s) => s.operationName)
      },
      {
        name: "serviceName",
        type: "string",
        values: spans.map((s) => s.serviceName)
      },
      {
        name: "service",
        type: "string",
        values: spans.map((s) => s.serviceName)
      },
      {
        name: "startTimeMs",
        type: "number",
        values: spans.map((s) => s.startTimeMs)
      },
      {
        name: "startTime",
        type: "number",
        values: spans.map((s) => s.startTimeMs)
      },
      {
        name: "durationNs",
        type: "string",
        values: spans.map((s) => s.durationNs)
      },
      {
        name: "durationMs",
        type: "number",
        values: spans.map((s) => s.durationMs)
      },
      {
        name: "duration",
        type: "number",
        values: spans.map((s) => s.durationMs)
      },
      {
        name: "status",
        type: "string",
        values: spans.map((s) => s.status)
      },
      {
        name: "resource",
        type: "other",
        values: spans.map((s) => s.resource)
      },
      {
        name: "attributes",
        type: "other",
        values: spans.map((s) => s.attributes)
      },
      {
        name: "events",
        type: "other",
        values: spans.map((s) => s.events)
      },
      {
        name: "links",
        type: "other",
        values: spans.map((s) => s.links)
      },
      {
        name: "references",
        type: "other",
        values: spans.map((s) => s.references)
      }
    ]
  });
}
function unwrapSearchRow(raw) {
  if (!raw || typeof raw !== "object" || Array.isArray(raw)) return {};
  const obj = raw;
  if (obj.data && typeof obj.data === "object" && !Array.isArray(obj.data)) {
    const data = obj.data;
    const { data: _drop, ...rest } = obj;
    return { ...data, ...rest };
  }
  return { ...obj };
}
function normalizeSearchRow(raw) {
  const t2 = unwrapSearchRow(raw);
  const durationNs = toDurationNs({
    durationNano: t2.durationNano,
    duration_nano: t2.duration_nano,
    durationNs: t2.durationNs,
    durationMs: t2.durationMs ?? t2.duration,
    duration: t2.durationNano ?? t2.duration_nano ?? t2.duration
  });
  let ns = durationNs;
  if (t2.durationNano != null || t2.duration_nano != null) {
    const v = t2.durationNano ?? t2.duration_nano;
    ns = typeof v === "bigint" ? v.toString() : String(v);
  }
  return {
    traceId: pickString(t2.traceId, t2.traceID, t2.trace_id),
    serviceName: pickString(
      t2.rootServiceName,
      t2.serviceName,
      t2.service,
      t2.rootService,
      t2["service.name"],
      t2.resource?.["service.name"],
      t2.resource?.service?.name
    ),
    operationName: pickString(
      t2.rootTraceName,
      t2.name,
      t2.operationName,
      t2.operation
    ),
    durationNs: ns,
    durationMs: toDurationMsFromNs(ns),
    spanCount: Number(t2.spanCount ?? t2.span_count ?? 0) || 0,
    status: statusFor({
      status: t2.status,
      errorCount: t2.errorCount ?? t2.error_count,
      hasError: t2.hasError
    }),
    startTimeMs: toStartTimeMs(t2)
  };
}
function searchRowsToFrame(rows, opts) {
  return createDataFrame({
    refId: opts.refId,
    name: "traces",
    meta: baseMeta(opts, "trace.search", {
      ...opts.nextCursor != null ? { nextCursor: opts.nextCursor } : {}
    }),
    fields: [
      { name: "traceId", type: "string", values: rows.map((r) => r.traceId) },
      {
        name: "service",
        type: "string",
        values: rows.map((r) => r.serviceName)
      },
      {
        name: "serviceName",
        type: "string",
        values: rows.map((r) => r.serviceName)
      },
      {
        name: "operation",
        type: "string",
        values: rows.map((r) => r.operationName)
      },
      {
        name: "operationName",
        type: "string",
        values: rows.map((r) => r.operationName)
      },
      {
        name: "durationNs",
        type: "string",
        values: rows.map((r) => r.durationNs)
      },
      {
        name: "duration",
        type: "number",
        values: rows.map((r) => r.durationMs)
      },
      {
        name: "durationMs",
        type: "number",
        values: rows.map((r) => r.durationMs)
      },
      {
        name: "spanCount",
        type: "number",
        values: rows.map((r) => r.spanCount)
      },
      { name: "status", type: "string", values: rows.map((r) => r.status) },
      {
        name: "startTimeMs",
        type: "number",
        values: rows.map((r) => r.startTimeMs)
      }
    ]
  });
}
function extractSpanList(body) {
  if (body == null) return [];
  if (Array.isArray(body)) return body;
  if (typeof body !== "object") return [];
  const b = body;
  const data = b.data && typeof b.data === "object" ? b.data : void 0;
  const candidates = [
    b.spans,
    data?.spans,
    data?.data?.spans,
    b.list,
    data?.list,
    b.results
  ];
  for (const c of candidates) {
    if (Array.isArray(c) && c.length) {
      if (c[0] && typeof c[0] === "object" && !Array.isArray(c[0])) {
        const first = c[0];
        if (Array.isArray(first.spans)) {
          const all = [];
          for (const r of c) {
            const spans = r?.spans;
            if (Array.isArray(spans)) all.push(...spans);
          }
          if (all.length) return all;
        }
        if (Array.isArray(first.list) || Array.isArray(first.traces)) {
          return [];
        }
        if (first.spanId || first.span_id || first.traceId || first.traceID) {
          return c;
        }
      } else {
        return c;
      }
    }
  }
  return [];
}
function extractSearchRows(results) {
  const rows = [];
  for (const r of results) {
    if (r == null) continue;
    if (Array.isArray(r)) {
      for (const item of r) rows.push(unwrapSearchRow(item));
      continue;
    }
    if (typeof r !== "object") continue;
    const obj = r;
    const list = obj.list ?? obj.traces ?? obj.rows;
    if (Array.isArray(list)) {
      for (const item of list) rows.push(unwrapSearchRow(item));
    } else if (obj.traceId || obj.traceID || obj.trace_id || obj.data && typeof obj.data === "object" && (obj.data.traceId || obj.data.traceID || obj.data.trace_id)) {
      rows.push(unwrapSearchRow(obj));
    }
  }
  return rows;
}
function isTraceSearchResult(result) {
  if (result == null) return false;
  if (Array.isArray(result)) {
    return result.some((item) => isTraceSearchResult(item));
  }
  if (typeof result !== "object") return false;
  const obj = result;
  if (Array.isArray(obj.list) || Array.isArray(obj.traces)) return true;
  if (Array.isArray(obj.spans) && obj.spans.length) return false;
  if (Array.isArray(obj.rows)) {
    if (!obj.rows.length) return true;
    const sample = unwrapSearchRow(obj.rows[0]);
    return Boolean(
      sample.traceId || sample.traceID || sample.trace_id || sample.spanCount != null || sample.span_count != null || sample["service.name"] != null || sample.rootServiceName != null || sample.rootTraceName != null
    );
  }
  return Boolean(obj.traceId || obj.traceID || obj.trace_id);
}
function mapTraceDetailBody(body, opts, options) {
  const list = extractSpanList(body);
  if (!list.length) {
    if (body != null && typeof body === "object") {
      const keys = Object.keys(body);
      if (keys.length === 0) {
        return [spansToDetailFrame([], opts, { empty: true })];
      }
      const b = body;
      if (Array.isArray(b.spans) || Array.isArray(b?.data?.spans) || Array.isArray(b?.data?.data?.spans)) {
        return [spansToDetailFrame([], opts, { empty: true })];
      }
      throw new DataSourceError(
        "INVALID_RESPONSE",
        "无法解析 trace detail 响应：缺少 spans",
        { bodyKeys: keys }
      );
    }
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "无法解析 trace detail 响应：payload 为空"
    );
  }
  const spans = list.map((s) => normalizeSpan(s));
  if (!spans.some((s) => s.spanId || s.traceId)) {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "无法解析 trace detail 响应：span 缺少 traceId/spanId"
    );
  }
  const payload = body && typeof body === "object" ? body.data && typeof body.data === "object" ? body.data : body : {};
  return [
    spansToDetailFrame(spans, opts, {
      rootService: opts.rootService ?? payload?.rootService,
      entryPoint: opts.entryPoint ?? payload?.entryPoint,
      totalCount: opts.totalCount ?? payload?.totalCount ?? spans.length,
      errorCount: opts.errorCount ?? payload?.errorCount,
      hasMore: opts.hasMore ?? payload?.hasMore
    })
  ];
}
function mapTraceSearchResults(results, opts) {
  const rawRows = extractSearchRows(results);
  const rows = rawRows.map((r) => normalizeSearchRow(r));
  return [searchRowsToFrame(rows, opts)];
}
function normalizeTraceFrames(frames) {
  return (frames ?? []).map((frame) => {
    const meta2 = { ...frame.meta || {} };
    const custom = {
      ...meta2.custom && typeof meta2.custom === "object" ? meta2.custom : {}
    };
    const name = String(frame.name || "").toLowerCase();
    const viz = String(meta2.preferredVisualisationType || "").toLowerCase();
    let semanticKind = custom.semanticKind || meta2.semanticKind;
    if (!semanticKind) {
      if (viz === "trace" || name === "trace") semanticKind = "trace.detail";
      else semanticKind = "trace.search";
    }
    custom.semanticKind = semanticKind;
    custom.signal = custom.signal ?? "traces";
    custom.source = custom.source ?? "signoz";
    meta2.custom = custom;
    meta2.signal = meta2.signal ?? "traces";
    if (semanticKind === "trace.detail" && !meta2.preferredVisualisationType) {
      meta2.preferredVisualisationType = "trace";
    }
    const fields = frame.fields.map((f) => {
      if (f.name === "events" || f.name === "links" || f.name === "references" || f.name === "attributes" || f.name === "resource") {
        const values = f.values.map((v) => {
          if (typeof v === "string") {
            if (f.name === "events" || f.name === "links" || f.name === "references") {
              return asObjectArray(v);
            }
            return asRecord(v);
          }
          return v;
        });
        return { ...f, type: "other", values };
      }
      return f;
    });
    return {
      ...frame,
      meta: meta2,
      fields,
      length: fields.reduce((m, f) => Math.max(m, f.values?.length ?? 0), 0)
    };
  });
}
function liveMeta(extra = {}, datasourceUid) {
  return {
    source: "live",
    ...{},
    ...extra
  };
}
function labelsToRecord(labels) {
  const out = {};
  if (!Array.isArray(labels)) return out;
  for (const l of labels) {
    const name = String(l?.key?.name ?? l?.name ?? "").trim();
    if (!name) continue;
    out[name] = String(l?.value ?? "");
  }
  return out;
}
function seriesName(labels, legend, fallback = "Value") {
  if (legend && legend.includes("{{")) {
    return legend.replace(
      /\{\{\s*([\w.-]+)\s*\}\}/g,
      (_, k) => labels[k] ?? ""
    );
  }
  if (legend) return legend;
  const pairs = Object.entries(labels);
  if (!pairs.length) return fallback;
  return pairs.map(([k, v]) => `${k}=${v}`).join(", ");
}
function mapSignozV5AggResponse(body, opts) {
  const results = body?.data?.results ?? body?.results ?? [];
  if (!Array.isArray(results) || !results.length) {
    return [
      createDataFrame({
        refId: opts.refId,
        name: opts.signal || "metrics",
        meta: liveMeta({
          preferredVisualisationType: "graph",
          apiProfile: "signoz-v5"
        }),
        fields: [
          { name: "Time", type: "time", values: [] },
          { name: "Value", type: "number", values: [] }
        ]
      })
    ];
  }
  const frames = [];
  for (const result of results) {
    const aggs = result?.aggregations ?? [];
    for (const bucket of aggs) {
      const seriesList = bucket?.series ?? [];
      for (const s of seriesList) {
        const labels = labelsToRecord(s?.labels);
        const pts = Array.isArray(s?.values) ? s.values : [];
        const times = pts.map((p) => {
          const t2 = Number(p?.timestamp ?? p?.[0] ?? 0);
          return t2 > 0 && t2 < 1e12 ? t2 * 1e3 : t2;
        });
        const values = pts.map((p) => {
          const raw = p?.value ?? p?.[1];
          if (raw == null || raw === "NaN") return null;
          const n = Number(raw);
          return Number.isFinite(n) ? n : null;
        });
        const name = seriesName(
          labels,
          opts.legendFormat,
          String(bucket?.alias || result?.queryName || "Value")
        );
        frames.push(
          createDataFrame({
            refId: opts.refId,
            name,
            meta: liveMeta({
              preferredVisualisationType: "graph",
              apiProfile: "signoz-v5",
              labels
            }),
            fields: [
              { name: "Time", type: "time", values: times },
              {
                name: "Value",
                type: "number",
                values,
                labels,
                config: { displayNameFromDS: name }
              }
            ]
          })
        );
      }
    }
  }
  if (frames.length) return frames;
  return [
    createDataFrame({
      refId: opts.refId,
      name: opts.signal || "metrics",
      meta: liveMeta({
        preferredVisualisationType: "table",
        apiProfile: "signoz-v5",
        empty: true,
        notices: [
          {
            severity: "warning",
            text: "signoz response produced no series; full body not truncated-inlined"
          }
        ]
      }),
      fields: [
        { name: "Time", type: "time", values: [] },
        { name: "Value", type: "number", values: [] }
      ]
    })
  ];
}
function parsePointTime(p) {
  if (Array.isArray(p)) {
    const t22 = Number(p[0]);
    return t22 > 0 && t22 < 1e12 ? t22 * 1e3 : t22;
  }
  const t2 = Number(p?.timestamp ?? p?.ts ?? p?.time ?? 0);
  return t2 > 0 && t2 < 1e12 ? t2 * 1e3 : t2;
}
function parsePointValue(p) {
  const raw = Array.isArray(p) ? p[1] : p?.value ?? p?.v;
  if (raw == null || raw === "NaN") return null;
  const n = Number(raw);
  return Number.isFinite(n) ? n : null;
}
function labelsFromUnknown(raw) {
  const labels = {};
  if (!raw) return labels;
  if (Array.isArray(raw)) {
    for (const item of raw) {
      const key = item?.key?.name ?? item?.key ?? item?.name;
      if (key == null) continue;
      if (String(key) === "__name__") continue;
      labels[String(key)] = String(item?.value ?? "");
    }
    return labels;
  }
  if (typeof raw === "object") {
    for (const [k, v] of Object.entries(raw)) {
      if (k === "__name__") continue;
      labels[k] = String(v);
    }
  }
  return labels;
}
function mapSignozV3Response(body, opts) {
  const resultList = body?.data?.result ?? body?.data?.results ?? body?.result;
  if (Array.isArray(resultList) && resultList.length === 0) {
    return [
      createDataFrame({
        refId: opts.refId,
        name: opts.signal || "metrics",
        meta: liveMeta({
          preferredVisualisationType: "graph",
          apiProfile: "signoz-v3",
          empty: true
        }),
        fields: [
          { name: "Time", type: "time", values: [] },
          { name: "Value", type: "number", values: [] }
        ]
      })
    ];
  }
  const result = body?.data?.result ?? body?.data?.data?.result ?? body?.result;
  if (Array.isArray(result) && result.length) {
    const frames = [];
    for (let idx = 0; idx < result.length; idx++) {
      const entry = result[idx];
      if (Array.isArray(entry?.series)) {
        for (const s of entry.series) {
          const labels2 = labelsFromUnknown(
            s?.labels ?? s?.labelsArray ?? entry?.metric
          );
          const pts = Array.isArray(s?.values) ? s.values : [];
          const times2 = pts.map(parsePointTime);
          const values2 = pts.map(parsePointValue);
          const baseName = entry.queryName && String(entry.queryName) || labels2.__name__ || `series ${idx}`;
          const name2 = seriesName(labels2, opts.legendFormat, baseName);
          frames.push(
            createDataFrame({
              refId: opts.refId,
              name: name2,
              meta: liveMeta({
                preferredVisualisationType: "graph",
                apiProfile: "signoz-v3",
                labels: labels2
              }),
              fields: [
                { name: "Time", type: "time", values: times2 },
                {
                  name: "Value",
                  type: "number",
                  values: values2,
                  labels: labels2,
                  config: { displayNameFromDS: name2 }
                }
              ]
            })
          );
        }
        continue;
      }
      const metric = entry.metric || entry.labels || {};
      const labels = labelsFromUnknown(metric);
      const name = seriesName(
        labels,
        opts.legendFormat,
        metric.__name__ || `series ${idx}`
      );
      let times = [];
      let values = [];
      if (entry.values) {
        times = entry.values.map(parsePointTime);
        values = entry.values.map(parsePointValue);
      } else if (entry.value) {
        times = [parsePointTime(entry.value)];
        values = [parsePointValue(entry.value)];
      }
      frames.push(
        createDataFrame({
          refId: opts.refId,
          name,
          meta: liveMeta({
            preferredVisualisationType: "graph",
            apiProfile: "signoz-v3",
            labels
          }),
          fields: [
            { name: "Time", type: "time", values: times },
            {
              name: "Value",
              type: "number",
              values,
              labels,
              config: { displayNameFromDS: name }
            }
          ]
        })
      );
    }
    if (frames.length) return frames;
  }
  throw new DataSourceError(
    "UNSUPPORTED_RESPONSE_SHAPE",
    `无法映射 time_series/legacy body; schema=${schemaSummary(body)}`
  );
}
function mapSignozResponse(body, profileId, opts) {
  const isNative = profileId.startsWith("signoz") || profileId === "argus-v5" || profileId === "prometheus-compatible";
  const profileShape = isNative ? "native" : "custom";
  if (profileId === "custom" && body == null) {
    throw new DataSourceError(
      "UNSUPPORTED_RESPONSE_SHAPE",
      "custom profile empty body"
    );
  }
  const strictV5 = isV5WireProfile(profileId);
  let envelope;
  try {
    envelope = extractSignozEnvelope(
      body,
      profileShape === "custom" ? "native" : profileShape,
      {
        strictV5: strictV5 && !body?.data?.resultType
      }
    );
  } catch (e) {
    if (body?.data?.resultType || body?.data?.result) {
      return mapSignozV3Response(body, opts);
    }
    const signal = String(opts.signal || "").toLowerCase();
    if (signal === "logs" || signal === "traces" || body && typeof body === "object" && (Array.isArray(body.logs) || Array.isArray(body.traces) || Array.isArray(body.rows))) {
      return mapRawResponse(body, opts);
    }
    throw e;
  }
  const type = (opts.requestType || envelope.type || "").toLowerCase() || envelope.type;
  const warnings = envelope.warning;
  if (type === "distribution" || envelope.type === "distribution") {
    return mapDistributionResponse(envelope.results, {
      ...opts,
      experimentalDistribution: opts.experimentalDistribution
    });
  }
  if (type === "scalar" || envelope.type === "scalar") {
    return mapScalarResponse(envelope.results, { ...opts, warnings });
  }
  if (type === "raw_stream" || envelope.type === "raw_stream") {
    return mapRawStreamResponse(envelope.results, { ...opts, warnings });
  }
  if (type === "raw" || envelope.type === "raw" || opts.signal === "logs") {
    if (envelope.type === "raw" || type === "raw") {
      return mapRawRows(envelope.results, { ...opts, warnings });
    }
  }
  const envelopeIsAggregation = envelope.type === "time_series";
  if ((type === "trace" || envelope.type === "trace" || opts.signal === "traces") && !envelopeIsAggregation) {
    const looksLikeSearch = !envelope.results.length || envelope.results.some(
      (r) => isTraceSearchResult(r) || Array.isArray(r?.list) || Array.isArray(r?.traces) || Array.isArray(r?.rows)
    );
    const looksLikeDetail = envelope.results.some(
      (r) => Array.isArray(r?.spans) && r.spans.length
    );
    if (looksLikeSearch && !looksLikeDetail) {
      return mapTraceList(envelope.results, opts, warnings);
    }
    return mapTraceDetail(body, opts);
  }
  const hasAggSeries = (envelope.results || []).some(
    (r) => Array.isArray(r?.aggregations) || Array.isArray(r?.series)
  );
  if (hasAggSeries && (envelope.type === "time_series" || type === "time_series")) {
    return mapSignozV5AggResponse(
      {
        status: envelope.status || "success",
        data: { results: envelope.results }
      },
      { ...opts, signal: opts.signal || "metrics" }
    );
  }
  if (body?.data?.resultType || body?.data?.result)
    return mapSignozV3Response(body, opts);
  if (envelope.type === "time_series" || type === "time_series") {
    const asV3 = {
      status: envelope.status || "success",
      data: {
        resultType: "matrix",
        result: envelope.results
      }
    };
    return mapSignozV3Response(asV3, opts);
  }
  if (envelope.type === "unknown" && !envelope.results.length) {
    return [
      createDataFrame({
        refId: opts.refId,
        name: opts.signal || "empty",
        meta: liveMeta({ source: "live", empty: true, warnings }),
        fields: [
          { name: "Time", type: "time", values: [] },
          { name: "Value", type: "number", values: [] }
        ]
      })
    ];
  }
  throw new DataSourceError(
    "UNSUPPORTED_RESPONSE_SHAPE",
    `unknown result type=${envelope.type}; schema=${envelope.schemaSummary || schemaSummary(body)}`
  );
}
function mapTraceDetail(body, opts) {
  return normalizeTraceFrames(
    mapTraceDetailBody(body, {
      refId: opts.refId,
      datasourceUid: opts.datasourceUid,
      profile: opts.profile,
      requestId: opts.requestId
    })
  );
}
function mapTraceList(results, opts, warnings) {
  return normalizeTraceFrames(
    mapTraceSearchResults(results, {
      refId: opts.refId,
      datasourceUid: opts.datasourceUid,
      profile: opts.profile,
      requestId: opts.requestId,
      warnings,
      nextCursor: results[0]?.nextCursor
    })
  );
}
function defaultBuilderSpec(name = "A", signal = "traces", opts) {
  const forceMetrics = opts?.forceMetricsHost || signal === "metrics";
  const effective = forceMetrics ? "metrics" : signal;
  const aggregations = effective === "metrics" ? [
    {
      kind: "metric",
      metricName: "",
      timeAggregation: "rate",
      spaceAggregation: "sum"
    }
  ] : [{ kind: "expression", expression: "count()" }];
  return {
    name,
    signal: effective,
    source: void 0,
    stepInterval: 60,
    tags: [],
    disabled: false,
    filter: { expression: "" },
    having: { expression: "" },
    groupBy: [],
    // Aggregation requestTypes (default time_series) reject order-by timestamp.
    // List/raw panels set order via QueryAddons; wire also re-adds defaults when needed.
    order: [],
    limit: 100,
    legend: "",
    functions: [],
    aggregations
  };
}
function defaultAggregationsForSignal(signal) {
  if (signal === "metrics") {
    return [
      {
        kind: "metric",
        metricName: "",
        timeAggregation: "rate",
        spaceAggregation: "sum"
      }
    ];
  }
  return [{ kind: "expression", expression: "count()" }];
}
function defaultPromItem(name = "A", expr = "") {
  return {
    type: "builder_query",
    queryType: "promql",
    spec: defaultBuilderSpec(name, "metrics"),
    rawQuery: expr,
    rawLegend: ""
  };
}
const DEFAULT_SIGNOZ_QUERY = {
  refId: "A",
  schema: 1,
  apiProfile: "signoz-v5",
  requestType: "time_series",
  queries: [
    {
      type: "builder_query",
      queryType: "builder",
      spec: defaultBuilderSpec("A", "traces")
    }
  ],
  signal: "traces",
  expr: "",
  legendFormat: "",
  limit: 100,
  formatOptions: { fillGaps: false, formatTableResultForUI: false }
};
const DEFAULT_SIGNOZ_OPTIONS = {
  schema: 1,
  apiProfile: "signoz-v5",
  timeout: 3e4,
  metadataCacheTTL: "5m",
  rawPageSize: 100,
  liveTailIntervalMs: 2e3,
  maxConcurrentRequests: 4,
  credentialKind: "signozApiKey",
  credentialHeaderName: "SIGNOZ-API-KEY",
  fetchCredentials: "omit",
  customHealthOk: false,
  customHealthSignature: "",
  dataMode: "live"
};
const STABLE_FUNCTIONS = [
  "cutOffMin",
  "cutOffMax",
  "clampMin",
  "clampMax",
  "absolute",
  "runningDiff",
  "log2",
  "log10",
  "cumulativeSum",
  "ewma3",
  "ewma5",
  "ewma7",
  "median3",
  "median5",
  "median7",
  "timeShift",
  "fillZero"
];
const FUNCTION_ARG_NAMES = {
  cutOffMin: ["threshold"],
  cutOffMax: ["threshold"],
  clampMin: ["threshold"],
  clampMax: ["threshold"],
  timeShift: ["shift"],
  absolute: [],
  runningDiff: [],
  log2: [],
  log10: [],
  cumulativeSum: [],
  ewma3: [],
  ewma5: [],
  ewma7: [],
  median3: [],
  median5: [],
  median7: [],
  fillZero: [],
  anomaly: []
};
const SIGNOZ_FUNCTION_CATALOG = STABLE_FUNCTIONS.map((name) => ({ name, category: "transform" }));
function normalizeFunctionArgs(name, args) {
  const names = FUNCTION_ARG_NAMES[name] || [];
  const list = Array.isArray(args) ? args : [];
  return list.map((a, i) => {
    if (a != null && typeof a === "object" && "value" in a) {
      const val = String(a.value ?? "");
      const n = a.name != null && String(a.name) !== "" ? String(a.name) : names[i] || (names.length === 1 ? names[0] : `arg${i}`);
      return { name: n, value: val };
    }
    return {
      name: names[i] || (names.length === 1 ? names[0] : `arg${i}`),
      value: String(a ?? "")
    };
  });
}
function resolveEditorCapabilities(args) {
  const id = String(args.profile.id);
  const exp = args.options?.experimentalCapabilities || {};
  const product = id === "signoz-v5" || id === "argus-v5" || id === "signoz-v4" || id === "signoz-v3";
  return {
    builder: product || id === "custom",
    formula: product || id === "custom",
    promql: true,
    clickhouseSql: product || id === "custom",
    traceOperator: product,
    subQuery: Boolean(exp.builderSubQuery),
    join: Boolean(exp.builderJoin),
    anomaly: Boolean(exp.anomaly),
    distribution: Boolean(exp.distribution),
    alerts: Boolean(args.profile.endpoints.alertsQuery?.path) || product
  };
}
function allowedRequestTypes(caps2) {
  const list = [
    "time_series",
    "scalar",
    "raw",
    "raw_stream",
    "trace"
  ];
  if (caps2.distribution) list.push("distribution");
  return list;
}
function validateSavedItem(item, caps2) {
  if (item.type === "builder_sub_query" && !caps2.subQuery) {
    return {
      ok: false,
      message: "builder_sub_query 当前不可用（缺少 capability VERIFIED）"
    };
  }
  if (item.type === "builder_join" && !caps2.join) {
    return {
      ok: false,
      message: "builder_join 当前不可用（缺少 capability VERIFIED）"
    };
  }
  if (item.type === "builder_trace_operator" && !caps2.traceOperator) {
    return { ok: false, message: "builder_trace_operator 当前 profile 不支持" };
  }
  if (item.type === "builder_query" && item.spec.functions?.length) {
    for (const fn of item.spec.functions) {
      if (fn.name === "anomaly" && !caps2.anomaly) {
        return {
          ok: false,
          message: "anomaly 函数当前不可用（缺少 capability VERIFIED）"
        };
      }
      if (fn.name !== "anomaly" && !STABLE_FUNCTIONS.includes(fn.name)) {
        return { ok: false, message: `函数 ${fn.name} 当前 profile 不支持` };
      }
    }
  }
  return { ok: true };
}
function functionsForEditor(caps2) {
  const list = STABLE_FUNCTIONS.map(
    (name) => ({ name, label: name })
  );
  if (caps2.anomaly) list.push({ name: "anomaly", label: "anomaly (licensed)" });
  return list;
}
function deepClone$2(v) {
  try {
    return structuredClone(v);
  } catch {
    return JSON.parse(JSON.stringify(v));
  }
}
function migrateLimitBy(raw, fallbackLimit) {
  if (raw == null) return void 0;
  if (Array.isArray(raw)) {
    const keys = raw.map((x) => typeof x === "string" ? x : x?.key).filter((k) => Boolean(k));
    if (!keys.length) return void 0;
    const firstVal = raw[0] && typeof raw[0] === "object" ? raw[0].value : void 0;
    const value = firstVal != null && firstVal !== "" ? Number(firstVal) : fallbackLimit != null ? Number(fallbackLimit) : 10;
    return { keys, value: Number.isFinite(value) ? value : 10 };
  }
  if (typeof raw === "object" && Array.isArray(raw.keys)) {
    const keys = raw.keys.map(String).filter(Boolean);
    if (!keys.length) return void 0;
    const value = raw.value != null ? Number(raw.value) : fallbackLimit != null ? Number(fallbackLimit) : void 0;
    return {
      keys,
      value: value != null && Number.isFinite(value) ? value : void 0
    };
  }
  return void 0;
}
function migrateJoinOn(raw) {
  if (raw == null) return "";
  if (typeof raw === "string") return raw;
  if (Array.isArray(raw)) {
    return raw.map((p) => {
      const l = p?.left ?? p?.l ?? "";
      const r = p?.right ?? p?.r ?? l;
      if (!l && !r) return "";
      return `${l} = ${r}`;
    }).filter(Boolean).join(" AND ");
  }
  return String(raw);
}
function migrateBuilderSpec(spec) {
  if (!spec || typeof spec !== "object") return spec;
  const next = { ...spec };
  if (next.functions) {
    next.functions = next.functions.map((f) => ({
      name: f.name,
      args: normalizeFunctionArgs(String(f.name || ""), f.args)
    }));
  }
  if (next.limitBy != null) {
    next.limitBy = migrateLimitBy(next.limitBy, next.limit);
  }
  return next;
}
function migrateQueryItem(item) {
  if (!item || typeof item !== "object") return item;
  if (item.type === "builder_query" && item.spec) {
    return { ...item, spec: migrateBuilderSpec(item.spec) };
  }
  if (item.type === "builder_join" && item.spec) {
    return {
      ...item,
      spec: {
        ...item.spec,
        on: migrateJoinOn(item.spec.on)
      }
    };
  }
  return item;
}
function migrateSigNozQuery(input) {
  const src = deepClone$2(input);
  if (Array.isArray(src.queries) && src.queries.length) {
    const queries2 = src.queries.map(migrateQueryItem);
    return {
      ...DEFAULT_SIGNOZ_QUERY,
      ...src,
      schema: 1,
      queries: queries2
    };
  }
  const signal = String(src.signal || "metrics");
  const expr = String(src.expr || src.query || "");
  const formula = String(src.formula || "");
  const name = String(src.refId || "A");
  const queries = [];
  if (formula) {
    queries.push({
      type: "builder_formula",
      spec: {
        name: "F1",
        expression: formula,
        disabled: false,
        legend: "",
        order: []
      }
    });
  }
  if (signal === "metrics" || !signal) {
    queries.unshift(defaultPromItem(name, expr));
  } else {
    const spec = defaultBuilderSpec(
      name,
      signal === "logs" || signal === "traces" ? signal : "metrics"
    );
    spec.service = src.service != null ? String(src.service) : void 0;
    spec.operation = src.operation != null ? String(src.operation) : void 0;
    spec.limit = src.limit != null ? Number(src.limit) : void 0;
    spec.legend = String(src.legendFormat || "");
    queries.unshift({
      type: "builder_query",
      queryType: "builder",
      spec,
      rawQuery: expr,
      rawLegend: String(src.legendFormat || "")
    });
  }
  return {
    refId: String(src.refId || "A"),
    hide: Boolean(src.hide),
    datasource: src.datasource,
    schema: 1,
    apiProfile: src.apiProfile || DEFAULT_SIGNOZ_QUERY.apiProfile,
    queries: queries.map(migrateQueryItem),
    signal,
    expr,
    service: src.service != null ? String(src.service) : void 0,
    operation: src.operation != null ? String(src.operation) : void 0,
    formula: formula || void 0,
    legendFormat: src.legendFormat != null ? String(src.legendFormat) : "",
    limit: src.limit != null ? Number(src.limit) : 100
  };
}
function migrateSigNozConfig(input) {
  const src = deepClone$2(input);
  let profile = String(src.apiProfile || DEFAULT_SIGNOZ_OPTIONS.apiProfile);
  if (!SIGNOZ_PROFILES[profile]) profile = "signoz-v5";
  let timeout = Number(src.timeout ?? DEFAULT_SIGNOZ_OPTIONS.timeout);
  if (!Number.isFinite(timeout) || timeout <= 0)
    timeout = DEFAULT_SIGNOZ_OPTIONS.timeout;
  if (typeof src.timeout === "string")
    timeout = Number(src.timeout) || DEFAULT_SIGNOZ_OPTIONS.timeout;
  const cacheTTL = String(
    src.metadataCacheTTL || src.cacheTTL || DEFAULT_SIGNOZ_OPTIONS.metadataCacheTTL
  );
  const options = {
    ...DEFAULT_SIGNOZ_OPTIONS,
    ...src,
    schema: 1,
    apiProfile: profile,
    timeout,
    metadataCacheTTL: cacheTTL,
    credentialKind: src.credentialKind || "bearer",
    customHealthOk: Boolean(src.customHealthOk),
    customHealthSignature: String(src.customHealthSignature || "")
  };
  if (options.apiProfile === "custom") {
    const url = String(src.url || "");
    const sig = buildCustomHealthSignature(url, options);
    if (options.customHealthOk && options.customHealthSignature !== sig) {
      options.customHealthOk = false;
    }
    const resolved = resolveSigNozProfile(options);
    if (!resolved.signals.length) {
      options.customHealthOk = false;
    }
  }
  return options;
}
function stableSerialize(value) {
  if (value === void 0) return "undefined";
  if (value === null || typeof value !== "object") return JSON.stringify(value);
  if (Array.isArray(value)) return `[${value.map(stableSerialize).join(",")}]`;
  const obj = value;
  const keys = Object.keys(obj).filter((k) => obj[k] !== void 0).sort();
  return `{${keys.map((k) => `${JSON.stringify(k)}:${stableSerialize(obj[k])}`).join(",")}}`;
}
function hashParams(params) {
  return stableSerialize(params || {});
}
function serializeCacheKey(key) {
  return stableSerialize({
    uid: key.uid,
    profile: key.profile,
    normalizedBaseUrl: key.normalizedBaseUrl,
    organizationId: key.organizationId || "",
    authMode: key.authMode || "",
    credentialRevision: key.credentialRevision || "",
    observedVersion: key.observedVersion || "",
    deploymentFingerprint: key.deploymentFingerprint || "",
    endpointContractHash: key.endpointContractHash || "",
    method: key.method,
    path: key.path,
    paramsHash: key.paramsHash
  });
}
function identityPrefix(id) {
  return stableSerialize({
    uid: id.uid,
    profile: id.profile,
    normalizedBaseUrl: id.normalizedBaseUrl,
    organizationId: id.organizationId || "",
    authMode: id.authMode || "",
    credentialRevision: id.credentialRevision || "",
    observedVersion: id.observedVersion || "",
    deploymentFingerprint: id.deploymentFingerprint || "",
    endpointContractHash: id.endpointContractHash || ""
  });
}
const MAX_ENTRIES = 500;
class SigNozMetadataCache {
  entries = /* @__PURE__ */ new Map();
  get(key) {
    const s = serializeCacheKey(key);
    const hit = this.entries.get(s);
    if (!hit) return void 0;
    if (hit.expiresAt <= Date.now()) {
      this.entries.delete(s);
      return void 0;
    }
    hit.lastAccess = Date.now();
    return hit.value;
  }
  set(key, value, ttlMs2) {
    if (ttlMs2 <= 0) return;
    if (value == null) return;
    if (this.entries.size >= MAX_ENTRIES) this.evict();
    this.entries.set(serializeCacheKey(key), {
      value,
      expiresAt: Date.now() + ttlMs2,
      lastAccess: Date.now()
    });
  }
  /** Clear all entries for a UID (identity change / auth failure). */
  clearUid(uid) {
    for (const k of [...this.entries.keys()]) {
      if (k.includes(`"uid":${JSON.stringify(uid)}`) || k.includes(`"uid":"${uid}"`)) {
        this.entries.delete(k);
      }
    }
  }
  clearIdentity(id) {
    const prefix = identityPrefix(id);
    for (const k of [...this.entries.keys()]) {
      if (k.startsWith(prefix.slice(0, 20)) || k.includes(`"uid":${JSON.stringify(id.uid)}`)) {
        if (k.includes(JSON.stringify(id.uid)) && k.includes(JSON.stringify(id.profile))) {
          this.entries.delete(k);
        }
      }
    }
  }
  clearAll() {
    this.entries.clear();
  }
  size() {
    return this.entries.size;
  }
  evict() {
    let oldestKey = null;
    let oldest = Infinity;
    for (const [k, v] of this.entries) {
      if (v.lastAccess < oldest) {
        oldest = v.lastAccess;
        oldestKey = k;
      }
    }
    if (oldestKey) this.entries.delete(oldestKey);
  }
}
const sharedSigNozMetadataCache = new SigNozMetadataCache();
function validateHealthV1(status, data) {
  if (status < 200 || status >= 300) {
    throw new DataSourceError("UPSTREAM_ERROR", `health v1 HTTP ${status}`, {
      status
    });
  }
  if (data == null || typeof data !== "object") {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "health v1 body missing or not object"
    );
  }
  const st = String(data.status ?? "").toLowerCase();
  if (st !== "ok") {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      `health v1 status must be 'ok', got ${st || "empty"}`
    );
  }
}
function validateHealthV2(status, data) {
  if (status === 503) {
    throw new DataSourceError(
      "UPSTREAM_ERROR",
      "health v2 reports unhealthy (503)",
      { status: 503 }
    );
  }
  if (status < 200 || status >= 300) {
    throw new DataSourceError("UPSTREAM_ERROR", `health v2 HTTP ${status}`, {
      status
    });
  }
  if (data == null || typeof data !== "object") {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "health v2 body missing or not object"
    );
  }
  const o = data;
  const st = String(o.status ?? "").toLowerCase();
  if (st !== "success") {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      `health v2 status must be 'success', got ${st || "empty"}`
    );
  }
  const d = o.data;
  if (d == null || typeof d !== "object") {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "health v2 data.healthy missing"
    );
  }
  if (d.healthy !== true) {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "health v2 data.healthy must be true"
    );
  }
}
function isFallbackStatus(status) {
  return status === 404 || status === 405 || status === 501;
}
function parseVersionPayload(data) {
  if (data == null || typeof data !== "object") return {};
  const o = data;
  const nested = o.data && typeof o.data === "object" ? o.data : o;
  return {
    version: nested.version != null ? String(nested.version) : o.version != null ? String(o.version) : void 0,
    ee: nested.ee != null ? Boolean(nested.ee) : o.ee != null ? Boolean(o.ee) : void 0,
    setupCompleted: nested.setupCompleted != null ? Boolean(nested.setupCompleted) : o.setupCompleted != null ? Boolean(o.setupCompleted) : void 0
  };
}
function healthCandidatesFor(profile, opts) {
  const list = profile.endpoints.healthCandidates?.length ? profile.endpoints.healthCandidates : profile.endpoints.health ? [profile.endpoints.health] : [];
  let ordered = list.map((h2) => {
    const path = h2.path;
    const kind2 = path.includes("healthz") || path.includes("v2") ? "v2" : path.includes("v1") ? "v1" : "other";
    return { path, method: h2.method, kind: kind2 };
  });
  if (opts?.preferV1First) {
    ordered = [...ordered].sort(
      (a, b) => a.kind === "v1" ? -1 : b.kind === "v1" ? 1 : 0
    );
  }
  return ordered;
}
async function probeHealth(http, profile, opts) {
  const candidates = healthCandidatesFor(profile, opts);
  if (!candidates.length) {
    return {
      ok: false,
      path: "",
      fatal: true,
      reason: "no health endpoint",
      reasonCode: "NO_HEALTH"
    };
  }
  let last = {
    ok: false,
    path: candidates[0].path,
    fatal: true,
    reason: "no candidate succeeded"
  };
  for (const c of candidates) {
    try {
      const res = await http({
        path: c.path,
        method: c.method || "GET",
        signal: opts?.signal
      });
      const status = Number(res.status || 0);
      if (status === 401 || status === 403) {
        return {
          ok: false,
          path: c.path,
          fatal: true,
          status,
          reason: "authentication failed",
          reasonCode: "AUTH"
        };
      }
      if (status === 429) {
        return {
          ok: false,
          path: c.path,
          fatal: true,
          status,
          reason: "rate limited",
          reasonCode: "RATE_LIMITED"
        };
      }
      if (status >= 500 && status !== 503) {
        return {
          ok: false,
          path: c.path,
          fatal: true,
          status,
          reason: `server error ${status}`,
          reasonCode: "UPSTREAM_ERROR"
        };
      }
      if (isFallbackStatus(status)) {
        last = {
          ok: false,
          path: c.path,
          fatal: false,
          status,
          reason: `fallback status ${status}`
        };
        continue;
      }
      try {
        if (c.kind === "v2") validateHealthV2(status, res.data);
        else if (c.kind === "v1") validateHealthV1(status, res.data);
        else if (status < 200 || status >= 300) {
          throw new DataSourceError("UPSTREAM_ERROR", `health HTTP ${status}`);
        }
        return { ok: true, path: c.path, details: { status, kind: c.kind } };
      } catch (e) {
        const msg = e instanceof Error ? e.message : String(e);
        if (e instanceof DataSourceError && e.code === "INVALID_RESPONSE") {
          last = { ok: false, path: c.path, fatal: false, status, reason: msg };
          continue;
        }
        return {
          ok: false,
          path: c.path,
          fatal: true,
          status,
          reason: msg,
          reasonCode: e instanceof DataSourceError ? e.code : "UPSTREAM_ERROR"
        };
      }
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      const code = e instanceof DataSourceError ? e.code : void 0;
      if (code === "AUTH_REQUIRED" || code === "AUTH_REJECTED" || /401|403|AUTH/i.test(msg)) {
        return {
          ok: false,
          path: c.path,
          fatal: true,
          reason: msg,
          reasonCode: "AUTH"
        };
      }
      last = { ok: false, path: c.path, fatal: false, reason: msg };
    }
  }
  return last;
}
function buildCapabilityIdentity(args) {
  return {
    uid: args.uid,
    profile: String(args.options.apiProfile || ""),
    normalizedBaseUrl: String(args.baseUrl || "").replace(/\/+$/, ""),
    organizationId: args.options.organizationId || "",
    authMode: args.options.credentialKind || "",
    credentialRevision: args.credentialRevision || "",
    observedVersion: args.observedVersion || "",
    deploymentFingerprint: args.deploymentFingerprint || "",
    endpointContractHash: args.endpointContractHash || ""
  };
}
function capabilityIdentityKey(id) {
  return identityPrefix(id);
}
function parseCacheTtlMs(raw, fallback = 3e5) {
  if (typeof raw === "number" && Number.isFinite(raw))
    return Math.max(0, Math.floor(raw));
  const s = String(raw ?? "").trim();
  if (!s) return fallback;
  const m = s.match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)$/i);
  if (!m) return fallback;
  const n = Number(m[1]);
  const scale = {
    ms: 1,
    s: 1e3,
    m: 6e4,
    h: 36e5,
    d: 864e5
  };
  return Math.floor(n * scale[m[2].toLowerCase()]);
}
function parseTimeoutMs(raw, fallback = 3e4) {
  const n = Number(raw);
  if (!Number.isFinite(n) || n <= 0) return fallback;
  return Math.floor(n);
}
function resolveLiveExportCapabilities(args) {
  const exp = args.options?.experimentalCapabilities || {};
  const ep = args.profile.endpoints;
  return {
    sseVerified: Boolean(exp.liveTailSse && ep.liveTail?.path),
    legacySseEnabled: Boolean(exp.liveTailLegacy && ep.liveTailLegacy?.path),
    // cursor poll available when logs query_range exists (raw/raw_stream)
    cursorPoll: Boolean(ep.logsQuery?.path || ep.metricsQuery?.path),
    exportRawVerified: Boolean(exp.exportRaw && ep.exportRaw?.path),
    liveTailPath: ep.liveTail?.path,
    legacyLiveTailPath: ep.liveTailLegacy?.path,
    exportRawPath: ep.exportRaw?.path
  };
}
const WATERFALL_ENDPOINT_SPECS = {
  "v3-waterfall": {
    id: "v3-waterfall",
    method: "POST",
    path: "/api/v3/traces/{traceId}/waterfall",
    buildBody: (state2) => ({
      selectedSpanId: state2.selectedSpanId ?? "",
      uncollapsedSpans: sortUnique(state2.uncollapsedSpans ?? []),
      aggregations: canonicalizeAggregations(state2.aggregations).slice(0, 10),
      limit: Math.min(state2.limit ?? 1e4, 1e4)
    })
  },
  "v4-waterfall": {
    id: "v4-waterfall",
    method: "POST",
    path: "/api/v4/traces/{traceId}/waterfall",
    buildBody: (state2) => ({
      selectedSpanId: state2.selectedSpanId ?? "",
      uncollapsedSpans: sortUnique(state2.uncollapsedSpans ?? [])
    })
  }
};
const ALLOWED_AGG = /* @__PURE__ */ new Set([
  "span_count",
  "execution_time_percentage",
  "duration"
]);
function sortUnique(ids) {
  return [...new Set(ids.map(String).filter(Boolean))].sort();
}
function canonicalizeAggregations(aggs) {
  if (!aggs?.length) return [];
  const out = [];
  for (const a of aggs) {
    const t2 = typeof a === "string" ? a : a?.type;
    if (ALLOWED_AGG.has(t2)) out.push({ type: t2 });
  }
  return out;
}
function waterfallCandidateIds(hasObservedV3Evidence) {
  return hasObservedV3Evidence ? ["v3-waterfall", "v4-waterfall"] : ["v4-waterfall", "v3-waterfall"];
}
function buildWaterfallPath(spec, traceId) {
  return spec.path.replace("{traceId}", encodeURIComponent(traceId));
}
function isRouteUnsupportedStatus(status) {
  return status === 404 || status === 405 || status === 501;
}
function shouldTryNextWaterfallCandidate(status, err) {
  if (isRouteUnsupportedStatus(status)) return true;
  const msg = String(err?.message || "");
  if (/unsupported|not found|no route|schema/i.test(msg) && !/401|403|429|5\d\d/.test(msg))
    return true;
  if (status === 401 || status === 403 || status === 429 || status >= 500)
    return false;
  return false;
}
function waterfallCapabilityKey(identity2) {
  return capabilityIdentityKey(identity2);
}
function waterfallResponseCacheKey(args) {
  const v4 = args.normalizeForV4 || args.resolvedEndpointId === "v4-waterfall";
  return hashParams({
    capabilityKey: args.capabilityKey,
    resolvedEndpoint: args.resolvedEndpointId,
    traceId: args.traceId,
    selectedSpanId: args.state.selectedSpanId ?? "",
    uncollapsedSpans: sortUnique(args.state.uncollapsedSpans ?? []),
    limit: v4 ? "" : Math.min(args.state.limit ?? 1e4, 1e4),
    aggregations: v4 ? [] : canonicalizeAggregations(args.state.aggregations)
  });
}
function createMemoryWaterfallCache() {
  const resolved = /* @__PURE__ */ new Map();
  const details = /* @__PURE__ */ new Map();
  return {
    getResolved: (k) => resolved.get(k),
    setResolved: (k, v) => resolved.set(k, v),
    getDetail: (k) => details.get(k),
    setDetail: (k, v) => details.set(k, v),
    clearIdentity: (prefix) => {
      for (const k of [...resolved.keys()])
        if (k.includes(prefix) || k === prefix) resolved.delete(k);
      for (const k of [...details.keys()])
        if (k.includes(prefix) || k.startsWith(prefix)) details.delete(k);
    }
  };
}
function mapWaterfallPayload(data, candidateId, path, status) {
  const root = data && typeof data === "object" ? data : {};
  const payload = root.data && typeof root.data === "object" ? root.data : root;
  const spansRaw = payload.spans || payload.spanList || payload.events || [];
  const list = Array.isArray(spansRaw) ? spansRaw : [];
  const spans = list.map((s) => {
    const durationNano = s.duration_nano != null ? String(s.duration_nano) : s.durationNano != null ? String(s.durationNano) : s.duration != null && Number(s.duration) > 1e6 ? String(s.duration) : String(Math.round(Number(s.durationMs || s.duration || 0) * 1e6));
    const timeUnixMs = (() => {
      const t2 = s.time_unix ?? s.timeUnix ?? s.startTimeUnixNano ?? s.startTime ?? s.timestamp;
      if (t2 == null) return 0;
      const n = Number(t2);
      if (!Number.isFinite(n)) return 0;
      if (n > 1e15) return Math.floor(n / 1e6);
      if (n > 1e12) return Math.floor(n / 1e3);
      return Math.floor(n);
    })();
    const durationMs = Number(durationNano) / 1e6;
    return {
      spanId: String(s.spanId ?? s.span_id ?? s.id ?? ""),
      parentSpanId: String(
        s.parentSpanId ?? s.parent_span_id ?? s.parentId ?? ""
      ),
      name: String(s.name ?? s.operationName ?? s.operation_name ?? ""),
      service: String(
        s.serviceName ?? s.service_name ?? s.service ?? s.resource?.["service.name"] ?? ""
      ),
      timeUnixMs,
      durationNano,
      durationMs: Number.isFinite(durationMs) ? durationMs : Number(s.durationMs || s.duration || 0),
      statusCode: s.statusCode != null ? String(s.statusCode) : s.status?.code != null ? String(s.status.code) : void 0,
      hasError: Boolean(
        s.hasError ?? s.error ?? (s.statusCode === 2 || s.status?.code === 2)
      ),
      resource: s.resource && typeof s.resource === "object" ? s.resource : void 0,
      attributes: s.attributes || s.tags || void 0,
      events: Array.isArray(s.events) ? s.events : void 0,
      links: Array.isArray(s.links) ? s.links : void 0,
      references: Array.isArray(s.references) ? s.references : void 0,
      raw: s
    };
  });
  return {
    candidateId,
    path,
    status,
    startMs: payload.start != null ? Number(payload.start) : spans[0]?.timeUnixMs,
    endMs: payload.end != null ? Number(payload.end) : spans.length ? Math.max(...spans.map((x) => x.timeUnixMs + x.durationMs)) : void 0,
    rootService: payload.rootService || payload.root_service || spans.find((s) => !s.parentSpanId)?.service,
    entryPoint: payload.entryPoint || payload.entry_point || spans.find((s) => !s.parentSpanId)?.name,
    missingCount: payload.missingCount ?? payload.missing_count,
    totalCount: payload.totalCount ?? payload.total_count ?? spans.length,
    errorCount: payload.errorCount ?? payload.error_count ?? spans.filter((s) => s.hasError).length,
    uncollapsed: Array.isArray(payload.uncollapsedSpans) ? payload.uncollapsedSpans.map(String) : void 0,
    hasMore: Boolean(payload.hasMore ?? payload.has_more),
    spans,
    raw: data
  };
}
function waterfallDetailToFrames(detail, refId = "Trace") {
  const spans = detail.spans;
  return [
    createDataFrame({
      refId,
      name: "waterfall",
      meta: {
        source: "live",
        preferredVisualisationType: "trace",
        signal: "traces",
        waterfall: {
          candidateId: detail.candidateId,
          path: detail.path,
          status: detail.status,
          rootService: detail.rootService,
          entryPoint: detail.entryPoint,
          missingCount: detail.missingCount,
          totalCount: detail.totalCount,
          errorCount: detail.errorCount,
          hasMore: detail.hasMore
        }
      },
      fields: [
        { name: "spanId", type: "string", values: spans.map((s) => s.spanId) },
        {
          name: "parentSpanId",
          type: "string",
          values: spans.map((s) => s.parentSpanId)
        },
        { name: "name", type: "string", values: spans.map((s) => s.name) },
        {
          name: "serviceName",
          type: "string",
          values: spans.map((s) => s.service)
        },
        {
          name: "service",
          type: "string",
          values: spans.map((s) => s.service)
        },
        {
          name: "startTime",
          type: "number",
          values: spans.map((s) => s.timeUnixMs)
        },
        {
          name: "duration",
          type: "number",
          values: spans.map((s) => s.durationMs)
        },
        {
          name: "duration_nano",
          type: "string",
          values: spans.map((s) => s.durationNano)
        },
        {
          name: "statusCode",
          type: "string",
          values: spans.map((s) => s.statusCode ?? "")
        },
        {
          name: "attributes",
          type: "string",
          values: spans.map(
            (s) => s.attributes ? JSON.stringify(s.attributes) : ""
          )
        },
        {
          name: "events",
          type: "string",
          values: spans.map((s) => s.events ? JSON.stringify(s.events) : "")
        },
        {
          name: "links",
          type: "string",
          values: spans.map((s) => s.links ? JSON.stringify(s.links) : "")
        },
        {
          name: "references",
          type: "string",
          values: spans.map(
            (s) => s.references ? JSON.stringify(s.references) : ""
          )
        }
      ]
    })
  ];
}
async function fetchWaterfall(args) {
  const traceId = String(args.traceId || "").trim();
  if (!traceId) throw new DataSourceError("INVALID_QUERY", "traceId required");
  const cache2 = args.cache || createMemoryWaterfallCache();
  const capKey = waterfallCapabilityKey(args.identity);
  const state2 = args.state || {};
  const resolved = cache2.getResolved(capKey);
  const preferred = args.preferredCandidateId || resolved?.id;
  let candidates = waterfallCandidateIds(Boolean(args.hasObservedV3Evidence));
  if (preferred && candidates.includes(preferred)) {
    candidates = [
      preferred,
      ...candidates.filter((c) => c !== preferred)
    ];
  }
  let lastErr = null;
  for (const id of candidates) {
    const spec = WATERFALL_ENDPOINT_SPECS[id];
    const path = buildWaterfallPath(spec, traceId);
    const body = spec.buildBody(state2);
    const respKey = waterfallResponseCacheKey({
      capabilityKey: capKey,
      resolvedEndpointId: id,
      traceId,
      state: state2,
      normalizeForV4: id === "v4-waterfall"
    });
    const cached = cache2.getDetail(respKey);
    if (cached) return cached;
    try {
      const res = await args.http({
        path,
        method: spec.method,
        body,
        signal: args.signal
      });
      const status = Number(res.status || 0);
      if (status === 401 || status === 403) {
        throw new DataSourceError("AUTH", `waterfall HTTP ${status}`, {
          status
        });
      }
      if (status === 429 || status >= 500) {
        throw new DataSourceError(
          "UPSTREAM_ERROR",
          `waterfall HTTP ${status}`,
          { status }
        );
      }
      if (isRouteUnsupportedStatus(status)) {
        lastErr = new DataSourceError(
          "UNSUPPORTED_CAPABILITY",
          `waterfall ${id} HTTP ${status}`,
          { status }
        );
        continue;
      }
      if (status < 200 || status >= 300) {
        if (shouldTryNextWaterfallCandidate(status)) {
          lastErr = new DataSourceError(
            "UNSUPPORTED_CAPABILITY",
            `waterfall ${id} HTTP ${status}`,
            { status }
          );
          continue;
        }
        throw new DataSourceError(
          "UPSTREAM_ERROR",
          `waterfall HTTP ${status}`,
          { status }
        );
      }
      const detail = mapWaterfallPayload(res.data, id, path, status);
      cache2.setResolved(capKey, {
        id,
        path: spec.path,
        method: spec.method,
        observedAt: (/* @__PURE__ */ new Date()).toISOString()
      });
      cache2.setDetail(respKey, detail);
      return detail;
    } catch (e) {
      if (e instanceof DataSourceError && (e.code === "AUTH" || e.code === "UPSTREAM_ERROR"))
        throw e;
      if (e?.name === "AbortError" || e?.code === "CANCELLED") throw e;
      const status = Number(e?.status || e?.meta?.status || 0);
      if (shouldTryNextWaterfallCandidate(status, e)) {
        lastErr = e instanceof Error ? e : new Error(String(e));
        continue;
      }
      throw e;
    }
  }
  throw lastErr || new DataSourceError(
    "UNSUPPORTED_CAPABILITY",
    "no waterfall candidate succeeded"
  );
}
async function fetchRelatedLogs(args) {
  const traceId = String(args.traceId || "").trim();
  if (!traceId)
    throw new DataSourceError(
      "INVALID_QUERY",
      "traceId required for related logs"
    );
  if (!args.logsQueryPath) {
    throw new DataSourceError(
      "UNSUPPORTED_CAPABILITY",
      "related logs 需要 logs query_range path"
    );
  }
  const margin = args.safetyMarginMs ?? 6e4;
  const start = Math.max(0, args.fromMs - margin);
  const end = args.toMs + margin;
  const filter2 = `trace_id = '${traceId.replace(/'/g, "\\'")}' OR traceId = '${traceId.replace(/'/g, "\\'")}'`;
  let cursor = null;
  const allRows = [];
  const maxPages = args.maxPages ?? 50;
  for (let page = 0; page < maxPages; page++) {
    const body = {
      start,
      end,
      requestType: "raw",
      compositeQuery: {
        queries: [
          {
            type: "builder_query",
            queryType: "builder",
            spec: {
              name: "A",
              signal: "logs",
              filter: { expression: filter2 },
              disabled: false,
              cursor: cursor || void 0,
              limit: 100
            }
          }
        ]
      }
    };
    const res = await args.http({
      path: args.logsQueryPath,
      method: "POST",
      body,
      signal: args.signal
    });
    const status = Number(res.status || 200);
    if (status === 401 || status === 403) {
      throw new DataSourceError("AUTH", `related logs HTTP ${status}`, {
        status
      });
    }
    if (status < 200 || status >= 300) {
      throw new DataSourceError(
        "UPSTREAM_ERROR",
        `related logs HTTP ${status}`,
        { status }
      );
    }
    const data = res.data;
    const results = data?.data?.data?.results ?? data?.data?.results ?? data?.results ?? [];
    const first = Array.isArray(results) ? results[0] : null;
    const rows = first?.rows || first?.data || [];
    if (Array.isArray(rows)) allRows.push(...rows);
    const next = first?.nextCursor ?? first?.cursor ?? null;
    if (!next || next === cursor) break;
    cursor = next;
  }
  const times = allRows.map(
    (r) => Number(r.timestamp ?? r.time ?? r.ts ?? start)
  );
  const lines = allRows.map(
    (r) => String(
      r.body ?? r.message ?? r.line ?? (typeof r === "string" ? r : JSON.stringify(r))
    )
  );
  const services = allRows.map(
    (r) => String(
      r.service ?? r.resources_string?.["service.name"] ?? r["service.name"] ?? ""
    )
  );
  const severities = allRows.map((r) => String(r.severity ?? r.level ?? ""));
  const spanIds = allRows.map((r) => String(r.span_id ?? r.spanId ?? ""));
  return [
    createDataFrame({
      name: "related_logs",
      meta: {
        source: "live",
        signal: "logs",
        relatedTraceId: traceId,
        rowCount: allRows.length
      },
      fields: [
        { name: "Time", type: "time", values: times },
        { name: "Line", type: "string", values: lines },
        { name: "service", type: "string", values: services },
        { name: "severity", type: "string", values: severities },
        { name: "traceId", type: "string", values: allRows.map(() => traceId) },
        { name: "spanId", type: "string", values: spanIds }
      ]
    })
  ];
}
function issuesWriteEnabled(args) {
  const id = String(args.profileId);
  if (id === "signoz-v3" || id === "signoz-v4" || id === "signoz-v5" || id === "prometheus-compatible") {
    return { acknowledge: false, resolve: false };
  }
  const base = Boolean(args.enableWrites) && Boolean(args.envGate) && Boolean(args.actionCapabilityVerified);
  return {
    acknowledge: base && Boolean(args.hasAcknowledgeEndpoint),
    resolve: base && Boolean(args.hasResolveEndpoint)
  };
}
function mapAlertsResponse(body, opts) {
  const rows = body?.data || body?.alerts || body || [];
  const list = Array.isArray(rows) ? rows : [];
  return [
    createDataFrame({
      refId: opts.refId,
      name: "alerts",
      meta: { preferredVisualisationType: "table", signal: "alerts" },
      fields: [
        {
          name: "id",
          type: "string",
          values: list.map(
            (r, i) => String(r.id || r.alertId || i)
          )
        },
        {
          name: "title",
          type: "string",
          values: list.map(
            (r) => String(r.title || r.name || r.alertname || "")
          )
        },
        {
          name: "service",
          type: "string",
          values: list.map(
            (r) => String(r.service || r.labels?.service || "")
          )
        },
        {
          name: "severity",
          type: "string",
          values: list.map(
            (r) => String(r.severity || r.labels?.severity || "")
          )
        },
        {
          name: "status",
          type: "string",
          values: list.map((r) => String(r.status || r.state || "firing"))
        },
        {
          name: "Time",
          type: "time",
          values: list.map(
            (r) => Number(r.startsAt || r.time || Date.now())
          )
        },
        {
          name: "alertId",
          type: "string",
          values: list.map(
            (r, i) => String(r.alertId || r.id || i)
          )
        }
      ]
    })
  ];
}
const OFFLINE_METRICS = [
  {
    metricName: "up",
    description: "offline",
    type: "gauge",
    unit: "",
    temporality: "",
    isMonotonic: false
  },
  {
    metricName: "http_requests_total",
    description: "offline",
    type: "counter",
    unit: "",
    temporality: "Cumulative",
    isMonotonic: true
  }
];
const OFFLINE_SERVICES = ["frontend", "api", "checkout"];
function asArray(data) {
  if (Array.isArray(data)) return data;
  if (data && typeof data === "object") {
    const o = data;
    if (Array.isArray(o.data)) return o.data;
    if (Array.isArray(o.result)) return o.result;
    if (Array.isArray(o.metrics)) return o.metrics;
    if (Array.isArray(o.keys)) return o.keys;
    if (Array.isArray(o.values)) return o.values;
    if (o.data && typeof o.data === "object") {
      if (Array.isArray(o.data.metrics)) return o.data.metrics;
      if (Array.isArray(o.data.keys)) return o.data.keys;
      if (Array.isArray(o.data.values)) return o.data.values;
      if (o.data.keys && typeof o.data.keys === "object" && !Array.isArray(o.data.keys)) {
        return flattenKeysDict(o.data.keys);
      }
    }
    if (o.keys && typeof o.keys === "object" && !Array.isArray(o.keys)) {
      return flattenKeysDict(o.keys);
    }
  }
  return [];
}
function flattenKeysDict(dict) {
  const out = [];
  for (const [k, v] of Object.entries(dict || {})) {
    if (Array.isArray(v)) {
      for (const item of v) {
        if (item && typeof item === "object") out.push({ name: k, ...item });
        else out.push({ name: k });
      }
    } else if (v && typeof v === "object") {
      out.push({ name: k, ...v });
    } else {
      out.push({ name: k });
    }
  }
  return out;
}
function mapMetric(row) {
  return {
    metricName: String(row.metricName || row.name || row.metric || ""),
    description: String(row.description || row.desc || ""),
    type: String(row.type || row.metricType || ""),
    unit: String(row.unit || ""),
    temporality: String(row.temporality || ""),
    isMonotonic: Boolean(row.isMonotonic)
  };
}
function mapField(row) {
  return {
    name: String(row.name || row.key || row.attributeKey || ""),
    fieldDataType: String(
      row.fieldDataType || row.dataType || "string"
    ).toLowerCase() || "string",
    fieldContext: String(row.fieldContext || row.type || "tag").toLowerCase() || "tag"
  };
}
function mapStringValues(rows) {
  return rows.map(
    (r) => typeof r === "string" || typeof r === "number" ? String(r) : String(r?.value ?? r?.name ?? r?.serviceName ?? "")
  ).filter(Boolean);
}
function createSigNozMetadataApi(opts) {
  const cache2 = opts.cache || sharedSigNozMetadataCache;
  const ttlMs2 = opts.ttlMs ?? 3e5;
  const profile = opts.profile;
  const profileId = String(profile.id);
  async function liveHttp(req) {
    if (!opts.http) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        "SigNoz metadata http 未注入"
      );
    }
    try {
      return await opts.http(req);
    } catch (e) {
      const msg = e instanceof Error ? e.message : String(e);
      const code = e instanceof DataSourceError ? e.code : void 0;
      if (code === "AUTH_REQUIRED" || code === "AUTH_REJECTED" || /401|403/.test(msg)) {
        cache2.clearUid(opts.identity.uid);
      }
      throw e;
    }
  }
  async function cachedGet(method, path, params, signal, loader) {
    const key = {
      ...opts.identity,
      method,
      path,
      paramsHash: hashParams(params)
    };
    const hit = cache2.get(key);
    if (hit !== void 0) return hit;
    try {
      const value = await loader();
      if (signal?.aborted) throw new DOMException("Aborted", "AbortError");
      cache2.set(key, value, ttlMs2);
      return value;
    } catch (e) {
      throw e;
    }
  }
  function endpointOrThrow(kind2, label) {
    const ep = profile.endpoints[kind2] || (kind2 === "metricsList" ? profile.endpoints.metadata : void 0) || (kind2 === "fieldsKeys" ? profile.endpoints.attributeKeys : void 0) || (kind2 === "fieldsValues" ? profile.endpoints.attributeValues : void 0);
    if (!ep?.path) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        `profile ${profileId} 未定义 ${label} endpoint（禁止假空列表）`
      );
    }
    return ep;
  }
  return {
    async getMetadata(request, signal) {
      if (opts.offline) return offlineMetadata(request);
      switch (request.type) {
        case "metrics": {
          const ep = endpointOrThrow("metricsList", "metrics");
          const values = await cachedGet(
            "GET",
            ep.path,
            { search: request.search || "" },
            signal,
            async () => {
              const res = await liveHttp({
                path: ep.path,
                method: ep.method || "GET",
                query: request.search ? { search: request.search } : void 0,
                signal
              });
              return asArray(res.data).map(mapMetric).filter((m) => m.metricName);
            }
          );
          const filtered = request.search ? values.filter((m) => m.metricName.includes(request.search)) : values;
          return { type: "metrics", values: filtered };
        }
        case "attributeKeys": {
          const ep = profile.endpoints.fieldsKeys || profile.endpoints.attributeKeys || endpointOrThrow("fieldsKeys", "fields/keys");
          const path = ep.path;
          const useMetricAttrs = request.metricName && profileId.startsWith("signoz") ? { path: "/api/v2/metrics/attributes", method: "GET" } : { path, method: ep.method || "GET" };
          const values = await cachedGet(
            useMetricAttrs.method,
            useMetricAttrs.path,
            {
              signal: request.signal,
              metricName: request.metricName || "",
              search: request.search || ""
            },
            signal,
            async () => {
              const res = await liveHttp({
                path: useMetricAttrs.path,
                method: useMetricAttrs.method,
                query: {
                  ...request.signal ? { dataSource: request.signal } : {},
                  ...request.metricName ? { metricName: request.metricName } : {},
                  ...request.search ? { search: request.search } : {}
                },
                signal
              });
              return asArray(res.data).map(mapField).filter((f) => f.name);
            }
          );
          return { type: "attributeKeys", values };
        }
        case "attributeValues": {
          const ep = profile.endpoints.fieldsValues || profile.endpoints.attributeValues;
          if (!ep?.path) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              `profile ${profileId} 未定义 fields/values endpoint`
            );
          }
          const values = await cachedGet(
            ep.method || "GET",
            ep.path,
            {
              key: request.key,
              signal: request.signal,
              search: request.search || ""
            },
            signal,
            async () => {
              const res = await liveHttp({
                path: ep.path,
                method: ep.method || "GET",
                query: {
                  fieldName: request.key,
                  name: request.key,
                  ...request.signal ? { dataSource: request.signal } : {},
                  ...request.search ? { search: request.search } : {}
                },
                signal
              });
              return mapStringValues(asArray(res.data));
            }
          );
          return { type: "attributeValues", values };
        }
        case "services": {
          const ep = profile.endpoints.services || profile.endpoints.fieldsValues || profile.endpoints.attributeValues;
          if (!ep?.path) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              `profile ${profileId} 未定义 services endpoint`
            );
          }
          const values = await cachedGet(
            ep.method || "GET",
            ep.path,
            { kind: "services", search: request.search || "", path: ep.path },
            signal,
            async () => {
              const isPost = (ep.method || "GET").toUpperCase() === "POST" || ep.path.includes("/v2/services");
              try {
                const endNs = String(Date.now()) + "000000";
                const startNs = String(Date.now() - 36e5) + "000000";
                const res = await liveHttp({
                  path: ep.path,
                  method: isPost ? "POST" : ep.method || "GET",
                  ...isPost ? {
                    body: {
                      start: startNs,
                      end: endNs,
                      tags: [],
                      ...request.search ? { search: request.search } : {}
                    }
                  } : {
                    query: {
                      fieldName: "service.name",
                      name: "service.name",
                      dataSource: "traces",
                      ...request.search ? { search: request.search } : {}
                    }
                  },
                  signal
                });
                return mapStringValues(asArray(res.data));
              } catch (e) {
                if (isPost && profile.endpoints.fieldsValues?.path) {
                  const fb = profile.endpoints.fieldsValues;
                  const res = await liveHttp({
                    path: fb.path,
                    method: fb.method || "GET",
                    query: {
                      fieldName: "service.name",
                      name: "service.name",
                      dataSource: "traces",
                      ...request.search ? { search: request.search } : {}
                    },
                    signal
                  });
                  return mapStringValues(asArray(res.data));
                }
                throw e;
              }
            }
          );
          const filtered = request.search ? values.filter((s) => s.includes(String(request.search))) : values;
          return { type: "services", values: filtered };
        }
        case "operations": {
          const ep = profile.endpoints.fieldsValues || profile.endpoints.attributeValues;
          if (!ep?.path) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              `profile ${profileId} 未定义 operations endpoint`
            );
          }
          if (!request.service) {
            throw new DataSourceError(
              "INVALID_QUERY",
              "operations 需要 service filter"
            );
          }
          const values = await cachedGet(
            ep.method || "GET",
            ep.path,
            {
              key: "name",
              service: request.service,
              search: request.search || ""
            },
            signal,
            async () => {
              const res = await liveHttp({
                path: ep.path,
                method: ep.method || "GET",
                query: {
                  fieldName: "name",
                  name: "name",
                  dataSource: "traces",
                  service: request.service,
                  "service.name": request.service,
                  ...request.search ? { search: request.search } : {}
                },
                signal
              });
              return mapStringValues(asArray(res.data));
            }
          );
          return { type: "operations", values };
        }
        case "traceById": {
          const ep = profile.endpoints.traceById;
          if (!ep?.path) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              `profile ${profileId} 未定义 traceById`
            );
          }
          const path = ep.path.replace(
            "{id}",
            encodeURIComponent(request.traceId)
          );
          const res = await liveHttp({
            path,
            method: ep.method || "GET",
            signal
          });
          return {
            type: "traceById",
            frames: [
              createDataFrame({
                fields: [
                  {
                    name: "payload",
                    type: "string",
                    values: [JSON.stringify(res.data)]
                  }
                ],
                meta: { signal: "traces" }
              })
            ]
          };
        }
        case "relatedLogs": {
          const logsPath = profile.endpoints.logsQuery?.path || profile.endpoints.metricsQuery?.path;
          if (!logsPath) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              "related logs 需要 logs query_range"
            );
          }
          const frames = await fetchRelatedLogs({
            traceId: request.traceId,
            fromMs: request.fromMs,
            toMs: request.toMs,
            http: async (req) => {
              const res = await liveHttp({
                path: req.path,
                method: req.method,
                body: req.body,
                signal: req.signal
              });
              return { status: Number(res.status ?? 200), data: res.data };
            },
            logsQueryPath: logsPath,
            signal
          });
          return { type: "relatedLogs", frames };
        }
        case "alerts": {
          const ep = profile.endpoints.alertsQuery;
          if (!ep?.path) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              `alerts 需要 alertsQuery capability 证据，当前不返回假空`
            );
          }
          const res = await liveHttp({
            path: ep.path,
            method: ep.method || "GET",
            query: (ep.method || "GET").toUpperCase() === "GET" ? {
              ...request.service ? { service: request.service } : {},
              ...request.environment ? { environment: request.environment } : {}
            } : void 0,
            body: (ep.method || "GET").toUpperCase() === "POST" ? {
              start: request.fromMs,
              end: request.toMs,
              service: request.service,
              environment: request.environment,
              severities: request.severities
            } : void 0,
            signal
          });
          const rows = asArray(res.data);
          const frames = mapAlertsResponse(
            { data: rows.length ? rows : res.data },
            { refId: "alerts" }
          );
          return { type: "alerts", frames };
        }
        default:
          throw new DataSourceError("INVALID_QUERY", `未知 metadata 请求`);
      }
    }
  };
}
function offlineMetadata(request) {
  switch (request.type) {
    case "metrics":
      return {
        type: "metrics",
        values: OFFLINE_METRICS.filter(
          (m) => !request.search || m.metricName.includes(request.search)
        )
      };
    case "services":
      return {
        type: "services",
        values: OFFLINE_SERVICES.filter(
          (s) => !request.search || s.includes(String(request.search))
        )
      };
    case "operations":
      return { type: "operations", values: ["HTTP GET", "HTTP POST", "gRPC"] };
    case "attributeKeys":
      return {
        type: "attributeKeys",
        values: [
          {
            name: "service.name",
            fieldDataType: "string",
            fieldContext: "resource"
          },
          {
            name: "http.status_code",
            fieldDataType: "int64",
            fieldContext: "tag"
          }
        ]
      };
    case "attributeValues":
      return { type: "attributeValues", values: ["prod", "staging"] };
    case "traceById": {
      const frames = [
        createDataFrame({
          fields: [
            { name: "spanId", values: ["root"] },
            { name: "name", values: ["GET /"] },
            { name: "service", values: ["frontend"] }
          ],
          meta: { signal: "traces" }
        })
      ];
      return { type: "traceById", frames };
    }
    case "relatedLogs":
      return {
        type: "relatedLogs",
        frames: [
          createDataFrame({
            fields: [
              { name: "Time", type: "time", values: [request.fromMs] },
              {
                name: "Line",
                type: "string",
                values: ["offline error log line"]
              },
              { name: "service", type: "string", values: ["frontend"] },
              { name: "severity", type: "string", values: ["error"] },
              { name: "traceId", type: "string", values: [request.traceId] },
              { name: "spanId", type: "string", values: ["span-offline"] }
            ],
            meta: {
              signal: "logs",
              source: "fixture",
              relatedTraceId: request.traceId
            }
          })
        ]
      };
    case "alerts":
      return {
        type: "alerts",
        frames: [
          createDataFrame({
            fields: [
              { name: "id", values: ["al-1"] },
              { name: "title", values: ["High error rate"] },
              { name: "service", values: [request.service || "api"] },
              { name: "severity", values: ["critical"] },
              { name: "status", values: ["firing"] },
              { name: "Time", values: [request.fromMs] },
              { name: "alertId", values: ["al-1"] }
            ],
            meta: { signal: "alerts" }
          })
        ]
      };
    default:
      throw new DataSourceError(
        "INVALID_QUERY",
        "unknown offline metadata request"
      );
  }
}
const REQUEST_TO_PANEL = {
  time_series: "graph",
  scalar: "value",
  raw: "list",
  raw_stream: "list",
  trace: "trace",
  distribution: "histogram"
};
const V3_OP_MAP = {
  "=": "=",
  "!=": "!=",
  in: "in",
  nin: "nin",
  contains: "contains",
  ncontains: "ncontains",
  regex: "regex",
  nregex: "nregex",
  like: "like",
  nlike: "nlike",
  exists: "exists",
  nexists: "nexists",
  has: "has",
  nhas: "nhas",
  ">": ">",
  ">=": ">=",
  "<": "<",
  "<=": "<=",
  "=~": "regex",
  "!~": "nregex"
};
function exprToV3Filters(expression) {
  const expr = String(expression || "").trim();
  if (!expr) return { items: [], op: "AND" };
  if (/\(|\)/.test(expr)) return { error: "complex_parens" };
  if (/\bOR\b/i.test(expr) && /\bAND\b/i.test(expr))
    return { error: "mixed_and_or" };
  const op = /\bOR\b/i.test(expr) ? "OR" : "AND";
  const parts = expr.split(/\bAND\b|\bOR\b/i).map((s) => s.trim()).filter(Boolean);
  const items = [];
  for (const part of parts) {
    const m = part.match(
      /^([a-zA-Z0-9_./-]+)\s*(!=|=~|!~|>=|<=|=|>|<|contains|ncontains|in|nin|regex|nregex|like|nlike|exists|nexists|has|nhas)\s*(.*)$/i
    );
    if (!m) return { error: `unsupported_clause:${part}` };
    const key = m[1];
    const rawOp = m[2];
    let valueRaw = m[3].trim();
    const mapped = V3_OP_MAP[rawOp] || V3_OP_MAP[rawOp.toLowerCase()] || rawOp;
    if (mapped === "exists" || mapped === "nexists") {
      items.push({
        key: { key, type: "tag", dataType: "string" },
        op: mapped,
        value: true
      });
      continue;
    }
    if (valueRaw.startsWith("'") && valueRaw.endsWith("'") || valueRaw.startsWith('"') && valueRaw.endsWith('"')) {
      valueRaw = valueRaw.slice(1, -1);
    }
    let value = valueRaw;
    if (mapped === "in" || mapped === "nin") {
      value = valueRaw.split(",").map((s) => s.trim().replace(/^['"]|['"]$/g, ""));
    }
    items.push({
      key: { key, type: "tag", dataType: "string" },
      op: mapped,
      value
    });
  }
  return { items, op };
}
function fieldToAttr(f) {
  return {
    key: f.name,
    type: f.fieldContext === "resource" ? "resource" : "tag",
    dataType: f.fieldDataType === "float64" || f.fieldDataType === "int64" ? f.fieldDataType : "string"
  };
}
function primaryAgg(spec) {
  return spec.aggregations && spec.aggregations[0] || {};
}
function specToV3Builder(spec, version = "v3") {
  const agg = primaryAgg(spec);
  const metricName = agg.metricName || "";
  const aggregateOperator = (agg.spaceAggregation || agg.timeAggregation || "count").toLowerCase();
  const filterParsed = exprToV3Filters(spec.filter?.expression || "");
  const filters = "error" in filterParsed ? {
    items: [],
    op: "AND",
    _conversionError: filterParsed.error
  } : { items: filterParsed.items, op: filterParsed.op };
  const groupBy = (spec.groupBy || []).map(fieldToAttr);
  const orderBy = (spec.order || []).map((o) => ({
    columnName: o.key?.name || "",
    order: o.direction || "asc"
  }));
  const having = [];
  const havingExpr = String(spec.having?.expression || "").trim();
  if (havingExpr) {
    const hm = havingExpr.match(/^(.+?)\s*(>=|<=|!=|=|>|<)\s*(.+)$/);
    if (hm) {
      having.push({
        columnName: hm[1].trim(),
        op: hm[2],
        value: hm[3].trim().replace(/^['"]|['"]$/g, "")
      });
    }
  }
  const out = {
    dataSource: spec.signal,
    aggregateOperator,
    aggregateAttribute: {
      key: metricName,
      type: agg.metricType || "",
      dataType: "float64"
    },
    filters: {
      items: filters.items,
      op: filters.op
    },
    groupBy,
    orderBy,
    having,
    legend: spec.legend || "",
    disabled: Boolean(spec.disabled),
    reduceTo: agg.reduceTo || "avg",
    limit: spec.limit,
    stepInterval: spec.stepInterval
  };
  if (version === "v4") {
    out.timeAggregation = agg.timeAggregation || "rate";
    out.spaceAggregation = agg.spaceAggregation || "sum";
  }
  if (spec.functions?.length) {
    out.functions = spec.functions.map((f) => ({
      name: f.name,
      args: normalizeFunctionArgs(String(f.name || ""), f.args)
    }));
  }
  const lb = spec.limitBy;
  if (lb) {
    if (Array.isArray(lb) && lb.length) {
      const keys = lb.map((x) => x?.key || x).filter(Boolean);
      const value = lb[0]?.value != null ? Number(lb[0].value) : void 0;
      out.limitBy = { keys, value };
    } else if (typeof lb === "object" && Array.isArray(lb.keys) && lb.keys.length) {
      out.limitBy = {
        keys: lb.keys.map(String),
        value: lb.value != null ? Number(lb.value) : void 0
      };
    }
  }
  if ("error" in filterParsed) {
    out._filterConversionError = filterParsed.error;
  }
  return out;
}
function requestTypeToPanelType(requestType, signal, opts) {
  if (requestType === "scalar") {
    return opts?.formatTable ? "table" : "value";
  }
  if (requestType === "trace" || signal === "traces") return "trace";
  return REQUEST_TO_PANEL[requestType] || "graph";
}
function isBareMetricsOp(expr) {
  const e = expr.trim().toLowerCase();
  return Boolean(e) && !e.includes("(") && /^(avg|sum|min|max|count|rate|increase|last|p\d+)$/.test(e);
}
function optString(v) {
  if (v == null) return void 0;
  const s = String(v);
  return s === "" ? void 0 : s;
}
function toV5MetricAggregation(a, metricMetadata) {
  const metricName = String(a.metricName || "");
  const expr = a.expression != null ? String(a.expression) : "";
  const simple = expr && !expr.includes("(");
  const timeAggregation = String(
    a.timeAggregation || (simple ? expr : "") || "avg"
  );
  const temporality = String(
    a.temporality || metricMetadata?.get(metricName)?.temporality || "Unspecified"
  ) || "Unspecified";
  const out = {
    metricName,
    temporality,
    timeAggregation,
    spaceAggregation: String(a.spaceAggregation || "avg")
  };
  const reduceTo = optString(a.reduceTo);
  const alias = optString(a.alias);
  if (reduceTo) out.reduceTo = reduceTo;
  if (alias) out.alias = alias;
  if (expr && expr.includes("(")) out.expression = expr;
  return out;
}
function toV5ExpressionAggregation(a) {
  let expression = a.expression != null && String(a.expression).trim() ? String(a.expression).trim() : "";
  if (!expression && a.timeAggregation && String(a.timeAggregation).includes("(")) {
    expression = String(a.timeAggregation).trim();
  }
  if (!expression || isBareMetricsOp(expression)) {
    expression = "count()";
  }
  const out = { expression };
  const alias = optString(a.alias);
  const reduceTo = optString(a.reduceTo);
  if (alias) out.alias = alias;
  if (reduceTo) out.reduceTo = reduceTo;
  return out;
}
function normalizeFilterExpression(expression) {
  if (expression == null) return "";
  let s = String(expression).trim();
  if (!s) return "";
  const vacuousEq = /(?:^|\s+)([A-Za-z_][\w./-]*)\s*(?:=|!=|LIKE|NOT_LIKE|ILIKE)\s*(?:''|"")(?=\s|$|\))/gi;
  s = s.replace(vacuousEq, " ").replace(/\(\s*\)/g, " ").replace(/\s+(AND|OR)\s+(AND|OR)\s+/gi, " $1 ").replace(/^\s*(?:AND|OR)\s+/i, "").replace(/\s+(?:AND|OR)\s*$/i, "").replace(/\s+/g, " ").trim();
  return s;
}
const LIST_ONLY_ORDER_KEYS = /* @__PURE__ */ new Set(["timestamp", "id"]);
function isAggregationRequestType(requestType) {
  if (requestType === "raw" || requestType === "trace" || requestType === "raw_stream") {
    return false;
  }
  return true;
}
function orderKeyName(entry) {
  if (entry == null) return "";
  if (typeof entry === "string") return entry.trim();
  const o = entry;
  const key = o.key;
  if (key && typeof key === "object") {
    return String(key.name ?? key.key ?? "").trim();
  }
  return String(o.columnName ?? o.name ?? o.key ?? "").trim();
}
function groupByName(entry) {
  if (entry == null) return "";
  if (typeof entry === "string") return entry.trim();
  const o = entry;
  return String(o.name ?? o.key?.name ?? o.key ?? "").trim();
}
function sanitizeV5Order(order, opts) {
  if (!Array.isArray(order) || order.length === 0) return void 0;
  if (!isAggregationRequestType(opts.requestType)) {
    return order;
  }
  const groupByNames = new Set(
    (opts.groupBy || []).map(groupByName).filter(Boolean)
  );
  const aggKeys = /* @__PURE__ */ new Set();
  (opts.aggregations || []).forEach((a, i) => {
    aggKeys.add(String(i));
    if (a?.alias != null && String(a.alias).trim()) {
      aggKeys.add(String(a.alias).trim());
    }
    if (a?.expression != null && String(a.expression).trim()) {
      aggKeys.add(String(a.expression).trim());
    }
  });
  const filtered = order.filter((entry) => {
    const name = orderKeyName(entry);
    if (!name) return false;
    if (LIST_ONLY_ORDER_KEYS.has(name)) return false;
    if (groupByNames.has(name)) return true;
    if (aggKeys.has(name)) return true;
    if (/^\d+$/.test(name)) return true;
    if (name.includes("(")) return true;
    return false;
  });
  return filtered.length ? filtered : void 0;
}
function toV5BuilderSpec(spec, opts) {
  const signal = spec.signal || "metrics";
  const requestType = opts?.requestType;
  const rawAggs = Array.isArray(spec.aggregations) ? spec.aggregations : [];
  const aggregations = rawAggs.map((a) => {
    if (signal === "metrics" && a?.metricName) {
      return toV5MetricAggregation(a, opts?.metricMetadata);
    }
    if (signal === "metrics") {
      if (a?.timeAggregation || a?.spaceAggregation) {
        return {
          ...optString(a?.expression) ? { expression: String(a.expression) } : {},
          ...a?.timeAggregation ? { timeAggregation: String(a.timeAggregation) } : {},
          ...a?.spaceAggregation ? { spaceAggregation: String(a.spaceAggregation) } : {},
          ...optString(a?.reduceTo) ? { reduceTo: String(a.reduceTo) } : {},
          ...optString(a?.alias) ? { alias: String(a.alias) } : {}
        };
      }
      return toV5ExpressionAggregation(a || {});
    }
    return toV5ExpressionAggregation(a || {});
  });
  const filterObj = spec.filter && typeof spec.filter === "object" ? spec.filter : {};
  const havingObj = spec.having && typeof spec.having === "object" ? spec.having : {};
  const groupBy = Array.isArray(spec.groupBy) && spec.groupBy.length ? spec.groupBy : void 0;
  const out = {
    name: String(spec.name || "A"),
    signal,
    // null means auto step — must be preserved
    stepInterval: spec.stepInterval === void 0 ? null : spec.stepInterval,
    filter: {
      expression: normalizeFilterExpression(filterObj.expression)
    },
    having: {
      expression: normalizeFilterExpression(havingObj.expression)
    },
    aggregations
  };
  if (spec.disabled) out.disabled = true;
  if (groupBy) out.groupBy = groupBy;
  const sanitizedOrder = sanitizeV5Order(
    Array.isArray(spec.order) ? spec.order : void 0,
    {
      requestType,
      groupBy,
      aggregations
    }
  );
  if (sanitizedOrder) {
    out.order = sanitizedOrder;
  } else if (requestType === "raw" || requestType === "trace" || requestType === "raw_stream") {
    out.order = [{ key: { name: "timestamp" }, direction: "desc" }];
  }
  if (spec.limit != null && spec.limit !== "") out.limit = Number(spec.limit);
  if (spec.offset != null && spec.offset !== "")
    out.offset = Number(spec.offset);
  if (optString(spec.legend)) out.legend = String(spec.legend);
  if (Array.isArray(spec.functions) && spec.functions.length)
    out.functions = spec.functions;
  if (optString(spec.source)) out.source = String(spec.source);
  if (Array.isArray(spec.selectColumns) && spec.selectColumns.length)
    out.selectColumns = spec.selectColumns;
  if (Array.isArray(spec.selectFields) && spec.selectFields.length) {
    out.selectFields = spec.selectFields;
  }
  return out;
}
function toV5PromqlSpec(name, query, legend) {
  const out = {
    name,
    query,
    disabled: false
  };
  if (legend) out.legend = legend;
  return out;
}
function toV5ClickHouseSpec(name, query) {
  return {
    name,
    query,
    disabled: false
  };
}
function isDisabled(item) {
  if (item.type === "builder_formula") return Boolean(item.spec.disabled);
  if (item.type === "builder_query") return Boolean(item.spec.disabled);
  if (item.type === "builder_trace_operator")
    return Boolean(item.spec.disabled);
  if (item.type === "builder_sub_query") return Boolean(item.spec.disabled);
  if (item.type === "builder_join") return Boolean(item.spec.disabled);
  return false;
}
function parseFormulaDeps(expression) {
  const names = expression.match(/\b[A-Z][A-Z0-9_]*\b/g) || [];
  return [...new Set(names)];
}
function endpointFor(profile, signal) {
  if (signal === "logs") return profile.endpoints.logsQuery;
  if (signal === "traces") return profile.endpoints.tracesQuery;
  return profile.endpoints.metricsQuery;
}
function stripEmpty(obj) {
  if (Array.isArray(obj))
    return obj.map(stripEmpty).filter((v) => v !== void 0);
  if (obj && typeof obj === "object") {
    const out = {};
    for (const [k, v] of Object.entries(obj)) {
      if (v == null) continue;
      if (typeof v === "string" && v === "") continue;
      if (Array.isArray(v) && v.length === 0) continue;
      if (k === "metricType") continue;
      out[k] = stripEmpty(v);
    }
    return out;
  }
  return obj;
}
function normalizeBuilderAggregation(a, signal, metricMetadata) {
  if (!a || typeof a !== "object") return a;
  if (signal === "metrics") {
    if (a.metricName) {
      return toV5MetricAggregation(a, metricMetadata);
    }
    const out = {};
    if (a.expression != null && String(a.expression) !== "")
      out.expression = a.expression;
    if (a.timeAggregation != null) out.timeAggregation = a.timeAggregation;
    if (a.spaceAggregation != null) out.spaceAggregation = a.spaceAggregation;
    if (a.reduceTo != null && a.reduceTo !== "") out.reduceTo = a.reduceTo;
    if (a.alias != null && a.alias !== "") out.alias = a.alias;
    return out;
  }
  return toV5ExpressionAggregation(a);
}
function resolveRequestType(query, caps2) {
  const rt = query.requestType || "time_series";
  if (rt === "distribution") {
    if (!caps2?.distribution && !query.apiProfile) ;
  }
  return rt;
}
function assertRequestTypeAllowed(rt, options, caps2) {
  if (rt === "distribution") {
    const ok2 = Boolean(
      caps2?.distribution || options.experimentalCapabilities?.distribution
    );
    if (!ok2) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        "distribution requestType 需要 experimentalDistribution capability"
      );
    }
  }
}
function assertGatedItems(items, options, caps2) {
  for (const item of items) {
    if (item.type === "builder_sub_query") {
      const ok2 = Boolean(
        caps2?.builderSubQuery || options.experimentalCapabilities?.builderSubQuery
      );
      if (!ok2) {
        throw new DataSourceError(
          "UNSUPPORTED_CAPABILITY",
          "builder_sub_query 默认禁用，需当前 deployment capability"
        );
      }
    }
    if (item.type === "builder_join") {
      const ok2 = Boolean(
        caps2?.builderJoin || options.experimentalCapabilities?.builderJoin
      );
      if (!ok2) {
        throw new DataSourceError(
          "UNSUPPORTED_CAPABILITY",
          "builder_join 默认禁用，需当前 deployment capability"
        );
      }
    }
  }
}
function toTypeSpecItem(item, metricMetadata, requestType) {
  if (item.type === "builder_query") {
    if (item.queryType === "promql") {
      const queryText = String(item.rawQuery ?? "").trim();
      if (!queryText) {
        throw new DataSourceError(
          "INVALID_QUERY",
          `PromQL 查询表达式不能为空（${item.spec.name}）。请填写如 up 的表达式，或切回 Builder。`
        );
      }
      const spec2 = toV5PromqlSpec(
        item.spec.name,
        queryText,
        item.rawLegend || item.spec.legend
      );
      spec2.disabled = Boolean(item.spec.disabled);
      if (item.step) spec2.step = item.step;
      if (item.stats != null) spec2.stats = item.stats;
      return { type: "promql", spec: spec2 };
    }
    if (item.queryType === "clickhouse_sql") {
      const queryText = String(item.rawQuery ?? "").trim();
      if (!queryText) {
        throw new DataSourceError(
          "INVALID_QUERY",
          `ClickHouse SQL 不能为空（${item.spec.name}）`
        );
      }
      const spec2 = toV5ClickHouseSpec(item.spec.name, queryText);
      spec2.disabled = Boolean(item.spec.disabled);
      if (item.rawLegend || item.spec.legend) {
        spec2.legend = item.rawLegend || item.spec.legend;
      }
      return { type: "clickhouse_sql", spec: spec2 };
    }
    const signal = String(item.spec.signal || "metrics");
    const withAggs = {
      ...item.spec,
      signal,
      aggregations: item.spec.aggregations?.length ? item.spec.aggregations : defaultAggregationsForSignal(signal)
    };
    const spec = toV5BuilderSpec(withAggs, {
      metricMetadata,
      requestType
    });
    spec.aggregations = withAggs.aggregations.map(
      (a) => normalizeBuilderAggregation(a, signal, metricMetadata)
    );
    spec.disabled = Boolean(item.spec.disabled);
    if (signal !== "metrics") {
      delete spec.source;
    }
    return {
      type: "builder_query",
      spec
    };
  }
  if (item.type === "builder_formula") {
    const formulaSpec = {
      name: item.spec.name,
      expression: item.spec.expression,
      disabled: Boolean(item.spec.disabled)
    };
    if (item.spec.limit != null) formulaSpec.limit = item.spec.limit;
    if (item.spec.legend) formulaSpec.legend = item.spec.legend;
    if (item.spec.order) formulaSpec.order = item.spec.order;
    return {
      type: "builder_formula",
      spec: formulaSpec
    };
  }
  if (item.type === "builder_trace_operator") {
    return {
      type: "builder_trace_operator",
      spec: toV5BuilderSpec(item.spec, { requestType })
    };
  }
  if (item.type === "builder_sub_query") {
    return {
      type: "builder_sub_query",
      spec: toV5BuilderSpec(
        {
          ...item.spec,
          signal: item.spec.signal || "traces"
        },
        { requestType }
      )
    };
  }
  if (item.type === "builder_join") {
    return {
      type: "builder_join",
      spec: {
        ...toV5BuilderSpec(
          {
            ...item.spec,
            signal: item.spec.signal || "traces"
          },
          { requestType }
        ),
        // join-specific whitelist
        ...item.spec.on != null ? { on: item.spec.on } : {},
        ...item.spec.joinType != null ? { joinType: item.spec.joinType } : {},
        ...item.spec.left != null ? { left: item.spec.left } : {},
        ...item.spec.right != null ? { right: item.spec.right } : {}
      }
    };
  }
  throw new DataSourceError("INVALID_QUERY", `未知 query item type`);
}
function primarySignal(items) {
  for (const item of items) {
    if (item.type === "builder_query") return item.spec.signal;
  }
  return "metrics";
}
function buildSigNozRequests(input) {
  const {
    profile,
    options,
    query,
    fromMs,
    toMs: toMs2,
    intervalMs,
    metricMetadata,
    capabilities
  } = input;
  const stepSec = Math.max(1, Math.round((intervalMs || 6e4) / 1e3));
  const items = (query.queries || []).filter((q) => !isDisabled(q));
  const caps2 = {
    builderSubQuery: capabilities?.builderSubQuery ?? options.experimentalCapabilities?.builderSubQuery,
    builderJoin: capabilities?.builderJoin ?? options.experimentalCapabilities?.builderJoin,
    distribution: capabilities?.distribution ?? options.experimentalCapabilities?.distribution
  };
  assertGatedItems(items, options, caps2);
  const formulas = items.filter((i) => i.type === "builder_formula");
  const queries = items.filter((i) => i.type === "builder_query");
  const out = [];
  if (profile.id === "prometheus-compatible") {
    for (const q of queries) {
      if (q.queryType !== "promql") {
        throw new DataSourceError(
          "UNSUPPORTED_QUERY_API",
          `prometheus-compatible 不支持 ${q.queryType}`
        );
      }
      const expr = String(q.rawQuery || "");
      if (!profile.endpoints.metricsQuery) {
        throw new DataSourceError(
          "UNSUPPORTED_QUERY_API",
          "缺少 metrics endpoint"
        );
      }
      out.push({
        requestKey: `prom:${q.spec.name}`,
        queryNames: [q.spec.name],
        signal: "metrics",
        path: profile.endpoints.metricsQuery.path,
        method: profile.endpoints.metricsQuery.method || "GET",
        query: {
          query: expr,
          start: Math.floor(fromMs / 1e3),
          end: Math.floor(toMs2 / 1e3),
          step: stepSec,
          ...q.stats ? { stats: true } : {}
        }
      });
    }
    for (const f of formulas) {
      out.push({
        requestKey: `formula:${f.spec.name}`,
        queryNames: [f.spec.name],
        signal: "metrics",
        path: "",
        method: "GET",
        localFormula: {
          name: f.spec.name,
          expression: f.spec.expression,
          dependsOn: parseFormulaDeps(f.spec.expression)
        }
      });
    }
    return out;
  }
  if (isV5WireProfile(profile.id)) {
    if (!items.length) return out;
    const signal = primarySignal(items);
    const ep = endpointFor(profile, signal) || profile.endpoints.metricsQuery;
    if (!ep?.path) {
      throw new DataSourceError(
        "UNSUPPORTED_QUERY_API",
        `${profile.id} 缺少 query_range`
      );
    }
    const requestType = resolveRequestType(query, caps2);
    assertRequestTypeAllowed(requestType, options, caps2);
    const compositeQueries = items.map(
      (item) => toTypeSpecItem(item, metricMetadata, requestType)
    );
    const variables = {};
    if (profile.id !== "argus-v5") {
      variables.SIGNOZ_START = { value: String(fromMs) };
      variables.SIGNOZ_END = { value: String(toMs2) };
      if (options.organizationId)
        variables.SIGNOZ_ORGANIZATION_ID = { value: options.organizationId };
      if (options.defaultEnvironment)
        variables.SIGNOZ_ENVIRONMENT = { value: options.defaultEnvironment };
    }
    const formatOptions = {
      formatTableResultForUI: Boolean(
        query.formatOptions?.formatTableResultForUI
      ),
      fillGaps: query.formatOptions?.fillGaps === true
      // default false
    };
    const body = {
      schemaVersion: "v1",
      start: fromMs,
      end: toMs2,
      requestType,
      compositeQuery: { queries: compositeQueries },
      formatOptions,
      variables
    };
    if (query.noCache) body.noCache = true;
    out.push({
      requestKey: `${profile.id}:composite`,
      queryNames: items.map((i) => i.spec?.name || i.type),
      signal,
      path: ep.path,
      method: ep.method || "POST",
      body
    });
    return out;
  }
  const groups = /* @__PURE__ */ new Map();
  for (const q of queries) {
    const key = `${q.spec.signal}:${q.queryType}`;
    const arr = groups.get(key) || [];
    arr.push(q);
    groups.set(key, arr);
  }
  for (const [key, group] of groups) {
    const signal = group[0].spec.signal;
    const mode2 = group[0].queryType;
    const ep = endpointFor(profile, signal);
    if (!ep?.path) {
      throw new DataSourceError(
        "UNSUPPORTED_QUERY_API",
        `profile ${profile.id} 未配置 ${signal} endpoint`
      );
    }
    const builderQueries = {};
    const promQueries = {};
    const chQueries = {};
    for (const q of group) {
      if (mode2 === "promql") {
        promQueries[q.spec.name] = {
          query: q.rawQuery || "",
          disabled: false,
          legend: q.rawLegend || q.spec.legend || ""
        };
      } else if (mode2 === "clickhouse_sql") {
        chQueries[q.spec.name] = {
          query: q.rawQuery || "",
          disabled: false,
          legend: q.rawLegend || ""
        };
      } else {
        const version = profile.id === "signoz-v4" ? "v4" : "v3";
        builderQueries[q.spec.name] = stripEmpty(
          specToV3Builder(q.spec, version)
        );
      }
    }
    const requestType = resolveRequestType(query, caps2);
    const compositeQuery = {
      queryType: mode2 === "promql" ? "promql" : mode2 === "clickhouse_sql" ? "clickhouse_sql" : "builder",
      panelType: requestTypeToPanelType(requestType, signal, {
        formatTable: Boolean(query.formatOptions?.formatTableResultForUI)
      })
    };
    if (Object.keys(builderQueries).length)
      compositeQuery.builderQueries = builderQueries;
    if (Object.keys(promQueries).length)
      compositeQuery.promQueries = promQueries;
    if (Object.keys(chQueries).length) compositeQuery.chQueries = chQueries;
    const body = {
      start: fromMs,
      end: toMs2,
      step: stepSec,
      compositeQuery
    };
    if (options.organizationId) body.organizationId = options.organizationId;
    if (options.defaultEnvironment)
      body.environment = options.defaultEnvironment;
    out.push({
      requestKey: `${profile.id}:${key}`,
      queryNames: group.map((g) => g.spec.name),
      signal,
      path: ep.path,
      method: ep.method || "POST",
      body: profile.id === "custom" ? {
        start: fromMs,
        end: toMs2,
        signal,
        queries: group.map((g) => stripEmpty({ ...g, spec: g.spec }))
      } : body
    });
  }
  for (const f of formulas) {
    out.push({
      requestKey: `formula:${f.spec.name}`,
      queryNames: [f.spec.name],
      signal: "metrics",
      path: "",
      method: "GET",
      localFormula: {
        name: f.spec.name,
        expression: f.spec.expression,
        dependsOn: parseFormulaDeps(f.spec.expression)
      }
    });
  }
  return out;
}
function asMetricFind(values) {
  return values.map((v) => ({ text: v, value: v }));
}
function withAllOption(values, includeAll) {
  if (!includeAll) return values;
  return ["__all__", ...values.filter((v) => v !== "__all__")];
}
async function runSigNozVariableQuery(api, query, opts = {}) {
  let q;
  if (typeof query === "string") {
    try {
      q = JSON.parse(query);
    } catch {
      q = { type: "service", search: query };
    }
  } else {
    q = query || { type: "service" };
  }
  const type = String(q.type || "service");
  const search = q.search != null ? String(q.search) : void 0;
  const includeAll = Boolean(
    q.includeAll || q.allValue === "__all__"
  );
  switch (type) {
    case "environment": {
      const res = await api.getMetadata(
        {
          type: "attributeValues",
          key: "deployment.environment",
          signal: "traces",
          search
        },
        opts.signal
      );
      const values = res.type === "attributeValues" ? res.values : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "service": {
      const res = await api.getMetadata(
        { type: "services", search },
        opts.signal
      );
      const values = res.type === "services" ? res.values : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "operation": {
      const service = String(q.service || "");
      if (!service) return [];
      const res = await api.getMetadata(
        { type: "operations", service, search },
        opts.signal
      );
      const values = res.type === "operations" ? res.values : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "metric": {
      const res = await api.getMetadata(
        { type: "metrics", search },
        opts.signal
      );
      const values = res.type === "metrics" ? res.values.map((m) => m.metricName) : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "attributeKey": {
      const signal = q.signal || "metrics";
      const res = await api.getMetadata(
        {
          type: "attributeKeys",
          signal,
          metricName: q.metricName,
          search
        },
        opts.signal
      );
      const values = res.type === "attributeKeys" ? res.values.map((f) => f.name) : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "attributeValue": {
      const key = String(q.key || "");
      if (!key) return [];
      const signal = q.signal || "metrics";
      const res = await api.getMetadata(
        { type: "attributeValues", key, signal, search },
        opts.signal
      );
      const values = res.type === "attributeValues" ? res.values : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "dynamic": {
      const key = String(q.field || q.key || "");
      const signal = q.source || q.signal || "metrics";
      if (!key) return [];
      const res = await api.getMetadata(
        { type: "attributeValues", key, signal, search },
        opts.signal
      );
      const values = res.type === "attributeValues" ? res.values : [];
      return asMetricFind(withAllOption(values, includeAll));
    }
    case "clickhouse_query": {
      const sql = String(q.query || q.sql || "").trim();
      if (!sql) return [];
      if (!opts.runClickHouseVariable) {
        throw new DataSourceError(
          "UNSUPPORTED_CAPABILITY",
          "ClickHouse 变量需要 variablesQuery endpoint（/api/v2/variables/query）"
        );
      }
      const values = await opts.runClickHouseVariable(sql, opts.signal);
      return asMetricFind(withAllOption(values, includeAll));
    }
    default:
      throw new DataSourceError("INVALID_QUERY", `未知变量类型 ${type}`);
  }
}
function emptyTypedFrame(signal, _uid) {
  return createDataFrame({
    fields: [
      { name: "Time", type: "time", values: [] },
      { name: "TimeEnd", type: "time", values: [] },
      { name: "Text", type: "string", values: [] },
      { name: "Tags", type: "string", values: [] },
      { name: "signal", type: "string", values: [] },
      { name: "traceId", type: "string", values: [] },
      { name: "spanId", type: "string", values: [] },
      { name: "alertId", type: "string", values: [] },
      { name: "DatasourceUid", type: "string", values: [] }
    ],
    meta: { signal, source: "annotation" }
  });
}
function fieldValues(frame, names) {
  for (const n of names) {
    const f = frame.fields.find(
      (x) => x.name === n || x.name.toLowerCase() === n.toLowerCase()
    );
    if (f?.values?.length) return f.values;
  }
  return [];
}
function normalizeToAnnotationFrames(frames, signal, uid, fallbackText) {
  if (!frames.length) return [emptyTypedFrame(signal)];
  const times = [];
  const ends = [];
  const texts = [];
  const tags = [];
  const signals = [];
  const traceIds = [];
  const spanIds = [];
  const alertIds = [];
  const uids = [];
  for (const fr of frames) {
    const n = Math.max(
      ...fr.fields.map((f) => f.values?.length || 0),
      0
    );
    const t2 = fieldValues(fr, ["Time", "time", "timestamp", "startTime"]);
    const te = fieldValues(fr, ["TimeEnd", "timeEnd", "endTime"]);
    const tx = fieldValues(fr, [
      "Text",
      "text",
      "title",
      "Line",
      "message",
      "name",
      "body"
    ]);
    const tg = fieldValues(fr, [
      "Tags",
      "tags",
      "service",
      "severity",
      "service.name"
    ]);
    const tr = fieldValues(fr, ["traceId", "trace_id", "TraceId"]);
    const sp = fieldValues(fr, ["spanId", "span_id", "SpanId"]);
    const al = fieldValues(fr, ["alertId", "id", "AlertId"]);
    for (let i = 0; i < n; i++) {
      times.push(Number(t2[i] ?? Date.now()));
      ends.push(te[i] != null ? Number(te[i]) : null);
      texts.push(String(tx[i] ?? fallbackText));
      tags.push(String(tg[i] ?? ""));
      signals.push(signal);
      traceIds.push(String(tr[i] ?? ""));
      spanIds.push(String(sp[i] ?? ""));
      alertIds.push(String(al[i] ?? ""));
      uids.push(uid);
    }
  }
  if (!times.length) return [emptyTypedFrame(signal)];
  return [
    createDataFrame({
      fields: [
        { name: "Time", type: "time", values: times },
        { name: "TimeEnd", type: "time", values: ends },
        { name: "Text", type: "string", values: texts },
        { name: "Tags", type: "string", values: tags },
        { name: "signal", type: "string", values: signals },
        { name: "traceId", type: "string", values: traceIds },
        { name: "spanId", type: "string", values: spanIds },
        { name: "alertId", type: "string", values: alertIds },
        { name: "DatasourceUid", type: "string", values: uids }
      ],
      meta: { signal, source: "annotation" }
    })
  ];
}
function serviceFilter(service) {
  if (!service) return "";
  return `service.name = '${service.replace(/'/g, "\\'")}'`;
}
function andExpr(...parts) {
  return parts.filter(Boolean).join(" AND ");
}
async function querySigNozAnnotations(api, target, range, options) {
  const uid = options?.datasourceUid || "";
  const signal = options?.signal;
  const svc = target.service || "";
  if (target.source === "firingAlerts") {
    if (!options?.alertsCapable) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        "firing alerts 需要 alertsQuery capability（不生成占位 marker）"
      );
    }
    const res = await api.getMetadata(
      {
        type: "alerts",
        fromMs: range.fromMs,
        toMs: range.toMs,
        service: target.service,
        environment: target.environment
      },
      signal
    );
    return normalizeToAnnotationFrames(
      res.frames || [],
      "alerts",
      uid,
      "firing alert"
    );
  }
  if (target.source === "errorSpans") {
    const filter22 = andExpr("hasError = true", serviceFilter(svc));
    if (options?.runRawQuery) {
      const frames = await options.runRawQuery({
        signal: "traces",
        filterExpression: filter22 || "hasError = true",
        fromMs: range.fromMs,
        toMs: range.toMs,
        abort: signal
      });
      return normalizeToAnnotationFrames(frames, "traces", uid, "error span");
    }
    return [
      createDataFrame({
        fields: [
          { name: "Time", type: "time", values: [range.fromMs] },
          { name: "TimeEnd", type: "time", values: [range.toMs] },
          {
            name: "Text",
            type: "string",
            values: [svc ? `error span service=${svc}` : "error span"]
          },
          { name: "Tags", type: "string", values: [svc || "error"] },
          { name: "signal", type: "string", values: ["traces"] },
          { name: "traceId", type: "string", values: [""] },
          { name: "spanId", type: "string", values: [""] },
          { name: "alertId", type: "string", values: [""] },
          { name: "DatasourceUid", type: "string", values: [uid] }
        ],
        meta: {
          signal: "traces",
          source: "annotation",
          filter: {
            expression: filter22 || "hasError = true",
            service: svc || void 0
          },
          fromMs: range.fromMs,
          toMs: range.toMs,
          offline: true
        }
      })
    ];
  }
  const filter2 = andExpr(
    "(severity_text = 'ERROR' OR severity = 'ERROR' OR level = 'error')",
    serviceFilter(svc)
  );
  if (options?.runRawQuery) {
    const frames = await options.runRawQuery({
      signal: "logs",
      filterExpression: filter2,
      fromMs: range.fromMs,
      toMs: range.toMs,
      abort: signal
    });
    return normalizeToAnnotationFrames(frames, "logs", uid, "error log");
  }
  return [
    createDataFrame({
      fields: [
        { name: "Time", type: "time", values: [range.fromMs] },
        { name: "TimeEnd", type: "time", values: [range.toMs] },
        {
          name: "Text",
          type: "string",
          values: [svc ? `error log service=${svc}` : "error log"]
        },
        { name: "Tags", type: "string", values: [svc || "error"] },
        { name: "signal", type: "string", values: ["logs"] },
        { name: "traceId", type: "string", values: [""] },
        { name: "spanId", type: "string", values: [""] },
        { name: "alertId", type: "string", values: [""] },
        { name: "DatasourceUid", type: "string", values: [uid] }
      ],
      meta: {
        signal: "logs",
        source: "annotation",
        filter: { expression: filter2, service: svc || void 0 },
        fromMs: range.fromMs,
        toMs: range.toMs,
        offline: true
      }
    })
  ];
}
let sessionSeq = 1;
function parseSseChunk(buffer, onEvent) {
  const normalized = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
  const parts = normalized.split("\n\n");
  const incomplete = parts.pop() ?? "";
  for (const block of parts) {
    if (!block.trim()) continue;
    let event = "message";
    let id;
    const dataLines = [];
    for (const line of block.split("\n")) {
      if (!line || line.startsWith(":")) continue;
      if (line.startsWith("event:")) {
        event = line.slice(6).trim();
      } else if (line.startsWith("data:")) {
        dataLines.push(line.slice(5).replace(/^\s/, ""));
      } else if (line.startsWith("id:")) {
        id = line.slice(3).trim();
      }
    }
    if (dataLines.length || event === "error") {
      onEvent({ event, data: dataLines.join("\n"), id });
    }
  }
  return incomplete;
}
function parseLiveTailDataPayload(data) {
  if (!data) return null;
  try {
    const parsed = JSON.parse(data);
    const ts = Number(
      parsed.timestamp ?? parsed.time ?? parsed.ts ?? (parsed.data && parsed.data.timestamp) ?? Date.now()
    );
    const body = parsed.data !== void 0 ? parsed.data : parsed;
    const rowId = stableRowId(ts, body, parsed.id);
    return { timestamp: ts, data: body, rowId };
  } catch {
    const ts = Date.now();
    return { timestamp: ts, data, rowId: stableRowId(ts, data) };
  }
}
function stableRowId(timestamp, data, hint) {
  if (hint) return `${timestamp}:${hint}`;
  if (data && typeof data === "object") {
    const o = data;
    const id = o.id ?? o.uuid ?? o.log_id ?? o.span_id ?? o.spanId;
    if (id != null) return `${timestamp}:${String(id)}`;
    const line = o.body ?? o.message ?? o.line;
    if (line != null) return `${timestamp}:${hashShort(String(line))}`;
  }
  return `${timestamp}:${hashShort(JSON.stringify(data))}`;
}
function hashShort(s) {
  let h2 = 0;
  for (let i = 0; i < s.length; i++)
    h2 = Math.imul(31, h2) + s.charCodeAt(i) | 0;
  return (h2 >>> 0).toString(16);
}
function defaultSleep(ms, signal) {
  return new Promise((resolve, reject) => {
    if (signal.aborted) {
      reject(new DataSourceError("CANCELLED", "live tail aborted"));
      return;
    }
    const t2 = setTimeout(() => {
      signal.removeEventListener("abort", onAbort);
      resolve();
    }, ms);
    const onAbort = () => {
      clearTimeout(t2);
      reject(new DataSourceError("CANCELLED", "live tail aborted"));
    };
    signal.addEventListener("abort", onAbort, { once: true });
  });
}
function resolveLiveTailTransport(caps2) {
  if (caps2.sseVerified && caps2.liveTailPath) return "sse";
  if (caps2.legacySseEnabled && caps2.legacyLiveTailPath) return "sse";
  if (caps2.cursorPoll) return "cursor_poll";
  return "none";
}
function createLiveTailSession(config) {
  const sessionId = sessionSeq++;
  const maxRows = Math.max(100, config.maxRows ?? 5e3);
  const pollIntervalMs = Math.max(200, config.pollIntervalMs ?? 2e3);
  const maxRetries = config.maxRetries ?? 8;
  const sleep2 = config.sleep || defaultSleep;
  let state2 = "idle";
  let transport = resolveLiveTailTransport(
    config.capabilities
  );
  let controller = null;
  let rows = [];
  const seen = /* @__PURE__ */ new Set();
  let lastTimestamp = config.startMs;
  let nextCursor = null;
  let retryCount = 0;
  let paused = false;
  let runToken = 0;
  const setState = (s, detail) => {
    state2 = s;
    config.onState?.(s, detail);
  };
  const isCurrent = (token) => token === runToken && controller != null && !controller.signal.aborted;
  const pushRows = (incoming) => {
    if (!incoming.length) return;
    const fresh = [];
    for (const r of incoming) {
      if (seen.has(r.rowId)) continue;
      seen.add(r.rowId);
      fresh.push(r);
      if (r.timestamp > lastTimestamp) lastTimestamp = r.timestamp;
    }
    if (!fresh.length) return;
    rows = rows.concat(fresh);
    if (rows.length > maxRows) {
      const drop = rows.length - maxRows;
      for (let i = 0; i < drop; i++) seen.delete(rows[i].rowId);
      rows = rows.slice(drop);
    }
    config.onRows?.(fresh, { sessionId, transport });
  };
  const cancelActive = () => {
    runToken += 1;
    if (controller) {
      controller.abort();
      controller = null;
    }
  };
  async function runSse(token) {
    if (!config.fetchStream) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        "SSE live tail 需要 fetchStream（API key/Bearer 不可用 EventSource）"
      );
    }
    const path = config.capabilities.sseVerified && config.capabilities.liveTailPath ? config.capabilities.liveTailPath : config.capabilities.legacyLiveTailPath;
    const query = {
      start: String(lastTimestamp || config.startMs),
      filter: config.filterExpression || ""
    };
    setState("connecting");
    const res = await config.fetchStream({
      path,
      query,
      signal: controller.signal
    });
    if (!isCurrent(token)) return;
    const ct = String(
      res.headers?.get?.("content-type") || res.headers?.get?.("Content-Type") || ""
    );
    if (!ct.includes("text/event-stream")) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        `live tail Content-Type 必须是 text/event-stream，得到 ${ct || "empty"}`
      );
    }
    if (!res.body || typeof res.body.getReader !== "function") {
      throw new DataSourceError("INVALID_RESPONSE", "SSE response body 不可读");
    }
    setState("live");
    retryCount = 0;
    const reader = res.body.getReader();
    const decoder = new TextDecoder();
    let buf = "";
    while (isCurrent(token)) {
      if (paused) {
        setState("paused");
        await sleep2(100, controller.signal);
        continue;
      }
      if (state2 === "paused") setState("live");
      const { done, value } = await reader.read();
      if (!isCurrent(token)) return;
      if (done) break;
      buf += decoder.decode(value, { stream: true });
      buf = parseSseChunk(buf, (ev) => {
        if (!isCurrent(token)) return;
        if (ev.event === "error") {
          throw new DataSourceError(
            "UPSTREAM_ERROR",
            ev.data || "SSE event: error"
          );
        }
        const row = parseLiveTailDataPayload(ev.data);
        if (row) pushRows([row]);
      });
    }
  }
  async function runCursorPoll(token) {
    if (!config.fetchCursorPage) {
      throw new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        "cursor poll 需要 fetchCursorPage"
      );
    }
    setState("connecting");
    setState("live");
    retryCount = 0;
    let firstPageDone = false;
    while (isCurrent(token)) {
      if (paused) {
        setState("paused");
        await sleep2(100, controller.signal);
        continue;
      }
      if (state2 === "paused") setState("live");
      const page = await config.fetchCursorPage({
        cursor: nextCursor,
        startMs: lastTimestamp || config.startMs,
        signal: controller.signal
      });
      if (!isCurrent(token) || controller.signal.aborted) return;
      pushRows(page.rows || []);
      if (page.nextCursor) {
        nextCursor = page.nextCursor;
        firstPageDone = true;
      } else if (!firstPageDone) {
        firstPageDone = true;
        if (!page.rows?.length) {
          throw new DataSourceError(
            "UNSUPPORTED_CAPABILITY",
            "无 SSE 且无 nextCursor，不能循环重拉第一页"
          );
        }
      } else if (!page.nextCursor && !page.rows?.length) ;
      await sleep2(pollIntervalMs, controller.signal);
      if (!nextCursor && firstPageDone && !page.rows?.length) ;
    }
  }
  async function loop() {
    const token = runToken;
    transport = resolveLiveTailTransport(config.capabilities);
    if (transport === "none") {
      setState("error", "UNSUPPORTED_CAPABILITY");
      const err = new DataSourceError(
        "UNSUPPORTED_CAPABILITY",
        "live tail 需要已验证 SSE 或 cursor poll capability"
      );
      config.onError?.(err, sessionId);
      return;
    }
    while (isCurrent(token) && state2 !== "stopped") {
      try {
        if (transport === "sse") await runSse(token);
        else await runCursorPoll(token);
        if (isCurrent(token) && !paused) {
          setState("retrying");
          retryCount += 1;
          if (retryCount > maxRetries) {
            setState("error", "max retries");
            config.onError?.(
              new DataSourceError("UPSTREAM_ERROR", "live tail max retries"),
              sessionId
            );
            return;
          }
          const backoff = Math.min(3e4, 500 * 2 ** Math.min(retryCount, 6));
          await sleep2(backoff, controller.signal);
        }
      } catch (e) {
        if (!isCurrent(token)) return;
        if (e?.code === "CANCELLED" || /abort/i.test(String(e?.message || "")))
          return;
        retryCount += 1;
        if (retryCount > maxRetries) {
          setState("error", e?.message || "error");
          config.onError?.(
            e instanceof Error ? e : new Error(String(e)),
            sessionId
          );
          return;
        }
        setState("retrying", e?.message);
        const backoff = Math.min(3e4, 500 * 2 ** Math.min(retryCount, 6));
        try {
          await sleep2(backoff, controller.signal);
        } catch {
          return;
        }
      }
    }
  }
  return {
    get sessionId() {
      return sessionId;
    },
    get state() {
      return state2;
    },
    get transport() {
      return transport;
    },
    get rows() {
      return rows;
    },
    async start() {
      cancelActive();
      paused = false;
      controller = new AbortController();
      void loop();
    },
    pause() {
      paused = true;
      if (state2 === "live" || state2 === "connecting") setState("paused");
    },
    resume() {
      if (state2 === "stopped" || state2 === "idle") return;
      paused = false;
      if (state2 === "paused") setState("live");
    },
    stop() {
      paused = false;
      cancelActive();
      setState("stopped");
    },
    dispose() {
      paused = false;
      cancelActive();
      setState("stopped");
      rows = [];
      seen.clear();
    }
  };
}
const MAX_EXPORT_BYTES = 50 * 1024 * 1024;
const MAX_PAGES = 1e4;
function isHtmlContentType(ct) {
  return /text\/html/i.test(ct);
}
function isJsonContentType(ct) {
  return /application\/json|text\/json|\+json/i.test(ct);
}
function looksLikeErrorJson(text) {
  try {
    const o = JSON.parse(text);
    if (o && typeof o === "object") {
      if (o.error || o.errors || o.status === "error" || o.success === false)
        return true;
    }
  } catch {
  }
  return false;
}
function redactSecrets(value, depth = 0) {
  if (depth > 12) return "[MaxDepth]";
  if (value == null) return value;
  if (Array.isArray(value))
    return value.map((v) => redactSecrets(v, depth + 1));
  if (typeof value !== "object") return value;
  const out = {};
  for (const [k, v] of Object.entries(value)) {
    if (/token|password|secret|authorization|api[_-]?key|credential/i.test(k)) {
      out[k] = "[REDACTED]";
    } else {
      out[k] = redactSecrets(v, depth + 1);
    }
  }
  return out;
}
function framesToCsv(frames) {
  const lines = [];
  for (const fr of frames) {
    const names = fr.fields.map((f) => f.name);
    lines.push(names.map(csvEscape).join(","));
    const n = fr.fields[0]?.values?.length || 0;
    for (let i = 0; i < n; i++) {
      lines.push(
        fr.fields.map((f) => {
          const v = f.values?.[i];
          if (v == null) return "";
          if (typeof v === "object") return csvEscape(stableJson(v));
          return csvEscape(String(v));
        }).join(",")
      );
    }
    lines.push("");
  }
  return lines.join("\n");
}
function csvEscape(s) {
  if (/[",\n\r]/.test(s)) return `"${s.replace(/"/g, '""')}"`;
  return s;
}
function stableJson(value) {
  return JSON.stringify(redactSecrets(value), (_k, v) => {
    if (v && typeof v === "object" && !Array.isArray(v)) {
      const o = v;
      const sorted = {};
      for (const k of Object.keys(o).sort()) sorted[k] = o[k];
      return sorted;
    }
    return v;
  });
}
async function exportUpstreamRaw(args) {
  const res = await args.http({
    path: args.path,
    method: "POST",
    body: args.body,
    signal: args.signal
  });
  const status = Number(res.status || 0);
  if (status < 200 || status >= 300) {
    throw new DataSourceError(
      "UPSTREAM_ERROR",
      `export_raw_data HTTP ${status}`,
      { status }
    );
  }
  const headers = res.headers;
  const getHeader = (name) => {
    if (!headers) return "";
    if (typeof headers.get === "function")
      return String(headers.get(name) || "");
    const h2 = headers;
    return String(h2[name] || h2[name.toLowerCase()] || "");
  };
  const ct = getHeader("content-type") || getHeader("Content-Type");
  if (isHtmlContentType(ct)) {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      "export 返回 HTML，不能当作导出成功"
    );
  }
  let body;
  let size;
  if (typeof res.data === "string") {
    if (isJsonContentType(ct) && looksLikeErrorJson(res.data)) {
      throw new DataSourceError("UPSTREAM_ERROR", "export 返回 error JSON");
    }
    body = res.data;
    size = new TextEncoder().encode(res.data).byteLength;
  } else if (res.data instanceof Uint8Array) {
    body = res.data;
    size = res.data.byteLength;
  } else if (res.data && typeof res.data === "object") {
    if (res.data.error || res.data.success === false) {
      throw new DataSourceError(
        "UPSTREAM_ERROR",
        "export 返回 error JSON object"
      );
    }
    body = stableJson(res.data);
    size = new TextEncoder().encode(body).byteLength;
  } else {
    body = String(res.data ?? "");
    size = body.length;
  }
  if (size > MAX_EXPORT_BYTES) {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      `export 超过 size limit ${MAX_EXPORT_BYTES}`
    );
  }
  const cd = getHeader("content-disposition") || getHeader("Content-Disposition");
  const filename = /filename\*?=(?:UTF-8''|")?([^\";]+)/i.exec(cd)?.[1] || args.filenameHint || `signoz-export-${Date.now()}.raw`;
  return {
    mode: "upstream",
    filename: decodeURIComponent(filename.replace(/"/g, "")),
    contentType: ct || "application/octet-stream",
    body,
    size
  };
}
async function exportViaCursorPages(args) {
  const maxPages = Math.min(MAX_PAGES, args.maxPages ?? MAX_PAGES);
  let cursor = null;
  let pages = 0;
  let rows = 0;
  let complete = false;
  let truncatedByUpstream = false;
  const allRows = [];
  const allFrames = [];
  const envelopes = [];
  while (pages < maxPages) {
    if (args.signal?.aborted) {
      args.onProgress?.({
        mode: "cursor_pages",
        pages,
        rows,
        bytes: 0,
        complete: false,
        truncatedByUpstream: false,
        cancelled: true
      });
      throw new DataSourceError("CANCELLED", "export cancelled");
    }
    const page = await args.fetchPage(cursor, args.signal);
    pages += 1;
    const pageRows = page.rows || [];
    rows += pageRows.length;
    allRows.push(...pageRows);
    if (page.frames) allFrames.push(...page.frames);
    if (page.envelope !== void 0)
      envelopes.push(redactSecrets(page.envelope));
    args.onProgress?.({
      mode: "cursor_pages",
      pages,
      rows,
      bytes: 0,
      complete: false,
      truncatedByUpstream: false,
      cancelled: false
    });
    if (!page.nextCursor) {
      complete = true;
      break;
    }
    if (page.nextCursor === cursor) {
      truncatedByUpstream = true;
      break;
    }
    cursor = page.nextCursor;
  }
  if (!complete && pages >= maxPages) truncatedByUpstream = true;
  let body;
  if (args.format === "csv") {
    if (allFrames.length) body = framesToCsv(allFrames);
    else {
      const keys = /* @__PURE__ */ new Set();
      for (const r of allRows) {
        if (r && typeof r === "object")
          Object.keys(r).forEach((k) => keys.add(k));
      }
      const cols = [...keys].sort();
      const lines = [cols.map(csvEscape).join(",")];
      for (const r of allRows) {
        const o = r && typeof r === "object" ? r : { value: r };
        lines.push(
          cols.map((c) => {
            const v = o[c];
            if (v == null) return "";
            if (typeof v === "object") return csvEscape(stableJson(v));
            return csvEscape(String(v));
          }).join(",")
        );
      }
      body = lines.join("\n");
    }
  } else {
    body = stableJson({
      exportMode: "cursor_pages",
      pages,
      rowCount: rows,
      complete,
      truncatedByUpstream,
      envelopes: envelopes.length ? envelopes : void 0,
      data: redactSecrets(allRows)
    });
  }
  const bytes = new TextEncoder().encode(body).byteLength;
  if (bytes > MAX_EXPORT_BYTES) {
    throw new DataSourceError(
      "INVALID_RESPONSE",
      `export 超过 size limit ${MAX_EXPORT_BYTES}`
    );
  }
  args.onProgress?.({
    mode: "cursor_pages",
    pages,
    rows,
    bytes,
    complete,
    truncatedByUpstream,
    cancelled: false
  });
  return {
    mode: "cursor_pages",
    format: args.format,
    filename: args.filenameHint || `signoz-export-pages-${Date.now()}.${args.format}`,
    body,
    pages,
    rows,
    complete,
    truncatedByUpstream
  };
}
function exportLoadedOnly(args) {
  const rows = args.rows || [];
  let body;
  if (args.format === "csv") {
    body = args.frames?.length ? framesToCsv(args.frames) : framesToCsv([]);
    if (!args.frames?.length && rows.length) {
      const keys = /* @__PURE__ */ new Set();
      for (const r of rows) {
        if (r && typeof r === "object")
          Object.keys(r).forEach((k) => keys.add(k));
      }
      const cols = [...keys].sort();
      const lines = [cols.map(csvEscape).join(",")];
      for (const r of rows) {
        const o = r && typeof r === "object" ? r : { value: r };
        lines.push(cols.map((c) => csvEscape(String(o[c] ?? ""))).join(","));
      }
      body = lines.join("\n");
    }
  } else {
    body = stableJson({
      exportMode: "loaded_only",
      disclaimer: "EXPORT_LOADED_ONLY",
      rows: redactSecrets(rows),
      frames: args.frames ? redactSecrets(
        args.frames.map((f) => ({
          name: f.name,
          fields: f.fields.map((x) => x.name)
        }))
      ) : void 0
    });
  }
  return {
    mode: "loaded_only",
    format: args.format,
    filename: args.filenameHint || `signoz-loaded-${Date.now()}.${args.format}`,
    body,
    rows: rows.length || args.frames?.reduce(
      (n, f) => n + (f.fields[0]?.values?.length || 0),
      0
    ) || 0,
    disclaimer: "EXPORT_LOADED_ONLY"
  };
}
async function exportSigNozRaw(args) {
  const format = args.format || "json";
  if (args.preferLoadedOnly) {
    return exportLoadedOnly({
      format,
      frames: args.loadedFrames,
      rows: args.loadedRows
    });
  }
  if (args.capabilities.exportRawVerified && args.capabilities.exportRawPath && args.http) {
    return exportUpstreamRaw({
      path: args.capabilities.exportRawPath,
      body: args.upstreamBody,
      signal: args.signal,
      http: args.http
    });
  }
  if (args.capabilities.cursorPaging && args.fetchPage) {
    return exportViaCursorPages({
      format,
      signal: args.signal,
      fetchPage: args.fetchPage,
      onProgress: args.onProgress
    });
  }
  if (args.loadedFrames?.length || args.loadedRows?.length) {
    return exportLoadedOnly({
      format,
      frames: args.loadedFrames,
      rows: args.loadedRows
    });
  }
  throw new DataSourceError(
    "UNSUPPORTED_CAPABILITY",
    "export 需要已验证 export_raw_data 或 cursor paging（禁止用屏幕前 N 行冒充全部）"
  );
}
const SIGNOZ_CAPABILITIES = {
  signals: ["metrics", "logs", "traces"],
  query: true,
  health: true,
  metadata: true,
  variables: true,
  annotations: true,
  exemplars: false,
  streaming: false,
  queryLanguages: ["promql", "signoz-builder", "clickhouse_sql"]
};
function rangeMs(range) {
  const from = range.from instanceof Date ? range.from.getTime() : Number(range.from?.valueOf?.() ?? range.from);
  const to = range.to instanceof Date ? range.to.getTime() : Number(range.to?.valueOf?.() ?? range.to);
  return { fromMs: from, toMs: to };
}
function createSignozDataSource(instance, meta2) {
  const dataMode = instance.jsonData?.dataMode === "fixture" ? "fixture" : "live";
  const useFixture = dataMode === "fixture";
  const fallback = createBuiltinDataSourceApi(instance, meta2);
  const options = migrateSigNozConfig(
    instance.jsonData || {}
  );
  const profile = resolveSigNozProfile(options);
  const profileId = String(options.apiProfile || profile.id);
  const base = String(
    instance.url || getRuntimeDataSourceSettings(instance.uid)?.url || ""
  ).replace(/\/$/, "");
  const timeoutMs = parseTimeoutMs(options.timeout, 3e4);
  const cacheTtlMs = parseCacheTtlMs(options.metadataCacheTTL, 3e5);
  let observedVersion = "";
  let credentialRevision = "";
  async function resolveCredential() {
    const cred = await getRuntimeCredential(instance.uid);
    if (cred && options.credentialKind === "signozApiKey" && cred.kind === "apiKey") {
      return {
        ...cred,
        headerName: options.credentialHeaderName || profile.defaultCredentialHeader || "SIGNOZ-API-KEY"
      };
    }
    if (cred && options.credentialKind === "signozApiKey" && cred.kind === "bearer" && cred.value) {
      return {
        kind: "apiKey",
        value: cred.value,
        headerName: options.credentialHeaderName || profile.defaultCredentialHeader || "SIGNOZ-API-KEY"
      };
    }
    credentialRevision = cred ? `${cred.kind}:${cred.headerName || ""}` : "none";
    return cred;
  }
  function cacheIdentity() {
    return buildCapabilityIdentity({
      uid: instance.uid,
      options,
      baseUrl: base,
      credentialRevision,
      observedVersion
    });
  }
  async function signozHttp(req) {
    const run = async () => {
      const cred2 = await resolveCredential();
      const mode2 = String(
        options.credentialMode || instance.jsonData?.credentialMode || ""
      );
      if (!useFixture && !cred2 && mode2 !== "proxy" && mode2 !== "none") {
        throw new DataSourceError(
          "AUTH",
          "SigNoz live 请求缺少运行时凭证（Authorization 不会被自动发明）。请设置 VITE_SIGNOZ_NATIVE_TOKEN 并重启 dev server，或使用 credentialMode=proxy 并由 Vite/BFF 注入。"
        );
      }
      return datasourceHttp({
        forceNetwork: !useFixture,
        baseUrl: base,
        path: req.path,
        method: req.method || "GET",
        body: req.body,
        query: req.query,
        uid: instance.uid,
        credential: cred2,
        signal: req.signal,
        timeoutMs
      });
    };
    const cred = await resolveCredential();
    const session = asSessionCredential(cred);
    if (session && !String(req.path || "").includes("/sessions/")) {
      return withAuthRetry(run, {
        uid: instance.uid,
        baseUrl: base,
        credential: session,
        signal: req.signal
      });
    }
    return run();
  }
  const metadataApi = createSigNozMetadataApi({
    offline: useFixture,
    profile,
    http: useFixture ? void 0 : signozHttp,
    identity: cacheIdentity(),
    cache: sharedSigNozMetadataCache,
    ttlMs: cacheTtlMs
  });
  const activeLiveTails = /* @__PURE__ */ new Map();
  const waterfallCache = createMemoryWaterfallCache();
  function liveExportCaps() {
    return resolveLiveExportCapabilities({ profile, options });
  }
  async function listServices(signal) {
    if (useFixture) {
      return [
        { text: "frontend", value: "frontend" },
        { text: "api", value: "api" },
        { text: "checkout", value: "checkout" }
      ];
    }
    try {
      const meta22 = await metadataApi.getMetadata({ type: "services" }, signal);
      if (meta22.type === "services") {
        return meta22.values.map((v) => ({ text: v, value: v }));
      }
    } catch {
    }
    return [];
  }
  async function mutate(request) {
    if (useFixture) {
      return {
        status: "success",
        message: "offline preview",
        data: {
          action: request.action,
          payload: request.payload,
          preview: true
        }
      };
    }
    const action = String(request.action || "");
    if (action !== "signoz.acknowledge" && action !== "signoz.resolve") {
      return {
        status: "error",
        message: `Unsupported action: ${action}`
      };
    }
    const payload = request.payload || {};
    if (payload.source && payload.source !== "alert") {
      return {
        status: "error",
        message: "only alert source supports actions"
      };
    }
    const endpoints = profile.endpoints;
    const path = action === "signoz.acknowledge" ? options.customAcknowledgePath || endpoints.acknowledge?.path : options.customResolvePath || endpoints.resolve?.path;
    if (!path) {
      return {
        status: "error",
        message: `Unsupported action: ${action}`
      };
    }
    const body = {
      alertId: payload.alertId || payload.issueId,
      source: "alert",
      message: payload.message
    };
    const cred = await getRuntimeCredential(instance.uid);
    const res = await datasourceHttp({
      forceNetwork: !useFixture,
      baseUrl: base,
      path,
      method: "POST",
      body,
      uid: instance.uid,
      credential: cred,
      signal: request.signal
    });
    const status = Number(res?.status ?? 200);
    if (!isSuccessfulActionResponse(status, res?.data)) {
      return {
        status: "error",
        message: "action response indicates failure"
      };
    }
    return {
      status: "success",
      message: "ok",
      data: res?.data
    };
  }
  return {
    ...fallback,
    uid: instance.uid,
    name: instance.name,
    type: instance.type,
    meta: meta2,
    capabilities: { ...SIGNOZ_CAPABILITIES },
    async query(request, signal) {
      const { fromMs, toMs: toMs2 } = rangeMs(request.range);
      const intervalMs = request.intervalMs || 6e4;
      const frames = [];
      const framesByName = /* @__PURE__ */ new Map();
      const pushNamed = (key, fr) => {
        const arr = framesByName.get(key) || [];
        arr.push(fr);
        framesByName.set(key, arr);
      };
      for (const rawTarget of request.targets || []) {
        if (rawTarget.hide) continue;
        const query = migrateSigNozQuery(rawTarget);
        if (useFixture) {
          try {
            buildSigNozRequests({
              profile,
              options,
              query,
              fromMs,
              toMs: toMs2,
              intervalMs
            });
          } catch (e) {
            if (e instanceof DataSourceError) throw e;
            throw new DataSourceError(
              "INVALID_QUERY",
              e instanceof Error ? e.message : String(e)
            );
          }
          const signalName = String(
            query.signal || query.queries?.[0]?.spec?.signal || "metrics"
          );
          if (signalName === "alerts") {
            const fr = createDataFrame({
              refId: query.refId,
              name: "issues",
              fields: [
                {
                  name: "Time",
                  type: "time",
                  values: [fromMs, fromMs + intervalMs, toMs2]
                },
                {
                  name: "id",
                  type: "string",
                  values: ["iss-1", "iss-2", "iss-3"]
                },
                {
                  name: "title",
                  type: "string",
                  values: ["High latency", "Error rate", "DB timeout"]
                },
                {
                  name: "service",
                  type: "string",
                  values: ["frontend", "api", "checkout"]
                },
                {
                  name: "severity",
                  type: "string",
                  values: ["critical", "warning", "error"]
                },
                {
                  name: "status",
                  type: "string",
                  values: ["firing", "firing", "acknowledged"]
                },
                { name: "traceId", type: "string", values: ["t1", "t2", "t3"] }
              ],
              meta: {
                preferredVisualisationType: "table",
                offline: useFixture,
                signal: "alerts"
              }
            });
            frames.push(fr);
            pushNamed("issues", fr);
            continue;
          }
          for (const item of query.queries || []) {
            if (item.type === "builder_formula") continue;
            if (item.spec?.disabled) continue;
            const name = item.spec.name || query.refId;
            const times = [fromMs, fromMs + intervalMs, toMs2];
            const fr = createDataFrame({
              refId: query.refId,
              name,
              fields: [
                { name: "Time", type: "time", values: times },
                { name, type: "number", values: [1, 2, 3] }
              ],
              meta: {
                preferredVisualisationType: "graph",
                offline: useFixture
              }
            });
            frames.push(fr);
            pushNamed(name, fr);
          }
          for (const item of query.queries || []) {
            if (item.type !== "builder_formula" || item.spec.disabled) continue;
            const f = evaluateLocalFormula(
              item.spec.expression,
              framesByName,
              item.spec.name
            );
            frames.push(f);
            pushNamed(item.spec.name, f);
          }
          continue;
        }
        if (profileId === "prometheus-compatible") {
          const onlyProm = (query.queries || []).every(
            (q) => q.type === "builder_formula" || q.type === "builder_query" && q.queryType === "promql"
          );
          if (onlyProm) {
            const prom = createPrometheusDataSource$1(
              {
                ...instance,
                jsonData: { ...instance.jsonData, httpMethod: "GET" }
              },
              meta2
            );
            const promTargets = (query.queries || []).filter((q) => q.type === "builder_query").map((q) => ({
              refId: q.spec.name || query.refId,
              expr: q.rawQuery || "",
              legendFormat: q.rawLegend || q.spec.legend || ""
            }));
            const res = await prom.query(
              { ...request, targets: promTargets },
              signal
            );
            for (const fr of res.data || []) {
              frames.push(fr);
              pushNamed(String(fr.refId || fr.name), fr);
            }
            for (const item of query.queries || []) {
              if (item.type !== "builder_formula" || item.spec.disabled)
                continue;
              const f = evaluateLocalFormula(
                item.spec.expression,
                framesByName,
                item.spec.name
              );
              frames.push(f);
            }
            continue;
          }
        }
        let built;
        try {
          built = buildSigNozRequests({
            profile,
            options,
            query,
            fromMs,
            toMs: toMs2,
            intervalMs
          });
        } catch (e) {
          if (e instanceof DataSourceError) throw e;
          throw new DataSourceError(
            "UNSUPPORTED_QUERY_API",
            e instanceof Error ? e.message : String(e)
          );
        }
        const cred = await getRuntimeCredential(instance.uid);
        for (const req of built) {
          if (req.localFormula) {
            const f = evaluateLocalFormula(
              req.localFormula.expression,
              framesByName,
              req.localFormula.name
            );
            frames.push(f);
            pushNamed(req.localFormula.name, f);
            continue;
          }
          if (!req.path) continue;
          const res = await datasourceHttp({
            forceNetwork: !useFixture,
            baseUrl: base,
            path: req.path,
            method: req.method,
            body: req.body,
            query: req.query,
            uid: instance.uid,
            credential: cred,
            signal
          });
          const isPromEnvelope = typeof res.data?.data?.resultType === "string" && Array.isArray(res.data?.data?.result);
          let mapped = [];
          if (isPromEnvelope) {
            mapped = normalizeDataFrames(
              mapPrometheusResponse(res.data, {
                refId: query.refId,
                legendFormat: "",
                expr: String(req.query?.query || "")
              }),
              {
                refId: query.refId,
                source: "signoz",
                datasourceUid: instance.uid,
                profile: profileId,
                signal: "metrics",
                requestId: request.requestId
              }
            );
          } else {
            mapped = normalizeDataFrames(
              mapSignozResponse(res.data, profileId, {
                refId: query.refId,
                signal: req.signal,
                requestType: String(
                  query.requestType || req.body?.requestType || ""
                ),
                datasourceUid: instance.uid,
                experimentalDistribution: Boolean(
                  options.experimentalCapabilities?.distribution
                )
              }),
              {
                refId: query.refId,
                source: "signoz",
                datasourceUid: instance.uid,
                profile: profileId,
                signal: String(req.signal || "metrics"),
                requestId: request.requestId
              }
            );
          }
          for (const fr of mapped) {
            frames.push(fr);
            const key = String(
              fr.name || fr.refId || req.queryNames[0] || query.refId
            );
            pushNamed(key, fr);
            for (const n of req.queryNames) {
              pushNamed(n, fr);
            }
          }
        }
      }
      return { data: frames };
    },
    async testDatasource(signal) {
      if (useFixture)
        return { status: "success", message: "SigNoz offline OK" };
      if (!base) return { status: "error", message: "Datasource URL is empty" };
      try {
        const healthRes = await probeHealth(
          async (req) => {
            const r = await signozHttp({
              ...req,
              signal: req.signal || signal
            });
            return { status: Number(r.status ?? 200), data: r.data };
          },
          profile,
          { signal }
        );
        if (!healthRes.ok) {
          if (healthRes.reasonCode === "AUTH") {
            sharedSigNozMetadataCache.clearUid(instance.uid);
            return {
              status: "error",
              message: `AUTH: ${healthRes.reason} @ ${healthRes.path}`
            };
          }
          return {
            status: "error",
            message: `health failed (${healthRes.reasonCode || "ERROR"}): ${healthRes.reason} @ ${healthRes.path || "n/a"}`
          };
        }
        const versionEp = profile.endpoints.version;
        let versionInfo = "";
        if (versionEp?.path) {
          try {
            const vres = await signozHttp({
              path: versionEp.path,
              method: "GET",
              signal
            });
            const parsed = parseVersionPayload(vres.data);
            if (parsed.version) {
              observedVersion = parsed.version;
              versionInfo = ` version=${parsed.version}`;
              if (parsed.ee != null) versionInfo += ` ee=${parsed.ee}`;
              if (parsed.setupCompleted != null)
                versionInfo += ` setupCompleted=${parsed.setupCompleted}`;
            }
          } catch {
          }
        }
        try {
          if (isV5WireProfile(profileId)) {
            await metadataApi.getMetadata({ type: "metrics" }, signal);
          } else if (profile.endpoints.metricsList || profile.endpoints.metadata || profile.endpoints.fieldsKeys) {
            try {
              await metadataApi.getMetadata({ type: "metrics" }, signal);
            } catch {
              await metadataApi.getMetadata(
                { type: "attributeKeys", signal: "metrics" },
                signal
              );
            }
          }
        } catch (e) {
          const msg = e instanceof Error ? e.message : String(e);
          if (/401|403|AUTH/i.test(msg)) {
            sharedSigNozMetadataCache.clearUid(instance.uid);
            return {
              status: "error",
              message: `AUTH: authenticated probe failed: ${msg}`
            };
          }
          return {
            status: "error",
            message: `authenticated probe failed: ${msg}`
          };
        }
        return {
          status: "success",
          message: `SigNoz profile ${profileId} healthy via ${healthRes.path}${versionInfo}`
        };
      } catch (e) {
        return {
          status: "error",
          message: e instanceof Error ? e.message : String(e)
        };
      }
    },
    listServices,
    async metricFindQuery(query, signal) {
      const caps2 = resolveEditorCapabilities({
        profile,
        options
      });
      try {
        return await runSigNozVariableQuery(metadataApi, query, {
          signal,
          profileId,
          capabilities: caps2,
          runClickHouseVariable: useFixture ? async () => ["offline-ch-1", "offline-ch-2"] : profile.endpoints.variablesQuery?.path ? async (sql, abort) => {
            const cred = await getRuntimeCredential(instance.uid);
            const res = await datasourceHttp({
              forceNetwork: true,
              baseUrl: base,
              path: profile.endpoints.variablesQuery.path,
              method: profile.endpoints.variablesQuery.method || "POST",
              body: { query: sql },
              uid: instance.uid,
              credential: cred,
              signal: abort
            });
            const rows = Array.isArray(res.data) ? res.data : Array.isArray(res.data?.data) ? res.data.data : Array.isArray(res.data?.values) ? res.data.values : [];
            return rows.map(
              (r) => typeof r === "string" || typeof r === "number" ? String(r) : String(r?.value ?? r?.name ?? "")
            ).filter(Boolean);
          } : void 0
        });
      } catch (e) {
        throw e;
      }
    },
    async annotationQuery(request, signal) {
      const { fromMs, toMs: toMs2 } = rangeMs(request.range);
      const ann = request.annotation || {};
      const target = ann.target || ann;
      const caps2 = resolveEditorCapabilities({
        profile,
        options
      });
      const alertsCapable = caps2.alerts || Boolean(
        options.customAlertsPath || profile.endpoints.alertsQuery?.path
      );
      const frames = await querySigNozAnnotations(
        metadataApi,
        {
          source: target.source || "errorLogs",
          service: target.service,
          environment: target.environment
        },
        { fromMs, toMs: toMs2 },
        {
          signal,
          datasourceUid: instance.uid,
          alertsCapable,
          runRawQuery: useFixture ? void 0 : async ({
            signal: sig,
            filterExpression,
            fromMs: f,
            toMs: t2,
            abort
          }) => {
            const ep = sig === "logs" ? profile.endpoints.logsQuery || profile.endpoints.metricsQuery : profile.endpoints.tracesQuery || profile.endpoints.metricsQuery;
            if (!ep?.path) {
              throw new DataSourceError(
                "UNSUPPORTED_CAPABILITY",
                `annotation raw ${sig} 需要 query_range endpoint`
              );
            }
            const cred = await getRuntimeCredential(instance.uid);
            const body = {
              start: f,
              end: t2,
              requestType: "raw",
              compositeQuery: {
                queries: [
                  {
                    type: "builder_query",
                    spec: {
                      name: "A",
                      signal: sig,
                      disabled: false,
                      filter: { expression: filterExpression },
                      limit: 100
                    }
                  }
                ]
              }
            };
            if (String(profile.id).includes("v3") || String(profile.id).includes("v4")) {
              body.compositeQuery = {
                queryType: "builder",
                panelType: sig === "traces" ? "trace" : "list",
                builderQueries: {
                  A: {
                    dataSource: sig,
                    filters: { items: [], op: "AND" },
                    filter: filterExpression,
                    aggregateOperator: "noop",
                    limit: 100
                  }
                }
              };
              delete body.requestType;
              body.start = f;
              body.end = t2;
            }
            const res = await datasourceHttp({
              forceNetwork: true,
              baseUrl: base,
              path: ep.path,
              method: ep.method || "POST",
              body,
              uid: instance.uid,
              credential: cred,
              signal: abort
            });
            return normalizeDataFrames(
              mapSignozResponse(res.data, profileId, {
                refId: "annotation",
                signal: sig,
                requestType: "raw",
                datasourceUid: instance.uid
              }),
              {
                refId: "annotation",
                source: "signoz",
                datasourceUid: instance.uid,
                profile: profileId,
                signal: String(sig || "logs"),
                requestId: "annotation"
              }
            );
          }
        }
      );
      return frames;
    },
    async getMetadata(request, signal) {
      const api = createSigNozMetadataApi({
        offline: useFixture,
        profile,
        http: useFixture ? void 0 : signozHttp,
        identity: cacheIdentity(),
        cache: sharedSigNozMetadataCache,
        ttlMs: cacheTtlMs
      });
      return api.getMetadata(request, signal);
    },
    /** Capability-gated live tail session. Switching UID/query should dispose prior session. */
    startLiveTail(args = {}) {
      const key = args.sessionKey || "default";
      const prev = activeLiveTails.get(key);
      if (prev) prev.dispose();
      const caps2 = liveExportCaps();
      const session = createLiveTailSession({
        uid: instance.uid,
        profileId,
        filterExpression: args.filterExpression || "",
        startMs: args.startMs ?? Date.now() - 6e4,
        pollIntervalMs: Number(options.liveTailIntervalMs) || 2e3,
        maxRows: 5e3,
        capabilities: {
          sseVerified: caps2.sseVerified,
          legacySseEnabled: caps2.legacySseEnabled,
          cursorPoll: caps2.cursorPoll || useFixture,
          liveTailPath: caps2.liveTailPath,
          legacyLiveTailPath: caps2.legacyLiveTailPath
        },
        fetchStream: useFixture ? void 0 : async ({ path, query, signal }) => {
          const qs = new URLSearchParams(query).toString();
          const fullPath = qs ? `${path}?${qs}` : path;
          const cred = await resolveCredential();
          if (typeof fetch !== "function") {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              "fetch unavailable for SSE"
            );
          }
          const headers = {
            Accept: "text/event-stream"
          };
          if (cred?.kind === "bearer" && cred.value)
            headers.Authorization = `Bearer ${cred.value}`;
          if (cred?.kind === "apiKey" && cred.value) {
            headers[cred.headerName || options.credentialHeaderName || "SIGNOZ-API-KEY"] = cred.value;
          }
          const url = `${base}${fullPath.startsWith("/") ? "" : "/"}${fullPath}`;
          return fetch(url, {
            method: "GET",
            headers,
            credentials: options.fetchCredentials || "omit",
            signal
          });
        },
        fetchCursorPage: async ({ cursor, startMs, signal }) => {
          if (useFixture) {
            if (cursor) return { rows: [], nextCursor: null };
            return {
              rows: [
                {
                  timestamp: startMs + 1,
                  data: { body: "offline live tail row", service: "frontend" },
                  rowId: stableRowId(startMs + 1, {
                    body: "offline live tail row"
                  })
                }
              ],
              nextCursor: null
            };
          }
          const path = profile.endpoints.logsQuery?.path || profile.endpoints.metricsQuery?.path;
          if (!path) {
            throw new DataSourceError(
              "UNSUPPORTED_CAPABILITY",
              "no logs query_range for cursor poll"
            );
          }
          const body = {
            start: startMs,
            end: Date.now(),
            requestType: "raw",
            compositeQuery: {
              queries: [
                {
                  type: "builder_query",
                  spec: {
                    name: "A",
                    signal: "logs",
                    filter: { expression: args.filterExpression || "" },
                    cursor: cursor || void 0
                  }
                }
              ]
            }
          };
          if (cursor) body.cursor = cursor;
          const res = await signozHttp({ path, method: "POST", body, signal });
          const data = res?.data;
          const results = data?.data?.data?.results ?? data?.data?.results ?? data?.results ?? [];
          const first = Array.isArray(results) ? results[0] : null;
          const rawRows = first?.rows || first?.data || [];
          const nextCursor = first?.nextCursor ?? first?.cursor ?? null;
          const rows = (Array.isArray(rawRows) ? rawRows : []).map((r) => {
            const ts = Number(r?.timestamp ?? r?.time ?? startMs);
            return { timestamp: ts, data: r, rowId: stableRowId(ts, r, r?.id) };
          });
          return { rows, nextCursor };
        },
        onState: args.onState,
        onRows: args.onRows,
        onError: args.onError
      });
      activeLiveTails.set(key, session);
      void session.start();
      return session;
    },
    stopLiveTail(sessionKey = "default") {
      const s = activeLiveTails.get(sessionKey);
      if (s) {
        s.dispose();
        activeLiveTails.delete(sessionKey);
      }
    },
    async exportRawData(args = {}) {
      const caps2 = liveExportCaps();
      return exportSigNozRaw({
        capabilities: {
          exportRawVerified: caps2.exportRawVerified && !useFixture,
          exportRawPath: caps2.exportRawPath,
          cursorPaging: caps2.cursorPoll || useFixture
        },
        format: args.format || "json",
        signal: args.signal,
        preferLoadedOnly: args.preferLoadedOnly,
        loadedRows: args.loadedRows,
        loadedFrames: args.loadedFrames,
        upstreamBody: args.upstreamBody,
        onProgress: args.onProgress,
        http: useFixture ? void 0 : async (req) => {
          const res = await signozHttp({
            path: req.path,
            method: req.method,
            body: req.body,
            signal: req.signal
          });
          return {
            status: Number(res?.status ?? 200),
            data: res?.data,
            headers: res?.headers
          };
        },
        fetchPage: async (cursor, signal) => {
          if (useFixture) {
            if (cursor) return { rows: [], nextCursor: null };
            return { rows: [{ body: "offline export row" }], nextCursor: null };
          }
          const path = profile.endpoints.logsQuery?.path || profile.endpoints.metricsQuery?.path;
          if (!path) return { rows: [], nextCursor: null };
          const body = {
            start: Date.now() - 36e5,
            end: Date.now(),
            requestType: "raw",
            compositeQuery: {
              queries: [
                {
                  type: "builder_query",
                  spec: {
                    name: "A",
                    signal: "logs",
                    cursor: cursor || void 0
                  }
                }
              ]
            }
          };
          const res = await signozHttp({ path, method: "POST", body, signal });
          const data = res?.data;
          const results = data?.data?.data?.results ?? data?.data?.results ?? data?.results ?? [];
          const first = Array.isArray(results) ? results[0] : null;
          return {
            rows: first?.rows || [],
            nextCursor: first?.nextCursor ?? first?.cursor ?? null,
            envelope: redactExportEnvelope(data)
          };
        }
      });
    },
    async getTraceWaterfall(args, signal) {
      if (useFixture) {
        const detail2 = {
          candidateId: "v4-waterfall",
          path: `/api/v4/traces/${args.traceId}/waterfall`,
          status: 200,
          rootService: "frontend",
          entryPoint: "GET /",
          spans: [
            {
              spanId: "root",
              parentSpanId: "",
              name: "GET /",
              service: "frontend",
              timeUnixMs: Date.now() - 1e3,
              durationNano: "2000000",
              durationMs: 2,
              attributes: { "http.method": "GET" },
              events: []
            }
          ],
          raw: { offline: true }
        };
        return { frames: waterfallDetailToFrames(detail2), detail: detail2 };
      }
      const detail = await fetchWaterfall({
        traceId: args.traceId,
        state: {
          selectedSpanId: args.selectedSpanId,
          uncollapsedSpans: args.uncollapsedSpans,
          limit: args.limit
        },
        http: async (req) => {
          const res = await signozHttp({
            path: req.path,
            method: req.method,
            body: req.body,
            signal: req.signal
          });
          return {
            status: Number(res?.status ?? 200),
            data: res?.data
          };
        },
        identity: cacheIdentity(),
        cache: waterfallCache,
        hasObservedV3Evidence: Boolean(
          options.experimentalCapabilities?.waterfallV3Observed
        ),
        signal
      });
      return { frames: waterfallDetailToFrames(detail), detail };
    },
    getIssuesWriteCapabilities() {
      return issuesWriteEnabled({
        profileId,
        enableWrites: Boolean(options.enableWrites),
        envGate: Boolean(options.enableWrites),
        hasAcknowledgeEndpoint: Boolean(
          profile.endpoints.acknowledge?.path || options.customAcknowledgePath
        ),
        hasResolveEndpoint: Boolean(
          profile.endpoints.resolve?.path || options.customResolvePath
        ),
        actionCapabilityVerified: Boolean(
          options.experimentalCapabilities?.actionsVerified
        )
      });
    },
    mutate
  };
}
function redactExportEnvelope(data) {
  if (data == null || typeof data !== "object") return data;
  const o = { ...data };
  for (const k of Object.keys(o)) {
    if (/token|password|secret|authorization|api[_-]?key/i.test(k))
      o[k] = "[REDACTED]";
  }
  return o;
}
const SIGNOZ_PANEL_ID = "signoz-issues";
const SIGNOZ_DATASOURCE_ID = "signoz";
const __vite_import_meta_env__$1 = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
const ZABBIX_TYPE = "alexanderzobnin-zabbix-datasource";
const SIGNOZ_TYPE = "signoz";
function defaultObservabilityDataSources(_env = {}) {
  return [];
}
function nonEmpty(v) {
  if (v == null) return void 0;
  const s = String(v).trim();
  return s.length ? s : void 0;
}
function firstEnv(env, keys) {
  for (const k of keys) {
    const v = nonEmpty(env[k]);
    if (v) return v;
  }
  return void 0;
}
function resolveSignozSessionFromEnv(env) {
  return {
    url: firstEnv(env, ["VITE_SIGNOZ_NATIVE_URL", "VITE_SIGNOZ_URL"]),
    token: firstEnv(env, [
      "VITE_SIGNOZ_NATIVE_TOKEN",
      "VITE_SIGNOZ_TOKEN",
      "SIGNOZ_TOKEN"
    ]),
    refreshToken: firstEnv(env, [
      "VITE_SIGNOZ_NATIVE_REFRESH_TOKEN",
      "VITE_SIGNOZ_REFRESH_TOKEN",
      "SIGNOZ_REFRESH_TOKEN"
    ]),
    email: firstEnv(env, ["VITE_SIGNOZ_EMAIL", "SIGNOZ_EMAIL"]),
    password: firstEnv(env, ["VITE_SIGNOZ_PASSWORD", "SIGNOZ_PASSWORD"]),
    orgID: firstEnv(env, ["VITE_SIGNOZ_ORG_ID", "SIGNOZ_ORG_ID"])
  };
}
function readEnv() {
  try {
    return { ...__vite_import_meta_env__$1 || {} };
  } catch {
    return {};
  }
}
function readWindowInjection() {
  if (typeof window === "undefined") return null;
  const w = window;
  const inj = w.__GRAFANA_VUE_DATASOURCES__;
  if (!Array.isArray(inj) || !inj.length) return null;
  return inj;
}
function mergeObservabilityDataSourceInput(prev, next) {
  if (!prev) {
    return {
      ...next,
      jsonData: next.jsonData ? { ...next.jsonData } : void 0
    };
  }
  const merged = {
    ...prev,
    ...Object.fromEntries(
      Object.entries(next).filter(
        ([key, v]) => key !== "jsonData" && v !== void 0 && v !== ""
      )
    ),
    uid: next.uid || prev.uid,
    jsonData: {
      ...prev.jsonData || {},
      ...next.jsonData || {}
    }
  };
  if (!Object.keys(merged.jsonData || {}).length && !prev.jsonData && !next.jsonData) {
    delete merged.jsonData;
  }
  return merged;
}
function mergeObservabilityDataSourceInputsByUid(...layers) {
  const byUid2 = /* @__PURE__ */ new Map();
  for (const layer of layers) {
    if (!layer?.length) continue;
    for (const row of layer) {
      if (!row?.uid) {
        throw new Error("datasource uid is required");
      }
      byUid2.set(row.uid, mergeObservabilityDataSourceInput(byUid2.get(row.uid), row));
    }
  }
  return [...byUid2.values()];
}
function buildEnvOverlay(env) {
  const envOverlay = [];
  if (nonEmpty(env.VITE_ZABBIX_URL_3) || nonEmpty(env.VITE_ZABBIX_TOKEN_3)) {
    const z3patch = {
      type: ZABBIX_TYPE,
      url: nonEmpty(env.VITE_ZABBIX_URL_3),
      token: nonEmpty(env.VITE_ZABBIX_TOKEN_3),
      credentialMode: "apiKey"
    };
    envOverlay.push({ uid: "zabbix-3", name: "Zabbix 50.3", ...z3patch });
    envOverlay.push({ uid: "zabbix", name: "Zabbix", ...z3patch });
  }
  if (nonEmpty(env.VITE_ZABBIX_URL_14) || nonEmpty(env.VITE_ZABBIX_TOKEN_14)) {
    envOverlay.push({
      uid: "zabbix-14",
      name: "Zabbix 50.14",
      type: ZABBIX_TYPE,
      url: nonEmpty(env.VITE_ZABBIX_URL_14),
      token: nonEmpty(env.VITE_ZABBIX_TOKEN_14),
      credentialMode: "apiKey"
    });
  }
  {
    const sn = resolveSignozSessionFromEnv(env);
    if (sn.url || sn.token || sn.refreshToken || sn.email || sn.password) {
      envOverlay.push({
        uid: "signoz",
        name: "SigNoz",
        type: SIGNOZ_TYPE,
        url: sn.url,
        profile: "signoz-v5",
        token: sn.token,
        refreshToken: sn.refreshToken,
        email: sn.email,
        password: sn.password,
        orgID: sn.orgID,
        credentialMode: sn.token ? "bearer" : "proxy"
      });
    }
  }
  return envOverlay;
}
function resolveObservabilityDataSources(opts = {}) {
  const env = opts.env ?? readEnv();
  const defaults2 = opts.defaults ?? defaultObservabilityDataSources(env);
  const datasources2 = opts.datasources ?? [];
  const windowInjection = opts.windowInjection !== void 0 ? opts.windowInjection : readWindowInjection();
  if (windowInjection?.length) {
    const seen = /* @__PURE__ */ new Set();
    for (const row of windowInjection) {
      if (!row?.uid) {
        throw new Error("datasource uid is required in window injection");
      }
      if (seen.has(row.uid)) {
        throw new Error(`duplicate uid in window injection: ${row.uid}`);
      }
      seen.add(row.uid);
    }
  }
  const inputs = mergeObservabilityDataSourceInputsByUid(
    defaults2,
    datasources2,
    buildEnvOverlay(env),
    windowInjection
  );
  const defaultsMarked = inputs.filter((i) => i.default || i.isDefault);
  if (defaultsMarked.length > 1) {
    throw new Error(
      `DATASOURCE_DEFAULT_CONFLICT: ${defaultsMarked.map((d) => d.uid).join(",")}`
    );
  }
  const settings = [];
  const credentials = [];
  for (const input of inputs) {
    const jsonData = { ...input.jsonData || {} };
    if (input.profile) {
      jsonData.apiProfile = input.profile;
    }
    if (input.credentialMode) {
      jsonData.credentialMode = input.credentialMode;
    }
    const explicitMode = jsonData.dataMode;
    if (explicitMode === "fixture" || explicitMode === "live") {
      jsonData.dataMode = explicitMode;
    } else if (input.token || input.password || input.refreshToken || nonEmpty(input.url)) {
      jsonData.dataMode = "live";
    } else {
      jsonData.dataMode = "fixture";
    }
    for (const k of Object.keys(jsonData)) {
      if (/token|password|secret|apiKey|authorization/i.test(k)) {
        delete jsonData[k];
      }
    }
    settings.push({
      uid: input.uid,
      name: input.name,
      type: input.type,
      url: input.url,
      access: "proxy",
      isDefault: !!(input.default || input.isDefault),
      jsonData,
      source: "runtime"
    });
    const mode2 = input.credentialMode || (input.token ? "apiKey" : "none");
    if (mode2 === "proxy" || mode2 === "none") {
      continue;
    }
    if (input.token) {
      const canSession = Boolean(input.refreshToken) || Boolean(input.email && input.password);
      if (canSession) {
        credentials.push({
          uid: input.uid,
          credential: {
            kind: "session",
            value: input.token,
            refreshToken: input.refreshToken,
            email: input.email,
            password: input.password,
            orgID: input.orgID,
            rememberPassword: Boolean(input.password)
          }
        });
      } else if (mode2 === "bearer" || mode2 === "token") {
        credentials.push({
          uid: input.uid,
          credential: { kind: "bearer", value: input.token }
        });
      } else if (mode2 === "apiKey") {
        credentials.push({
          uid: input.uid,
          credential: {
            kind: "apiKey",
            value: input.token,
            headerName: input.apiKeyHeader
          }
        });
      } else {
        credentials.push({
          uid: input.uid,
          credential: { kind: "apiKey", value: input.token }
        });
      }
    } else if (input.username || input.password) {
      credentials.push({
        uid: input.uid,
        credential: {
          kind: "basic",
          username: input.username || "",
          password: input.password || ""
        }
      });
    }
  }
  return { settings, credentials };
}
function bootstrapObservabilityDataSources(resolved) {
  const r = resolved ?? resolveObservabilityDataSources();
  configureRuntimeDataSourceSettings(r.settings);
  for (const { uid, credential } of r.credentials) {
    setRuntimeCredential(uid, credential);
    if (uid === "zabbix-3") setRuntimeCredential("zabbix", credential);
    if (uid === "signoz" || uid === "signoz-native" || uid === "signoz-argus") {
      setRuntimeCredential("signoz", credential);
      setRuntimeCredential("signoz-native", credential);
      setRuntimeCredential("signoz-argus", credential);
    }
  }
  if (typeof console !== "undefined") {
    const signoz = r.settings.find((s) => s.uid === "signoz");
    const z3 = r.settings.find((s) => s.uid === "zabbix-3");
    console.info(
      `[grafana-vue] observability datasources: ${r.settings.length}` + (z3?.url ? ` zabbix=${z3.url}` : "") + (signoz?.url ? ` signoz=${signoz.url}` : "") + (r.credentials.length ? ` credentials=${r.credentials.length}` : "")
    );
  }
  return r;
}
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
function resolveBackendBootSelection(input) {
  const params = new URLSearchParams(input.search ?? "");
  const env = input.env ?? {};
  const g = input.globals ?? {};
  const envMode = env.VITE_BACKEND_MODE || g.__GRAFANA_VUE_BACKEND_MODE__;
  const grafanaUrl = env.VITE_GRAFANA_URL || env.VITE_GRAFANA_API_URL || g.__GRAFANA_VUE_GRAFANA_URL__;
  const hasToken = !!(env.VITE_GRAFANA_TOKEN || env.VITE_GRAFANA_API_TOKEN || g.__GRAFANA_VUE_AUTH_TOKEN__);
  const wantLive = params.get("backend") === "live" || envMode === "live" || !!grafanaUrl || hasToken;
  if (!wantLive) {
    return { mode: "offline" };
  }
  const requireAuth = params.get("requireAuth") === "0" || params.get("requireAuth") === "false" ? false : !!(grafanaUrl || hasToken || params.get("requireAuth") === "1");
  return {
    mode: "live",
    baseUrl: grafanaUrl || "",
    requireAuth
  };
}
function bootstrapGrafanaVue(options = {}) {
  registerBuiltinPlugins();
  void registerHeavyPlugins().catch((err) => {
    if (typeof console !== "undefined") {
      console.error("[grafana-vue] heavy plugin registration failed", err);
    }
  });
  const injected = typeof window !== "undefined" ? window.grafanaBootData : void 0;
  setBootData(injected ?? createDefaultBootData());
  initTheme();
  bootBackendMode();
  bootObservabilityDataSources(options);
}
function bootObservabilityDataSources(options) {
  try {
    const hasCallerDatasources = (options.datasources?.length ?? 0) > 0;
    if (!hasCallerDatasources && listRuntimeDataSourceSettings().length > 0) {
      return;
    }
    bootstrapObservabilityDataSources(
      resolveObservabilityDataSources({
        datasources: options.datasources,
        env: options.env,
        windowInjection: options.windowInjection
      })
    );
  } catch (err) {
    if (typeof console !== "undefined") {
      console.error(
        "[grafana-vue] observability datasource bootstrap failed",
        err
      );
    }
  }
}
function bootBackendMode() {
  const env = __vite_import_meta_env__ ?? {};
  const globals = typeof globalThis !== "undefined" ? globalThis : {};
  const selection = resolveBackendBootSelection({
    search: typeof location !== "undefined" ? location.search : "",
    env,
    globals
  });
  if (selection.mode === "live") {
    configureBackendSrv({
      mode: "live",
      baseUrl: selection.baseUrl,
      requireAuth: selection.requireAuth
    });
  }
  if (typeof console !== "undefined") {
    console.info(
      `[grafana-vue] backend mode: ${getBackendMode()}${selection.mode === "live" && selection.baseUrl ? " grafana=" + selection.baseUrl : ""}`
    );
  }
}
let shared = null;
const listeners = /* @__PURE__ */ new Set();
function getSharedMapView() {
  return shared ? { ...shared } : null;
}
function setSharedMapView(patch) {
  const next = {
    lat: Number(patch.lat ?? shared?.lat ?? 20),
    lon: Number(patch.lon ?? shared?.lon ?? 0),
    zoom: Number(patch.zoom ?? shared?.zoom ?? 2),
    updatedAt: Date.now()
  };
  shared = next;
  for (const l of listeners) l({ ...next });
  return next;
}
function subscribeSharedMapView(fn) {
  listeners.add(fn);
  return () => listeners.delete(fn);
}
const _hoisted_1$_ = ["data-zoom", "data-lat", "data-lon", "data-view-shared", "data-view-dashboard-variable", "data-view-dashboard-variable-name", "data-view-dashboard-variable-enabled", "data-mouse-wheel-zoom", "data-show-scale", "data-show-debug", "data-show-zoom", "data-show-measure", "data-show-attribution", "data-measure-mode", "data-measure-active", "data-marker-radius", "data-marker-color", "data-show-labels", "data-opacity", "data-basemap", "data-tiles-ready", "data-tooltip-mode", "data-layer-count", "data-data-layer-type", "data-data-layer-count", "data-geojson-layers", "data-heatmap-layers", "data-location-modes", "data-layer-names", "data-point-count", "data-demo", "data-config-show-legend", "data-config-crop", "data-config-shadow", "data-config-sun", "data-config-arrow", "data-config-access-token", "data-access-token-applied", "data-tile-url-has-token", "data-config-night-color", "data-config-id-field", "data-config-data-style", "data-config-edge-style", "data-config-kind", "data-config-rules", "data-config-server", "data-config-blur", "data-config-min-zoom", "data-config-max-zoom", "data-config-style", "data-config-theme", "data-config-url", "data-config-src", "data-config-border", "data-config-weight", "data-config-color", "data-config-attribution", "data-type", "data-filter-data", "data-layer-tooltip", "data-view-id", "data-view-no-repeat"];
const _hoisted_2$L = {
  key: 1,
  class: "geomap__legend",
  "data-testid": "geomap-legend"
};
const _hoisted_3$D = {
  key: 2,
  class: "geomap__fallback",
  "data-testid": "geomap-fallback"
};
const _hoisted_4$u = {
  viewBox: "0 0 100 90",
  class: "map",
  preserveAspectRatio: "none",
  role: "img",
  "aria-label": "地理地图回退"
};
const _hoisted_5$p = {
  stroke: "rgba(255,255,255,0.06)",
  "stroke-width": "0.3"
};
const _hoisted_6$l = ["y1", "y2"];
const _hoisted_7$h = ["x1", "x2"];
const _hoisted_8$b = ["cx", "cy", "r", "fill"];
const _hoisted_9$a = ["x", "y"];
const _hoisted_10$8 = {
  key: 3,
  class: "geomap__tooltip",
  "data-testid": "geomap-tooltip"
};
const _hoisted_11$7 = {
  key: 4,
  class: "geomap__debug",
  "data-testid": "geomap-debug"
};
const _hoisted_12$6 = {
  key: 5,
  class: "geomap__measure",
  "data-testid": "geomap-measure"
};
const _hoisted_13$6 = {
  key: 0,
  "data-testid": "geomap-measure-value"
};
const _hoisted_14$6 = {
  key: 6,
  class: "geomap__demo-badge",
  "data-testid": "geomap-demo-badge"
};
const _sfc_main$13 = /* @__PURE__ */ defineComponent({
  __name: "GeomapRenderer",
  props: {
    data: {},
    width: {},
    height: {},
    options: {},
    replaceVariables: { type: Function }
  },
  setup(__props) {
    let ol = null;
    async function ensureOl() {
      if (!ol) {
        ol = await Promise.resolve().then(() => olApi);
      }
      return ol;
    }
    const props = __props;
    const opts = computed(() => props.options ?? {});
    const layers = computed(() => normalizeGeomapLayers(props.options ?? {}));
    const dataLayerList = computed(() => dataLayers(layers.value));
    const geoJsonLayerCount = computed(
      () => dataLayerList.value.filter((l) => String(l.type) === "geojson").length
    );
    const heatmapLayerCount = computed(
      () => dataLayerList.value.filter((l) => String(l.type) === "heatmap").length
    );
    const baseLayerCfg = computed(() => basemapLayer(layers.value));
    const host = ref(null);
    const tilesReady = ref(false);
    const fallback = ref(false);
    const hoverLabel = ref(null);
    const measureActive = ref(false);
    const measureMode = ref("length");
    const measureText = ref(null);
    let map = null;
    let baseLayer = null;
    const dataVectorLayers = [];
    let measureSource = null;
    let measureLayer = null;
    let drawInteraction = null;
    let unsubShared = null;
    const basemapType = computed(() => {
      const base = baseLayerCfg.value;
      if (base?.config?.basemapType) {
        const t2 = String(base.config.basemapType);
        return t2 === "default" ? "carto" : t2;
      }
      const b = opts.value.basemap;
      if (typeof b === "string" && b) return b === "default" ? "carto" : b;
      if (b && typeof b === "object" && b.type) {
        const t2 = String(b.type);
        return t2 === "default" || !t2 ? "carto" : t2;
      }
      return "carto";
    });
    const dataLayerType = computed(
      () => String(dataLayerList.value[0]?.type ?? opts.value.type ?? "markers")
    );
    const markerRadius = computed(
      () => Number(
        dataLayerList.value[0]?.config?.radius ?? opts.value.config?.radius ?? 6
      )
    );
    const markerColor = computed(
      () => String(
        dataLayerList.value[0]?.config?.color ?? opts.value.config?.color ?? "rgba(61, 113, 217, 0.75)"
      )
    );
    const markerBorder = computed(
      () => String(opts.value.config?.border ?? "#8ab8ff")
    );
    const layerOpacity = computed(() => {
      const o = dataLayerList.value[0]?.opacity ?? opts.value.opacity;
      return o == null || o === "" ? 1 : Math.max(0, Math.min(1, Number(o)));
    });
    const showLabels = computed(
      () => Boolean(
        opts.value.config?.showLabels ?? dataLayerList.value[0]?.config?.showLabels
      )
    );
    const tooltipMode = computed(
      () => String(opts.value.tooltip?.mode ?? "details")
    );
    const showMeasure = computed(() => Boolean(opts.value.controls?.showMeasure));
    const panelConfig = computed(() => opts.value.config ?? {});
    const legendEnabled = computed(() => panelConfig.value.showLegend === true);
    const configCrop = computed(() => panelConfig.value.crop === true);
    const configShadow = computed(() => panelConfig.value.shadow === true);
    const configSun = computed(() => panelConfig.value.sun === true);
    const configArrow = computed(() => {
      const a = panelConfig.value.arrow;
      if (a === true || a === "true") return true;
      if (typeof a === "string" && a && a !== "false") return true;
      return a === true;
    });
    const accessToken = computed(
      () => String(panelConfig.value.accessToken ?? opts.value.accessToken ?? "")
    );
    const nightColor = computed(
      () => String(panelConfig.value.nightColor ?? "rgba(0,0,40,0.35)")
    );
    const idField = computed(
      () => String(panelConfig.value.idField ?? dataLayerList.value[0]?.config?.idField ?? "")
    );
    const dataStyle = computed(
      () => String(panelConfig.value.dataStyle ?? dataLayerList.value[0]?.config?.dataStyle ?? "")
    );
    const edgeStyle = computed(
      () => String(panelConfig.value.edgeStyle ?? dataLayerList.value[0]?.config?.edgeStyle ?? "")
    );
    const layerKind = computed(
      () => String(panelConfig.value.kind ?? dataLayerList.value[0]?.config?.kind ?? dataLayerType.value)
    );
    const layerTooltip = computed(
      () => String(opts.value["layer-tooltip"] ?? opts.value.layerTooltip ?? tooltipMode.value)
    );
    const rulesCount = computed(() => {
      const r = panelConfig.value.rules ?? dataLayerList.value[0]?.config?.rules;
      return Array.isArray(r) ? r.length : r ? 1 : 0;
    });
    const configServer = computed(
      () => String(panelConfig.value.server ?? dataLayerList.value[0]?.config?.server ?? "")
    );
    const configBlur = computed(
      () => Number(
        panelConfig.value.blur ?? dataLayerList.value[0]?.config?.blur ?? 0
      )
    );
    const configMinZoom = computed(
      () => String(panelConfig.value.minZoom ?? opts.value.view?.minZoom ?? "")
    );
    const configMaxZoom = computed(
      () => String(panelConfig.value.maxZoom ?? opts.value.view?.maxZoom ?? "")
    );
    const configStyle = computed(
      () => String(panelConfig.value.style ?? dataLayerList.value[0]?.config?.style ?? "")
    );
    const configTheme = computed(
      () => String(
        panelConfig.value.theme ?? baseLayerCfg.value?.config?.theme ?? opts.value.basemap?.config?.theme ?? ""
      )
    );
    const configUrl = computed(
      () => String(
        panelConfig.value.url ?? baseLayerCfg.value?.config?.url ?? opts.value.basemap?.config?.url ?? ""
      )
    );
    const configSrc = computed(() => {
      const s = panelConfig.value.src ?? panelConfig.value.geojson ?? dataLayerList.value[0]?.config?.src ?? dataLayerList.value[0]?.config?.geojson;
      return s == null || s === "" ? "" : "set";
    });
    const configWeight = computed(
      () => Number(
        panelConfig.value.weight ?? dataLayerList.value[0]?.config?.weight ?? 1
      )
    );
    const configAttribution = computed(
      () => String(
        panelConfig.value.attribution ?? opts.value.basemap?.config?.attribution ?? baseLayerCfg.value?.config?.attribution ?? ""
      )
    );
    const viewNoRepeat = computed(() => Boolean(opts.value.view?.noRepeat));
    const viewDashboardVariable = computed(
      () => String(opts.value.view?.dashboardVariable ?? "")
    );
    const viewDashboardVariableName = computed(
      () => String(opts.value.view?.dashboardVariableName ?? "")
    );
    const panelLayerType = computed(
      () => String(opts.value.type ?? dataLayerType.value ?? "")
    );
    const filterDataKey = computed(() => {
      const fd = opts.value.filterData ?? dataLayerList.value[0]?.filterData ?? null;
      if (fd == null || fd === "") return "";
      if (typeof fd === "string") return fd;
      if (typeof fd === "object") {
        const o = fd;
        return String(o.options ?? o.id ?? "set");
      }
      return String(fd);
    });
    const usingDemoData = computed(() => false);
    const layerPoints = computed(() => {
      const series = props.data?.series ?? [];
      return resolveAllLayerPoints(series, layers.value, opts.value.filterData);
    });
    const geoPoints = computed(() => layerPoints.value.flatMap((lp) => lp.points));
    const locationModes = computed(
      () => dataLayerList.value.map((l) => String(l.location?.mode ?? "auto")).join(",")
    );
    function resolveAccessTokenUrl(url, token) {
      if (!url) return url;
      const tok = String(token ?? "").trim();
      if (!tok) return url;
      let out = url.replace(/\{access_token\}/gi, encodeURIComponent(tok)).replace(/\{accessToken\}/g, encodeURIComponent(tok));
      if (/mapbox\.com|mapbox:\/\//i.test(out) && !/[?&]access_token=/i.test(out)) {
        out += (out.includes("?") ? "&" : "?") + `access_token=${encodeURIComponent(tok)}`;
      }
      return out;
    }
    const tileUrlResolved = computed(() => {
      const cfg = {
        ...opts.value.config ?? {},
        ...opts.value.basemap?.config ?? {},
        ...baseLayerCfg.value?.config ?? {}
      };
      const raw = String(
        cfg.url || opts.value.config?.url || ""
      );
      return resolveAccessTokenUrl(raw, accessToken.value);
    });
    function createBaseSource(type) {
      if (!ol) throw new Error("OpenLayers not loaded");
      if (type === "none") return null;
      if (type === "osm") {
        return new ol.OSM({ wrapX: !viewNoRepeat.value });
      }
      const cfg = {
        ...opts.value.config ?? {},
        ...opts.value.basemap?.config ?? {},
        ...baseLayerCfg.value?.config ?? {}
      };
      if (type === "xyz" || type === "xyztiles") {
        const rawUrl = String(
          cfg.url || opts.value.config?.url || "https://tile.openstreetmap.org/{z}/{x}/{y}.png"
        );
        const url = resolveAccessTokenUrl(rawUrl, accessToken.value);
        return new ol.XYZ({
          url,
          attributions: cfg.attribution || void 0,
          wrapX: !viewNoRepeat.value
        });
      }
      let theme = String(cfg.theme ?? "auto");
      if (!theme || theme === "auto") theme = "dark";
      const showLabels2 = cfg.showLabels !== false;
      const style = `${theme}${showLabels2 ? "_all" : "_nolabels"}`;
      const scale = typeof window !== "undefined" && window.devicePixelRatio > 1 ? "@2x" : "";
      return new ol.XYZ({
        url: `https://{1-4}.basemaps.cartocdn.com/${style}/{z}/{x}/{y}${scale}.png`,
        wrapX: !viewNoRepeat.value,
        attributions: configAttribution.value || '<a href="https://carto.com/attribution/">©CARTO</a> <a href="https://www.openstreetmap.org/copyright">©OpenStreetMap</a> contributors'
      });
    }
    const LAYER_PALETTE = [
      "rgba(61, 113, 217, 0.75)",
      "rgba(220, 80, 80, 0.75)",
      "rgba(70, 180, 100, 0.75)",
      "rgba(240, 180, 40, 0.75)",
      "rgba(160, 90, 200, 0.75)"
    ];
    function styleForLayer(layer, value, label, index2) {
      const cfg = layer.config ?? {};
      const baseR = Number(cfg.radius ?? markerRadius.value);
      const color = String(
        cfg.color ?? LAYER_PALETTE[index2 % LAYER_PALETTE.length]
      );
      const border = String(cfg.border ?? markerBorder.value);
      const blur = Number(cfg.blur ?? (layer.type === "heatmap" ? 8 : 0));
      const weight = Number(cfg.weight ?? opts.value.config?.weight ?? 1);
      const radius = baseR + Math.min(10, Math.abs(value) / 20);
      layer.opacity == null ? 1 : Math.max(0, Math.min(1, Number(layer.opacity)));
      const fillColor = color.includes("rgba") ? color : color;
      const shadowOn = cfg.shadow === true || cfg.shadow == null && panelConfig.value.shadow === true;
      const images = [];
      if (shadowOn) {
        images.push(
          new ol.Style({
            image: new ol.CircleStyle({
              radius: radius + blur + 3,
              fill: new ol.Fill({ color: "rgba(0,0,0,0.35)" })
            })
          })
        );
      }
      images.push(
        new ol.Style({
          image: new ol.CircleStyle({
            radius: radius + blur,
            fill: new ol.Fill({ color: fillColor }),
            stroke: new ol.Stroke({ color: border, width: weight })
          })
          // route layers also draw larger stroke when connected later
        })
      );
      const arrowOn = cfg.arrow === true || cfg.arrow === "true" || cfg.arrow == null && (panelConfig.value.arrow === true || panelConfig.value.arrow === "true");
      if (arrowOn) {
        images.push(
          new ol.Style({
            text: new ol.TextStyle({
              text: "➤",
              font: "12px sans-serif",
              fill: new ol.Fill({ color: border }),
              offsetY: 0
            })
          })
        );
      }
      const labelsOn = Boolean(cfg.showLabels ?? showLabels.value);
      if (labelsOn && label) {
        images.push(
          new ol.Style({
            text: new ol.TextStyle({
              text: label,
              offsetY: -(radius + 8),
              fill: new ol.Fill({ color: "#e8e9ea" }),
              stroke: new ol.Stroke({ color: "#000", width: 2 }),
              font: "11px sans-serif"
            })
          })
        );
      }
      return images;
    }
    function clearDataLayers() {
      if (!map) return;
      for (const vl of dataVectorLayers) {
        map.removeLayer(vl);
      }
      dataVectorLayers.length = 0;
    }
    function parseGeoJsonObject(raw) {
      if (!raw) return null;
      if (typeof raw === "object") return raw;
      if (typeof raw === "string") {
        try {
          return JSON.parse(raw);
        } catch {
          return null;
        }
      }
      return null;
    }
    function loadGeoJsonFeatures(layer) {
      const cfg = layer.config ?? {};
      const obj = parseGeoJsonObject(cfg.geojson ?? cfg.src ?? cfg.data);
      if (!obj) return [];
      try {
        const format = new ol.GeoJSON();
        return format.readFeatures(obj, {
          dataProjection: "EPSG:4326",
          featureProjection: "EPSG:3857"
        });
      } catch {
        return [];
      }
    }
    function syncMultiLayerFeatures() {
      if (!map) return;
      clearDataLayers();
      layerPoints.value.forEach(({ layer, points }, index2) => {
        const source = new ol.VectorSource();
        const isRoute = layer.type === "route";
        const isGeoJson = layer.type === "geojson";
        const coords = [];
        let geoJsonFeatureCount = 0;
        if (isGeoJson) {
          const feats = loadGeoJsonFeatures(layer);
          geoJsonFeatureCount = feats.length;
          const color = String(
            layer.config?.color ?? LAYER_PALETTE[index2 % LAYER_PALETTE.length]
          );
          for (const f of feats) {
            f.setStyle(
              new ol.Style({
                stroke: new ol.Stroke({
                  color,
                  width: Number(layer.config?.weight ?? 2)
                }),
                fill: new ol.Fill({
                  color: color.includes("rgba") ? color : color + "55"
                }),
                image: new ol.CircleStyle({
                  radius: Number(layer.config?.radius ?? 5),
                  fill: new ol.Fill({ color })
                })
              })
            );
            source.addFeature(f);
          }
        }
        for (const p of points) {
          if (isGeoJson && geoJsonFeatureCount) break;
          if (!Number.isFinite(p.lon) || !Number.isFinite(p.lat)) continue;
          const c = ol.fromLonLat([p.lon, p.lat]);
          coords.push(c);
          const feature = new ol.Feature({
            geometry: new ol.Point(c),
            label: p.label,
            value: p.value,
            layerName: layer.name
          });
          feature.setStyle(styleForLayer(layer, p.value, p.label, index2));
          source.addFeature(feature);
        }
        if (isRoute && coords.length >= 2) {
          const line = new ol.Feature({
            geometry: new ol.LineString(coords)
          });
          const color = String(
            layer.config?.color ?? LAYER_PALETTE[index2 % LAYER_PALETTE.length]
          );
          line.setStyle(
            new ol.Style({
              stroke: new ol.Stroke({
                color,
                width: Number(layer.config?.weight ?? 3)
              })
            })
          );
          source.addFeature(line);
        }
        const opacity = layer.opacity == null ? 1 : Math.max(0, Math.min(1, Number(layer.opacity)));
        let vl;
        if (layer.type === "heatmap") {
          vl = new ol.HeatmapLayer({
            source,
            blur: Number(layer.config?.blur ?? 15),
            radius: Number(layer.config?.radius ?? 8),
            opacity,
            weight: (feature) => {
              const v = Number(feature.get("value") ?? 1);
              return Number.isFinite(v) ? Math.max(0.05, Math.min(1, Math.abs(v) / 100)) : 0.5;
            },
            properties: { name: layer.name, type: layer.type }
          });
        } else {
          vl = new ol.VectorLayer({
            source,
            opacity,
            properties: {
              name: layer.name,
              type: layer.type,
              geoJsonFeatures: geoJsonFeatureCount
            }
          });
        }
        map.addLayer(vl);
        dataVectorLayers.push(vl);
      });
      applyView();
    }
    function resolveViewNum(raw, fallback2) {
      if (raw == null || raw === "") return fallback2;
      let s = String(raw);
      if (props.replaceVariables) {
        try {
          s = props.replaceVariables(s);
        } catch {
        }
      }
      const n = Number(s);
      return Number.isFinite(n) ? n : fallback2;
    }
    function wireSharedView() {
      if (unsubShared) {
        unsubShared();
        unsubShared = null;
      }
      if (!map) return;
      if (!opts.value.view?.shared) return;
      unsubShared = subscribeSharedMapView((sv) => {
        if (!map) return;
        const view = map.getView();
        const cur = view.getCenter();
        const curZoom = view.getZoom() ?? 2;
        const [lon, lat] = cur ? ol.toLonLat(cur) : [sv.lon, sv.lat];
        if (Math.abs(lat - sv.lat) < 1e-6 && Math.abs(lon - sv.lon) < 1e-6 && Math.abs(curZoom - sv.zoom) < 1e-6) {
          return;
        }
        view.setCenter(ol.fromLonLat([sv.lon, sv.lat]));
        view.setZoom(sv.zoom);
      });
      map.on("moveend", () => {
        if (!opts.value.view?.shared || !map) return;
        const view = map.getView();
        const c = view.getCenter();
        if (!c) return;
        const [lon, lat] = ol.toLonLat(c);
        setSharedMapView({ lat, lon, zoom: view.getZoom() ?? 2 });
      });
    }
    const MAP_CENTER_PRESETS = {
      zero: { lat: 0, lon: 0, zoom: 1 },
      coords: {},
      // use view.lat/lon/zoom
      fit: { fit: true, zoom: 15 },
      "north-america": { lat: 40, lon: -100, zoom: 4 },
      "south-america": { lat: -20, lon: -60, zoom: 3 },
      europe: { lat: 46, lon: 14, zoom: 4 },
      africa: { lat: 0, lon: 30, zoom: 3 },
      "west-asia": { lat: 26, lon: 53, zoom: 4 },
      "s-asia": { lat: 19.5, lon: 80, zoom: 4 },
      "se-asia": { lat: 10, lon: 106, zoom: 4 },
      "e-asia": { lat: 33, lon: 120, zoom: 4 },
      australia: { lat: -25, lon: 135, zoom: 4 },
      oceania: { lat: -10, lon: -140, zoom: 3 }
    };
    const resolvedMapView = computed(() => {
      const rawId = opts.value.view?.id;
      const hasCoords = opts.value.view?.lat != null || opts.value.view?.lon != null || opts.value.view?.center != null;
      const viewId = String(
        rawId ?? (hasCoords ? "coords" : "zero")
      );
      const preset = MAP_CENTER_PRESETS[viewId] ?? MAP_CENTER_PRESETS.coords;
      let zoom = resolveViewNum(
        opts.value.view?.zoom ?? preset?.zoom,
        preset?.zoom ?? 1
      );
      let lat = resolveViewNum(
        opts.value.view?.lat ?? opts.value.view?.center?.[1] ?? preset?.lat,
        preset?.lat ?? 0
      );
      let lon = resolveViewNum(
        opts.value.view?.lon ?? opts.value.view?.center?.[0] ?? preset?.lon,
        preset?.lon ?? 0
      );
      if (preset && preset.lat != null && viewId !== "coords" && viewId !== "fit" && viewId !== "zero") {
        lat = preset.lat;
        lon = preset.lon ?? 0;
        if (preset.zoom != null && opts.value.view?.zoom == null) zoom = preset.zoom;
      }
      if (viewId === "zero") {
        lat = 0;
        lon = 0;
        zoom = resolveViewNum(opts.value.view?.zoom, preset?.zoom ?? 1);
      }
      return { id: viewId, lat, lon, zoom, fit: viewId === "fit" || !!preset?.fit };
    });
    function fitViewToData(view, maxZoom) {
      const coords = geoPoints.value.filter((p) => Number.isFinite(p.lon) && Number.isFinite(p.lat)).map((p) => ol.fromLonLat([p.lon, p.lat]));
      if (!coords.length) {
        view.setCenter(ol.fromLonLat([0, 0]));
        view.setZoom(1);
        return;
      }
      if (coords.length === 1) {
        view.setCenter(coords[0]);
        view.setZoom(Math.min(maxZoom, 8));
        return;
      }
      let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;
      for (const c of coords) {
        minX = Math.min(minX, c[0]);
        minY = Math.min(minY, c[1]);
        maxX = Math.max(maxX, c[0]);
        maxY = Math.max(maxY, c[1]);
      }
      const extent = [minX, minY, maxX, maxY];
      try {
        view.fit(extent, { padding: [40, 40, 40, 40], maxZoom, duration: 0 });
      } catch {
        const cx = (minX + maxX) / 2;
        const cy = (minY + maxY) / 2;
        view.setCenter([cx, cy]);
        view.setZoom(Math.min(maxZoom, 4));
      }
    }
    function applyView() {
      if (!map) return;
      const view = map.getView();
      const rv = resolvedMapView.value;
      const viewId = rv.id;
      const preset = MAP_CENTER_PRESETS[viewId] ?? MAP_CENTER_PRESETS.coords;
      let zoom = rv.zoom;
      let lat = rv.lat;
      let lon = rv.lon;
      const shared2 = Boolean(opts.value.view?.shared);
      if (shared2 && viewId !== "fit") {
        const sv = getSharedMapView();
        if (sv) {
          lat = sv.lat;
          lon = sv.lon;
          zoom = sv.zoom;
        } else {
          setSharedMapView({ lat, lon, zoom });
        }
      }
      if (viewId === "fit" || preset?.fit) {
        fitViewToData(view, zoom || 15);
      } else if (Number.isFinite(lat) && Number.isFinite(lon)) {
        view.setCenter(ol.fromLonLat([lon, lat]));
        view.setZoom(zoom);
        if (shared2) setSharedMapView({ lat, lon, zoom });
      } else if (geoPoints.value.length) {
        fitViewToData(view, Math.max(zoom, 4));
      }
      const minZ = opts.value.config?.minZoom;
      const maxZ = opts.value.config?.maxZoom;
      if (minZ != null && minZ !== "") view.setMinZoom(Number(minZ));
      if (maxZ != null && maxZ !== "") view.setMaxZoom(Number(maxZ));
    }
    function applyControls() {
      if (!map) return;
      const c = opts.value.controls ?? {};
      const controls = map.getControls();
      controls.clear();
      if (c.showZoom !== false) controls.push(new ol.Zoom());
      if (c.showScale) controls.push(new ol.ScaleLine());
      if (c.showAttribution !== false)
        controls.push(new ol.Attribution({ collapsible: true, collapsed: true }));
      try {
        const interactions = map.getInteractions().getArray();
        for (const it of interactions) {
          if (String(it.constructor.name).toLowerCase().includes("mousewheel")) {
            it.setActive(c.mouseWheelZoom !== false);
          }
        }
      } catch {
      }
      if (!c.showMeasure) {
        stopMeasure();
      }
    }
    function applyBasemap() {
      if (!map) return;
      const type = basemapType.value;
      const src = createBaseSource(type);
      if (baseLayer) {
        map.removeLayer(baseLayer);
        baseLayer = null;
      }
      if (src) {
        baseLayer = new ol.TileLayer({ source: src });
        map.getLayers().insertAt(0, baseLayer);
      }
    }
    function formatLength(line) {
      const len = ol.getLength(line);
      if (len > 1e3) return `${(len / 1e3).toFixed(2)} km`;
      return `${len.toFixed(0)} m`;
    }
    function formatArea(poly) {
      const area = ol.getArea(poly);
      if (area > 1e6) return `${(area / 1e6).toFixed(2)} km²`;
      return `${area.toFixed(0)} m²`;
    }
    function stopMeasure() {
      measureActive.value = false;
      measureText.value = null;
      if (map && drawInteraction) {
        map.removeInteraction(drawInteraction);
        drawInteraction = null;
      }
      if (map && measureLayer) {
        map.removeLayer(measureLayer);
        measureLayer = null;
      }
      measureSource = null;
    }
    function startMeasure(mode2 = measureMode.value) {
      if (!map) return;
      stopMeasure();
      measureMode.value = mode2;
      measureActive.value = true;
      measureSource = new ol.VectorSource();
      measureLayer = new ol.VectorLayer({
        source: measureSource,
        style: new ol.Style({
          stroke: new ol.Stroke({ color: "#f5a623", width: 2, lineDash: [6, 4] }),
          fill: new ol.Fill({ color: "rgba(245, 166, 35, 0.15)" }),
          image: new ol.CircleStyle({
            radius: 4,
            fill: new ol.Fill({ color: "#f5a623" })
          })
        })
      });
      map.addLayer(measureLayer);
      drawInteraction = new ol.Draw({
        source: measureSource,
        type: mode2 === "area" ? "Polygon" : "LineString"
      });
      drawInteraction.on("drawend", (evt) => {
        const geom = evt.feature.getGeometry();
        if (mode2 === "area" && geom instanceof ol.Polygon) {
          measureText.value = formatArea(geom);
        } else if (geom instanceof ol.LineString) {
          measureText.value = formatLength(geom);
        }
      });
      map.addInteraction(drawInteraction);
    }
    function toggleMeasure(mode2 = "length") {
      if (measureActive.value && measureMode.value === mode2) stopMeasure();
      else startMeasure(mode2);
    }
    function buildMap() {
      if (!host.value) return;
      try {
        const c = opts.value.controls ?? {};
        const controls = ol.defaultControls({
          zoom: c.showZoom !== false,
          attribution: false,
          // add Attribution manually collapsed
          rotate: false
        });
        if (c.showAttribution !== false) {
          controls.push(
            new ol.Attribution({ collapsible: true, collapsed: true })
          );
        }
        if (c.showScale) controls.push(new ol.ScaleLine());
        baseLayer = null;
        const src = createBaseSource(basemapType.value);
        const mapLayers = [];
        if (src) {
          baseLayer = new ol.TileLayer({ source: src });
          mapLayers.push(baseLayer);
        }
        map = new ol.Map({
          target: host.value,
          layers: mapLayers,
          view: new ol.View({
            center: ol.fromLonLat([
              Number(opts.value.view?.lon ?? opts.value.view?.center?.[0] ?? 0),
              Number(opts.value.view?.lat ?? opts.value.view?.center?.[1] ?? 0)
            ]),
            zoom: Number(opts.value.view?.zoom ?? 1)
          }),
          controls
        });
        map.on("pointermove", (evt) => {
          if (tooltipMode.value === "none" || measureActive.value) {
            hoverLabel.value = null;
            return;
          }
          const feature = map.forEachFeatureAtPixel(evt.pixel, (f) => f);
          if (feature && feature.get("label") != null) {
            const layerName = feature.get("layerName");
            const val = feature.get("value");
            hoverLabel.value = layerName ? `${layerName}: ${feature.get("label")}${val != null ? ` (${val})` : ""}` : String(feature.get("label"));
          } else {
            hoverLabel.value = null;
          }
        });
        syncMultiLayerFeatures();
        wireSharedView();
        applyControls();
        fallback.value = false;
        requestAnimationFrame(() => {
          map?.updateSize();
          applyView();
        });
        setTimeout(() => {
          map?.updateSize();
          applyView();
        }, 50);
        tilesReady.value = false;
        if (baseLayer) {
          const src2 = baseLayer.getSource?.();
          if (src2 && typeof src2.on === "function") {
            let pending = 0;
            const mark = () => {
              if (pending <= 0) tilesReady.value = true;
            };
            src2.on("tileloadstart", () => {
              pending += 1;
              tilesReady.value = false;
            });
            src2.on("tileloadend", () => {
              pending = Math.max(0, pending - 1);
              mark();
            });
            src2.on("tileloaderror", () => {
              pending = Math.max(0, pending - 1);
              mark();
            });
            setTimeout(() => {
              if (pending === 0) tilesReady.value = true;
            }, 1500);
            setTimeout(() => {
              tilesReady.value = true;
            }, 2500);
          } else {
            tilesReady.value = true;
          }
        } else {
          tilesReady.value = true;
        }
      } catch {
        fallback.value = true;
        map = null;
        tilesReady.value = true;
      }
    }
    function resize() {
      map?.updateSize();
    }
    function destroyMap() {
      stopMeasure();
      clearDataLayers();
      if (map) {
        map.setTarget(void 0);
        map = null;
      }
      baseLayer = null;
    }
    onMounted(() => {
      void (async () => {
        try {
          await ensureOl();
          buildMap();
          resize();
        } catch (e) {
          fallback.value = true;
          if (typeof console !== "undefined")
            console.error("[geomap] OpenLayers load failed", e);
        }
      })();
    });
    onBeforeUnmount(() => {
      if (unsubShared) {
        unsubShared();
        unsubShared = null;
      }
      destroyMap();
    });
    watch(
      () => [props.width, props.height],
      () => resize()
    );
    watch(
      () => props.options,
      () => {
        void (async () => {
          await ensureOl();
          if (!map) {
            buildMap();
            return;
          }
          applyBasemap();
          applyControls();
          syncMultiLayerFeatures();
          wireSharedView();
          applyView();
        })();
      },
      { deep: true }
    );
    watch(
      () => props.data,
      () => {
        if (!ol || !map) return;
        syncMultiLayerFeatures();
      },
      { deep: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["geomap", { "geomap--crop": configCrop.value, "geomap--sun": configSun.value }]),
        "data-testid": "panel-geomap",
        "data-zoom": String(resolvedMapView.value.zoom),
        "data-lat": String(resolvedMapView.value.lat),
        "data-lon": String(resolvedMapView.value.lon),
        "data-view-shared": String(Boolean(opts.value.view?.shared)),
        "data-view-dashboard-variable": viewDashboardVariable.value || viewDashboardVariableName.value,
        "data-view-dashboard-variable-name": viewDashboardVariableName.value,
        "data-view-dashboard-variable-enabled": String(Boolean(viewDashboardVariable.value || viewDashboardVariableName.value)),
        "data-mouse-wheel-zoom": String(opts.value.controls?.mouseWheelZoom !== false),
        "data-show-scale": String(Boolean(opts.value.controls?.showScale)),
        "data-show-debug": String(Boolean(opts.value.controls?.showDebug)),
        "data-show-zoom": String(opts.value.controls?.showZoom !== false),
        "data-show-measure": String(Boolean(opts.value.controls?.showMeasure)),
        "data-show-attribution": String(opts.value.controls?.showAttribution !== false),
        "data-measure-mode": measureMode.value,
        "data-measure-active": String(measureActive.value),
        "data-marker-radius": String(markerRadius.value),
        "data-marker-color": String(markerColor.value),
        "data-show-labels": String(showLabels.value),
        "data-opacity": String(layerOpacity.value),
        "data-basemap": basemapType.value,
        "data-tiles-ready": tilesReady.value ? "1" : "0",
        "data-tooltip-mode": tooltipMode.value,
        "data-layer-count": String(layers.value.length),
        "data-data-layer-type": dataLayerType.value,
        "data-data-layer-count": String(dataLayerList.value.length),
        "data-geojson-layers": String(geoJsonLayerCount.value),
        "data-heatmap-layers": String(heatmapLayerCount.value),
        "data-location-modes": locationModes.value,
        "data-layer-names": layers.value.map((l) => l.name || l.type).join(","),
        "data-point-count": String(geoPoints.value.length),
        "data-demo": String(usingDemoData.value),
        "data-config-show-legend": String(legendEnabled.value),
        "data-config-crop": String(configCrop.value),
        "data-config-shadow": String(configShadow.value),
        "data-config-sun": String(configSun.value),
        "data-config-arrow": String(configArrow.value),
        "data-config-access-token": accessToken.value ? "set" : "",
        "data-access-token-applied": accessToken.value && tileUrlResolved.value.includes(encodeURIComponent(accessToken.value)) ? "1" : accessToken.value && tileUrlResolved.value.includes(accessToken.value) ? "1" : "",
        "data-tile-url-has-token": tileUrlResolved.value && (tileUrlResolved.value.includes("access_token") || !!accessToken.value && tileUrlResolved.value.includes(encodeURIComponent(accessToken.value))) ? "1" : "",
        "data-config-night-color": nightColor.value,
        "data-config-id-field": idField.value,
        "data-config-data-style": dataStyle.value,
        "data-config-edge-style": edgeStyle.value,
        "data-config-kind": layerKind.value,
        "data-config-rules": String(rulesCount.value),
        "data-config-server": configServer.value,
        "data-config-blur": String(configBlur.value),
        "data-config-min-zoom": configMinZoom.value,
        "data-config-max-zoom": configMaxZoom.value,
        "data-config-style": configStyle.value,
        "data-config-theme": configTheme.value,
        "data-config-url": configUrl.value ? "set" : "",
        "data-config-src": configSrc.value,
        "data-config-border": markerBorder.value,
        "data-config-weight": String(configWeight.value),
        "data-config-color": markerColor.value,
        "data-config-attribution": configAttribution.value,
        "data-type": panelLayerType.value,
        "data-filter-data": filterDataKey.value,
        "data-layer-tooltip": layerTooltip.value,
        "data-view-id": String(resolvedMapView.value.id),
        "data-view-no-repeat": String(viewNoRepeat.value)
      }, [
        withDirectives(createElementVNode(
          "div",
          {
            ref_key: "host",
            ref: host,
            class: "geomap__map",
            role: "img",
            "aria-label": "地理地图"
          },
          null,
          512
          /* NEED_PATCH */
        ), [
          [vShow, !fallback.value]
        ]),
        configSun.value && !fallback.value ? (openBlock(), createElementBlock(
          "div",
          {
            key: 0,
            class: "geomap__sun",
            "data-testid": "geomap-sun",
            style: normalizeStyle({ background: nightColor.value })
          },
          null,
          4
          /* STYLE */
        )) : createCommentVNode("v-if", true),
        legendEnabled.value && dataLayerList.value.length ? (openBlock(), createElementBlock("ul", _hoisted_2$L, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(dataLayerList.value, (l, i) => {
              return openBlock(), createElementBlock("li", { key: i }, [
                createElementVNode(
                  "i",
                  {
                    style: normalizeStyle({
                      background: String(l.config?.color || LAYER_PALETTE[i % LAYER_PALETTE.length])
                    })
                  },
                  null,
                  4
                  /* STYLE */
                ),
                createTextVNode(
                  " " + toDisplayString(l.name || l.type || "图层 " + (i + 1)),
                  1
                  /* TEXT */
                )
              ]);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])) : createCommentVNode("v-if", true),
        fallback.value ? (openBlock(), createElementBlock("div", _hoisted_3$D, [
          (openBlock(), createElementBlock("svg", _hoisted_4$u, [
            _cache[2] || (_cache[2] = createElementVNode(
              "defs",
              null,
              [
                createElementVNode("linearGradient", {
                  id: "ocean",
                  x1: "0",
                  y1: "0",
                  x2: "0",
                  y2: "1"
                }, [
                  createElementVNode("stop", {
                    offset: "0%",
                    "stop-color": "#0d2137"
                  }),
                  createElementVNode("stop", {
                    offset: "100%",
                    "stop-color": "#0b1a2a"
                  })
                ])
              ],
              -1
              /* CACHED */
            )),
            _cache[3] || (_cache[3] = createElementVNode(
              "rect",
              {
                x: "0",
                y: "0",
                width: "100",
                height: "90",
                fill: "url(#ocean)"
              },
              null,
              -1
              /* CACHED */
            )),
            createCommentVNode(" simple lat/lon grid "),
            createElementVNode("g", _hoisted_5$p, [
              (openBlock(), createElementBlock(
                Fragment,
                null,
                renderList(5, (g) => {
                  return createElementVNode("line", {
                    key: "h" + g,
                    x1: "0",
                    y1: g * 15,
                    x2: "100",
                    y2: g * 15
                  }, null, 8, _hoisted_6$l);
                }),
                64
                /* STABLE_FRAGMENT */
              )),
              (openBlock(), createElementBlock(
                Fragment,
                null,
                renderList(6, (g) => {
                  return createElementVNode("line", {
                    key: "v" + g,
                    x1: g * 14.28,
                    y1: "0",
                    x2: g * 14.28,
                    y2: "90"
                  }, null, 8, _hoisted_7$h);
                }),
                64
                /* STABLE_FRAGMENT */
              ))
            ]),
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(geoPoints.value, (p, i) => {
                return openBlock(), createElementBlock("g", { key: i }, [
                  createElementVNode("circle", {
                    cx: (p.lon + 180) / 360 * 100,
                    cy: (90 - p.lat) / 180 * 90,
                    r: Math.max(1.2, markerRadius.value / 2),
                    fill: markerColor.value,
                    stroke: "rgba(255,255,255,0.35)",
                    "stroke-width": "0.3"
                  }, null, 8, _hoisted_8$b),
                  showLabels.value && p.label ? (openBlock(), createElementBlock("text", {
                    key: 0,
                    x: (p.lon + 180) / 360 * 100,
                    y: (90 - p.lat) / 180 * 90 - (markerRadius.value / 2 + 1.5),
                    "text-anchor": "middle",
                    "font-size": "2.8",
                    fill: "var(--grafana-text)"
                  }, toDisplayString(p.label), 9, _hoisted_9$a)) : createCommentVNode("v-if", true)
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])),
          _cache[4] || (_cache[4] = createElementVNode(
            "div",
            { class: "geomap__fallback-hint" },
            "地图引擎不可用 · 使用 SVG 回退",
            -1
            /* CACHED */
          ))
        ])) : createCommentVNode("v-if", true),
        hoverLabel.value && tooltipMode.value !== "none" ? (openBlock(), createElementBlock(
          "div",
          _hoisted_10$8,
          toDisplayString(hoverLabel.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        opts.value.controls?.showDebug ? (openBlock(), createElementBlock(
          "div",
          _hoisted_11$7,
          " z=" + toDisplayString(opts.value.view?.zoom ?? 2) + " · " + toDisplayString(basemapType.value) + " · " + toDisplayString(geoPoints.value.length) + " pts · 层 " + toDisplayString(dataLayerList.value.length),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        showMeasure.value ? (openBlock(), createElementBlock("div", _hoisted_12$6, [
          createElementVNode(
            "button",
            {
              type: "button",
              "data-testid": "geomap-measure-toggle",
              onClick: _cache[0] || (_cache[0] = ($event) => toggleMeasure("length"))
            },
            toDisplayString(measureActive.value && measureMode.value === "length" ? "结束测距" : "测距"),
            1
            /* TEXT */
          ),
          createElementVNode(
            "button",
            {
              type: "button",
              "data-testid": "geomap-measure-area",
              onClick: _cache[1] || (_cache[1] = ($event) => toggleMeasure("area"))
            },
            toDisplayString(measureActive.value && measureMode.value === "area" ? "结束测面" : "测面积"),
            1
            /* TEXT */
          ),
          measureText.value ? (openBlock(), createElementBlock(
            "span",
            _hoisted_13$6,
            toDisplayString(measureText.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true),
        usingDemoData.value ? (openBlock(), createElementBlock("div", _hoisted_14$6, " 演示数据 ")) : createCommentVNode("v-if", true),
        createCommentVNode(" Grafana has no footer meta strip; keep data attrs on root for tests ")
      ], 10, _hoisted_1$_);
    };
  }
});
const GeomapRenderer = /* @__PURE__ */ _export_sfc(_sfc_main$13, [["__scopeId", "data-v-d4291708"]]);
const _sfc_main$12 = /* @__PURE__ */ defineComponent({
  __name: "Panel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean },
    editable: { type: Boolean }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(GeomapRenderer, {
        data: __props.data,
        options: __props.options,
        "field-config": __props.fieldConfig,
        "replace-variables": __props.replaceVariables,
        width: __props.width,
        height: __props.height
      }, null, 8, ["data", "options", "field-config", "replace-variables", "width", "height"]);
    };
  }
});
const plugin$4 = new VuePanelPlugin(
  {
    id: "geomap",
    name: "地理地图",
    description: "OpenLayers 地理可视化",
    state: "stable",
    skipDataQuery: false
  },
  _sfc_main$12
).setNoPadding().setPanelOptions((builder) => {
  const catMap = ["地图视图"];
  const catCtrl = ["地图控件"];
  const catTip = ["提示"];
  const catLayer = ["图层"];
  const catStyle = ["图层 / 样式"];
  builder.addCustom(
    {
      id: "view",
      path: "view",
      name: "初始视图",
      category: catMap,
      description: "面板首次加载时显示的位置",
      editor: "custom",
      // UI is the expanded view.id/lat/lon/zoom editors; hide composite shell
      showIf: () => false
    },
    {
      id: "zero",
      lat: 0,
      lon: 0,
      zoom: 1,
      allLayers: true,
      noRepeat: false
    }
  ).addSelect(
    {
      id: "view.id",
      path: "view.id",
      name: "视图中心",
      category: catMap,
      description: "面板首次加载时的地图中心",
      settings: {
        options: [
          { label: "零点 (0,0)", value: "zero" },
          { label: "坐标", value: "coords" },
          { label: "适应数据", value: "fit" }
        ]
      }
    },
    "zero"
  ).addNumber(
    {
      id: "view.lat",
      path: "view.lat",
      name: "纬度",
      category: catMap,
      settings: { min: -90, max: 90, step: 1e-6 },
      showIf: (c) => (c.view?.id ?? "zero") === "coords"
    },
    0
  ).addNumber(
    {
      id: "view.lon",
      path: "view.lon",
      name: "经度",
      category: catMap,
      settings: { min: -180, max: 180, step: 1e-6 },
      showIf: (c) => (c.view?.id ?? "zero") === "coords"
    },
    0
  ).addNumber(
    {
      id: "view.zoom",
      path: "view.zoom",
      name: "缩放",
      category: catMap,
      settings: { min: 1, max: 18, step: 0.01 }
    },
    1
  ).addSelect(
    {
      id: "basemap.type",
      path: "basemap.type",
      name: "底图类型",
      category: ["底图图层"],
      settings: {
        options: [
          { label: "OpenStreetMap", value: "osm" },
          { label: "XYZ 瓦片", value: "xyz" },
          { label: "Carto", value: "carto" },
          { label: "无底图", value: "none" }
        ]
      }
    },
    "carto"
  ).addBoolean(
    {
      id: "view.shared",
      path: "view.shared",
      name: "共享视图",
      category: catMap
    },
    false
  ).addBoolean(
    {
      id: "view.noRepeat",
      path: "view.noRepeat",
      name: "不重复地图",
      category: catMap
    },
    false
  ).addBoolean(
    {
      id: "view.dashboardVariable",
      path: "view.dashboardVariable",
      name: "同步到仪表盘变量",
      category: catMap
    },
    false
  ).addBoolean(
    {
      id: "controls.showZoom",
      path: "controls.showZoom",
      name: "显示缩放",
      category: catCtrl
    },
    true
  ).addBoolean(
    {
      id: "controls.mouseWheelZoom",
      path: "controls.mouseWheelZoom",
      name: "鼠标滚轮缩放",
      category: catCtrl
    },
    true
  ).addBoolean(
    {
      id: "controls.showAttribution",
      path: "controls.showAttribution",
      name: "显示归属",
      category: catCtrl
    },
    true
  ).addBoolean(
    {
      id: "controls.showScale",
      path: "controls.showScale",
      name: "显示比例尺",
      category: catCtrl
    },
    false
  ).addBoolean(
    {
      id: "controls.showMeasure",
      path: "controls.showMeasure",
      name: "显示测量",
      category: catCtrl
    },
    false
  ).addBoolean(
    {
      id: "controls.showDebug",
      path: "controls.showDebug",
      name: "显示调试",
      category: catCtrl
    },
    false
  ).addBoolean(
    {
      id: "config.showLabels",
      path: "config.showLabels",
      name: "显示标签",
      category: catStyle
    },
    false
  ).addBoolean(
    {
      id: "config.showLegend",
      path: "config.showLegend",
      name: "显示图例",
      category: catStyle
    },
    false
  ).addBoolean(
    {
      id: "config.crop",
      path: "config.crop",
      name: "裁剪",
      category: catStyle
    },
    true
  ).addBoolean(
    {
      id: "config.shadow",
      path: "config.shadow",
      name: "阴影",
      category: catStyle
    },
    false
  ).addBoolean(
    {
      id: "config.sun",
      path: "config.sun",
      name: "太阳",
      category: catStyle
    },
    false
  ).addText(
    {
      id: "view.dashboardVariableName",
      path: "view.dashboardVariableName",
      name: "变量名",
      category: catMap,
      showIf: (c) => !!c.view?.dashboardVariable
    },
    void 0
  ).addRadio(
    {
      id: "tooltip.mode",
      path: "tooltip.mode",
      name: "提示",
      category: catTip,
      settings: {
        options: [
          { label: "无", value: "none", description: "点击显示" },
          { label: "详情", value: "details", description: "悬停显示" }
        ]
      }
    },
    "details"
  ).addSelect(
    {
      id: "type",
      path: "type",
      name: "图层类型",
      category: catLayer,
      settings: {
        options: [
          { label: "标记", value: "markers" },
          { label: "热力", value: "heatmap" },
          { label: "GeoJSON", value: "geojson" },
          { label: "路径", value: "route" },
          { label: "照片", value: "photos" },
          { label: "网络", value: "network" },
          { label: "昼夜", value: "dayNight" },
          { label: "底图", value: "basemap" }
        ]
      }
    },
    "markers"
  ).addNumber(
    {
      id: "opacity",
      path: "opacity",
      name: "不透明度",
      category: catLayer,
      settings: { min: 0, max: 1, step: 0.05 }
    },
    1
  ).addText(
    {
      id: "filterData",
      path: "filterData",
      name: "数据过滤",
      category: catLayer
    },
    void 0
  ).addCustom({
    id: "layer-tooltip",
    path: "layer-tooltip",
    name: "图层提示",
    category: catLayer,
    editor: "text"
  }).addText(
    {
      id: "config.accessToken",
      path: "config.accessToken",
      name: "访问令牌",
      category: catStyle
    },
    void 0
  ).addSelect(
    {
      id: "config.arrow",
      path: "config.arrow",
      name: "箭头",
      category: catStyle,
      settings: {
        options: [
          { label: "无", value: "none" },
          { label: "正向", value: "forward" },
          { label: "反向", value: "reverse" },
          { label: "双向", value: "both" }
        ]
      }
    },
    void 0
  ).addText(
    {
      id: "config.attribution",
      path: "config.attribution",
      name: "版权归属",
      category: catStyle
    },
    void 0
  ).addNumber(
    {
      id: "config.blur",
      path: "config.blur",
      name: "模糊",
      category: catStyle
    },
    void 0
  ).addText(
    {
      id: "config.border",
      path: "config.border",
      name: "边框色",
      category: catStyle
    },
    void 0
  ).addColor(
    {
      id: "config.color",
      path: "config.color",
      name: "颜色",
      category: catStyle
    },
    void 0
  ).addText(
    {
      id: "config.dataStyle",
      path: "config.dataStyle",
      name: "数据样式",
      category: catStyle
    },
    void 0
  ).addText(
    {
      id: "config.edgeStyle",
      path: "config.edgeStyle",
      name: "边样式",
      category: catStyle
    },
    void 0
  ).addText(
    {
      id: "config.idField",
      path: "config.idField",
      name: "ID 字段",
      category: catStyle
    },
    void 0
  ).addSelect(
    {
      id: "config.kind",
      path: "config.kind",
      name: "形状",
      category: catStyle,
      settings: {
        options: [
          { label: "方", value: "square" },
          { label: "圆", value: "circle" },
          { label: "标记", value: "marker" }
        ]
      }
    },
    void 0
  ).addNumber(
    {
      id: "config.maxZoom",
      path: "config.maxZoom",
      name: "最大缩放",
      category: catStyle
    },
    void 0
  ).addNumber(
    {
      id: "config.minZoom",
      path: "config.minZoom",
      name: "最小缩放",
      category: catStyle
    },
    void 0
  ).addColor(
    {
      id: "config.nightColor",
      path: "config.nightColor",
      name: "夜间颜色",
      category: catStyle
    },
    void 0
  ).addNumber(
    {
      id: "config.radius",
      path: "config.radius",
      name: "半径",
      category: catStyle
    },
    void 0
  ).addText(
    {
      id: "config.rules",
      path: "config.rules",
      name: "规则",
      category: catStyle
    },
    void 0
  ).addSelect(
    {
      id: "config.server",
      path: "config.server",
      name: "底图服务",
      category: catStyle,
      settings: {
        options: [
          { label: "街道", value: "streets" },
          { label: "卫星", value: "satellite" },
          { label: "地形", value: "topo" },
          { label: "海洋", value: "ocean" }
        ]
      }
    },
    void 0
  ).addSelect(
    {
      id: "config.show",
      path: "config.show",
      name: "显示",
      category: catStyle,
      settings: {
        options: [
          { label: "夜", value: "night" },
          { label: "昼", value: "day" },
          { label: "两者", value: "both" }
        ]
      }
    },
    void 0
  ).addText(
    {
      id: "config.src",
      path: "config.src",
      name: "图片源",
      category: catStyle
    },
    void 0
  ).addText(
    {
      id: "config.style",
      path: "config.style",
      name: "样式",
      category: catStyle
    },
    void 0
  ).addSelect(
    {
      id: "config.theme",
      path: "config.theme",
      name: "主题",
      category: catStyle,
      settings: {
        options: [
          { label: "自动", value: "auto" },
          { label: "亮", value: "light" },
          { label: "暗", value: "dark" }
        ]
      }
    },
    void 0
  ).addText(
    {
      id: "config.url",
      path: "config.url",
      name: "URL",
      category: catStyle
    },
    void 0
  ).addNumber(
    {
      id: "config.weight",
      path: "config.weight",
      name: "权重",
      category: catStyle
    },
    void 0
  );
}).setRuntimeConsumedPaths([
  "view.id",
  "view.lat",
  "view.lon",
  "view.zoom",
  "view.shared",
  "view.noRepeat",
  "view.dashboardVariable",
  "view.dashboardVariableName",
  "basemap.type",
  "config.accessToken",
  "config.arrow",
  "config.attribution",
  "config.blur",
  "config.border",
  "config.color",
  "config.crop",
  "config.dataStyle",
  "config.edgeStyle",
  "config.idField",
  "config.kind",
  "config.maxZoom",
  "config.minZoom",
  "config.nightColor",
  "config.radius",
  "config.rules",
  "config.server",
  "config.shadow",
  "config.show",
  "config.showLabels",
  "config.showLegend",
  "config.src",
  "config.style",
  "config.sun",
  "config.theme",
  "config.url",
  "config.weight",
  "controls.mouseWheelZoom",
  "controls.showAttribution",
  "controls.showDebug",
  "controls.showMeasure",
  "controls.showScale",
  "controls.showZoom",
  "filterData",
  "layer-tooltip",
  "opacity",
  "tooltip.mode",
  "type",
  "view",
  "view.dashboardVariable",
  "view.dashboardVariableName",
  "view.noRepeat",
  "view.shared"
]).setOptionsEditor(GeomapLayersEditor).register();
const module$5 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  plugin: plugin$4
}, Symbol.toStringTag, { value: "Module" }));
function deepClone$1(v) {
  try {
    return structuredClone(v);
  } catch {
    return JSON.parse(JSON.stringify(v));
  }
}
function nextRefId(targets) {
  const used = new Set(targets.map((t2) => t2.refId).filter(Boolean));
  for (let i = 0; i < 26; i++) {
    const id = String.fromCharCode(65 + i);
    if (!used.has(id)) return id;
  }
  return `Q${targets.length + 1}`;
}
function getDefaultTarget(targets = []) {
  return {
    group: { filter: "" },
    host: { filter: "" },
    application: { filter: "" },
    trigger: { filter: "" },
    tags: { filter: "" },
    proxy: { filter: "" },
    refId: nextRefId(targets)
  };
}
function isEmptyTarget(target) {
  return !target || !(target.group && target.host && target.application && target.trigger);
}
function isInvalidTarget(target, targetKey) {
  return Boolean(target && target.refId === "A" && targetKey === "0");
}
function isDefaultTarget(target) {
  return !target?.group?.filter && !target?.host?.filter && !target?.application?.filter && !target?.trigger?.filter && !target?.queryType;
}
function isEmptyTargets(targets) {
  if (!targets) return true;
  if (Array.isArray(targets)) {
    return targets.length === 0 || targets.length === 1 && (!targets[0] || Object.keys(targets[0]).length === 0);
  }
  return false;
}
function datasourceKey(ds2) {
  if (ds2 == null || ds2 === "") return "default";
  if (typeof ds2 === "string") {
    if (ds2 === "[object Object]") return "default";
    return ds2;
  }
  if (typeof ds2 === "object") {
    const o = ds2;
    if (typeof o.uid === "string" && o.uid && o.uid !== "[object Object]")
      return o.uid;
    if (typeof o.type === "string" && o.type) return o.type;
  }
  return "default";
}
function isEmptyPanel(panel2) {
  return !panel2.datasource && !panel2.datasources && !panel2.triggers && isEmptyTargets(panel2.targets);
}
function isDefaultPanel(panel2) {
  return Array.isArray(panel2.targets) && panel2.targets.length === 1 && isDefaultTarget(panel2.targets[0]);
}
function migrateShowEvents(panel2) {
  if (panel2.showEvents?.value === 1) return "problems";
  if (panel2.showEvents?.value === 0 || Array.isArray(panel2.showEvents?.value) && panel2.showEvents.value.length > 1) {
    return "history";
  }
  return "problems";
}
function migrateTargetOptions(panel2) {
  let acknowledged = 2;
  if (panel2.showTriggers === "acknowledged") acknowledged = 1;
  else if (panel2.showTriggers === "unacknowledged") acknowledged = 0;
  let limit = 1001;
  if (panel2.limit && panel2.limit !== 100) limit = panel2.limit;
  return {
    hostsInMaintenance: panel2.hostsInMaintenance,
    sortProblems: panel2.sortTriggersBy?.value === "priority" ? "priority" : "default",
    minSeverity: 0,
    acknowledged,
    limit
  };
}
function migrateProblemsPanelOptions(input = {}) {
  const src = { ...input };
  if (src.schema != null && src.schemaVersion == null)
    src.schemaVersion = src.schema;
  if (src.showTimeline != null && src.problemTimeline == null)
    src.problemTimeline = src.showTimeline;
  const next = {
    ...DEFAULT_PROBLEMS_OPTIONS,
    ...src,
    triggerSeverity: Array.isArray(src.triggerSeverity) && src.triggerSeverity.length ? src.triggerSeverity : DEFAULT_PROBLEMS_OPTIONS.triggerSeverity.map((s) => ({ ...s })),
    resizedColumns: Array.isArray(src.resizedColumns) ? src.resizedColumns : []
  };
  next.schemaVersion = 8;
  if (next.layout !== "list") next.layout = "table";
  if (!["default", "lastchange", "priority"].includes(next.sortProblems))
    next.sortProblems = "lastchange";
  if (!Number.isFinite(Number(next.pageSize)) || Number(next.pageSize) <= 0)
    next.pageSize = 10;
  return next;
}
function migrateProblemsPanel(input) {
  const panel2 = deepClone$1(input);
  if (isDefaultPanel(panel2)) {
    panel2.options = migrateProblemsPanelOptions(
      panel2.options || {}
    );
    return panel2;
  }
  if (isEmptyPanel(panel2)) {
    delete panel2.targets;
    panel2.options = migrateProblemsPanelOptions(
      panel2.options || {}
    );
    return panel2;
  }
  const schemaVersion = Number(panel2.schemaVersion || 1);
  if (schemaVersion < 2) {
    const hasModernArrayTargets = Array.isArray(panel2.targets);
    if (!hasModernArrayTargets) {
      const triggers = panel2.triggers;
      const dsList = Array.isArray(panel2.datasources) ? panel2.datasources : panel2.datasource != null ? [panel2.datasource] : [];
      panel2.datasources = dsList;
      panel2.targets = {};
      const key = datasourceKey(dsList[0]);
      panel2.targets[key] = triggers;
      delete panel2.triggers;
      delete panel2.datasource;
    } else {
      delete panel2.triggers;
    }
  }
  if (schemaVersion < 3) {
    delete panel2.lastChangeField;
    delete panel2.infoField;
    delete panel2.scroll;
    delete panel2.hideHostsInMaintenance;
  }
  if (schemaVersion < 5) {
    if (panel2.targets && typeof panel2.targets === "object" && !Array.isArray(panel2.targets)) {
      for (const key of Object.keys(panel2.targets)) {
        const t2 = panel2.targets[key];
        panel2.targets[key] = { ...getDefaultTarget(), ...t2 };
      }
    } else if (Array.isArray(panel2.targets)) {
      panel2.targets = panel2.targets.map((t2) => ({
        ...getDefaultTarget(panel2.targets),
        ...t2
      }));
    }
  }
  if (schemaVersion < 6) {
    if (panel2.showEvents?.value === "1") {
      panel2.showEvents.value = 1;
    }
  }
  if (schemaVersion < 7) {
    const updated = [];
    if (panel2.targets && typeof panel2.targets === "object" && !Array.isArray(panel2.targets)) {
      for (const targetKey of Object.keys(panel2.targets)) {
        const target = panel2.targets[targetKey];
        if (!isEmptyTarget(target) && !isInvalidTarget(target, targetKey)) {
          const dsRef = target.datasource ?? (targetKey === "[object Object]" ? void 0 : targetKey);
          updated.push({
            ...target,
            datasource: dsRef ?? datasourceKey(targetKey)
          });
        }
      }
    } else if (Array.isArray(panel2.targets)) {
      updated.push(...panel2.targets);
    }
    for (const target of updated) {
      if (!target.refId) target.refId = nextRefId(updated);
    }
    panel2.targets = updated;
    delete panel2.datasources;
  }
  if (schemaVersion < 8) {
    const targets = Array.isArray(panel2.targets) ? panel2.targets : [];
    if (targets.length === 1) {
      if (targets[0].datasource) {
        panel2.datasource = targets[0].datasource;
        delete targets[0].datasource;
      }
    } else if (targets.length > 1) {
      panel2.datasource = "-- Mixed --";
    }
    for (const target of targets) {
      target.queryType = 5;
      target.showProblems = migrateShowEvents(panel2);
      target.options = {
        ...target.options || {},
        ...migrateTargetOptions(panel2)
      };
      if (!target.tags) target.tags = { filter: "" };
    }
    panel2.targets = targets;
    panel2.sortProblems = panel2.sortTriggersBy?.value === "priority" ? "priority" : "lastchange";
    delete panel2.showEvents;
    delete panel2.showTriggers;
    delete panel2.hostsInMaintenance;
    delete panel2.sortTriggersBy;
  }
  if (panel2.datasource === "[object Object]" || panel2.datasource && typeof panel2.datasource === "object" && typeof panel2.datasource.uid === "object") {
    const fromTarget = Array.isArray(panel2.targets) ? panel2.targets[0]?.datasource : void 0;
    const key = datasourceKey(fromTarget ?? panel2.datasource);
    panel2.datasource = {
      uid: key === "default" ? "zabbix" : key,
      type: "alexanderzobnin-zabbix-datasource"
    };
  }
  panel2.schemaVersion = CURRENT_SCHEMA_VERSION;
  const optionsInput = {
    ...panel2.options || {},
    sortProblems: panel2.sortProblems ?? panel2.options?.sortProblems
  };
  panel2.options = migrateProblemsPanelOptions(
    optionsInput
  );
  return panel2;
}
function col$1(frame, name) {
  return frame.fields.find((f) => f.name === name)?.values || [];
}
function parseJsonArray(raw) {
  if (Array.isArray(raw)) return raw;
  if (typeof raw === "string") {
    try {
      const v = JSON.parse(raw || "[]");
      return Array.isArray(v) ? v : [];
    } catch {
      return [];
    }
  }
  if (raw && typeof raw === "object") return [raw];
  return [];
}
function toMs$1(v) {
  const n = Number(v ?? 0);
  if (!Number.isFinite(n) || n <= 0) return 0;
  return n < 1e12 ? n * 1e3 : n;
}
function hostsOf(raw) {
  return parseJsonArray(raw).map((h2) => ({
    hostid: String(h2.hostid ?? h2.id ?? ""),
    name: String(h2.name ?? h2.host ?? ""),
    host: String(h2.host ?? h2.name ?? "")
  }));
}
function groupsOf(raw) {
  return parseJsonArray(raw).map(
    (g) => typeof g === "string" ? g : String(g.name ?? g.groupid ?? "")
  );
}
function acksOf(raw) {
  return parseJsonArray(raw).map((a) => ({
    acknowledgeid: String(a.acknowledgeid ?? ""),
    clock: toMs$1(a.clock),
    user: String(a.user ?? a.username ?? a.alias ?? ""),
    message: String(a.message ?? ""),
    action: Number(a.action ?? 0)
  }));
}
function itemsOf(raw) {
  return parseJsonArray(raw).map((i) => ({
    itemid: String(i.itemid ?? ""),
    name: String(i.name ?? ""),
    key_: String(i.key_ ?? i.key ?? ""),
    lastvalue: i.lastvalue != null ? String(i.lastvalue) : void 0,
    value_type: i.value_type != null ? String(i.value_type) : void 0
  }));
}
function metaOf(frame) {
  const meta2 = frame.meta || {};
  return {
    uid: String(meta2.datasourceUid || meta2.uid || ""),
    name: String(meta2.datasourceName || meta2.name || "")
  };
}
function framesToProblemViewModels(frames = [], options) {
  const notices = [];
  const problems = [];
  for (const frame of frames) {
    const meta2 = metaOf(frame);
    const n = frame.length || col$1(frame, "eventid").length || 0;
    for (let i = 0; i < n; i++) {
      const get = (name) => col$1(frame, name)[i];
      const eventid = String(get("eventid") ?? "");
      if (!eventid) {
        notices.push("已过滤缺少 eventid 的问题行");
        continue;
      }
      const ackRaw = get("acknowledged");
      const acknowledged = ackRaw === true || ackRaw === 1 || String(ackRaw) === "1";
      problems.push({
        eventid,
        objectid: String(get("objectid") ?? ""),
        name: String(get("name") ?? ""),
        severity: Number(get("severity") ?? 0),
        clock: toMs$1(get("clock")),
        acknowledged,
        status: String(get("status") ?? "problem"),
        hosts: hostsOf(get("hosts")),
        groups: groupsOf(get("groups")),
        tags: parseJsonArray(get("tags")).map(
          (t2) => typeof t2 === "string" ? { tag: t2, value: "" } : { tag: String(t2.tag ?? ""), value: String(t2.value ?? "") }
        ),
        acknowledges: acksOf(get("acknowledges")),
        alerts: parseJsonArray(get("alerts")),
        events: parseJsonArray(get("events")),
        items: itemsOf(get("items")),
        description: String(get("description") ?? ""),
        opdata: String(get("opdata") ?? ""),
        expression: String(get("expression") ?? ""),
        datasourceUid: meta2.uid,
        datasourceName: meta2.name,
        manual_close: (() => {
          const v = get("manual_close");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        suppressed: (() => {
          const v = get("suppressed");
          return v === true || v === 1 || String(v) === "1";
        })(),
        suppression: parseJsonArray(
          get("suppression_data") ?? get("suppression")
        ),
        historicalItemValue: (() => {
          const v = get("historicalItemValue");
          return v == null || v === "" ? null : String(v);
        })(),
        hostInMaintenance: (() => {
          const v = get("hostInMaintenance") ?? get("maintenance_status");
          return v === true || v === 1 || String(v) === "1";
        })(),
        url: (() => {
          const v = get("url");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        type: (() => {
          const v = get("type");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        correlation_mode: (() => {
          const v = get("correlation_mode");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        correlation_tag: (() => {
          const v = get("correlation_tag");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        state: (() => {
          const v = get("state");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        error: (() => {
          const v = get("error");
          return v == null || v === "" ? void 0 : String(v);
        })(),
        proxy: (() => {
          const v = get("proxy") ?? get("proxy_host") ?? get("proxy_name");
          return v == null || v === "" ? void 0 : String(v);
        })()
      });
    }
  }
  const sort = options?.sortProblems || "lastchange";
  if (sort === "priority") {
    problems.sort(
      (a, b) => b.severity - a.severity || b.clock - a.clock || a.eventid.localeCompare(b.eventid)
    );
  } else if (sort === "lastchange") {
    problems.sort(
      (a, b) => b.clock - a.clock || a.eventid.localeCompare(b.eventid)
    );
  } else {
    problems.sort((a, b) => a.eventid.localeCompare(b.eventid));
  }
  return { problems, notices: [...new Set(notices)] };
}
function problemsFromPanelData(data, options) {
  return framesToProblemViewModels(data?.series || [], options);
}
const _hoisted_1$Z = ["data-status", "data-ack"];
const _sfc_main$11 = /* @__PURE__ */ defineComponent({
  __name: "ProblemStatus",
  props: {
    status: {},
    acknowledged: { type: Boolean },
    markAck: { type: Boolean },
    ackColor: {},
    okColor: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("span", {
        class: "status",
        "data-status": __props.status,
        "data-ack": String(__props.acknowledged),
        "data-testid": "problem-status",
        style: normalizeStyle(
          __props.acknowledged && __props.markAck ? { color: __props.ackColor } : __props.status === "resolved" ? { color: __props.okColor } : void 0
        )
      }, toDisplayString(__props.status === "resolved" ? "已恢复" : __props.acknowledged ? "已确认" : "问题"), 13, _hoisted_1$Z);
    };
  }
});
const ProblemStatus = /* @__PURE__ */ _export_sfc(_sfc_main$11, [["__scopeId", "data-v-0240222c"]]);
const _hoisted_1$Y = ["data-testid"];
const _hoisted_2$K = ["href"];
const _hoisted_3$C = { key: 1 };
const _sfc_main$10 = /* @__PURE__ */ defineComponent({
  __name: "ProblemStatusBar",
  props: {
    problem: {},
    compact: { type: Boolean, default: false },
    markAck: { type: Boolean },
    ackColor: {},
    okColor: {}
  },
  setup(__props) {
    const props = __props;
    const icons = computed(() => {
      const p = props.problem;
      const out = [];
      if (p.hostInMaintenance)
        out.push({
          key: "maintenance",
          icon: "exclamation-triangle",
          title: "主机处于维护"
        });
      if (p.url)
        out.push({
          key: "url",
          icon: "share-alt",
          title: "触发器 URL",
          href: p.url
        });
      if (String(p.type) === "1")
        out.push({ key: "multi", icon: "copy", title: "多事件触发器" });
      if (String(p.correlation_mode) === "1") {
        out.push({
          key: "correlation",
          icon: "link",
          title: `关联关闭标签: ${p.correlation_tag || "—"}`
        });
      }
      if ((p.alerts || []).length)
        out.push({
          key: "alerts",
          icon: "bell",
          title: `告警动作 ${p.alerts.length}`
        });
      if (String(p.state) === "1")
        out.push({ key: "unknown", icon: "question", title: "状态未知" });
      if (p.error)
        out.push({ key: "error", icon: "times", title: `触发器错误: ${p.error}` });
      if (String(p.manual_close) === "1" || p.manual_close === true) {
        out.push({ key: "manual", icon: "check", title: "允许手动关闭" });
      }
      return out;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["status-bar", { compact: __props.compact }]),
          "data-testid": "problem-status-bar"
        },
        [
          !__props.compact ? (openBlock(), createBlock(ProblemStatus, {
            key: 0,
            status: __props.problem.status,
            acknowledged: __props.problem.acknowledged,
            "mark-ack": __props.markAck,
            "ack-color": __props.ackColor || "",
            "ok-color": __props.okColor || ""
          }, null, 8, ["status", "acknowledged", "mark-ack", "ack-color", "ok-color"])) : createCommentVNode("v-if", true),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(icons.value, (ic) => {
              return openBlock(), createElementBlock("span", {
                key: ic.key,
                class: "ic",
                "data-testid": `status-icon-${ic.key}`
              }, [
                createVNode(unref(_sfc_main$4r), {
                  title: ic.title
                }, {
                  default: withCtx(() => [
                    ic.href ? (openBlock(), createElementBlock("a", {
                      key: 0,
                      href: ic.href,
                      target: "_blank",
                      rel: "noopener noreferrer",
                      onClick: _cache[0] || (_cache[0] = withModifiers(() => {
                      }, ["stop"]))
                    }, [
                      createVNode(unref(GIcon), {
                        name: ic.icon
                      }, null, 8, ["name"])
                    ], 8, _hoisted_2$K)) : (openBlock(), createElementBlock("span", _hoisted_3$C, [
                      createVNode(unref(GIcon), {
                        name: ic.icon
                      }, null, 8, ["name"])
                    ]))
                  ]),
                  _: 2
                  /* DYNAMIC */
                }, 1032, ["title"])
              ], 8, _hoisted_1$Y);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ],
        2
        /* CLASS */
      );
    };
  }
});
const ProblemStatusBar = /* @__PURE__ */ _export_sfc(_sfc_main$10, [["__scopeId", "data-v-19115f34"]]);
function useColumnResize(getColumns, onChange) {
  const dragging = ref(null);
  let startX = 0;
  let startW = 0;
  let colId = "";
  function onMove(e) {
    if (!dragging.value) return;
    const dx = e.clientX - startX;
    const width2 = Math.max(48, startW + dx);
    const prev = getColumns().filter((c) => c.id !== colId);
    onChange([...prev, { id: colId, value: width2 }]);
  }
  function onUp() {
    dragging.value = null;
    window.removeEventListener("mousemove", onMove);
    window.removeEventListener("mouseup", onUp);
  }
  function startResize(id, currentWidth, e) {
    e.preventDefault();
    e.stopPropagation();
    colId = id;
    startX = e.clientX;
    startW = currentWidth;
    dragging.value = id;
    window.addEventListener("mousemove", onMove);
    window.addEventListener("mouseup", onUp);
  }
  onBeforeUnmount(() => {
    window.removeEventListener("mousemove", onMove);
    window.removeEventListener("mouseup", onUp);
  });
  return { dragging, startResize };
}
function widthFor(id, resized, fallback = 120) {
  const hit = (resized || []).find((c) => c.id === id);
  return hit?.value ?? fallback;
}
function buildColumns(o) {
  const cols = [
    { key: "time", title: "时间", sortable: true, width: 140 }
  ];
  if (o.severityField)
    cols.push({ key: "severity", title: "严重性", sortable: true, width: 90 });
  if (o.statusField)
    cols.push({ key: "status", title: "状态", sortable: true, width: 80 });
  if (o.statusIcon) cols.push({ key: "statusIcon", title: "图标", width: 96 });
  if (o.hostField)
    cols.push({ key: "host", title: "主机", sortable: true, width: 120 });
  if (o.hostTechNameField)
    cols.push({ key: "hostTechName", title: "技术名", width: 120 });
  if (o.hostGroups)
    cols.push({ key: "hostGroups", title: "主机组", width: 120 });
  if (o.hostProxy) cols.push({ key: "proxy", title: "代理", width: 100 });
  cols.push({ key: "problem", title: "问题", sortable: true, width: 220 });
  if (o.ageField)
    cols.push({ key: "age", title: "年龄", sortable: true, width: 72 });
  if (o.opdataField)
    cols.push({ key: "opdata", title: "运行数据", width: 120 });
  if (o.ackField) cols.push({ key: "ack", title: "确认", width: 80 });
  if (o.showTags) cols.push({ key: "tags", title: "标签", width: 140 });
  if (o.showDatasourceName)
    cols.push({ key: "datasource", title: "数据源", width: 100 });
  const custom = String(o.customTagColumns || "").split(",").map((s) => s.trim()).filter(Boolean);
  for (const tag of custom)
    cols.push({ key: `tag:${tag}`, title: tag, width: 100 });
  if (o.allowAcknowledge || o.allowUnacknowledge || o.allowClose || o.allowChangeSeverity || o.allowSuppress || o.allowUnsuppress || o.allowExecuteScripts) {
    cols.push({ key: "actions", title: "动作", width: 180 });
  }
  return cols;
}
const _hoisted_1$X = {
  class: "tbl",
  "data-testid": "problems-table"
};
const _hoisted_2$J = ["data-col", "onClick"];
const _hoisted_3$B = ["onMousedown"];
const _hoisted_4$t = ["data-testid", "onClick"];
const _hoisted_5$o = {
  key: 0,
  class: "sub"
};
const _hoisted_6$k = ["title"];
const _hoisted_7$g = ["onClick"];
const _hoisted_8$a = ["onClick"];
const _hoisted_9$9 = ["onClick"];
const _hoisted_10$7 = ["onClick"];
const _hoisted_11$6 = ["onClick"];
const _hoisted_12$5 = ["onClick"];
const _hoisted_13$5 = ["onClick"];
const _hoisted_14$5 = ["onClick"];
const _hoisted_15$5 = {
  class: "pager",
  "data-testid": "problems-pager"
};
const _hoisted_16$4 = ["disabled"];
const _hoisted_17$4 = ["disabled"];
const _hoisted_18$4 = ["value"];
const _hoisted_19$4 = ["value"];
const _sfc_main$$ = /* @__PURE__ */ defineComponent({
  __name: "ProblemsTable",
  props: {
    items: {},
    options: {}
  },
  emits: ["select", "acknowledge", "unacknowledge", "close", "severity", "suppress", "unsuppress", "script", "update:options", "tag-click"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const sortKey = ref("time");
    const sortDir = ref("desc");
    const page = ref(0);
    const severityMap = computed(() => {
      const m = /* @__PURE__ */ new Map();
      for (const s of props.options.triggerSeverity || []) m.set(s.priority, s);
      return m;
    });
    const columns = computed(() => buildColumns(props.options));
    const { startResize } = useColumnResize(
      () => props.options.resizedColumns || [],
      (next) => emit("update:options", { ...props.options, resizedColumns: next })
    );
    function colWidth(c) {
      return widthFor(String(c.key), props.options.resizedColumns, c.width || 120);
    }
    function sevStyle(n) {
      return {
        background: severityMap.value.get(n)?.color || "#999",
        color: "#fff"
      };
    }
    function hostLabel(p) {
      return p.hosts.map((h2) => h2.name || h2.host).join(", ");
    }
    function hostTech(p) {
      return p.hosts.map((h2) => h2.host || h2.name).join(", ");
    }
    function age(p) {
      if (!p.clock) return "";
      const sec = Math.max(0, Math.floor((Date.now() - p.clock) / 1e3));
      if (sec < 60) return `${sec}s`;
      if (sec < 3600) return `${Math.floor(sec / 60)}m`;
      if (sec < 86400) return `${Math.floor(sec / 3600)}h`;
      return `${Math.floor(sec / 86400)}d`;
    }
    function formatTime2(p) {
      if (!p.clock) return "";
      if (props.options.customLastChangeFormat && props.options.lastChangeFormat) {
        const d = new Date(p.clock);
        const pad = (n) => String(n).padStart(2, "0");
        return props.options.lastChangeFormat.replace(/YYYY/g, String(d.getFullYear())).replace(/MM/g, pad(d.getMonth() + 1)).replace(/DD/g, pad(d.getDate())).replace(/HH/g, pad(d.getHours())).replace(/mm/g, pad(d.getMinutes())).replace(/ss/g, pad(d.getSeconds()));
      }
      return new Date(p.clock).toLocaleString();
    }
    function tagValue(p, tag) {
      return p.tags.find((t2) => t2.tag === tag)?.value || "";
    }
    function isNew(p) {
      if (!props.options.highlightNewEvents) return false;
      const thr = parseDurationMs2(props.options.highlightNewerThan || "1h");
      return Date.now() - p.clock <= thr;
    }
    function parseDurationMs2(s) {
      const m = String(s).trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/i);
      if (!m) return 36e5;
      const n = Number(m[1]);
      const u = (m[2] || "s").toLowerCase();
      if (u === "ms") return n;
      if (u === "s") return n * 1e3;
      if (u === "m") return n * 6e4;
      if (u === "h") return n * 36e5;
      if (u === "d") return n * 864e5;
      return n * 1e3;
    }
    const sorted = computed(() => {
      const list = [...props.items].filter(
        (p) => severityMap.value.get(p.severity)?.show !== false
      );
      const dir = sortDir.value === "asc" ? 1 : -1;
      const key = sortKey.value;
      list.sort((a, b) => {
        let cmp = 0;
        if (key === "severity") cmp = a.severity - b.severity;
        else if (key === "status")
          cmp = String(a.status).localeCompare(String(b.status));
        else if (key === "host") cmp = hostLabel(a).localeCompare(hostLabel(b));
        else if (key === "problem") cmp = a.name.localeCompare(b.name);
        else if (key === "age") cmp = a.clock - b.clock;
        else cmp = a.clock - b.clock;
        return cmp * dir || a.eventid.localeCompare(b.eventid);
      });
      return list;
    });
    const pageSize = computed(() => {
      const allowed = [5, 10, 20, 25, 50, 100];
      const n = Number(props.options.pageSize || 10);
      return allowed.includes(n) ? n : 10;
    });
    const pageCount = computed(
      () => Math.max(1, Math.ceil(sorted.value.length / pageSize.value))
    );
    const pageItems = computed(() => {
      const start = page.value * pageSize.value;
      return sorted.value.slice(start, start + pageSize.value);
    });
    function toggleSort(key, sortable) {
      if (!sortable) return;
      if (sortKey.value === key)
        sortDir.value = sortDir.value === "asc" ? "desc" : "asc";
      else {
        sortKey.value = key;
        sortDir.value = key === "time" || key === "severity" ? "desc" : "asc";
      }
    }
    function onTagClick(e, tag, value, problem) {
      emit("tag-click", { tag, value, ctrl: e.ctrlKey || e.metaKey, problem });
    }
    const anyAction = computed(
      () => props.options.allowAcknowledge || props.options.allowUnacknowledge || props.options.allowClose || props.options.allowChangeSeverity || props.options.allowSuppress || props.options.allowUnsuppress || props.options.allowExecuteScripts
    );
    const fontSize = computed(() => props.options.fontSize || "100%");
    __expose({ buildColumns, columns, pageItems, sorted, toggleSort });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: "wrap",
          style: normalizeStyle({ fontSize: fontSize.value }),
          "data-testid": "problems-table-wrap"
        },
        [
          createElementVNode("table", _hoisted_1$X, [
            createElementVNode("thead", null, [
              createElementVNode("tr", null, [
                (openBlock(true), createElementBlock(
                  Fragment,
                  null,
                  renderList(columns.value, (c) => {
                    return openBlock(), createElementBlock("th", {
                      key: c.key,
                      "data-col": c.key,
                      style: normalizeStyle({ width: colWidth(c) + "px" }),
                      class: normalizeClass({ sortable: c.sortable }),
                      onClick: ($event) => toggleSort(String(c.key), c.sortable)
                    }, [
                      createElementVNode(
                        "span",
                        null,
                        toDisplayString(c.title),
                        1
                        /* TEXT */
                      ),
                      createElementVNode("span", {
                        class: "resizer",
                        "data-testid": "col-resizer",
                        onMousedown: withModifiers(($event) => unref(startResize)(String(c.key), colWidth(c), $event), ["stop"])
                      }, null, 40, _hoisted_3$B)
                    ], 14, _hoisted_2$J);
                  }),
                  128
                  /* KEYED_FRAGMENT */
                ))
              ])
            ]),
            createElementVNode("tbody", null, [
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(pageItems.value, (p) => {
                  return openBlock(), createElementBlock("tr", {
                    key: p.eventid,
                    "data-testid": `problem-row-${p.eventid}`,
                    class: normalizeClass({
                      ack: p.acknowledged && __props.options.markAckEvents,
                      "is-new": isNew(p),
                      "hl-bg": __props.options.highlightBackground
                    }),
                    style: normalizeStyle(
                      __props.options.highlightBackground ? { background: sevStyle(p.severity).background + "22" } : void 0
                    ),
                    onClick: ($event) => emit("select", p)
                  }, [
                    (openBlock(true), createElementBlock(
                      Fragment,
                      null,
                      renderList(columns.value, (c) => {
                        return openBlock(), createElementBlock(
                          "td",
                          {
                            key: c.key,
                            style: normalizeStyle({ width: colWidth(c) + "px" })
                          },
                          [
                            c.key === "time" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 0 },
                              [
                                createTextVNode(
                                  toDisplayString(formatTime2(p)),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "severity" ? (openBlock(), createElementBlock(
                              "span",
                              {
                                key: 1,
                                class: "sev",
                                style: normalizeStyle(sevStyle(p.severity))
                              },
                              toDisplayString(severityMap.value.get(p.severity)?.severity || p.severity),
                              5
                              /* TEXT, STYLE */
                            )) : c.key === "status" ? (openBlock(), createBlock(ProblemStatus, {
                              key: 2,
                              status: p.status,
                              acknowledged: p.acknowledged,
                              "mark-ack": __props.options.markAckEvents,
                              "ack-color": __props.options.ackEventColor,
                              "ok-color": __props.options.okEventColor
                            }, null, 8, ["status", "acknowledged", "mark-ack", "ack-color", "ok-color"])) : c.key === "statusIcon" ? (openBlock(), createBlock(ProblemStatusBar, {
                              key: 3,
                              problem: p,
                              compact: ""
                            }, null, 8, ["problem"])) : c.key === "host" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 4 },
                              [
                                createTextVNode(
                                  toDisplayString(hostLabel(p)),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "hostTechName" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 5 },
                              [
                                createTextVNode(
                                  toDisplayString(hostTech(p)),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "hostGroups" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 6 },
                              [
                                createTextVNode(
                                  toDisplayString(p.groups.join(", ")),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "proxy" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 7 },
                              [
                                createTextVNode(
                                  toDisplayString(p.proxy || "—"),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "problem" ? (openBlock(), createElementBlock(
                              "div",
                              {
                                key: 8,
                                class: normalizeClass({ "desc-nl": __props.options.descriptionAtNewLine })
                              },
                              [
                                createElementVNode(
                                  "div",
                                  null,
                                  toDisplayString(p.name),
                                  1
                                  /* TEXT */
                                ),
                                __props.options.descriptionAtNewLine && p.description ? (openBlock(), createElementBlock(
                                  "div",
                                  _hoisted_5$o,
                                  toDisplayString(p.description),
                                  1
                                  /* TEXT */
                                )) : createCommentVNode("v-if", true)
                              ],
                              2
                              /* CLASS */
                            )) : c.key === "age" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 9 },
                              [
                                createTextVNode(
                                  toDisplayString(age(p)),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "opdata" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 10 },
                              [
                                createTextVNode(
                                  toDisplayString(p.opdata || p.historicalItemValue || "—"),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "ack" ? (openBlock(), createElementBlock("span", {
                              key: 11,
                              class: "ack-count",
                              title: p.acknowledges.map((a) => `${a.user}: ${a.message}`).join("\n"),
                              "data-testid": "ack-count"
                            }, toDisplayString(p.acknowledges.length), 9, _hoisted_6$k)) : c.key === "tags" ? (openBlock(true), createElementBlock(
                              Fragment,
                              { key: 12 },
                              renderList(p.tags, (t2) => {
                                return openBlock(), createElementBlock("button", {
                                  key: t2.tag + t2.value,
                                  type: "button",
                                  class: "tag",
                                  onClick: withModifiers(($event) => onTagClick($event, t2.tag, t2.value, p), ["stop"])
                                }, toDisplayString(t2.tag) + toDisplayString(t2.value ? ":" + t2.value : ""), 9, _hoisted_7$g);
                              }),
                              128
                              /* KEYED_FRAGMENT */
                            )) : c.key === "datasource" ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 13 },
                              [
                                createTextVNode(
                                  toDisplayString(p.datasourceName),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : String(c.key).startsWith("tag:") ? (openBlock(), createElementBlock(
                              Fragment,
                              { key: 14 },
                              [
                                createTextVNode(
                                  toDisplayString(tagValue(p, String(c.key).slice(4))),
                                  1
                                  /* TEXT */
                                )
                              ],
                              64
                              /* STABLE_FRAGMENT */
                            )) : c.key === "actions" && anyAction.value ? (openBlock(), createElementBlock("div", {
                              key: 15,
                              class: "actions",
                              onClick: _cache[0] || (_cache[0] = withModifiers(() => {
                              }, ["stop"]))
                            }, [
                              __props.options.allowAcknowledge ? (openBlock(), createElementBlock("button", {
                                key: 0,
                                type: "button",
                                "data-testid": "action-ack",
                                onClick: ($event) => emit("acknowledge", p)
                              }, " 确认 ", 8, _hoisted_8$a)) : createCommentVNode("v-if", true),
                              __props.options.allowUnacknowledge ? (openBlock(), createElementBlock("button", {
                                key: 1,
                                type: "button",
                                "data-testid": "action-unack",
                                onClick: ($event) => emit("unacknowledge", p)
                              }, " 取消确认 ", 8, _hoisted_9$9)) : createCommentVNode("v-if", true),
                              __props.options.allowClose ? (openBlock(), createElementBlock("button", {
                                key: 2,
                                type: "button",
                                "data-testid": "action-close",
                                onClick: ($event) => emit("close", p)
                              }, " 关闭 ", 8, _hoisted_10$7)) : createCommentVNode("v-if", true),
                              __props.options.allowChangeSeverity ? (openBlock(), createElementBlock("button", {
                                key: 3,
                                type: "button",
                                "data-testid": "action-sev",
                                onClick: ($event) => emit("severity", p)
                              }, " 严重级别 ", 8, _hoisted_11$6)) : createCommentVNode("v-if", true),
                              __props.options.allowSuppress ? (openBlock(), createElementBlock("button", {
                                key: 4,
                                type: "button",
                                "data-testid": "action-suppress",
                                onClick: ($event) => emit("suppress", p)
                              }, " 抑制 ", 8, _hoisted_12$5)) : createCommentVNode("v-if", true),
                              __props.options.allowUnsuppress ? (openBlock(), createElementBlock("button", {
                                key: 5,
                                type: "button",
                                "data-testid": "action-unsuppress",
                                onClick: ($event) => emit("unsuppress", p)
                              }, " 取消抑制 ", 8, _hoisted_13$5)) : createCommentVNode("v-if", true),
                              __props.options.allowExecuteScripts ? (openBlock(), createElementBlock("button", {
                                key: 6,
                                type: "button",
                                "data-testid": "action-script",
                                onClick: ($event) => emit("script", p)
                              }, " 脚本 ", 8, _hoisted_14$5)) : createCommentVNode("v-if", true)
                            ])) : createCommentVNode("v-if", true)
                          ],
                          4
                          /* STYLE */
                        );
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    ))
                  ], 14, _hoisted_4$t);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ])
          ]),
          createElementVNode("div", _hoisted_15$5, [
            createElementVNode("button", {
              type: "button",
              disabled: page.value <= 0,
              onClick: _cache[1] || (_cache[1] = ($event) => page.value = Math.max(0, page.value - 1))
            }, " 上一页 ", 8, _hoisted_16$4),
            createElementVNode(
              "span",
              null,
              toDisplayString(page.value + 1) + " / " + toDisplayString(pageCount.value),
              1
              /* TEXT */
            ),
            createElementVNode("button", {
              type: "button",
              disabled: page.value + 1 >= pageCount.value,
              onClick: _cache[2] || (_cache[2] = ($event) => page.value = Math.min(pageCount.value - 1, page.value + 1))
            }, " 下一页 ", 8, _hoisted_17$4),
            createElementVNode("select", {
              value: pageSize.value,
              "data-testid": "problems-page-size",
              onChange: _cache[3] || (_cache[3] = ($event) => {
                emit("update:options", {
                  ...__props.options,
                  pageSize: Number($event.target.value)
                });
                page.value = 0;
              })
            }, [
              (openBlock(), createElementBlock(
                Fragment,
                null,
                renderList([5, 10, 20, 25, 50, 100], (n) => {
                  return createElementVNode("option", {
                    key: n,
                    value: n
                  }, toDisplayString(n), 9, _hoisted_19$4);
                }),
                64
                /* STABLE_FRAGMENT */
              ))
            ], 40, _hoisted_18$4)
          ])
        ],
        4
        /* STYLE */
      );
    };
  }
});
const ProblemsTable = /* @__PURE__ */ _export_sfc(_sfc_main$$, [["__scopeId", "data-v-b41be292"]]);
const _sfc_main$_ = /* @__PURE__ */ defineComponent({
  __name: "SeverityBadge",
  props: {
    severity: {},
    label: {},
    color: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "span",
        {
          class: "sev",
          "data-testid": "severity-badge",
          style: normalizeStyle({ background: __props.color || "#999", color: "#fff" })
        },
        toDisplayString(__props.label ?? __props.severity),
        5
        /* TEXT, STYLE */
      );
    };
  }
});
const SeverityBadge = /* @__PURE__ */ _export_sfc(_sfc_main$_, [["__scopeId", "data-v-2244911d"]]);
const _hoisted_1$W = ["data-testid", "onClick"];
const _hoisted_2$I = { class: "name" };
const _hoisted_3$A = { class: "meta" };
const _hoisted_4$s = {
  key: 0,
  class: "maint",
  title: "维护中",
  "data-testid": "maintenance-icon"
};
const _hoisted_5$n = ["href"];
const _hoisted_6$j = {
  key: 2,
  class: "acks"
};
const _sfc_main$Z = /* @__PURE__ */ defineComponent({
  __name: "ProblemsList",
  props: {
    items: {},
    options: {}
  },
  emits: ["select"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function colorFor(sev) {
      return props.options.triggerSeverity?.find((s) => s.priority === sev)?.color || "#999";
    }
    function labelFor(sev) {
      return props.options.triggerSeverity?.find((s) => s.priority === sev)?.severity || String(sev);
    }
    function isNew(p) {
      if (!props.options.highlightNewEvents) return false;
      const thr = parseDurationMs2(props.options.highlightNewerThan || "1h");
      return Date.now() - p.clock <= thr;
    }
    function parseDurationMs2(s) {
      const m = String(s).trim().match(/^(\d+(?:\.\d+)?)(ms|s|m|h|d)?$/i);
      if (!m) return 36e5;
      const n = Number(m[1]);
      const u = (m[2] || "s").toLowerCase();
      if (u === "ms") return n;
      if (u === "s") return n * 1e3;
      if (u === "m") return n * 6e4;
      if (u === "h") return n * 36e5;
      if (u === "d") return n * 864e5;
      return n * 1e3;
    }
    function cardStyle(p) {
      if (!props.options.highlightBackground) return void 0;
      return {
        background: colorFor(p.severity) + "22",
        borderColor: colorFor(p.severity)
      };
    }
    const fontSize = computed(() => props.options.fontSize || "100%");
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "ul",
        {
          class: "list",
          "data-testid": "problems-list",
          style: normalizeStyle({ fontSize: fontSize.value })
        },
        [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(__props.items, (p) => {
              return openBlock(), createElementBlock("li", {
                key: p.eventid,
                class: normalizeClass(["card", { blink: isNew(p), "hl-bg": __props.options.highlightBackground }]),
                style: normalizeStyle(cardStyle(p)),
                "data-testid": `problem-row-${p.eventid}`,
                onClick: ($event) => emit("select", p)
              }, [
                createElementVNode(
                  "span",
                  {
                    class: "sev-bar",
                    style: normalizeStyle({ background: colorFor(p.severity) }),
                    "aria-hidden": "true"
                  },
                  null,
                  4
                  /* STYLE */
                ),
                createVNode(SeverityBadge, {
                  severity: p.severity,
                  label: labelFor(p.severity),
                  color: colorFor(p.severity)
                }, null, 8, ["severity", "label", "color"]),
                createElementVNode(
                  "span",
                  _hoisted_2$I,
                  toDisplayString(p.name),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "span",
                  _hoisted_3$A,
                  toDisplayString(p.hosts.map((h2) => h2.name || h2.host).join(", ")),
                  1
                  /* TEXT */
                ),
                p.hostInMaintenance ? (openBlock(), createElementBlock("span", _hoisted_4$s, "🔧")) : createCommentVNode("v-if", true),
                p.url ? (openBlock(), createElementBlock("a", {
                  key: 1,
                  class: "url",
                  href: p.url,
                  target: "_blank",
                  rel: "noopener noreferrer",
                  "data-testid": "problem-url",
                  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
                  }, ["stop"]))
                }, "外链", 8, _hoisted_5$n)) : createCommentVNode("v-if", true),
                p.acknowledges.length ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_6$j,
                  "确认 " + toDisplayString(p.acknowledges.length),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ], 14, _hoisted_1$W);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ],
        4
        /* STYLE */
      );
    };
  }
});
const ProblemsList = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["__scopeId", "data-v-28b6c6e0"]]);
const _hoisted_1$V = {
  class: "tl-wrap",
  "data-testid": "problem-timeline",
  "aria-label": "问题时间线"
};
const _hoisted_2$H = ["viewBox"];
const _hoisted_3$z = ["x", "width", "fill", "data-testid"];
const _hoisted_4$r = ["cx", "fill"];
const _hoisted_5$m = {
  key: 1,
  class: "empty",
  "data-testid": "timeline-empty"
};
const width = 480;
const height = 36;
const _sfc_main$Y = /* @__PURE__ */ defineComponent({
  __name: "ProblemTimeline",
  props: {
    problem: {},
    timeRange: {},
    okColor: {},
    problemColor: {}
  },
  setup(__props, { expose: __expose }) {
    const props = __props;
    const ok2 = computed(() => props.okColor || "rgb(56,189,113)");
    const bad = computed(() => props.problemColor || "rgb(215,0,0)");
    const range = computed(() => {
      const from = props.timeRange?.from ?? props.problem.clock - 36e5;
      const to = props.timeRange?.to ?? Date.now();
      return { from, to: Math.max(to, from + 1) };
    });
    const points = computed(() => {
      const list = [...props.problem.events || []];
      if (!list.length) {
        list.push({
          clock: props.problem.clock / 1e3,
          value: 1,
          name: props.problem.name
        });
      }
      return list.map((e) => {
        const raw = Number(e.clock || 0);
        const clock = raw < 1e12 ? raw * 1e3 : raw;
        const value = Number(e.value ?? 1);
        return {
          clock,
          value,
          name: String(e.name || e.value_str || ""),
          isProblem: value === 1 || String(e.value) === "1"
        };
      }).filter((e) => Number.isFinite(e.clock)).sort((a, b) => a.clock - b.clock);
    });
    const segments = computed(() => {
      const { from, to } = range.value;
      const span = to - from;
      const pts = points.value;
      if (!pts.length) return [];
      const segs = [];
      for (let i = 0; i < pts.length; i++) {
        const start = Math.max(from, pts[i].clock);
        const end = i + 1 < pts.length ? Math.min(to, pts[i + 1].clock) : to;
        if (end <= start) continue;
        const x = (start - from) / span * width;
        const w = Math.max(2, (end - start) / span * width);
        const kind2 = pts[i].isProblem ? "problem" : "ok";
        const durMs = end - start;
        const dur = durMs < 6e4 ? `${Math.round(durMs / 1e3)}s` : durMs < 36e5 ? `${Math.round(durMs / 6e4)}m` : `${(durMs / 36e5).toFixed(1)}h`;
        segs.push({
          x,
          w,
          kind: kind2,
          title: `${kind2 === "problem" ? "PROBLEM" : "OK"} · ${dur} · ${pts[i].name || ""}`.trim()
        });
      }
      return segs;
    });
    const dots = computed(() => {
      const { from, to } = range.value;
      const span = to - from;
      return points.value.map((p) => ({
        x: (Math.min(to, Math.max(from, p.clock)) - from) / span * width,
        fill: p.isProblem ? bad.value : ok2.value,
        title: `${new Date(p.clock).toLocaleString()} · ${p.name || (p.isProblem ? "PROBLEM" : "OK")}`
      }));
    });
    __expose({ segments, dots, points });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$V, [
        segments.value.length ? (openBlock(), createElementBlock("svg", {
          key: 0,
          viewBox: `0 0 ${width} ${height}`,
          width: "100%",
          height,
          role: "img"
        }, [
          createElementVNode("rect", {
            x: "0",
            y: "10",
            width,
            height: "10",
            fill: "rgba(255,255,255,0.06)",
            rx: "2"
          }),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(segments.value, (s, i) => {
              return openBlock(), createElementBlock("rect", {
                key: "s" + i,
                x: s.x,
                y: "10",
                width: s.w,
                height: "10",
                fill: s.kind === "problem" ? bad.value : ok2.value,
                "data-testid": `timeline-seg-${s.kind}`
              }, [
                createElementVNode(
                  "title",
                  null,
                  toDisplayString(s.title),
                  1
                  /* TEXT */
                )
              ], 8, _hoisted_3$z);
            }),
            128
            /* KEYED_FRAGMENT */
          )),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(dots.value, (d, i) => {
              return openBlock(), createElementBlock("circle", {
                key: "d" + i,
                cx: d.x,
                cy: "15",
                r: "3.5",
                fill: d.fill,
                stroke: "#111",
                "stroke-width": "1",
                "data-testid": "timeline-dot"
              }, [
                createElementVNode(
                  "title",
                  null,
                  toDisplayString(d.title),
                  1
                  /* TEXT */
                )
              ], 8, _hoisted_4$r);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ], 8, _hoisted_2$H)) : (openBlock(), createElementBlock("p", _hoisted_5$m, "无事件时间线"))
      ]);
    };
  }
});
const ProblemTimeline = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["__scopeId", "data-v-f4373cba"]]);
const _hoisted_1$U = {
  key: 0,
  class: "acks",
  "data-testid": "problem-acks"
};
const _hoisted_2$G = {
  key: 1,
  class: "empty",
  "data-testid": "problem-acks-empty"
};
const _sfc_main$X = /* @__PURE__ */ defineComponent({
  __name: "ProblemAcknowledges",
  props: {
    items: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return __props.items?.length ? (openBlock(), createElementBlock("ul", _hoisted_1$U, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.items, (a) => {
            return openBlock(), createElementBlock("li", {
              key: a.acknowledgeid || a.clock + a.user
            }, [
              createElementVNode(
                "time",
                null,
                toDisplayString(a.clock ? new Date(a.clock).toLocaleString() : ""),
                1
                /* TEXT */
              ),
              createElementVNode(
                "strong",
                null,
                toDisplayString(a.user || "用户"),
                1
                /* TEXT */
              ),
              createElementVNode(
                "span",
                null,
                toDisplayString(a.message),
                1
                /* TEXT */
              )
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ])) : (openBlock(), createElementBlock("p", _hoisted_2$G, "暂无确认记录"));
    };
  }
});
const ProblemAcknowledges = /* @__PURE__ */ _export_sfc(_sfc_main$X, [["__scopeId", "data-v-83362a58"]]);
const _hoisted_1$T = {
  class: "tags",
  "data-testid": "tag-list"
};
const _sfc_main$W = /* @__PURE__ */ defineComponent({
  __name: "TagList",
  props: {
    tags: {}
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("span", _hoisted_1$T, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.tags, (t2) => {
            return openBlock(), createElementBlock(
              "span",
              {
                key: t2.tag + t2.value,
                class: "tag"
              },
              toDisplayString(t2.tag) + toDisplayString(t2.value ? ":" + t2.value : ""),
              1
              /* TEXT */
            );
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const TagList = /* @__PURE__ */ _export_sfc(_sfc_main$W, [["__scopeId", "data-v-33c2d20f"]]);
const _hoisted_1$S = {
  class: "details",
  "data-testid": "problem-details",
  role: "dialog",
  "aria-label": "问题详情"
};
const _hoisted_2$F = { "data-testid": "problem-eventid" };
const _hoisted_3$y = {
  key: 1,
  "data-testid": "problem-hosts"
};
const _hoisted_4$q = {
  key: 2,
  "data-testid": "problem-groups"
};
const _hoisted_5$l = {
  key: 3,
  "data-testid": "problem-tags"
};
const _hoisted_6$i = ["innerHTML"];
const _hoisted_7$f = {
  key: 5,
  "data-testid": "problem-opdata"
};
const _hoisted_8$9 = { "data-testid": "problem-expression" };
const _hoisted_9$8 = {
  key: 6,
  "data-testid": "problem-hist-value"
};
const _hoisted_10$6 = { "data-testid": "problem-manual-close" };
const _hoisted_11$5 = { "data-testid": "problem-suppressed" };
const _hoisted_12$4 = {
  "data-testid": "problem-items",
  class: "block"
};
const _hoisted_13$4 = {
  key: 0,
  class: "plain"
};
const _hoisted_14$4 = { key: 0 };
const _hoisted_15$4 = {
  key: 1,
  class: "empty"
};
const _hoisted_16$3 = {
  "data-testid": "problem-alerts",
  class: "block"
};
const _hoisted_17$3 = {
  key: 0,
  class: "plain"
};
const _hoisted_18$3 = {
  key: 1,
  class: "empty"
};
const _hoisted_19$3 = {
  "data-testid": "problem-events",
  class: "block"
};
const _hoisted_20$3 = {
  key: 0,
  class: "plain"
};
const _hoisted_21$2 = {
  key: 1,
  class: "empty"
};
const _hoisted_22$2 = {
  "data-testid": "problem-suppression",
  class: "block"
};
const _hoisted_23$1 = {
  key: 0,
  class: "plain"
};
const _hoisted_24$1 = { key: 0 };
const _hoisted_25$1 = {
  key: 1,
  class: "empty"
};
const _hoisted_26$1 = {
  class: "block",
  "data-testid": "problem-acks-section"
};
const _sfc_main$V = /* @__PURE__ */ defineComponent({
  __name: "ProblemDetails",
  props: {
    problem: {},
    options: {}
  },
  emits: ["close", "view-metrics"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function onViewMetrics() {
      emit("view-metrics", props.problem);
    }
    const descHtml = computed(
      () => sanitizeProblemHtml(
        props.problem.description || props.problem.name,
        props.options.allowDangerousHTML
      )
    );
    const hostLabel = computed(
      () => props.problem.hosts.map((h2) => h2.name || h2.host).filter(Boolean).join(", ")
    );
    const suppressionRows = computed(() => props.problem.suppression || []);
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("aside", _hoisted_1$S, [
        createElementVNode("header", null, [
          createElementVNode(
            "h4",
            null,
            toDisplayString(__props.problem.name),
            1
            /* TEXT */
          ),
          createElementVNode("button", {
            type: "button",
            "data-testid": "problem-details-close",
            onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
          }, " 关闭 ")
        ]),
        createVNode(ProblemStatusBar, {
          problem: __props.problem,
          "mark-ack": __props.options.markAckEvents,
          "ack-color": __props.options.ackEventColor,
          "ok-color": __props.options.okEventColor
        }, null, 8, ["problem", "mark-ack", "ack-color", "ok-color"]),
        __props.problem.items.length ? (openBlock(), createElementBlock("button", {
          key: 0,
          type: "button",
          "data-testid": "problem-view-metrics",
          onClick: onViewMetrics
        }, " 查看指标 ")) : createCommentVNode("v-if", true),
        createElementVNode(
          "p",
          _hoisted_2$F,
          "Event: " + toDisplayString(__props.problem.eventid),
          1
          /* TEXT */
        ),
        __props.options.hostField ? (openBlock(), createElementBlock(
          "p",
          _hoisted_3$y,
          " 主机: " + toDisplayString(hostLabel.value || "—"),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        __props.options.hostGroups || __props.problem.groups.length ? (openBlock(), createElementBlock(
          "p",
          _hoisted_4$q,
          " 组: " + toDisplayString(__props.problem.groups.length ? __props.problem.groups.join(", ") : "—"),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        __props.options.showTags || __props.problem.tags.length ? (openBlock(), createElementBlock("div", _hoisted_5$l, [
          _cache[1] || (_cache[1] = createTextVNode(
            " 标签: ",
            -1
            /* CACHED */
          )),
          createVNode(TagList, {
            tags: __props.problem.tags
          }, null, 8, ["tags"])
        ])) : createCommentVNode("v-if", true),
        __props.options.descriptionField ? (openBlock(), createElementBlock("div", {
          key: 4,
          class: "desc",
          "data-testid": "problem-description",
          innerHTML: descHtml.value
        }, null, 8, _hoisted_6$i)) : createCommentVNode("v-if", true),
        __props.options.opdataField || __props.problem.opdata ? (openBlock(), createElementBlock(
          "p",
          _hoisted_7$f,
          " 运维数据: " + toDisplayString(__props.problem.opdata || "—"),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createElementVNode(
          "p",
          _hoisted_8$9,
          " 表达式: " + toDisplayString(__props.problem.expression || "—"),
          1
          /* TEXT */
        ),
        __props.problem.historicalItemValue != null ? (openBlock(), createElementBlock(
          "p",
          _hoisted_9$8,
          " 历史值: " + toDisplayString(__props.problem.historicalItemValue),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createElementVNode(
          "p",
          _hoisted_10$6,
          " 手动关闭: " + toDisplayString(__props.problem.manual_close === "1" || __props.problem.manual_close === true ? "允许" : "否"),
          1
          /* TEXT */
        ),
        createElementVNode(
          "p",
          _hoisted_11$5,
          " 抑制: " + toDisplayString(__props.problem.suppressed ? "是" : "否"),
          1
          /* TEXT */
        ),
        createElementVNode("section", _hoisted_12$4, [
          createElementVNode(
            "h5",
            null,
            "监控项 (" + toDisplayString(__props.problem.items.length) + ")",
            1
            /* TEXT */
          ),
          __props.problem.items.length ? (openBlock(), createElementBlock("ul", _hoisted_13$4, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.problem.items, (it) => {
                return openBlock(), createElementBlock("li", {
                  key: it.itemid
                }, [
                  createElementVNode(
                    "strong",
                    null,
                    toDisplayString(it.name || it.key_),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "code",
                    null,
                    toDisplayString(it.key_),
                    1
                    /* TEXT */
                  ),
                  it.lastvalue != null ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_14$4,
                    "= " + toDisplayString(it.lastvalue),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : (openBlock(), createElementBlock("p", _hoisted_15$4, "无关联监控项"))
        ]),
        createElementVNode("section", _hoisted_16$3, [
          createElementVNode(
            "h5",
            null,
            "告警 (" + toDisplayString(__props.problem.alerts.length) + ")",
            1
            /* TEXT */
          ),
          __props.problem.alerts.length ? (openBlock(), createElementBlock("ul", _hoisted_17$3, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.problem.alerts, (a, i) => {
                return openBlock(), createElementBlock(
                  "li",
                  { key: i },
                  toDisplayString(String(
                    a.alertid || a.subject || a.message || JSON.stringify(a)
                  )),
                  1
                  /* TEXT */
                );
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : (openBlock(), createElementBlock("p", _hoisted_18$3, "无告警记录"))
        ]),
        createElementVNode("section", _hoisted_19$3, [
          createElementVNode(
            "h5",
            null,
            "事件 (" + toDisplayString(__props.problem.events.length) + ")",
            1
            /* TEXT */
          ),
          __props.problem.events.length ? (openBlock(), createElementBlock("ul", _hoisted_20$3, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.problem.events, (e, i) => {
                return openBlock(), createElementBlock("li", { key: i }, [
                  createElementVNode(
                    "time",
                    null,
                    toDisplayString(e.clock ? new Date(
                      Number(e.clock) < 1e12 ? Number(e.clock) * 1e3 : Number(e.clock)
                    ).toLocaleString() : ""),
                    1
                    /* TEXT */
                  ),
                  createTextVNode(
                    " " + toDisplayString(String(
                      e.name || e.value_str || e.eventid || ""
                    )),
                    1
                    /* TEXT */
                  )
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : (openBlock(), createElementBlock("p", _hoisted_21$2, "无额外事件列表"))
        ]),
        createElementVNode("section", _hoisted_22$2, [
          createElementVNode(
            "h5",
            null,
            "抑制明细 (" + toDisplayString(suppressionRows.value.length) + ")",
            1
            /* TEXT */
          ),
          suppressionRows.value.length ? (openBlock(), createElementBlock("ul", _hoisted_23$1, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(suppressionRows.value, (s, i) => {
                return openBlock(), createElementBlock("li", { key: i }, [
                  createTextVNode(
                    toDisplayString(String(
                      s.maintenanceid || s.userid || JSON.stringify(s)
                    )) + " ",
                    1
                    /* TEXT */
                  ),
                  s.suppress_until != null ? (openBlock(), createElementBlock(
                    "span",
                    _hoisted_24$1,
                    " until " + toDisplayString(s.suppress_until === 0 || s.suppress_until === "0" ? "无限期" : s.suppress_until),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])) : (openBlock(), createElementBlock("p", _hoisted_25$1, "无抑制记录"))
        ]),
        __props.options.problemTimeline ? (openBlock(), createBlock(ProblemTimeline, {
          key: 7,
          problem: __props.problem
        }, null, 8, ["problem"])) : createCommentVNode("v-if", true),
        createElementVNode("section", _hoisted_26$1, [
          createElementVNode(
            "h5",
            null,
            "确认记录 (" + toDisplayString(__props.problem.acknowledges.length) + ")",
            1
            /* TEXT */
          ),
          createVNode(ProblemAcknowledges, {
            items: __props.problem.acknowledges
          }, null, 8, ["items"])
        ])
      ]);
    };
  }
});
const ProblemDetails = /* @__PURE__ */ _export_sfc(_sfc_main$V, [["__scopeId", "data-v-2b135c62"]]);
const ACK_ACTION = {
  CLOSE: 1,
  ACKNOWLEDGE: 2,
  ADD_MESSAGE: 4,
  CHANGE_SEVERITY: 8,
  UNACKNOWLEDGE: 16,
  SUPPRESS: 32,
  UNSUPPRESS: 64
};
function envLiveWrites(raw) {
  if (typeof raw === "boolean") return raw;
  if (raw != null)
    return String(raw) === "1" || String(raw).toLowerCase() === "true";
  if (typeof process !== "undefined" && process.env) {
    return process.env.ZABBIX_LIVE_WRITES === "1";
  }
  return false;
}
function panelAllows(action, panel2) {
  if (!panel2) return false;
  switch (action) {
    case "acknowledge":
    case "message":
      return Boolean(panel2.allowAcknowledge);
    case "unacknowledge":
      return Boolean(panel2.allowUnacknowledge);
    case "close":
      return Boolean(panel2.allowClose);
    case "changeSeverity":
      return Boolean(panel2.allowChangeSeverity);
    case "suppress":
      return Boolean(panel2.allowSuppress);
    case "unsuppress":
      return Boolean(panel2.allowUnsuppress);
    case "executeScript":
      return Boolean(panel2.allowExecuteScripts);
    default:
      return false;
  }
}
function evaluateWriteGate(action, gate = {}) {
  if (!panelAllows(action, gate.panel)) {
    return { allowed: false, reason: `面板未启用动作 ${action}` };
  }
  if (!gate.datasourceEnableWrites) {
    return { allowed: false, reason: "数据源未开启 enableWrites" };
  }
  if (!envLiveWrites(gate.liveWritesEnv)) {
    return { allowed: false, reason: "未设置 ZABBIX_LIVE_WRITES=1" };
  }
  if (gate.userCanWrite === false) {
    return { allowed: false, reason: "当前用户只读或无写权限" };
  }
  if (action === "close" && gate.eventManualClose === false) {
    return { allowed: false, reason: "事件/触发器不允许 manual_close" };
  }
  if (action === "executeScript") {
    if (!gate.hasScript && !gate.scriptid) {
      return { allowed: false, reason: "未选择脚本（禁止默认 scriptid=1）" };
    }
  }
  return { allowed: true };
}
function buildAcknowledgeMask(action, opts = {}) {
  let mask = 0;
  const payload = {};
  switch (action) {
    case "acknowledge":
      mask = ACK_ACTION.ACKNOWLEDGE;
      if (opts.message) mask |= ACK_ACTION.ADD_MESSAGE;
      break;
    case "message":
      mask = ACK_ACTION.ADD_MESSAGE;
      break;
    case "unacknowledge":
      mask = ACK_ACTION.UNACKNOWLEDGE;
      if (opts.message) mask |= ACK_ACTION.ADD_MESSAGE;
      break;
    case "close":
      mask = ACK_ACTION.CLOSE;
      if (opts.message) mask |= ACK_ACTION.ADD_MESSAGE;
      break;
    case "changeSeverity":
      mask = ACK_ACTION.CHANGE_SEVERITY;
      if (opts.message) mask |= ACK_ACTION.ADD_MESSAGE;
      payload.severity = Math.min(5, Math.max(0, Number(opts.severity ?? 0)));
      break;
    case "suppress":
      mask = ACK_ACTION.SUPPRESS;
      if (opts.message) mask |= ACK_ACTION.ADD_MESSAGE;
      payload.suppress_until = opts.suppressUntil != null ? Number(opts.suppressUntil) : 0;
      break;
    case "unsuppress":
      mask = ACK_ACTION.UNSUPPRESS;
      if (opts.message) mask |= ACK_ACTION.ADD_MESSAGE;
      break;
    default:
      throw new Error(`buildAcknowledgeMask does not support ${action}`);
  }
  if (action === "unacknowledge" && mask & ACK_ACTION.ACKNOWLEDGE) {
    throw new Error("unacknowledge must not include ACK bit");
  }
  if (action === "acknowledge" && mask & ACK_ACTION.CLOSE) {
    throw new Error("acknowledge must not include CLOSE bit");
  }
  if (action === "suppress" && payload.suppress_until === void 0) {
    throw new Error("suppress requires suppress_until");
  }
  if (action !== "suppress" && "suppress_until" in payload) {
    throw new Error("suppress_until only valid for suppress");
  }
  if (opts.message) payload.message = opts.message;
  payload.action = mask;
  return { action: mask, payload };
}
function resolveApi$1(preferredUid) {
  if (preferredUid) {
    const byUid2 = getRuntimeDataSource(String(preferredUid));
    if (byUid2?.mutate) return byUid2;
  }
  const all = listRuntimeDataSources();
  return all.find(
    (ds2) => ds2?.mutate && String(ds2.type || "").includes("zabbix")
  ) || all.find((ds2) => ds2?.mutate);
}
async function runProblemAction(problem, action, opts = {}) {
  const gate = evaluateWriteGate(action, {
    panel: opts.gate?.panel,
    datasourceEnableWrites: opts.gate?.datasourceEnableWrites,
    liveWritesEnv: opts.gate?.liveWritesEnv,
    userCanWrite: opts.gate?.userCanWrite,
    eventManualClose: opts.gate?.eventManualClose ?? (problem.manual_close === "1" || problem.manual_close === true || void 0),
    hasScript: opts.gate?.hasScript,
    scriptid: opts.scriptid
  });
  if (!gate.allowed) {
    return { status: "blocked", message: gate.reason, reason: gate.reason };
  }
  const api = resolveApi$1(problem.datasourceUid);
  if (!api?.mutate) return { status: "error", message: "当前数据源不支持动作" };
  if (action === "executeScript") {
    const scriptid = String(opts.scriptid || "").trim();
    if (!scriptid) {
      return {
        status: "blocked",
        reason: "scriptid 必填",
        message: "scriptid 必填"
      };
    }
    const hostid = problem.hosts[0]?.hostid;
    const res2 = await api.mutate({
      action: "zabbix.executeScript",
      payload: { scriptid, hostid, eventid: problem.eventid }
    });
    if (res2?.status === "success" && opts.reread) {
      try {
        await opts.reread(problem.eventid);
      } catch {
      }
    }
    return res2?.status === "success" ? { status: "success", message: res2.message, data: res2.data } : { status: "error", message: res2?.message || "动作失败" };
  }
  const built = buildAcknowledgeMask(action, {
    message: opts.message,
    severity: opts.severity ?? problem.severity,
    suppressUntil: opts.suppressUntil
  });
  const payload = {
    eventids: [problem.eventid],
    ...built.payload
  };
  if (!payload.message && opts.message) payload.message = opts.message;
  const res = await api.mutate({ action: "zabbix.acknowledge", payload });
  if (res?.status === "success" && opts.reread) {
    try {
      await opts.reread(problem.eventid);
    } catch {
    }
  }
  return res?.status === "success" ? { status: "success", message: res.message, data: res.data } : { status: "error", message: res?.message || "动作失败" };
}
const _hoisted_1$R = {
  key: 0,
  class: "modal",
  "data-testid": "ack-modal",
  role: "dialog"
};
const _hoisted_2$E = { class: "row" };
const _hoisted_3$x = { class: "row" };
const _hoisted_4$p = {
  key: 0,
  class: "sev-radios",
  "data-testid": "ack-modal-sev-radios"
};
const _hoisted_5$k = ["value", "data-testid"];
const _hoisted_6$h = {
  key: 1,
  class: "row"
};
const _hoisted_7$e = {
  key: 2,
  class: "hint",
  "data-testid": "ack-modal-close-blocked"
};
const _hoisted_8$8 = {
  class: "hint",
  "data-testid": "ack-modal-mask"
};
const _hoisted_9$7 = { key: 1 };
const _hoisted_10$5 = { key: 2 };
const _sfc_main$U = /* @__PURE__ */ defineComponent({
  __name: "AcknowledgeModal",
  props: {
    problem: {},
    open: { type: Boolean },
    mode: {}
  },
  emits: ["confirm", "cancel"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const message = ref("已确认");
    const severity = ref(3);
    const suppressUntil = ref(0);
    const doAck = ref(true);
    const doClose = ref(false);
    const doSev = ref(false);
    const canManualClose = computed(() => {
      const v = props.problem?.manual_close;
      return v === true || String(v) === "1";
    });
    const isComposite = computed(
      () => !props.mode || props.mode === "acknowledge" || props.mode === "composite"
    );
    watch(
      () => [props.open, props.problem?.eventid, props.mode],
      ([open]) => {
        if (!open) return;
        message.value = props.mode === "close" ? "关闭" : props.mode === "suppress" ? "抑制" : props.mode === "unacknowledge" ? "取消确认" : "已确认";
        severity.value = props.problem?.severity ?? 3;
        suppressUntil.value = 0;
        doAck.value = true;
        doClose.value = props.mode === "close";
        doSev.value = props.mode === "changeSeverity";
      }
    );
    function compositeMask() {
      let mask = ACK_ACTION.ADD_MESSAGE;
      if (doAck.value) mask |= ACK_ACTION.ACKNOWLEDGE;
      if (doClose.value && canManualClose.value) mask |= ACK_ACTION.CLOSE;
      if (doSev.value) mask |= ACK_ACTION.CHANGE_SEVERITY;
      return mask;
    }
    function onOk() {
      if (isComposite.value) {
        emit("confirm", {
          message: message.value,
          severity: doSev.value ? severity.value : void 0,
          actionMask: compositeMask(),
          acknowledge: doAck.value,
          close: doClose.value && canManualClose.value,
          changeSeverity: doSev.value
        });
        return;
      }
      emit("confirm", {
        message: message.value,
        severity: props.mode === "changeSeverity" ? severity.value : void 0,
        suppressUntil: props.mode === "suppress" ? suppressUntil.value : void 0
      });
    }
    __expose({ compositeMask, canManualClose });
    return (_ctx, _cache) => {
      return __props.open && __props.problem ? (openBlock(), createElementBlock("div", _hoisted_1$R, [
        createElementVNode(
          "p",
          null,
          toDisplayString(__props.mode === "close" ? "关闭" : __props.mode === "suppress" ? "抑制" : __props.mode === "unacknowledge" ? "取消确认" : __props.mode === "changeSeverity" ? "修改严重级别" : __props.mode === "unsuppress" ? "取消抑制" : "确认") + " 问题 " + toDisplayString(__props.problem.eventid) + "？ ",
          1
          /* TEXT */
        ),
        withDirectives(createElementVNode(
          "input",
          {
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => message.value = $event),
            "data-testid": "ack-modal-message",
            "aria-label": "动作备注"
          },
          null,
          512
          /* NEED_PATCH */
        ), [
          [vModelText, message.value]
        ]),
        isComposite.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 0 },
          [
            createElementVNode("label", _hoisted_2$E, [
              withDirectives(createElementVNode(
                "input",
                {
                  "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => doAck.value = $event),
                  type: "checkbox",
                  "data-testid": "ack-modal-do-ack"
                },
                null,
                512
                /* NEED_PATCH */
              ), [
                [vModelCheckbox, doAck.value]
              ]),
              _cache[8] || (_cache[8] = createTextVNode(
                " 确认问题 (Acknowledge) ",
                -1
                /* CACHED */
              ))
            ]),
            createElementVNode("label", _hoisted_3$x, [
              withDirectives(createElementVNode(
                "input",
                {
                  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => doSev.value = $event),
                  type: "checkbox",
                  "data-testid": "ack-modal-do-sev"
                },
                null,
                512
                /* NEED_PATCH */
              ), [
                [vModelCheckbox, doSev.value]
              ]),
              _cache[9] || (_cache[9] = createTextVNode(
                " 修改严重级别 ",
                -1
                /* CACHED */
              ))
            ]),
            doSev.value ? (openBlock(), createElementBlock("div", _hoisted_4$p, [
              (openBlock(), createElementBlock(
                Fragment,
                null,
                renderList([0, 1, 2, 3, 4, 5], (n) => {
                  return createElementVNode("label", {
                    key: n,
                    class: "row"
                  }, [
                    withDirectives(createElementVNode("input", {
                      "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => severity.value = $event),
                      type: "radio",
                      value: n,
                      "data-testid": `ack-modal-sev-${n}`
                    }, null, 8, _hoisted_5$k), [
                      [
                        vModelRadio,
                        severity.value,
                        void 0,
                        { number: true }
                      ]
                    ]),
                    createTextVNode(
                      " " + toDisplayString(n),
                      1
                      /* TEXT */
                    )
                  ]);
                }),
                64
                /* STABLE_FRAGMENT */
              ))
            ])) : createCommentVNode("v-if", true),
            canManualClose.value ? (openBlock(), createElementBlock("label", _hoisted_6$h, [
              withDirectives(createElementVNode(
                "input",
                {
                  "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => doClose.value = $event),
                  type: "checkbox",
                  "data-testid": "ack-modal-do-close"
                },
                null,
                512
                /* NEED_PATCH */
              ), [
                [vModelCheckbox, doClose.value]
              ]),
              _cache[10] || (_cache[10] = createTextVNode(
                " 关闭问题 ",
                -1
                /* CACHED */
              ))
            ])) : (openBlock(), createElementBlock("p", _hoisted_7$e, " 当前触发器不允许手动关闭 ")),
            createElementVNode(
              "p",
              _hoisted_8$8,
              " action mask = " + toDisplayString(compositeMask()),
              1
              /* TEXT */
            )
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        __props.mode === "changeSeverity" && !isComposite.value ? (openBlock(), createElementBlock("label", _hoisted_9$7, [
          _cache[11] || (_cache[11] = createTextVNode(
            " 严重级别 ",
            -1
            /* CACHED */
          )),
          withDirectives(createElementVNode(
            "input",
            {
              "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => severity.value = $event),
              type: "number",
              min: "0",
              max: "5",
              "data-testid": "ack-modal-severity",
              "aria-label": "严重级别"
            },
            null,
            512
            /* NEED_PATCH */
          ), [
            [
              vModelText,
              severity.value,
              void 0,
              { number: true }
            ]
          ])
        ])) : createCommentVNode("v-if", true),
        __props.mode === "suppress" ? (openBlock(), createElementBlock("label", _hoisted_10$5, [
          _cache[12] || (_cache[12] = createTextVNode(
            " 抑制至 (unix，0=无限期) ",
            -1
            /* CACHED */
          )),
          withDirectives(createElementVNode(
            "input",
            {
              "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => suppressUntil.value = $event),
              type: "number",
              min: "0",
              "data-testid": "ack-modal-suppress-until",
              "aria-label": "抑制截止时间"
            },
            null,
            512
            /* NEED_PATCH */
          ), [
            [
              vModelText,
              suppressUntil.value,
              void 0,
              { number: true }
            ]
          ])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("button", {
          type: "button",
          "data-testid": "ack-modal-ok",
          onClick: onOk
        }, "确认"),
        createElementVNode("button", {
          type: "button",
          "data-testid": "ack-modal-cancel",
          onClick: _cache[7] || (_cache[7] = ($event) => emit("cancel"))
        }, " 取消 ")
      ])) : createCommentVNode("v-if", true);
    };
  }
});
const AcknowledgeModal = /* @__PURE__ */ _export_sfc(_sfc_main$U, [["__scopeId", "data-v-4f3b17fc"]]);
const _hoisted_1$Q = {
  key: 0,
  class: "modal",
  "data-testid": "script-modal",
  role: "dialog"
};
const _hoisted_2$D = {
  key: 0,
  "data-testid": "script-modal-loading"
};
const _hoisted_3$w = {
  key: 1,
  class: "err",
  "data-testid": "script-modal-error"
};
const _hoisted_4$o = ["value"];
const _hoisted_5$j = {
  key: 0,
  class: "empty",
  "data-testid": "script-modal-empty"
};
const _hoisted_6$g = {
  key: 1,
  class: "meta",
  "data-testid": "script-modal-meta"
};
const _hoisted_7$d = { key: 0 };
const _hoisted_8$7 = { class: "actions" };
const _hoisted_9$6 = ["disabled"];
const _sfc_main$T = /* @__PURE__ */ defineComponent({
  __name: "ExecuteScriptModal",
  props: {
    problem: {},
    open: { type: Boolean }
  },
  emits: ["confirm", "cancel"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const scripts = ref([]);
    const selectedId = ref("");
    const loading = ref(false);
    const loadError = ref("");
    const selected = computed(
      () => scripts.value.find((s) => s.scriptid === selectedId.value) || null
    );
    async function loadScripts() {
      scripts.value = [];
      selectedId.value = "";
      loadError.value = "";
      if (!props.problem) return;
      const api = getRuntimeDataSource(props.problem.datasourceUid);
      if (!api?.getMetadata) {
        loadError.value = "当前数据源无法加载脚本列表";
        return;
      }
      loading.value = true;
      try {
        const hostid = props.problem.hosts[0]?.hostid || "";
        const res = await api.getMetadata({
          type: "scripts",
          hostid,
          eventid: props.problem.eventid
        });
        const values = res?.values || [];
        scripts.value = values.map((s) => ({
          ...s,
          scriptid: String(s.scriptid ?? ""),
          name: String(s.name ?? s.scriptid ?? "")
        }));
        selectedId.value = "";
      } catch (e) {
        loadError.value = e?.message || "加载脚本失败";
      } finally {
        loading.value = false;
      }
    }
    watch(
      () => [props.open, props.problem?.eventid],
      ([open]) => {
        if (open && props.problem) void loadScripts();
      },
      { immediate: true }
    );
    function onConfirm() {
      const id = String(selectedId.value || "").trim();
      if (!id) return;
      emit("confirm", id);
    }
    return (_ctx, _cache) => {
      return __props.open && __props.problem ? (openBlock(), createElementBlock("div", _hoisted_1$Q, [
        createElementVNode(
          "p",
          null,
          "对 " + toDisplayString(__props.problem.hosts[0]?.name || __props.problem.eventid) + " 执行脚本",
          1
          /* TEXT */
        ),
        loading.value ? (openBlock(), createElementBlock("p", _hoisted_2$D, " 正在加载 script.get… ")) : loadError.value ? (openBlock(), createElementBlock(
          "p",
          _hoisted_3$w,
          toDisplayString(loadError.value),
          1
          /* TEXT */
        )) : (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            createElementVNode("label", null, [
              _cache[3] || (_cache[3] = createTextVNode(
                " 脚本 ",
                -1
                /* CACHED */
              )),
              withDirectives(createElementVNode(
                "select",
                {
                  "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => selectedId.value = $event),
                  "data-testid": "script-modal-select",
                  "aria-label": "选择脚本"
                },
                [
                  _cache[2] || (_cache[2] = createElementVNode(
                    "option",
                    { value: "" },
                    "请选择脚本",
                    -1
                    /* CACHED */
                  )),
                  (openBlock(true), createElementBlock(
                    Fragment,
                    null,
                    renderList(scripts.value, (s) => {
                      return openBlock(), createElementBlock("option", {
                        key: s.scriptid,
                        value: s.scriptid
                      }, toDisplayString(s.name) + " (" + toDisplayString(s.scriptid) + ") ", 9, _hoisted_4$o);
                    }),
                    128
                    /* KEYED_FRAGMENT */
                  ))
                ],
                512
                /* NEED_PATCH */
              ), [
                [vModelSelect, selectedId.value]
              ])
            ]),
            !scripts.value.length ? (openBlock(), createElementBlock("p", _hoisted_5$j, " 无可用脚本 ")) : createCommentVNode("v-if", true),
            selected.value ? (openBlock(), createElementBlock("dl", _hoisted_6$g, [
              createElementVNode("div", null, [
                _cache[4] || (_cache[4] = createElementVNode(
                  "dt",
                  null,
                  "确认",
                  -1
                  /* CACHED */
                )),
                createElementVNode(
                  "dd",
                  null,
                  toDisplayString(selected.value.confirmation || "—"),
                  1
                  /* TEXT */
                )
              ]),
              createElementVNode("div", null, [
                _cache[5] || (_cache[5] = createElementVNode(
                  "dt",
                  null,
                  "范围",
                  -1
                  /* CACHED */
                )),
                createElementVNode(
                  "dd",
                  null,
                  toDisplayString(selected.value.scope || "—"),
                  1
                  /* TEXT */
                )
              ]),
              createElementVNode("div", null, [
                _cache[6] || (_cache[6] = createElementVNode(
                  "dt",
                  null,
                  "访问",
                  -1
                  /* CACHED */
                )),
                createElementVNode(
                  "dd",
                  null,
                  toDisplayString(selected.value.host_access || "—"),
                  1
                  /* TEXT */
                )
              ]),
              selected.value.description ? (openBlock(), createElementBlock("div", _hoisted_7$d, [
                _cache[7] || (_cache[7] = createElementVNode(
                  "dt",
                  null,
                  "说明",
                  -1
                  /* CACHED */
                )),
                createElementVNode(
                  "dd",
                  null,
                  toDisplayString(selected.value.description),
                  1
                  /* TEXT */
                )
              ])) : createCommentVNode("v-if", true)
            ])) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        )),
        createElementVNode("div", _hoisted_8$7, [
          createElementVNode("button", {
            type: "button",
            "data-testid": "script-modal-ok",
            disabled: !selectedId.value,
            onClick: onConfirm
          }, " 执行 ", 8, _hoisted_9$6),
          createElementVNode("button", {
            type: "button",
            "data-testid": "script-modal-cancel",
            onClick: _cache[1] || (_cache[1] = ($event) => emit("cancel"))
          }, " 取消 ")
        ])
      ])) : createCommentVNode("v-if", true);
    };
  }
});
const ExecuteScriptModal = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["__scopeId", "data-v-7e46303a"]]);
const _hoisted_1$P = { class: "toolbar" };
const _hoisted_2$C = {
  key: 0,
  class: "error",
  role: "alert"
};
const _hoisted_3$v = {
  key: 1,
  class: "ok",
  role: "status"
};
const _hoisted_4$n = {
  key: 2,
  class: "empty",
  "data-testid": "problems-empty"
};
const _hoisted_5$i = {
  key: 5,
  class: "pager"
};
const _hoisted_6$f = ["disabled"];
const _hoisted_7$c = ["disabled"];
const _sfc_main$S = /* @__PURE__ */ defineComponent({
  __name: "ProblemsPanel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const options = computed(
      () => migrateProblemsPanelOptions(props.options || {})
    );
    const model = computed(
      () => problemsFromPanelData(props.data, options.value)
    );
    const problems = computed(() => model.value.problems);
    const notices = computed(() => model.value.notices);
    const page = ref(0);
    const selected = ref(null);
    const message = ref("");
    const actionError = ref("");
    const actionOk = ref("");
    const ackOpen = ref(false);
    const ackMode = ref("acknowledge");
    const ackTarget = ref(null);
    const scriptOpen = ref(false);
    const scriptTarget = ref(null);
    const pageSize = computed(() => options.value.pageSize || 10);
    const pageItems = computed(() => {
      const start = page.value * pageSize.value;
      return problems.value.slice(start, start + pageSize.value);
    });
    function dsEnableWrites(uid) {
      const ds2 = getRuntimeDataSource(uid);
      return Boolean(ds2?.enableWrites);
    }
    async function reread(eventid, uid) {
      const ds2 = getRuntimeDataSource(uid);
      if (!ds2?.getMetadata) return;
      await ds2.getMetadata({ type: "problemDetail", eventid });
    }
    function openAck(p, mode2) {
      ackTarget.value = p;
      ackMode.value = mode2;
      ackOpen.value = true;
    }
    function openScript(p) {
      if (!options.value.allowExecuteScripts) return;
      scriptTarget.value = p;
      scriptOpen.value = true;
    }
    async function execute(p, action, opts = {}) {
      actionError.value = "";
      actionOk.value = "";
      const res = await runProblemAction(p, action, {
        message: opts.message ?? message.value,
        severity: opts.severity,
        suppressUntil: opts.suppressUntil,
        scriptid: opts.scriptid,
        gate: {
          panel: options.value,
          datasourceEnableWrites: dsEnableWrites(p.datasourceUid),
          liveWritesEnv: typeof process !== "undefined" ? process.env.ZABBIX_LIVE_WRITES : void 0,
          userCanWrite: true,
          eventManualClose: p.manual_close === "1" || p.manual_close === true,
          hasScript: Boolean(opts.scriptid),
          scriptid: opts.scriptid
        },
        reread: (eventid) => reread(eventid, p.datasourceUid)
      });
      if (res.status !== "success")
        actionError.value = res.message || res.reason || "动作失败";
      else actionOk.value = res.message || "已提交";
    }
    async function onAckConfirm(payload) {
      const p = ackTarget.value;
      ackOpen.value = false;
      if (!p) return;
      await execute(
        p,
        ackMode.value === "message" ? "message" : ackMode.value,
        payload
      );
      ackTarget.value = null;
    }
    async function onScriptConfirm(scriptid) {
      const p = scriptTarget.value;
      scriptOpen.value = false;
      if (!p) return;
      await execute(p, "executeScript", { scriptid });
      scriptTarget.value = null;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: "zbx-problems",
          "data-testid": "zabbix-problems-panel",
          style: normalizeStyle({
            width: __props.width + "px",
            height: __props.height + "px",
            fontSize: options.value.fontSize
          })
        },
        [
          createElementVNode("div", _hoisted_1$P, [
            createElementVNode(
              "span",
              null,
              "问题 " + toDisplayString(problems.value.length),
              1
              /* TEXT */
            ),
            withDirectives(createElementVNode(
              "input",
              {
                "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => message.value = $event),
                placeholder: "动作备注",
                "data-testid": "ack-message",
                "aria-label": "动作备注"
              },
              null,
              512
              /* NEED_PATCH */
            ), [
              [vModelText, message.value]
            ])
          ]),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(notices.value, (n) => {
              return openBlock(), createElementBlock(
                "div",
                {
                  key: n,
                  class: "notice",
                  role: "status"
                },
                toDisplayString(n),
                1
                /* TEXT */
              );
            }),
            128
            /* KEYED_FRAGMENT */
          )),
          actionError.value ? (openBlock(), createElementBlock(
            "div",
            _hoisted_2$C,
            toDisplayString(actionError.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          actionOk.value ? (openBlock(), createElementBlock(
            "div",
            _hoisted_3$v,
            toDisplayString(actionOk.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          !problems.value.length ? (openBlock(), createElementBlock("div", _hoisted_4$n, " 当前筛选条件下没有 Zabbix 问题 ")) : options.value.layout === "table" ? (openBlock(), createBlock(ProblemsTable, {
            key: 3,
            items: problems.value,
            options: options.value,
            onSelect: _cache[1] || (_cache[1] = ($event) => selected.value = $event),
            onAcknowledge: _cache[2] || (_cache[2] = ($event) => openAck($event, "acknowledge")),
            onUnacknowledge: _cache[3] || (_cache[3] = ($event) => openAck($event, "unacknowledge")),
            onClose: _cache[4] || (_cache[4] = ($event) => openAck($event, "close")),
            onSeverity: _cache[5] || (_cache[5] = ($event) => openAck($event, "changeSeverity")),
            onSuppress: _cache[6] || (_cache[6] = ($event) => openAck($event, "suppress")),
            onUnsuppress: _cache[7] || (_cache[7] = ($event) => openAck($event, "unsuppress")),
            onScript: openScript,
            "onUpdate:options": _cache[8] || (_cache[8] = (o) => props.onOptionsChange?.(o))
          }, null, 8, ["items", "options"])) : (openBlock(), createBlock(ProblemsList, {
            key: 4,
            items: pageItems.value,
            options: options.value,
            onSelect: _cache[9] || (_cache[9] = ($event) => selected.value = $event)
          }, null, 8, ["items", "options"])),
          options.value.layout === "list" && problems.value.length > pageSize.value ? (openBlock(), createElementBlock("div", _hoisted_5$i, [
            createElementVNode("button", {
              type: "button",
              disabled: page.value === 0,
              "data-testid": "problems-prev",
              onClick: _cache[10] || (_cache[10] = ($event) => page.value--)
            }, " 上一页 ", 8, _hoisted_6$f),
            createElementVNode(
              "span",
              null,
              toDisplayString(page.value + 1) + " / " + toDisplayString(Math.max(1, Math.ceil(problems.value.length / pageSize.value))),
              1
              /* TEXT */
            ),
            createElementVNode("button", {
              type: "button",
              disabled: (page.value + 1) * pageSize.value >= problems.value.length,
              "data-testid": "problems-next",
              onClick: _cache[11] || (_cache[11] = ($event) => page.value++)
            }, " 下一页 ", 8, _hoisted_7$c)
          ])) : createCommentVNode("v-if", true),
          selected.value && options.value.showDetails ? (openBlock(), createBlock(ProblemDetails, {
            key: 6,
            problem: selected.value,
            options: options.value,
            onClose: _cache[12] || (_cache[12] = ($event) => selected.value = null)
          }, null, 8, ["problem", "options"])) : createCommentVNode("v-if", true),
          createVNode(AcknowledgeModal, {
            problem: ackTarget.value,
            open: ackOpen.value,
            mode: ackMode.value,
            onConfirm: onAckConfirm,
            onCancel: _cache[13] || (_cache[13] = ($event) => {
              ackOpen.value = false;
              ackTarget.value = null;
            })
          }, null, 8, ["problem", "open", "mode"]),
          createVNode(ExecuteScriptModal, {
            problem: scriptTarget.value,
            open: scriptOpen.value,
            onConfirm: onScriptConfirm,
            onCancel: _cache[14] || (_cache[14] = ($event) => {
              scriptOpen.value = false;
              scriptTarget.value = null;
            })
          }, null, 8, ["problem", "open"])
        ],
        4
        /* STYLE */
      );
    };
  }
});
const ProblemsPanel = /* @__PURE__ */ _export_sfc(_sfc_main$S, [["__scopeId", "data-v-a4b2e9d4"]]);
const _hoisted_1$O = {
  class: "sev-editor",
  "data-testid": "severity-color-editor"
};
const _hoisted_2$B = ["data-testid"];
const _hoisted_3$u = { class: "name" };
const _sfc_main$R = /* @__PURE__ */ defineComponent({
  __name: "SeverityColorEditor",
  props: {
    value: {},
    context: {}
  },
  emits: ["update:value"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function list() {
      const v = props.value?.length ? props.value : DEFAULT_SEVERITY;
      return v.map((s) => ({ ...s }));
    }
    function patch(i, partial) {
      const next = list().map((s, idx) => idx === i ? { ...s, ...partial } : s);
      emit("update:value", next);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$O, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(list(), (s, i) => {
            return openBlock(), createElementBlock("div", {
              key: s.priority,
              class: "row",
              "data-testid": `severity-row-${s.priority}`
            }, [
              createElementVNode(
                "span",
                _hoisted_3$u,
                toDisplayString(s.severity),
                1
                /* TEXT */
              ),
              createVNode(unref(GInput), {
                "model-value": s.color,
                "test-id": `severity-color-${s.priority}`,
                "aria-label": "严重性颜色",
                "onUpdate:modelValue": ($event) => patch(i, { color: String($event) })
              }, null, 8, ["model-value", "test-id", "onUpdate:modelValue"]),
              createElementVNode(
                "span",
                {
                  class: "swatch",
                  style: normalizeStyle({ background: s.color }),
                  "aria-hidden": "true"
                },
                null,
                4
                /* STYLE */
              ),
              createVNode(unref(_sfc_main$4v), {
                checked: s.show !== false,
                "test-id": `severity-show-${s.priority}`,
                "onUpdate:checked": ($event) => patch(i, { show: $event })
              }, null, 8, ["checked", "test-id", "onUpdate:checked"])
            ], 8, _hoisted_2$B);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const SeverityColorEditor = /* @__PURE__ */ _export_sfc(_sfc_main$R, [["__scopeId", "data-v-3ad6848a"]]);
const _hoisted_1$N = {
  class: "reset-cols",
  "data-testid": "reset-columns-editor"
};
const _hoisted_2$A = {
  key: 0,
  class: "hint"
};
const _sfc_main$Q = /* @__PURE__ */ defineComponent({
  __name: "ResetColumnsEditor",
  props: {
    value: {}
  },
  emits: ["update:value"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$N, [
        createVNode(unref(GButton), {
          size: "sm",
          variant: "secondary",
          "test-id": "reset-columns-btn",
          onClick: _cache[0] || (_cache[0] = ($event) => emit("update:value", []))
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              " 重置列宽 ",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        }),
        (__props.value || []).length ? (openBlock(), createElementBlock(
          "span",
          _hoisted_2$A,
          "已自定义 " + toDisplayString(__props.value.length) + " 列",
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const ResetColumnsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$Q, [["__scopeId", "data-v-1745230d"]]);
const FONT_SIZES = [
  "80%",
  "90%",
  "100%",
  "110%",
  "120%",
  "130%",
  "150%",
  "160%",
  "180%",
  "200%",
  "220%",
  "250%"
];
const plugin$3 = new VuePanelPlugin(
  {
    id: "alexanderzobnin-zabbix-triggers-panel",
    name: "Zabbix Problems",
    state: "stable"
  },
  ProblemsPanel
).setPanelOptions((builder) => {
  builder.addRadio(
    {
      id: "layout",
      path: "layout",
      name: "布局",
      category: ["显示"],
      editor: "radio",
      settings: {
        options: [
          { label: "表格", value: "table" },
          { label: "列表", value: "list" }
        ]
      }
    },
    "table"
  ).addRadio(
    {
      id: "sortProblems",
      path: "sortProblems",
      name: "排序",
      category: ["显示"],
      editor: "radio",
      settings: {
        options: [
          { label: "默认", value: "default" },
          { label: "最后变更", value: "lastchange" },
          { label: "严重性", value: "priority" }
        ]
      }
    },
    "lastchange"
  ).addSelect(
    {
      id: "fontSize",
      path: "fontSize",
      name: "字号",
      category: ["显示"],
      editor: "select",
      settings: {
        options: FONT_SIZES.map((v) => ({ label: v, value: v }))
      }
    },
    "100%"
  ).addSelect(
    {
      id: "pageSize",
      path: "pageSize",
      name: "每页条数",
      category: ["显示"],
      editor: "select",
      settings: {
        options: [5, 10, 20, 25, 50, 100].map((n) => ({
          label: String(n),
          value: n
        }))
      }
    },
    10
  ).addBoolean(
    {
      id: "problemTimeline",
      path: "problemTimeline",
      name: "问题时间线",
      category: ["显示"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "highlightBackground",
      path: "highlightBackground",
      name: "高亮背景",
      category: ["显示"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "highlightNewEvents",
      path: "highlightNewEvents",
      name: "高亮新事件",
      category: ["显示"],
      editor: "boolean"
    },
    false
  ).addText(
    {
      id: "highlightNewerThan",
      path: "highlightNewerThan",
      name: "新事件阈值",
      category: ["显示"],
      editor: "text"
    },
    "1h"
  ).addBoolean(
    {
      id: "customLastChangeFormat",
      path: "customLastChangeFormat",
      name: "自定义时间格式",
      category: ["显示"],
      editor: "boolean"
    },
    false
  ).addText(
    {
      id: "lastChangeFormat",
      path: "lastChangeFormat",
      name: "时间格式",
      category: ["显示"],
      editor: "text"
    },
    ""
  ).addBoolean(
    {
      id: "markAckEvents",
      path: "markAckEvents",
      name: "标记已确认事件",
      category: ["显示"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "hostField",
      path: "hostField",
      name: "主机",
      category: ["字段"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "hostTechNameField",
      path: "hostTechNameField",
      name: "主机技术名",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "hostGroups",
      path: "hostGroups",
      name: "主机组",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "hostProxy",
      path: "hostProxy",
      name: "代理",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showTags",
      path: "showTags",
      name: "标签",
      category: ["字段"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "statusField",
      path: "statusField",
      name: "状态",
      category: ["字段"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "statusIcon",
      path: "statusIcon",
      name: "状态图标",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "severityField",
      path: "severityField",
      name: "严重性",
      category: ["字段"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "ackField",
      path: "ackField",
      name: "确认",
      category: ["字段"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "ageField",
      path: "ageField",
      name: "年龄",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "opdataField",
      path: "opdataField",
      name: "运行数据",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "descriptionField",
      path: "descriptionField",
      name: "描述",
      category: ["字段"],
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "descriptionAtNewLine",
      path: "descriptionAtNewLine",
      name: "描述换行",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showDatasourceName",
      path: "showDatasourceName",
      name: "数据源名",
      category: ["字段"],
      editor: "boolean"
    },
    false
  ).addText(
    {
      id: "customTagColumns",
      path: "customTagColumns",
      name: "标签列",
      category: ["字段"],
      editor: "text"
    },
    ""
  ).addCustomEditor(
    {
      id: "triggerSeverity",
      path: "triggerSeverity",
      name: "严重性颜色",
      category: ["严重级别"],
      editor: "custom",
      customEditor: SeverityColorEditor
    },
    DEFAULT_SEVERITY.map((s) => ({ ...s }))
  ).addCustomEditor(
    {
      id: "resizedColumns",
      path: "resizedColumns",
      name: "列宽",
      category: ["显示"],
      editor: "custom",
      customEditor: ResetColumnsEditor
    },
    []
  ).addBoolean(
    {
      id: "allowDangerousHTML",
      path: "allowDangerousHTML",
      name: "允许危险 HTML",
      category: ["安全"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowAcknowledge",
      path: "allowAcknowledge",
      name: "允许确认",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowUnacknowledge",
      path: "allowUnacknowledge",
      name: "允许取消确认",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowClose",
      path: "allowClose",
      name: "允许关闭",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowChangeSeverity",
      path: "allowChangeSeverity",
      name: "允许改严重级别",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowSuppress",
      path: "allowSuppress",
      name: "允许抑制",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowUnsuppress",
      path: "allowUnsuppress",
      name: "允许取消抑制",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "allowExecuteScripts",
      path: "allowExecuteScripts",
      name: "允许执行脚本",
      category: ["动作"],
      editor: "boolean"
    },
    false
  ).addBoolean(
    {
      id: "showDetails",
      path: "showDetails",
      name: "显示详情",
      category: ["布局"],
      editor: "boolean"
    },
    true
  ).addColor(
    {
      id: "okEventColor",
      path: "okEventColor",
      name: "OK 颜色",
      category: ["严重级别"],
      editor: "color"
    },
    "rgb(56, 189, 113)"
  ).addColor(
    {
      id: "ackEventColor",
      path: "ackEventColor",
      name: "确认颜色",
      category: ["严重级别"],
      editor: "color"
    },
    "rgb(56, 219, 156)"
  );
}).setPanelMigrationHandler(migrateProblemsPanel).setMigrationHandler((options) => ({
  options: migrateProblemsPanelOptions({
    ...DEFAULT_PROBLEMS_OPTIONS,
    ...options
  })
})).setRuntimeConsumedPaths(Object.keys(DEFAULT_PROBLEMS_OPTIONS)).register();
const module$4 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: plugin$3
}, Symbol.toStringTag, { value: "Module" }));
const DESCENDANTS = {
  group: ["host", "application", "item", "trigger", "macro"],
  host: ["application", "item", "trigger", "macro"],
  application: ["item"],
  item: [],
  trigger: [],
  macro: [],
  proxy: []
};
function canRunWithoutParentScope(owner, parents) {
  if (parents.scope === "all") return true;
  if (owner === "group" || owner === "proxy") return true;
  if (owner === "host") return (parents.groupIds?.length ?? 0) > 0;
  if (owner === "application" || owner === "item" || owner === "trigger" || owner === "macro") {
    return (parents.hostIds?.length ?? 0) > 0 || (parents.groupIds?.length ?? 0) > 0;
  }
  return true;
}
class ZabbixMetadataScheduler {
  maxConcurrent;
  running = 0;
  queue = [];
  active = /* @__PURE__ */ new Map();
  revisions = /* @__PURE__ */ new Map();
  inflightByKey = /* @__PURE__ */ new Map();
  constructor(opts) {
    this.maxConcurrent = Math.max(1, opts?.maxConcurrent ?? 4);
  }
  getRevision(owner) {
    return this.revisions.get(owner) ?? 0;
  }
  /**
   * Bump revision for owner and abort owner + descendants.
   * Returns the new revision.
   */
  invalidateFrom(owner, revision) {
    const next = revision ?? this.getRevision(owner) + 1;
    this.revisions.set(owner, next);
    const victims = /* @__PURE__ */ new Set([owner, ...DESCENDANTS[owner]]);
    for (const o of victims) {
      if (o !== owner) this.revisions.set(o, next);
    }
    for (const [key, active] of this.active) {
      if (victims.has(active.owner)) {
        active.controller.abort();
        this.active.delete(key);
      }
    }
    for (let i = this.queue.length - 1; i >= 0; i--) {
      if (victims.has(this.queue[i].request.owner)) {
        const t2 = this.queue.splice(i, 1)[0];
        t2.controller.abort();
        t2.resolve(void 0);
      }
    }
    for (const [key, _p] of this.inflightByKey) {
      const ownerKey = key.split(":")[0];
      if (victims.has(ownerKey)) this.inflightByKey.delete(key);
    }
    return next;
  }
  cancel(owner) {
    if (!owner) {
      for (const active of this.active.values()) active.controller.abort();
      this.active.clear();
      for (const t2 of this.queue) {
        t2.controller.abort();
        t2.resolve(void 0);
      }
      this.queue.length = 0;
      this.inflightByKey.clear();
      return;
    }
    this.invalidateFrom(owner);
  }
  async request(request, loader) {
    if (!canRunWithoutParentScope(request.owner, request.parents)) {
      return void 0;
    }
    const latest = this.getRevision(request.owner);
    if (request.revision < latest) {
      return void 0;
    }
    const inflightKey = `${request.owner}:${request.key}:r${request.revision}`;
    const existing = this.inflightByKey.get(inflightKey);
    if (existing) return existing;
    const promise = new Promise((resolve, reject) => {
      const controller = new AbortController();
      const task = {
        request,
        loader,
        resolve,
        reject,
        controller
      };
      if (request.priority === "interactive") {
        this.queue.unshift(task);
      } else {
        this.queue.push(task);
      }
      this.pump();
    });
    this.inflightByKey.set(inflightKey, promise);
    promise.finally(() => {
      if (this.inflightByKey.get(inflightKey) === promise) {
        this.inflightByKey.delete(inflightKey);
      }
    });
    return promise;
  }
  pump() {
    while (this.running < this.maxConcurrent && this.queue.length > 0) {
      const task = this.queue.shift();
      const latest = this.getRevision(task.request.owner);
      if (task.request.revision < latest) {
        task.resolve(void 0);
        continue;
      }
      this.running += 1;
      const key = `${task.request.owner}:${task.request.key}`;
      this.active.set(key, {
        controller: task.controller,
        revision: task.request.revision,
        owner: task.request.owner
      });
      void (async () => {
        try {
          if (task.controller.signal.aborted) {
            task.resolve(void 0);
            return;
          }
          const value = await task.loader(task.controller.signal);
          const stillLatest = this.getRevision(task.request.owner);
          if (task.request.revision < stillLatest || task.controller.signal.aborted) {
            task.resolve(void 0);
            return;
          }
          task.resolve(value);
        } catch (e) {
          if (e?.name === "AbortError") {
            task.resolve(void 0);
          } else {
            task.reject(e);
          }
        } finally {
          this.active.delete(key);
          this.running -= 1;
          this.pump();
        }
      })();
    }
  }
}
const byUid = /* @__PURE__ */ new Map();
function getZabbixMetadataScheduler(uid, opts) {
  const key = String(uid || "__default__");
  let s = byUid.get(key);
  if (!s) {
    s = new ZabbixMetadataScheduler(opts);
    byUid.set(key, s);
  }
  return s;
}
function useZabbixMetadata(load, opts = {}) {
  const options = ref([]);
  const loading = ref(false);
  const error = ref("");
  const stale = ref(false);
  let sequence = 0;
  let controller = null;
  let debounceTimer = null;
  const debounceMs = opts.debounceMs ?? 0;
  let localRevision = 0;
  async function runLoad(priority = "refresh") {
    if (opts.canLoad && !opts.canLoad()) {
      options.value = [];
      loading.value = false;
      error.value = "";
      return;
    }
    const current = ++sequence;
    loading.value = true;
    error.value = "";
    stale.value = false;
    try {
      let rows;
      if (opts.scheduler && opts.owner) {
        localRevision += 1;
        const revision = localRevision;
        const result = await opts.scheduler.request(
          {
            owner: opts.owner,
            revision,
            parents: opts.parents?.() ?? {},
            key: opts.requestKey?.() ?? `${opts.owner}:${revision}`,
            priority: opts.priority ?? priority
          },
          (signal) => load(signal)
        );
        if (current !== sequence) return;
        if (result === void 0) {
          if (opts.canLoad && !opts.canLoad()) options.value = [];
          stale.value = true;
          return;
        }
        rows = result;
      } else {
        controller?.abort();
        controller = new AbortController();
        rows = await load(controller.signal);
      }
      if (current === sequence) {
        options.value = Array.isArray(rows) ? rows : [];
      }
    } catch (cause) {
      if (current === sequence) {
        const err = cause;
        if (err?.name !== "AbortError") {
          error.value = err instanceof Error ? err.message : String(cause);
        }
      }
    } finally {
      if (current === sequence) loading.value = false;
    }
  }
  function refresh(meta2) {
    if (meta2?.revision != null) localRevision = Math.max(localRevision, meta2.revision);
    const priority = meta2?.priority ?? "refresh";
    if (debounceMs > 0) {
      if (debounceTimer) clearTimeout(debounceTimer);
      debounceTimer = setTimeout(() => {
        debounceTimer = null;
        void runLoad(priority);
      }, debounceMs);
      return;
    }
    void runLoad(priority);
  }
  function retry() {
    if (debounceTimer) {
      clearTimeout(debounceTimer);
      debounceTimer = null;
    }
    void runLoad("interactive");
  }
  function cancel() {
    if (debounceTimer) {
      clearTimeout(debounceTimer);
      debounceTimer = null;
    }
    controller?.abort();
    if (opts.scheduler && opts.owner) opts.scheduler.cancel(opts.owner);
  }
  onBeforeUnmount(() => {
    cancel();
  });
  return {
    options,
    loading,
    error,
    stale,
    refresh,
    retry,
    cancel,
    /** @internal test */
    getController: () => controller
  };
}
function resolveZabbixMetadataApi(datasourceUid, fallback) {
  const uid = String(datasourceUid || "").trim();
  if (uid) {
    const registered2 = getRuntimeDataSource(uid);
    if (registered2 && typeof registered2.getMetadata === "function") {
      return registered2;
    }
  }
  if (fallback && typeof fallback.getMetadata === "function") return fallback;
  return null;
}
function isFreeformFilter(value) {
  const v = value.trim();
  if (!v) return false;
  if (v.startsWith("/") && v.lastIndexOf("/") > 0) return true;
  if (v.startsWith("$") || v.includes("${") || v.startsWith("[[") && v.endsWith("]]"))
    return true;
  return false;
}
function optionToFilter(opt) {
  const text = String(opt.text ?? opt.value ?? "");
  const id = opt.id != null ? String(opt.id) : void 0;
  return id ? { filter: text, name: text, ids: [id] } : { filter: text, name: text, ids: [] };
}
function freeformToFilter(raw) {
  return { filter: raw };
}
const RAW = [
  {
    name: "groupBy",
    category: "Transform",
    params: [
      { name: "interval", type: "string" },
      {
        name: "function",
        type: "string",
        options: [
          "avg",
          "min",
          "max",
          "sum",
          "count",
          "median",
          "first",
          "last"
        ]
      }
    ],
    defaultParams: ["1m", "avg"]
  },
  {
    name: "scale",
    category: "Transform",
    params: [{ name: "factor", type: "float", options: [100, 0.01, 10, -1] }],
    defaultParams: [100]
  },
  {
    name: "offset",
    category: "Transform",
    params: [{ name: "delta", type: "float", options: [-100, 100] }],
    defaultParams: [100]
  },
  { name: "delta", category: "Transform", params: [], defaultParams: [] },
  { name: "rate", category: "Transform", params: [], defaultParams: [] },
  {
    name: "movingAverage",
    category: "Transform",
    params: [{ name: "factor", type: "int", options: [6, 10, 60, 100, 600] }],
    defaultParams: [10]
  },
  {
    name: "exponentialMovingAverage",
    category: "Transform",
    params: [
      { name: "smoothing", type: "float", options: [6, 10, 60, 100, 600] }
    ],
    defaultParams: [0.2]
  },
  {
    name: "percentile",
    category: "Transform",
    params: [
      { name: "interval", type: "string" },
      {
        name: "percent",
        type: "float",
        options: [25, 50, 75, 90, 95, 99, 99.9]
      }
    ],
    defaultParams: ["1m", 95]
  },
  {
    name: "removeAboveValue",
    category: "Transform",
    params: [{ name: "number", type: "float" }],
    defaultParams: [0]
  },
  {
    name: "removeBelowValue",
    category: "Transform",
    params: [{ name: "number", type: "float" }],
    defaultParams: [0]
  },
  {
    name: "transformNull",
    category: "Transform",
    params: [{ name: "number", type: "float" }],
    defaultParams: [0]
  },
  {
    name: "aggregateBy",
    category: "Aggregate",
    params: [
      { name: "interval", type: "string" },
      {
        name: "function",
        type: "string",
        options: [
          "avg",
          "min",
          "max",
          "sum",
          "count",
          "median",
          "first",
          "last"
        ]
      }
    ],
    defaultParams: ["1m", "avg"]
  },
  { name: "sumSeries", category: "Aggregate", params: [], defaultParams: [] },
  {
    name: "percentileAgg",
    category: "Aggregate",
    params: [
      { name: "interval", type: "string" },
      {
        name: "percent",
        type: "float",
        options: [25, 50, 75, 90, 95, 99, 99.9]
      }
    ],
    defaultParams: ["1m", 95]
  },
  {
    name: "top",
    category: "Filter",
    params: [
      { name: "number", type: "int" },
      {
        name: "value",
        type: "string",
        options: [
          "avg",
          "min",
          "max",
          "sum",
          "count",
          "median",
          "first",
          "last"
        ]
      }
    ],
    defaultParams: [5, "avg"]
  },
  {
    name: "bottom",
    category: "Filter",
    params: [
      { name: "number", type: "int" },
      {
        name: "value",
        type: "string",
        options: [
          "avg",
          "min",
          "max",
          "sum",
          "count",
          "median",
          "first",
          "last"
        ]
      }
    ],
    defaultParams: [5, "avg"]
  },
  {
    name: "sortSeries",
    category: "Filter",
    params: [{ name: "direction", type: "string", options: ["asc", "desc"] }],
    defaultParams: ["asc"]
  },
  {
    name: "trendValue",
    category: "Trends",
    params: [
      {
        name: "type",
        type: "string",
        options: ["avg", "min", "max", "sum", "count"]
      }
    ],
    defaultParams: ["avg"]
  },
  {
    name: "timeShift",
    category: "Time",
    params: [
      {
        name: "interval",
        type: "string",
        options: ["24h", "7d", "1M", "+24h", "-24h"]
      }
    ],
    defaultParams: ["24h"]
  },
  {
    name: "setAlias",
    category: "Alias",
    params: [{ name: "alias", type: "string" }],
    defaultParams: []
  },
  {
    name: "setAliasByRegex",
    category: "Alias",
    params: [{ name: "aliasByRegex", type: "string" }],
    defaultParams: []
  },
  {
    name: "replaceAlias",
    category: "Alias",
    params: [
      { name: "regexp", type: "string" },
      { name: "newAlias", type: "string" }
    ],
    defaultParams: ["/(.*)/", "$1"]
  },
  {
    name: "consolidateBy",
    category: "Special",
    params: [
      {
        name: "type",
        type: "string",
        options: ["avg", "min", "max", "sum", "count"]
      }
    ],
    defaultParams: ["avg"]
  }
];
const CATEGORY_ORDER = [
  "Transform",
  "Aggregate",
  "Filter",
  "Trends",
  "Time",
  "Alias",
  "Special"
];
function sortDefs(defs) {
  return [...defs].sort((a, b) => {
    const ca = CATEGORY_ORDER.indexOf(a.category);
    const cb = CATEGORY_ORDER.indexOf(b.category);
    if (ca !== cb) return ca - cb;
    return a.name.localeCompare(b.name);
  });
}
const FUNCTION_DEFINITIONS = sortDefs(RAW);
FUNCTION_DEFINITIONS.map((d) => ({
  name: d.name,
  category: d.category,
  params: d.params.map((p) => ({
    name: p.name,
    type: p.type === "string" ? "string" : p.type === "int" || p.type === "float" ? "number" : "string",
    options: p.options?.map(String),
    defaultValue: d.defaultParams[d.params.indexOf(p)]
  })),
  description: d.name
}));
function getFunctionDef(name) {
  return FUNCTION_DEFINITIONS.find((d) => d.name === name);
}
function createFunctionInstance(name) {
  const def = getFunctionDef(name);
  const params = def ? [...def.defaultParams] : [];
  return {
    name,
    params,
    text: formatFunctionText(name, params),
    added: true
  };
}
function formatFunctionText(name, params) {
  if (!params.length) return `${name}()`;
  return `${name}(${params.map(String).join(", ")})`;
}
const ALIAS_FUNCTIONS = /* @__PURE__ */ new Set([
  "setAlias",
  "setAliasByRegex",
  "replaceAlias"
]);
function isAliasFunction(name) {
  const def = getFunctionDef(name);
  return def?.category === "Alias" || ALIAS_FUNCTIONS.has(name);
}
function moveAliasFuncLast(fns) {
  const nonAlias = [];
  const alias = [];
  for (const f of fns || []) {
    if (isAliasFunction(f.name)) alias.push(f);
    else nonAlias.push(f);
  }
  return [...nonAlias, ...alias];
}
const _hoisted_1$M = {
  class: "zbx-fn",
  "data-testid": "zabbix-functions"
};
const _hoisted_2$z = { class: "row add-row" };
const _hoisted_3$t = ["data-testid"];
const _hoisted_4$m = { class: "fn-main" };
const _hoisted_5$h = ["title"];
const _hoisted_6$e = {
  class: "fn-toolbar",
  "data-testid": "fn-toolbar"
};
const _sfc_main$P = /* @__PURE__ */ defineComponent({
  __name: "FunctionEditor",
  props: {
    modelValue: { default: void 0 },
    functions: { default: void 0 }
  },
  emits: ["update:modelValue", "update:functions"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const list = computed(() => props.functions ?? props.modelValue ?? []);
    function commit(next) {
      const ordered = moveAliasFuncLast(next);
      emit("update:modelValue", ordered);
      emit("update:functions", ordered);
    }
    const addOptions = computed(() => {
      const groups = /* @__PURE__ */ new Map();
      for (const d of FUNCTION_DEFINITIONS) {
        const arr = groups.get(d.category) || [];
        arr.push({ label: d.name, value: d.name });
        groups.set(d.category, arr);
      }
      return [...groups.entries()].map(([label, options]) => ({ label, options }));
    });
    function add(name) {
      const n = String(name || "");
      if (!n) return;
      const inst = createFunctionInstance(n);
      commit([...list.value, inst]);
    }
    function remove(idx) {
      commit(list.value.filter((_, i) => i !== idx));
    }
    function move(idx, dir) {
      const next = [...list.value];
      const j = idx + dir;
      if (j < 0 || j >= next.length) return;
      const a = next[idx];
      const b = next[j];
      if (isAliasFunction(a.name) !== isAliasFunction(b.name)) return;
      const tmp = next[idx];
      next[idx] = next[j];
      next[j] = tmp;
      commit(next);
    }
    function setParam(idx, pidx, value) {
      const next = list.value.map((f, i) => {
        if (i !== idx) return f;
        const def = getFunctionDef(f.name);
        const params = [...f.params || []];
        while (params.length <= pidx) params.push("");
        const pdef = def?.params[pidx];
        let v = value;
        if (pdef?.type === "int") v = Number.parseInt(String(value), 10);
        else if (pdef?.type === "float") v = Number(value);
        params[pidx] = v;
        const cleaned = def && def.defaultParams.length === 0 && params.every((p) => p === "" || p == null) ? [] : params;
        return { ...f, params: cleaned, text: formatFunctionText(f.name, cleaned) };
      });
      commit(next);
    }
    function paramValue(fn, pidx) {
      const v = fn.params?.[pidx];
      return v == null ? "" : String(v);
    }
    function unknownDef(name) {
      return !getFunctionDef(name);
    }
    __expose({ add, remove, move, setParam, moveAliasFuncLast });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$M, [
        _cache[4] || (_cache[4] = createElementVNode(
          "span",
          {
            hidden: "",
            "data-testid": "zabbix-function-editor"
          },
          null,
          -1
          /* CACHED */
        )),
        createElementVNode("div", _hoisted_2$z, [
          createVNode(unref(GSelect), {
            options: addOptions.value,
            placeholder: "添加函数",
            "test-id": "zabbix-function-add",
            "onUpdate:value": add
          }, null, 8, ["options"])
        ]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(list.value, (fn, idx) => {
            return openBlock(), createElementBlock("div", {
              key: `${fn.name}-${idx}`,
              class: normalizeClass(["fn-row", {
                "fn-row--unknown": unknownDef(fn.name),
                "fn-row--alias": unref(isAliasFunction)(fn.name)
              }]),
              "data-testid": `fn-${fn.name}`
            }, [
              createElementVNode("div", _hoisted_4$m, [
                createElementVNode("strong", {
                  title: fn.text || fn.name,
                  class: normalizeClass({ "fn-name--error": unknownDef(fn.name) })
                }, toDisplayString(fn.name), 11, _hoisted_5$h),
                unref(getFunctionDef)(fn.name) ? (openBlock(true), createElementBlock(
                  Fragment,
                  { key: 0 },
                  renderList(unref(getFunctionDef)(fn.name).params, (p, pidx) => {
                    return openBlock(), createElementBlock(
                      Fragment,
                      { key: pidx },
                      [
                        p.options?.length ? (openBlock(), createBlock(unref(GSelect), {
                          key: 0,
                          value: paramValue(fn, pidx),
                          options: p.options.map((o) => ({ label: String(o), value: String(o) })),
                          "test-id": `fn-${fn.name}-p${pidx}`,
                          "aria-label": `${fn.name} ${p.name}`,
                          "onUpdate:value": ($event) => setParam(idx, pidx, $event)
                        }, null, 8, ["value", "options", "test-id", "aria-label", "onUpdate:value"])) : (openBlock(), createBlock(unref(GInput), {
                          key: 1,
                          "model-value": paramValue(fn, pidx),
                          type: p.type === "string" ? "text" : "number",
                          "test-id": `fn-${fn.name}-p${pidx}`,
                          placeholder: p.name,
                          "onUpdate:modelValue": ($event) => setParam(
                            idx,
                            pidx,
                            p.type === "string" ? String($event) : Number($event)
                          )
                        }, null, 8, ["model-value", "type", "test-id", "placeholder", "onUpdate:modelValue"]))
                      ],
                      64
                      /* STABLE_FRAGMENT */
                    );
                  }),
                  128
                  /* KEYED_FRAGMENT */
                )) : (openBlock(), createElementBlock(
                  Fragment,
                  { key: 1 },
                  [
                    (openBlock(true), createElementBlock(
                      Fragment,
                      null,
                      renderList(fn.params || [], (pv, pidx) => {
                        return openBlock(), createBlock(unref(GInput), {
                          key: "legacy-" + pidx,
                          "model-value": String(pv),
                          "test-id": `fn-${fn.name}-p${pidx}`,
                          "onUpdate:modelValue": ($event) => setParam(idx, pidx, String($event))
                        }, null, 8, ["model-value", "test-id", "onUpdate:modelValue"]);
                      }),
                      128
                      /* KEYED_FRAGMENT */
                    )),
                    _cache[0] || (_cache[0] = createElementVNode(
                      "span",
                      {
                        class: "unknown-hint",
                        role: "status"
                      },
                      "未知函数",
                      -1
                      /* CACHED */
                    ))
                  ],
                  64
                  /* STABLE_FRAGMENT */
                ))
              ]),
              createElementVNode("div", _hoisted_6$e, [
                createVNode(
                  unref(_sfc_main$4r),
                  { title: "左移" },
                  {
                    default: withCtx(() => [
                      createVNode(unref(GButton), {
                        size: "sm",
                        variant: "text",
                        "test-id": `fn-up-${idx}`,
                        "aria-label": "左移",
                        onClick: ($event) => move(idx, -1)
                      }, {
                        default: withCtx(() => [..._cache[1] || (_cache[1] = [
                          createTextVNode(
                            "←",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["test-id", "onClick"])
                    ]),
                    _: 2
                    /* DYNAMIC */
                  },
                  1024
                  /* DYNAMIC_SLOTS */
                ),
                createVNode(
                  unref(_sfc_main$4r),
                  { title: "右移" },
                  {
                    default: withCtx(() => [
                      createVNode(unref(GButton), {
                        size: "sm",
                        variant: "text",
                        "test-id": `fn-down-${idx}`,
                        "aria-label": "右移",
                        onClick: ($event) => move(idx, 1)
                      }, {
                        default: withCtx(() => [..._cache[2] || (_cache[2] = [
                          createTextVNode(
                            "→",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["test-id", "onClick"])
                    ]),
                    _: 2
                    /* DYNAMIC */
                  },
                  1024
                  /* DYNAMIC_SLOTS */
                ),
                createVNode(
                  unref(_sfc_main$4r),
                  { title: "删除" },
                  {
                    default: withCtx(() => [
                      createVNode(unref(GButton), {
                        size: "sm",
                        variant: "destructive",
                        "test-id": `fn-del-${idx}`,
                        "aria-label": "删除",
                        onClick: ($event) => remove(idx)
                      }, {
                        default: withCtx(() => [..._cache[3] || (_cache[3] = [
                          createTextVNode(
                            "×",
                            -1
                            /* CACHED */
                          )
                        ])]),
                        _: 1
                        /* STABLE */
                      }, 8, ["test-id", "onClick"])
                    ]),
                    _: 2
                    /* DYNAMIC */
                  },
                  1024
                  /* DYNAMIC_SLOTS */
                )
              ])
            ], 10, _hoisted_3$t);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const FunctionEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["__scopeId", "data-v-4ab2902e"]]);
const _hoisted_1$L = {
  class: "host-tag-editor",
  "data-testid": "zabbix-host-tag-editor"
};
const _hoisted_2$y = { class: "toolbar" };
const _hoisted_3$s = ["data-testid"];
const _sfc_main$O = /* @__PURE__ */ defineComponent({
  __name: "HostTagQueryEditor",
  props: {
    tags: { default: () => [] },
    evaltype: { default: "0" },
    tagOptions: { default: () => [] },
    zabbixMajor: { default: 6 }
  },
  emits: ["change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const operators = computed(() => {
      const major = props.zabbixMajor ?? 6;
      return [
        { label: "Contains", value: 0 },
        { label: "Equals", value: 1 },
        { label: major >= 7 ? "Does not contain" : "Not like", value: 2 },
        { label: major >= 7 ? "Does not equal" : "Not equal", value: 3 },
        { label: "Exists", value: 4 },
        { label: major >= 7 ? "Does not exist" : "Not exists", value: 5 }
      ];
    });
    const evalOptions = [
      { label: "AND/OR", value: "0" },
      { label: "OR", value: "2" }
    ];
    function addRow() {
      emit(
        "change",
        [...props.tags || [], { tag: "", value: "", operator: 0 }],
        props.evaltype || "0"
      );
    }
    function patchRow(i, partial) {
      const next = (props.tags || []).map(
        (t2, j) => j === i ? { ...t2, ...partial } : t2
      );
      emit("change", next, props.evaltype || "0");
    }
    function removeRow(i) {
      emit(
        "change",
        (props.tags || []).filter((_, j) => j !== i),
        props.evaltype || "0"
      );
    }
    function setEvaltype(v) {
      const e = String(v) === "2" ? "2" : "0";
      emit("change", props.tags || [], e);
    }
    function needsValue(op) {
      return op !== 4 && op !== 5;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$L, [
        createElementVNode("div", _hoisted_2$y, [
          createVNode(unref(GButton), {
            size: "sm",
            variant: "secondary",
            "test-id": "zabbix-host-tag-add",
            "aria-label": "Add new host tag filter",
            onClick: addRow
          }, {
            default: withCtx(() => [
              createVNode(unref(GIcon), { name: "plus" }),
              _cache[0] || (_cache[0] = createTextVNode(
                " 主机标签 ",
                -1
                /* CACHED */
              ))
            ]),
            _: 1
            /* STABLE */
          }),
          (__props.tags || []).length > 1 ? (openBlock(), createBlock(unref(GSelect), {
            key: 0,
            value: __props.evaltype || "0",
            options: evalOptions,
            "test-id": "zabbix-host-tag-evaltype",
            "aria-label": "Host tag evaluation type",
            "onUpdate:value": setEvaltype
          }, null, 8, ["value"])) : createCommentVNode("v-if", true)
        ]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.tags || [], (t2, i) => {
            return openBlock(), createElementBlock("div", {
              key: i,
              class: "host-tag-row",
              "data-testid": `zabbix-host-tag-row-${i}`
            }, [
              createVNode(unref(GSelect), {
                value: t2.tag,
                options: __props.tagOptions,
                "show-search": "",
                mode: "tags",
                placeholder: "tag",
                "test-id": `zabbix-host-tag-name-${i}`,
                "onUpdate:value": (v) => {
                  const arr = Array.isArray(v) ? v.map(String) : [String(v ?? "")];
                  patchRow(i, { tag: arr[arr.length - 1] || "" });
                }
              }, null, 8, ["value", "options", "test-id", "onUpdate:value"]),
              createVNode(unref(GSelect), {
                value: t2.operator,
                options: operators.value,
                "test-id": `zabbix-host-tag-op-${i}`,
                "onUpdate:value": ($event) => patchRow(i, { operator: Number($event) })
              }, null, 8, ["value", "options", "test-id", "onUpdate:value"]),
              needsValue(Number(t2.operator)) ? (openBlock(), createBlock(unref(GInput), {
                key: 0,
                "model-value": t2.value,
                placeholder: "value",
                "test-id": `zabbix-host-tag-value-${i}`,
                "onUpdate:modelValue": ($event) => patchRow(i, { value: String($event) })
              }, null, 8, ["model-value", "test-id", "onUpdate:modelValue"])) : createCommentVNode("v-if", true),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "text",
                "test-id": `zabbix-host-tag-remove-${i}`,
                "aria-label": "Remove host tag filter",
                onClick: ($event) => removeRow(i)
              }, {
                default: withCtx(() => [..._cache[1] || (_cache[1] = [
                  createTextVNode(
                    " × ",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["test-id", "onClick"])
            ], 8, _hoisted_3$s);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const HostTagQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["__scopeId", "data-v-7aa10521"]]);
const _hoisted_1$K = ["for"];
const _hoisted_2$x = { class: "inline-field__text" };
const _hoisted_3$r = {
  class: "inline-field__tip",
  "aria-hidden": "true"
};
const _hoisted_4$l = { class: "inline-field__control" };
const _sfc_main$N = /* @__PURE__ */ defineComponent({
  __name: "InlineField",
  props: {
    label: {},
    labelWidth: { default: 12 },
    tooltip: {},
    htmlFor: {},
    grow: { type: Boolean, default: false }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["inline-field", { "inline-field--grow": __props.grow }]),
          "data-testid": "zabbix-inline-field"
        },
        [
          createElementVNode("label", {
            class: "inline-field__label",
            for: __props.htmlFor,
            style: normalizeStyle({ width: `${(__props.labelWidth ?? 12) * 8}px` })
          }, [
            createElementVNode(
              "span",
              _hoisted_2$x,
              toDisplayString(__props.label),
              1
              /* TEXT */
            ),
            __props.tooltip ? (openBlock(), createBlock(unref(_sfc_main$4r), {
              key: 0,
              title: __props.tooltip
            }, {
              default: withCtx(() => [
                createElementVNode("span", _hoisted_3$r, [
                  createVNode(unref(GIcon), { name: "info-circle" })
                ])
              ]),
              _: 1
              /* STABLE */
            }, 8, ["title"])) : createCommentVNode("v-if", true)
          ], 12, _hoisted_1$K),
          createElementVNode("div", _hoisted_4$l, [
            renderSlot(_ctx.$slots, "default", {}, void 0, true)
          ])
        ],
        2
        /* CLASS */
      );
    };
  }
});
const InlineField = /* @__PURE__ */ _export_sfc(_sfc_main$N, [["__scopeId", "data-v-b1be77e5"]]);
const _hoisted_1$J = {
  class: "inline-field-row",
  "data-testid": "zabbix-inline-field-row"
};
const _sfc_main$M = /* @__PURE__ */ defineComponent({
  __name: "InlineFieldRow",
  props: {
    filler: { type: Boolean, default: true },
    fillerWidth: { default: 10 }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$J, [
        renderSlot(_ctx.$slots, "default", {}, void 0, true),
        __props.filler ? (openBlock(), createElementBlock(
          "label",
          {
            key: 0,
            class: "inline-field-row__filler",
            style: normalizeStyle({ width: `${(__props.fillerWidth ?? 10) * 8}px` }),
            "aria-hidden": "true"
          },
          null,
          4
          /* STYLE */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const InlineFieldRow = /* @__PURE__ */ _export_sfc(_sfc_main$M, [["__scopeId", "data-v-e9095d9e"]]);
const _hoisted_1$I = {
  class: "lld",
  "data-testid": "zabbix-lld-selector"
};
const _hoisted_2$w = {
  key: 0,
  class: "hint",
  "data-testid": "zabbix-lld-loading"
};
const _hoisted_3$q = {
  key: 1,
  class: "hint",
  "data-testid": "zabbix-lld-empty"
};
const _hoisted_4$k = {
  key: 2,
  class: "err",
  "data-testid": "zabbix-lld-error"
};
const _sfc_main$L = /* @__PURE__ */ defineComponent({
  __name: "LldSelector",
  props: {
    query: {},
    datasourceApi: {},
    hostids: {}
  },
  emits: ["update:query", "item-count-change"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const rulesMeta = useZabbixMetadata(async (signal) => {
      if (!props.datasourceApi || !props.hostids.length) return [];
      const res = await props.datasourceApi.getMetadata(
        { type: "discoveryRules", hostids: props.hostids },
        signal
      );
      if (res.type !== "discoveryRules") return [];
      return res.values;
    });
    const ruleId = computed(
      () => String(props.query.lld?.ruleId || props.query.lldRuleId || "")
    );
    const prototypesMeta = useZabbixMetadata(async (signal) => {
      const id = ruleId.value;
      if (!props.datasourceApi || !id) return [];
      const res = await props.datasourceApi.getMetadata(
        { type: "itemPrototypes", discoveryRuleId: id },
        signal
      );
      if (res.type !== "itemPrototypes") return [];
      return res.values;
    });
    const rulesError = computed(() => rulesMeta.error.value);
    const protosError = computed(() => prototypesMeta.error.value);
    const ruleOptions = computed(
      () => rulesMeta.options.value.map((o) => ({
        label: o.text || o.value,
        value: String(o.id || o.value)
      }))
    );
    const prototypeOptions = computed(
      () => prototypesMeta.options.value.map((o) => ({
        label: `${o.text || o.value}${o.id ? ` (${o.id})` : ""}`,
        // value encodes id|key for multi-select recovery
        value: `${o.id || ""}::${o.value || o.text || ""}`
      }))
    );
    const ruleValue = computed(() => ruleId.value);
    const prototypeValue = computed(() => {
      const ids = props.query.lld?.prototypeIds || [];
      const keys = props.query.lld?.prototypeKeys || props.query.lldItemKeys || [];
      if (ids.length) {
        return ids.map((id, i) => `${id}::${keys[i] || ""}`);
      }
      return keys.map((k) => `::${k}`);
    });
    function patch(partial) {
      emit("update:query", { ...props.query, ...partial });
    }
    function onRule(v) {
      const id = String(v || "");
      const opt = rulesMeta.options.value.find(
        (o) => String(o.id || o.value) === id
      );
      const name = opt ? String(opt.text || opt.value) : void 0;
      patch({
        executionMode: id ? "lld" : "standard",
        lld: id ? { ruleId: id, ruleName: name, prototypeIds: [], prototypeKeys: [] } : void 0,
        // legacy mirrors
        lldRuleId: id || void 0,
        lldRuleName: name,
        lldItemKeys: []
      });
      emit("item-count-change", 0);
    }
    function onPrototypes(v) {
      const arr = Array.isArray(v) ? v.map(String) : v ? [String(v)] : [];
      const seen = /* @__PURE__ */ new Set();
      const prototypeIds = [];
      const prototypeKeys = [];
      for (const raw of arr) {
        if (seen.has(raw)) continue;
        seen.add(raw);
        const [id, ...rest] = raw.split("::");
        const key = rest.join("::");
        if (id) prototypeIds.push(id);
        if (key) prototypeKeys.push(key);
      }
      const rid = ruleId.value;
      patch({
        executionMode: "lld",
        lld: {
          ruleId: rid,
          ruleName: props.query.lld?.ruleName || props.query.lldRuleName,
          prototypeIds,
          prototypeKeys
        },
        lldRuleId: rid || void 0,
        lldItemKeys: prototypeKeys
      });
      emit(
        "item-count-change",
        Math.max(prototypeIds.length, prototypeKeys.length)
      );
    }
    watch(
      () => props.hostids.join(","),
      async () => {
        if (props.query.lld?.ruleId || props.query.lldRuleId || (props.query.lldItemKeys || []).length) {
          patch({
            executionMode: "standard",
            lld: void 0,
            lldRuleId: void 0,
            lldRuleName: void 0,
            lldItemKeys: []
          });
        }
        await rulesMeta.refresh();
        prototypesMeta.options.value = [];
      },
      { immediate: true }
    );
    watch(
      () => ruleId.value,
      async () => {
        await prototypesMeta.refresh();
      }
    );
    __expose({ onRule, onPrototypes });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$I, [
        _cache[1] || (_cache[1] = createElementVNode(
          "label",
          null,
          "发现规则 (LLD)",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          value: ruleValue.value || void 0,
          options: ruleOptions.value,
          "allow-clear": "",
          placeholder: "选择 discovery rule",
          "test-id": "zabbix-lld-rule",
          "onUpdate:value": onRule
        }, null, 8, ["value", "options"]),
        _cache[2] || (_cache[2] = createElementVNode(
          "label",
          null,
          "监控项原型",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          mode: "multiple",
          value: prototypeValue.value,
          options: prototypeOptions.value,
          "allow-clear": "",
          placeholder: "选择 item prototypes",
          "test-id": "zabbix-lld-prototypes",
          "onUpdate:value": onPrototypes
        }, null, 8, ["value", "options"]),
        unref(rulesMeta).loading.value || unref(prototypesMeta).loading.value ? (openBlock(), createElementBlock("p", _hoisted_2$w, " 加载中… ")) : !unref(rulesMeta).loading.value && __props.hostids.length && !ruleOptions.value.length ? (openBlock(), createElementBlock("p", _hoisted_3$q, " 无发现规则 ")) : createCommentVNode("v-if", true),
        rulesError.value || protosError.value ? (openBlock(), createElementBlock("p", _hoisted_4$k, [
          createTextVNode(
            toDisplayString(rulesError.value || protosError.value) + " ",
            1
            /* TEXT */
          ),
          createElementVNode("button", {
            type: "button",
            "data-testid": "zabbix-lld-retry",
            onClick: _cache[0] || (_cache[0] = ($event) => {
              unref(rulesMeta).retry();
              unref(prototypesMeta).retry();
            })
          }, " 重试 ")
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const LldSelector = /* @__PURE__ */ _export_sfc(_sfc_main$L, [["__scopeId", "data-v-31767cc1"]]);
const _hoisted_1$H = ["data-testid"];
const _hoisted_2$v = {
  key: 0,
  class: "lbl"
};
const _hoisted_3$p = {
  key: 1,
  class: "hint",
  role: "status"
};
const _hoisted_4$j = ["data-testid"];
const _sfc_main$K = /* @__PURE__ */ defineComponent({
  __name: "MetricPicker",
  props: {
    value: { default: "" },
    options: { default: () => [] },
    loading: { type: Boolean, default: false },
    placeholder: { default: "选择或输入" },
    variables: { default: () => [] },
    disabled: { type: Boolean, default: false },
    testId: { default: "zabbix-metric-picker" },
    label: { default: "" },
    single: { type: Boolean, default: true }
  },
  emits: ["update:value", "search"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const mergedOptions = computed(() => {
      const vars = (props.variables || []).map((v) => {
        const name = String(v).replace(/^\$/, "");
        return { label: `$${name}`, value: `$${name}` };
      });
      const seen = /* @__PURE__ */ new Set();
      const out = [];
      for (const o of [
        ...vars,
        { label: "/.*/", value: "/.*/" },
        ...props.options || []
      ]) {
        const val = String(o.value ?? "");
        if (!val || seen.has(val)) continue;
        seen.add(val);
        out.push({ label: o.label || val, value: val });
      }
      return out;
    });
    const selectValue = computed(() => {
      const v = String(props.value || "").trim();
      return v ? [v] : [];
    });
    const error = computed(() => {
      const v = String(props.value || "").trim();
      if (!v) return "";
      if (v === "*") return "请使用 /.*/ 匹配全部";
      if (v.startsWith("/") && !/^\/.*\/[gmius]*$/.test(v))
        return "正则必须以 / 结尾";
      return "";
    });
    function onChange(raw) {
      const arr = Array.isArray(raw) ? raw.map(String) : raw == null || raw === "" ? [] : [String(raw)];
      if (!arr.length) {
        emit("update:value", "");
        return;
      }
      const token = props.single ? arr[arr.length - 1] : arr.join(",");
      emit("update:value", token);
    }
    __expose({ error, mergedOptions, onChange });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["metric-picker", { "has-error": !!error.value }]),
        "data-testid": __props.testId
      }, [
        __props.label ? (openBlock(), createElementBlock(
          "label",
          _hoisted_2$v,
          toDisplayString(__props.label),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createVNode(unref(GSelect), {
          mode: "tags",
          value: selectValue.value,
          options: mergedOptions.value,
          disabled: __props.disabled,
          placeholder: __props.placeholder,
          "allow-clear": "",
          "test-id": `${__props.testId}-select`,
          "aria-label": __props.label || __props.placeholder,
          "onUpdate:value": onChange
        }, null, 8, ["value", "options", "disabled", "placeholder", "test-id", "aria-label"]),
        __props.loading ? (openBlock(), createElementBlock("p", _hoisted_3$p, "加载中…")) : createCommentVNode("v-if", true),
        error.value ? (openBlock(), createElementBlock("p", {
          key: 2,
          class: "picker-error",
          role: "status",
          "data-testid": `${__props.testId}-error`
        }, toDisplayString(error.value), 9, _hoisted_4$j)) : createCommentVNode("v-if", true)
      ], 10, _hoisted_1$H);
    };
  }
});
const MetricPicker = /* @__PURE__ */ _export_sfc(_sfc_main$K, [["__scopeId", "data-v-ac0f0c02"]]);
const _hoisted_1$G = {
  class: "fields",
  "data-testid": "zabbix-fields-metrics"
};
const _sfc_main$J = /* @__PURE__ */ defineComponent({
  __name: "MetricsQueryEditor",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {},
    variables: {},
    zabbixMajor: {},
    supportsApplications: { type: Boolean }
  },
  emits: ["update:query", "item-count-change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const api = computed(
      () => resolveZabbixMetadataApi(props.datasourceUid, props.datasourceApi || null)
    );
    const useApplications = computed(() => props.supportsApplications !== false);
    const hostTagOptions = ref([]);
    const itemTagOptions = ref([]);
    const scheduler = computed(
      () => getZabbixMetadataScheduler(String(props.datasourceUid || "default"))
    );
    const groupRevision = ref(0);
    const groups = useZabbixMetadata(
      async (signal) => {
        if (!api.value) return [];
        const res = await api.value.getMetadata(
          { type: "groups", filter: "" },
          signal
        );
        return res.type === "groups" ? res.values : [];
      },
      {
        scheduler: scheduler.value,
        owner: "group",
        parents: () => ({}),
        requestKey: () => "groups"
      }
    );
    const hosts = useZabbixMetadata(
      async (signal) => {
        if (!api.value) return [];
        const groupids = props.query.group?.ids || [];
        const res = await api.value.getMetadata(
          {
            type: "hosts",
            groupids,
            filter: "",
            hostTags: props.query.hostTags || []
          },
          signal
        );
        return res.type === "hosts" ? res.values : [];
      },
      {
        scheduler: scheduler.value,
        owner: "host",
        canLoad: () => (props.query.group?.ids?.length ?? 0) > 0 || Boolean(props.query.group?.filter?.trim()),
        parents: () => ({ groupIds: props.query.group?.ids || [] }),
        requestKey: () => `hosts:${(props.query.group?.ids || []).join(",")}|${props.query.group?.filter || ""}`
      }
    );
    const applications = useZabbixMetadata(
      async (signal) => {
        if (!api.value || !useApplications.value) return [];
        const hostids2 = props.query.host?.ids || [];
        const res = await api.value.getMetadata(
          { type: "applications", hostids: hostids2, filter: "" },
          signal
        );
        return res.type === "applications" ? res.values : [];
      },
      {
        scheduler: scheduler.value,
        owner: "application",
        canLoad: () => (props.query.host?.ids?.length ?? 0) > 0,
        parents: () => ({ hostIds: props.query.host?.ids || [] }),
        requestKey: () => `apps:${(props.query.host?.ids || []).join(",")}`
      }
    );
    const items = useZabbixMetadata(
      async (signal) => {
        if (!api.value) return [];
        const hostids2 = props.query.host?.ids || [];
        const applicationids = props.query.application?.ids || [];
        const res = await api.value.getMetadata(
          {
            type: "items",
            hostids: hostids2,
            applicationids,
            filter: "",
            itemTag: props.query.itemTag?.filter || "",
            showDisabled: Boolean(props.query.options?.showDisabledItems)
          },
          signal
        );
        if (res.type === "items") {
          emit("item-count-change", res.values.length);
          const tags = /* @__PURE__ */ new Map();
          for (const it of res.values) {
            const rawTags = it.tags;
            if (Array.isArray(rawTags)) {
              for (const t2 of rawTags) {
                const key = `${t2.tag}: ${t2.value}`;
                tags.set(key, key);
              }
            }
          }
          if (tags.size)
            itemTagOptions.value = [...tags.values()].map((v) => ({
              label: v,
              value: v
            }));
          return res.values;
        }
        return [];
      },
      {
        scheduler: scheduler.value,
        owner: "item",
        canLoad: () => (props.query.host?.ids?.length ?? 0) > 0,
        parents: () => ({
          hostIds: props.query.host?.ids || [],
          applicationIds: props.query.application?.ids || []
        }),
        requestKey: () => `items:${(props.query.host?.ids || []).join(",")}|${props.query.itemTag?.filter || ""}`
      }
    );
    watch(
      () => [
        props.query.group?.filter,
        props.query.group?.ids?.join(","),
        // hostTags signature without full JSON.stringify of query
        (props.query.hostTags || []).map((t2) => `${t2.tag ?? t2.key ?? ""}=${t2.value ?? ""}`).join("|")
      ],
      () => {
        groupRevision.value = scheduler.value.invalidateFrom(
          "group",
          groupRevision.value + 1
        );
        groups.refresh({ revision: groupRevision.value });
        hosts.refresh({ revision: groupRevision.value });
      }
    );
    onMounted(() => {
      nextTick(() => {
        groupRevision.value = scheduler.value.invalidateFrom(
          "group",
          groupRevision.value + 1
        );
        groups.refresh({ revision: groupRevision.value });
        hosts.refresh({ revision: groupRevision.value });
      });
    });
    watch(
      () => [props.query.host?.filter, props.query.host?.ids?.join(",")],
      () => {
        const rev = scheduler.value.invalidateFrom("host");
        hosts.refresh({ revision: rev });
        applications.refresh({ revision: rev });
        items.refresh({ revision: rev });
      }
    );
    watch(
      () => [
        props.query.application?.filter,
        props.query.itemTag?.filter,
        props.query.options?.showDisabledItems
      ],
      () => items.refresh({ priority: "refresh" })
    );
    const hostids = computed(() => props.query.host?.ids || []);
    const functions = computed({
      get: () => props.query.functions || [],
      set: (v) => emit("update:query", { ...props.query, functions: v })
    });
    function toOptions(list) {
      return (list || []).map((o) => ({
        label: o.text || o.value,
        value: String(o.value ?? o.text ?? "")
      }));
    }
    function findOption(list, token) {
      return list.find(
        (o) => String(o.value) === token || String(o.text) === token || String(o.id) === token
      );
    }
    function filterFromToken(list, token) {
      const t2 = String(token || "").trim();
      if (!t2) return { filter: "" };
      if (t2.startsWith("/") || t2.startsWith("$") || t2 === "/.*/")
        return freeformToFilter(t2);
      const opt = findOption(list, t2);
      if (opt) {
        const next = optionToFilter(opt);
        return next.ids?.length ? next : { filter: next.filter, name: next.name };
      }
      return freeformToFilter(t2);
    }
    function filterDisplay(f) {
      if (!f) return "";
      if (f.filter) return f.filter;
      if (f.name) return f.name;
      if (f.ids?.length) return f.ids[0];
      return "";
    }
    function patchFilter(key, token) {
      const list = key === "group" ? groups.options.value : key === "host" ? hosts.options.value : key === "application" ? applications.options.value : key === "item" ? items.options.value : [];
      const value = key === "itemTag" ? freeformToFilter(token) : filterFromToken(list, token);
      emit("update:query", { ...props.query, [key]: value });
    }
    function onHostTags(tags, evaltype) {
      emit("update:query", { ...props.query, hostTags: tags, evaltype });
    }
    function onUpdate(q) {
      emit("update:query", q);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$G, [
        _cache[7] || (_cache[7] = createStaticVNode('<span hidden data-testid="zabbix-functions" data-v-4026e5eb></span><span hidden data-testid="zabbix-cascade-filters" data-v-4026e5eb></span><span hidden data-testid="zabbix-group" data-v-4026e5eb></span><span hidden data-testid="zabbix-host" data-v-4026e5eb></span><span hidden data-testid="zabbix-application" data-v-4026e5eb></span><span hidden data-testid="zabbix-itemTag" data-v-4026e5eb></span><span hidden data-testid="zabbix-item" data-v-4026e5eb></span>', 7)),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Group",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterDisplay(__props.query.group),
                  options: toOptions(unref(groups).options.value),
                  loading: unref(groups).loading.value,
                  variables: __props.variables,
                  "test-id": "zabbix-group",
                  placeholder: "Group",
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchFilter("group", $event))
                }, null, 8, ["value", "options", "loading", "variables"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Host tag",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(HostTagQueryEditor, {
                  tags: __props.query.hostTags || [],
                  evaltype: __props.query.evaltype || "0",
                  "tag-options": hostTagOptions.value,
                  "zabbix-major": __props.zabbixMajor ?? 6,
                  onChange: onHostTags
                }, null, 8, ["tags", "evaltype", "tag-options", "zabbix-major"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Host",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterDisplay(__props.query.host),
                  options: toOptions(unref(hosts).options.value),
                  loading: unref(hosts).loading.value,
                  variables: __props.variables,
                  "test-id": "zabbix-host",
                  placeholder: "Host",
                  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchFilter("host", $event))
                }, null, 8, ["value", "options", "loading", "variables"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            useApplications.value ? (openBlock(), createBlock(InlineField, {
              key: 0,
              label: "Application",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterDisplay(__props.query.application),
                  options: toOptions(unref(applications).options.value),
                  loading: unref(applications).loading.value,
                  variables: __props.variables,
                  "test-id": "zabbix-application",
                  placeholder: "Application",
                  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patchFilter("application", $event))
                }, null, 8, ["value", "options", "loading", "variables"])
              ]),
              _: 1
              /* STABLE */
            })) : (openBlock(), createBlock(InlineField, {
              key: 1,
              label: "Item tag",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterDisplay(__props.query.itemTag),
                  options: itemTagOptions.value,
                  variables: __props.variables,
                  "test-id": "zabbix-itemTag",
                  placeholder: "tag: value",
                  "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patchFilter("itemTag", $event))
                }, null, 8, ["value", "options", "variables"])
              ]),
              _: 1
              /* STABLE */
            })),
            createVNode(InlineField, {
              label: "Item",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterDisplay(__props.query.item),
                  options: toOptions(unref(items).options.value),
                  loading: unref(items).loading.value,
                  variables: __props.variables,
                  "test-id": "zabbix-item",
                  placeholder: "Item",
                  "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patchFilter("item", $event))
                }, null, 8, ["value", "options", "loading", "variables"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(LldSelector, {
          query: __props.query,
          "datasource-api": __props.datasourceApi || null,
          hostids: hostids.value,
          "onUpdate:query": onUpdate,
          onItemCountChange: _cache[5] || (_cache[5] = ($event) => emit("item-count-change", $event))
        }, null, 8, ["query", "datasource-api", "hostids"]),
        createVNode(InlineFieldRow, { filler: false }, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Functions",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(FunctionEditor$1, {
                  modelValue: functions.value,
                  "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => functions.value = $event)
                }, null, 8, ["modelValue"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const MetricsQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["__scopeId", "data-v-4026e5eb"]]);
const _hoisted_1$F = ["data-testid", "data-disabled"];
const _hoisted_2$u = {
  key: 0,
  class: "vmp-selected",
  "data-testid": "metadata-selected"
};
const _hoisted_3$o = ["aria-busy"];
const _hoisted_4$i = ["aria-selected", "disabled", "onClick"];
const _hoisted_5$g = { class: "vmp-label" };
const _hoisted_6$d = {
  key: 0,
  class: "vmp-empty"
};
const _hoisted_7$b = {
  key: 1,
  class: "vmp-empty"
};
const _hoisted_8$6 = { class: "vmp-footer" };
const _hoisted_9$5 = {
  key: 0,
  class: "vmp-warn",
  "data-testid": "metadata-truncated"
};
const _hoisted_10$4 = ["disabled"];
const _hoisted_11$4 = { class: "vmp-count" };
const ROW_H = 28;
const OVERSCAN = 20;
const WINDOW = 80;
const _sfc_main$I = /* @__PURE__ */ defineComponent({
  __name: "VirtualMetadataPicker",
  props: {
    modelValue: { default: "" },
    options: { default: () => [] },
    loading: { type: Boolean, default: false },
    truncated: { type: Boolean, default: false },
    complete: { type: Boolean, default: true },
    placeholder: { default: "搜索…" },
    testId: { default: "virtual-metadata-picker" },
    disabled: { type: Boolean, default: false },
    remoteSearch: { type: Boolean, default: false }
  },
  emits: ["update:modelValue", "search", "load-more"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const query = ref("");
    const scrollTop = ref(0);
    const viewportH = ref(ROW_H * 10);
    let searchTimer = null;
    const selected = computed(() => String(props.modelValue || "").trim());
    const filtered = computed(() => {
      const q = query.value.trim().toLowerCase();
      const list = props.options || [];
      if (!q || props.remoteSearch) return list;
      return list.filter(
        (o) => o.label.toLowerCase().includes(q) || o.value.toLowerCase().includes(q) || String(o.id || "").includes(q)
      );
    });
    const displayList = computed(() => {
      const list = filtered.value.slice();
      if (selected.value && !list.some((o) => o.value === selected.value)) {
        list.unshift({ label: selected.value, value: selected.value });
      }
      return list;
    });
    const total = computed(() => displayList.value.length);
    const start = computed(
      () => Math.max(0, Math.floor(scrollTop.value / ROW_H) - OVERSCAN)
    );
    const end = computed(
      () => Math.min(total.value, start.value + WINDOW + OVERSCAN * 2)
    );
    const windowItems = computed(
      () => displayList.value.slice(start.value, end.value).map((item, i) => ({
        item,
        index: start.value + i
      }))
    );
    const padTop = computed(() => start.value * ROW_H);
    const padBottom = computed(
      () => Math.max(0, (total.value - end.value) * ROW_H)
    );
    function onScroll(ev) {
      const el = ev.target;
      scrollTop.value = el.scrollTop;
      viewportH.value = el.clientHeight;
      if (el.scrollTop + el.clientHeight >= el.scrollHeight - ROW_H * 4) {
        if (!props.complete) emit("load-more");
      }
    }
    function onSearchInput(v) {
      query.value = String(v ?? "");
      if (!props.remoteSearch) return;
      if (searchTimer) clearTimeout(searchTimer);
      searchTimer = setTimeout(() => {
        emit("search", query.value.trim());
      }, 300);
    }
    function select(value) {
      emit("update:modelValue", value);
    }
    watch(
      () => props.options?.length,
      () => {
        scrollTop.value = 0;
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "vmp",
        "data-testid": __props.testId,
        "data-disabled": __props.disabled || void 0
      }, [
        createVNode(unref(GInput), {
          value: query.value,
          placeholder: __props.placeholder,
          disabled: __props.disabled,
          "test-id": "metadata-search",
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => onSearchInput(String($event ?? "")))
        }, null, 8, ["value", "placeholder", "disabled"]),
        selected.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_2$u,
          " 已选：" + toDisplayString(selected.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createElementVNode("div", {
          class: "vmp-list",
          role: "listbox",
          "aria-busy": __props.loading || void 0,
          onScroll
        }, [
          createElementVNode(
            "div",
            {
              class: "vmp-spacer",
              style: normalizeStyle({ height: padTop.value + "px" })
            },
            null,
            4
            /* STYLE */
          ),
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(windowItems.value, ({ item, index: index2 }) => {
              return openBlock(), createElementBlock("button", {
                key: item.value + ":" + index2,
                type: "button",
                role: "option",
                class: normalizeClass(["vmp-row", { active: item.value === selected.value }]),
                "aria-selected": item.value === selected.value,
                style: normalizeStyle({ height: ROW_H + "px" }),
                disabled: __props.disabled,
                onClick: ($event) => select(item.value)
              }, [
                createElementVNode(
                  "span",
                  _hoisted_5$g,
                  toDisplayString(item.label),
                  1
                  /* TEXT */
                )
              ], 14, _hoisted_4$i);
            }),
            128
            /* KEYED_FRAGMENT */
          )),
          createElementVNode(
            "div",
            {
              class: "vmp-spacer",
              style: normalizeStyle({ height: padBottom.value + "px" })
            },
            null,
            4
            /* STYLE */
          ),
          !displayList.value.length && !__props.loading ? (openBlock(), createElementBlock("div", _hoisted_6$d, "无选项")) : createCommentVNode("v-if", true),
          __props.loading ? (openBlock(), createElementBlock("div", _hoisted_7$b, "加载中…")) : createCommentVNode("v-if", true)
        ], 40, _hoisted_3$o),
        createElementVNode("div", _hoisted_8$6, [
          __props.truncated ? (openBlock(), createElementBlock("span", _hoisted_9$5, " 结果可能被截断，请缩小搜索范围 ")) : createCommentVNode("v-if", true),
          !__props.complete ? (openBlock(), createElementBlock("button", {
            key: 1,
            type: "button",
            class: "vmp-more",
            "data-testid": "metadata-load-more",
            disabled: __props.disabled || __props.loading,
            onClick: _cache[1] || (_cache[1] = ($event) => emit("load-more"))
          }, " 加载更多 ", 8, _hoisted_10$4)) : createCommentVNode("v-if", true),
          createElementVNode(
            "span",
            _hoisted_11$4,
            toDisplayString(total.value) + " 项",
            1
            /* TEXT */
          )
        ])
      ], 8, _hoisted_1$F);
    };
  }
});
const VirtualMetadataPicker = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["__scopeId", "data-v-64b71318"]]);
const _hoisted_1$E = ["data-testid"];
const _hoisted_2$t = {
  key: 0,
  class: "lbl"
};
const _hoisted_3$n = {
  key: 1,
  class: "hint",
  role: "status"
};
const _sfc_main$H = /* @__PURE__ */ defineComponent({
  __name: "FilterPicker",
  props: {
    modelValue: { default: () => ({ filter: "" }) },
    options: { default: () => [] },
    loading: { type: Boolean, default: false },
    label: { default: "" },
    testId: { default: "zabbix-filter" },
    disabled: { type: Boolean, default: false },
    placeholder: { default: "选择或输入过滤条件" }
  },
  emits: ["update:modelValue", "search"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const useVirtual = computed(() => (props.options?.length ?? 0) > 200);
    const selectOptions = computed(
      () => (props.options || []).map((o) => ({
        label: o.text || o.value,
        value: String(o.value ?? o.text ?? "")
      }))
    );
    const selectValue = computed(() => {
      const f = String(props.modelValue?.filter || "").trim();
      return f ? [f] : [];
    });
    function findOption(token) {
      return (props.options || []).find(
        (o) => String(o.value) === token || String(o.text) === token || String(o.id) === token
      );
    }
    function onChange(raw) {
      const arr = Array.isArray(raw) ? raw.map(String) : raw == null || raw === "" ? [] : [String(raw)];
      if (!arr.length) {
        emit("update:modelValue", { filter: "" });
        return;
      }
      const token = arr[arr.length - 1];
      if (isFreeformFilter(token)) {
        emit("update:modelValue", freeformToFilter(token));
        return;
      }
      const opt = findOption(token);
      if (opt) {
        const next = optionToFilter(opt);
        emit(
          "update:modelValue",
          next.ids.length ? next : { filter: next.filter, name: next.name }
        );
        return;
      }
      emit("update:modelValue", freeformToFilter(token));
    }
    __expose({ onChange });
    const virtualOptions = computed(
      () => (props.options || []).map((o) => ({
        label: String(o.text || o.value || ""),
        value: String(o.value ?? o.text ?? ""),
        id: o.id != null ? String(o.id) : void 0
      }))
    );
    function onVirtualSelect(value) {
      const opt = findOption(value);
      if (opt) {
        emit("update:modelValue", optionToFilter(opt));
        return;
      }
      if (isFreeformFilter(value) || value) {
        emit("update:modelValue", freeformToFilter(value));
      } else {
        emit("update:modelValue", { filter: "" });
      }
    }
    return (_ctx, _cache) => {
      return useVirtual.value ? (openBlock(), createBlock(VirtualMetadataPicker, {
        key: 0,
        "model-value": String(__props.modelValue?.filter || ""),
        options: virtualOptions.value,
        loading: __props.loading,
        disabled: __props.disabled,
        placeholder: __props.placeholder,
        "test-id": __props.testId,
        "remote-search": "",
        "onUpdate:modelValue": onVirtualSelect,
        onSearch: _cache[0] || (_cache[0] = ($event) => emit("search", $event))
      }, null, 8, ["model-value", "options", "loading", "disabled", "placeholder", "test-id"])) : (openBlock(), createElementBlock("div", {
        key: 1,
        class: "filter-picker",
        "data-testid": __props.testId
      }, [
        __props.label ? (openBlock(), createElementBlock(
          "label",
          _hoisted_2$t,
          toDisplayString(__props.label),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createVNode(unref(GSelect), {
          mode: "tags",
          value: selectValue.value,
          options: selectOptions.value,
          disabled: __props.disabled,
          placeholder: __props.placeholder,
          "allow-clear": "",
          "test-id": `${__props.testId}-select`,
          "aria-label": __props.label || __props.placeholder,
          "onUpdate:value": onChange
        }, null, 8, ["value", "options", "disabled", "placeholder", "test-id", "aria-label"]),
        __props.loading ? (openBlock(), createElementBlock("p", _hoisted_3$n, "加载中…")) : createCommentVNode("v-if", true)
      ], 8, _hoisted_1$E));
    };
  }
});
const FilterPicker = /* @__PURE__ */ _export_sfc(_sfc_main$H, [["__scopeId", "data-v-3cf479da"]]);
const _hoisted_1$D = {
  class: "cascade",
  "data-testid": "zabbix-cascade-filters"
};
const _sfc_main$G = /* @__PURE__ */ defineComponent({
  __name: "CascadeFilters",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {},
    fields: {}
  },
  emits: ["update:query", "item-count-change"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const api = computed(
      () => resolveZabbixMetadataApi(props.datasourceUid, props.datasourceApi || null)
    );
    function patchFilter(key, value) {
      emit("update:query", { ...props.query, [key]: value });
    }
    const groups = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const res = await api.value.getMetadata(
        { type: "groups", filter: "" },
        signal
      );
      return res.type === "groups" ? res.values : [];
    });
    const hosts = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const groupids = props.query.group?.ids || [];
      if (!groupids.length && !String(props.query.group?.filter || "").trim()) {
        return [];
      }
      const res = await api.value.getMetadata(
        {
          type: "hosts",
          groupids,
          filter: "",
          hostTags: props.query.hostTags || []
        },
        signal
      );
      return res.type === "hosts" ? res.values : [];
    });
    const applications = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const hostids = props.query.host?.ids || [];
      const res = await api.value.getMetadata(
        { type: "applications", hostids, filter: "" },
        signal
      );
      return res.type === "applications" ? res.values : [];
    });
    const items = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const hostids = props.query.host?.ids || [];
      const applicationids = props.query.application?.ids || [];
      if (!hostids.length) return [];
      const res = await api.value.getMetadata(
        {
          type: "items",
          hostids,
          applicationids,
          filter: "",
          itemTag: props.query.itemTag?.filter || "",
          showDisabled: Boolean(props.query.options?.showDisabledItems)
        },
        signal
      );
      if (res.type === "items") {
        emit("item-count-change", res.values.length);
        return res.values;
      }
      return [];
    });
    const triggers = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const hostids = props.query.host?.ids || [];
      const res = await api.value.getMetadata(
        { type: "triggers", hostids, filter: "" },
        signal
      );
      return res.type === "triggers" ? res.values : [];
    });
    const proxies = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const res = await api.value.getMetadata(
        { type: "proxies", filter: "" },
        signal
      );
      return res.type === "proxies" ? res.values : [];
    });
    const macros = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const hostids = props.query.host?.ids || [];
      const res = await api.value.getMetadata(
        { type: "macros", hostids, filter: "" },
        signal
      );
      return res.type === "macros" ? res.values : [];
    });
    const labels = {
      group: "主机组",
      host: "主机",
      application: "应用集",
      itemTag: "监控项标签",
      item: "监控项",
      proxy: "代理",
      trigger: "触发器",
      tags: "标签",
      macro: "宏"
    };
    watch(
      () => [props.query.group?.filter, props.query.group?.ids?.join(",")],
      () => {
        groups.refresh();
        hosts.refresh();
      }
    );
    onMounted(() => {
      nextTick(() => {
        groups.refresh();
        hosts.refresh();
      });
    });
    watch(
      () => [props.query.host?.filter, props.query.host?.ids?.join(",")],
      () => {
        hosts.refresh();
        applications.refresh();
        items.refresh();
        triggers.refresh();
        macros.refresh();
      }
    );
    watch(
      () => [props.query.application?.filter, props.query.itemTag?.filter],
      () => items.refresh()
    );
    function optsFor(field) {
      switch (field) {
        case "group":
          return groups.options.value;
        case "host":
          return hosts.options.value;
        case "application":
          return applications.options.value;
        case "item":
          return items.options.value;
        case "trigger":
          return triggers.options.value;
        case "proxy":
          return proxies.options.value;
        case "macro":
          return macros.options.value;
        default:
          return [];
      }
    }
    function loadingFor(field) {
      switch (field) {
        case "group":
          return groups.loading.value;
        case "host":
          return hosts.loading.value;
        case "application":
          return applications.loading.value;
        case "item":
          return items.loading.value;
        case "trigger":
          return triggers.loading.value;
        case "proxy":
          return proxies.loading.value;
        case "macro":
          return macros.loading.value;
        default:
          return false;
      }
    }
    function valueFor(field) {
      const q = props.query;
      return q[field] || { filter: "" };
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$D, [
        createCommentVNode(" static registry for field-matrix extraction "),
        _cache[0] || (_cache[0] = createStaticVNode('<span hidden data-testid="zabbix-group" data-v-bc850fdd></span><span hidden data-testid="zabbix-host" data-v-bc850fdd></span><span hidden data-testid="zabbix-application" data-v-bc850fdd></span><span hidden data-testid="zabbix-itemTag" data-v-bc850fdd></span><span hidden data-testid="zabbix-item" data-v-bc850fdd></span><span hidden data-testid="zabbix-proxy" data-v-bc850fdd></span><span hidden data-testid="zabbix-trigger" data-v-bc850fdd></span><span hidden data-testid="zabbix-tags" data-v-bc850fdd></span><span hidden data-testid="zabbix-macro" data-v-bc850fdd></span>', 9)),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.fields, (field) => {
            return openBlock(), createBlock(FilterPicker, {
              key: field,
              "model-value": valueFor(field),
              options: optsFor(field),
              loading: loadingFor(field),
              label: labels[field],
              "test-id": `zabbix-${field}`,
              "onUpdate:modelValue": ($event) => patchFilter(field, $event)
            }, null, 8, ["model-value", "options", "loading", "label", "test-id", "onUpdate:modelValue"]);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const CascadeFilters = /* @__PURE__ */ _export_sfc(_sfc_main$G, [["__scopeId", "data-v-bc850fdd"]]);
const _hoisted_1$C = {
  class: "fields",
  "data-testid": "zabbix-fields-text"
};
const _hoisted_2$s = { class: "row" };
const _sfc_main$F = /* @__PURE__ */ defineComponent({
  __name: "TextQueryEditor",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {}
  },
  emits: ["update:query"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function patch(partial) {
      emit("update:query", { ...props.query, ...partial });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$C, [
        createVNode(CascadeFilters, {
          query: __props.query,
          "datasource-uid": __props.datasourceUid,
          "datasource-api": __props.datasourceApi,
          fields: ["group", "host", "application", "item"],
          "onUpdate:query": _cache[0] || (_cache[0] = ($event) => emit("update:query", $event))
        }, null, 8, ["query", "datasource-uid", "datasource-api"]),
        _cache[4] || (_cache[4] = createElementVNode(
          "label",
          null,
          "文本过滤",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          "model-value": __props.query.textFilter,
          "test-id": "zabbix-text-filter",
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => patch({ textFilter: String($event) }))
        }, null, 8, ["model-value"]),
        createElementVNode("label", _hoisted_2$s, [
          createVNode(unref(_sfc_main$4v), {
            checked: __props.query.useCaptureGroups,
            "test-id": "zabbix-use-capture-groups",
            "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => patch({ useCaptureGroups: $event }))
          }, null, 8, ["checked"]),
          _cache[3] || (_cache[3] = createTextVNode(
            " 使用捕获组 ",
            -1
            /* CACHED */
          ))
        ])
      ]);
    };
  }
});
const TextQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$F, [["__scopeId", "data-v-0d88475b"]]);
const _hoisted_1$B = {
  class: "fields",
  "data-testid": "zabbix-fields-itemid"
};
const _sfc_main$E = /* @__PURE__ */ defineComponent({
  __name: "ItemIdQueryEditor",
  props: {
    query: {}
  },
  emits: ["update:query"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$B, [
        _cache[1] || (_cache[1] = createElementVNode(
          "label",
          null,
          "Item IDs（逗号分隔）",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          "model-value": __props.query.itemids,
          "test-id": "zabbix-itemids",
          placeholder: "10001,10002",
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:query", { ...__props.query, itemids: String($event) }))
        }, null, 8, ["model-value"])
      ]);
    };
  }
});
const ItemIdQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$E, [["__scopeId", "data-v-422148e0"]]);
const _hoisted_1$A = {
  class: "fields",
  "data-testid": "zabbix-fields-problems"
};
const _sfc_main$D = /* @__PURE__ */ defineComponent({
  __name: "ProblemsQueryEditor",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {},
    variables: {}
  },
  emits: ["update:query"],
  setup(__props, { emit: __emit }) {
    const SEVERITIES = [
      { label: "Not classified", value: 0 },
      { label: "Information", value: 1 },
      { label: "Warning", value: 2 },
      { label: "Average", value: 3 },
      { label: "High", value: 4 },
      { label: "Disaster", value: 5 }
    ];
    const props = __props;
    const emit = __emit;
    function patch(partial) {
      emit("update:query", { ...props.query, ...partial });
    }
    const severities = computed(() => props.query.options?.severities ?? []);
    function setSeverities(raw) {
      const arr = Array.isArray(raw) ? raw.map(Number).filter((n) => Number.isFinite(n)) : [];
      patch({ options: { ...props.query.options, severities: arr } });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$A, [
        createVNode(CascadeFilters, {
          query: __props.query,
          "datasource-uid": __props.datasourceUid,
          "datasource-api": __props.datasourceApi,
          fields: ["group", "host", "application", "proxy", "trigger", "tags"],
          "onUpdate:query": _cache[0] || (_cache[0] = ($event) => emit("update:query", $event))
        }, null, 8, ["query", "datasource-uid", "datasource-api"]),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Host tags",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(HostTagQueryEditor, {
                  tags: __props.query.hostTags || [],
                  evaltype: __props.query.evaltype || "0",
                  onChange: _cache[1] || (_cache[1] = (tags, evaltype) => patch({ hostTags: tags, evaltype }))
                }, null, 8, ["tags", "evaltype"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Severity",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  mode: "multiple",
                  value: severities.value,
                  options: SEVERITIES,
                  "test-id": "zabbix-problem-severities",
                  placeholder: "全部级别",
                  "onUpdate:value": setSeverities
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Tags eval",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: __props.query.evaltype || "0",
                  options: [
                    { label: "AND/OR", value: "0" },
                    { label: "OR", value: "2" }
                  ],
                  "test-id": "zabbix-problem-evaltype",
                  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ evaltype: String($event) === "2" ? "2" : "0" }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Problem",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(unref(GInput), {
                  "model-value": String(__props.query.trigger?.filter || ""),
                  "test-id": "zabbix-problem-text",
                  placeholder: "问题名称过滤",
                  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => patch({
                    trigger: {
                      ...__props.query.trigger || { filter: "" },
                      filter: String($event)
                    }
                  }))
                }, null, 8, ["model-value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Show",
              "label-width": 10
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: __props.query.showProblems || "problems",
                  options: [
                    { label: "Problems", value: "problems" },
                    { label: "Recent problems", value: "recent" },
                    { label: "History", value: "history" }
                  ],
                  "test-id": "zabbix-show-problems",
                  "onUpdate:value": _cache[4] || (_cache[4] = ($event) => patch({ showProblems: $event }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ProblemsQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["__scopeId", "data-v-b65b5880"]]);
const _hoisted_1$z = {
  class: "fields",
  "data-testid": "zabbix-fields-triggers"
};
const _hoisted_2$r = { class: "row" };
const _sfc_main$C = /* @__PURE__ */ defineComponent({
  __name: "TriggersQueryEditor",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {}
  },
  emits: ["update:query"],
  setup(__props, { emit: __emit }) {
    const SEVERITY_LABELS = [
      { label: "Not classified", value: 0 },
      { label: "Information", value: 1 },
      { label: "Warning", value: 2 },
      { label: "Average", value: 3 },
      { label: "High", value: 4 },
      { label: "Disaster", value: 5 }
    ];
    const props = __props;
    const emit = __emit;
    const countBy = computed(() => props.query.countTriggersBy || "");
    function patch(partial) {
      emit("update:query", { ...props.query, ...partial });
    }
    const cascadeFields = computed(() => {
      if (countBy.value === "problems")
        return ["group", "host", "application", "proxy", "tags"];
      if (countBy.value === "items")
        return ["group", "host", "application", "itemTag", "item", "tags"];
      return [
        "group",
        "host",
        "application",
        "itemTag",
        "item",
        "trigger",
        "tags"
      ];
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$z, [
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Count by",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: countBy.value,
                  options: [
                    { label: "All triggers", value: "" },
                    { label: "Problems", value: "problems" },
                    { label: "Items", value: "items" }
                  ],
                  "test-id": "zabbix-count-by",
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ countTriggersBy: $event || "" }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Min severity",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: __props.query.options?.minSeverity ?? 0,
                  options: SEVERITY_LABELS,
                  "test-id": "zabbix-opt-min-severity",
                  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({
                    options: { ...__props.query.options, minSeverity: Number($event) }
                  }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(CascadeFilters, {
          query: __props.query,
          "datasource-uid": __props.datasourceUid,
          "datasource-api": __props.datasourceApi,
          fields: [...cascadeFields.value],
          "onUpdate:query": _cache[2] || (_cache[2] = ($event) => emit("update:query", $event))
        }, null, 8, ["query", "datasource-uid", "datasource-api", "fields"]),
        countBy.value === "problems" ? (openBlock(), createBlock(InlineFieldRow, { key: 0 }, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Problem",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(unref(GInput), {
                  "model-value": String(__props.query.trigger?.filter || ""),
                  "test-id": "zabbix-trigger-problem",
                  placeholder: "问题过滤",
                  "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => patch({
                    trigger: {
                      ...__props.query.trigger || { filter: "" },
                      filter: String($event)
                    }
                  }))
                }, null, 8, ["model-value"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        })) : createCommentVNode("v-if", true),
        createElementVNode("label", _hoisted_2$r, [
          createVNode(unref(_sfc_main$4v), {
            checked: Boolean(__props.query.options?.count),
            "test-id": "zabbix-count-triggers",
            "onUpdate:checked": _cache[4] || (_cache[4] = ($event) => patch({ options: { ...__props.query.options, count: $event } }))
          }, null, 8, ["checked"]),
          _cache[5] || (_cache[5] = createTextVNode(
            " 仅返回数量 ",
            -1
            /* CACHED */
          ))
        ])
      ]);
    };
  }
});
const TriggersQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "data-v-9e1c71cd"]]);
const _hoisted_1$y = {
  class: "fields",
  "data-testid": "zabbix-fields-services"
};
const _sfc_main$B = /* @__PURE__ */ defineComponent({
  __name: "ServicesQueryEditor",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {},
    variables: {},
    supportsSla: { type: Boolean }
  },
  emits: ["update:query"],
  setup(__props, { emit: __emit }) {
    const SLA_PROPERTY = [
      { label: "状态", value: "status" },
      { label: "SLI", value: "sli" },
      { label: "正常时长", value: "uptime" },
      { label: "故障时长", value: "downtime" },
      { label: "错误预算", value: "error_budget" }
    ];
    const SLA_INTERVAL = [
      { label: "无间隔", value: "none" },
      { label: "自动", value: "auto" },
      { label: "1 小时", value: "1h" },
      { label: "12 小时", value: "12h" },
      { label: "24 小时", value: "1d" },
      { label: "1 周", value: "1w" },
      { label: "1 月", value: "1M" }
    ];
    const props = __props;
    const emit = __emit;
    const api = computed(
      () => resolveZabbixMetadataApi(props.datasourceUid, props.datasourceApi || null)
    );
    const services = useZabbixMetadata(async (signal) => {
      if (!api.value) return [];
      const res = await api.value.getMetadata(
        { type: "services", filter: props.query.itServiceFilter || "" },
        signal
      );
      return res.type === "services" ? res.values : [];
    });
    const slas = useZabbixMetadata(async (signal) => {
      if (!api.value || props.supportsSla === false) return [];
      const serviceids = services.options.value.map((s) => String(s.id || s.value)).filter(Boolean);
      const res = await api.value.getMetadata(
        { type: "slas", serviceids, filter: props.query.slaFilter || "" },
        signal
      );
      return res.type === "slas" ? res.values : [];
    });
    watch(
      () => props.query.itServiceFilter,
      () => services.refresh()
    );
    onMounted(() => {
      nextTick(() => services.refresh());
    });
    watch(
      () => [props.query.slaFilter, services.options.value.length],
      () => slas.refresh()
    );
    function patch(partial) {
      emit("update:query", { ...props.query, ...partial });
    }
    function serviceOptions() {
      return services.options.value.map((s) => ({
        label: s.text || s.value,
        value: String(s.value ?? s.text ?? "")
      }));
    }
    function slaOptions() {
      return slas.options.value.map((s) => ({
        label: s.text || s.value,
        value: String(s.value ?? s.text ?? "")
      }));
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$y, [
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Service",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: __props.query.itServiceFilter,
                  options: serviceOptions(),
                  loading: unref(services).loading.value,
                  variables: __props.variables,
                  "test-id": "zabbix-service-filter",
                  placeholder: "IT 服务",
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ itServiceFilter: $event }))
                }, null, 8, ["value", "options", "loading", "variables"])
              ]),
              _: 1
              /* STABLE */
            }),
            __props.supportsSla !== false ? (openBlock(), createBlock(InlineField, {
              key: 0,
              label: "SLA",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: __props.query.slaFilter,
                  options: slaOptions(),
                  loading: unref(slas).loading.value,
                  variables: __props.variables,
                  "test-id": "zabbix-sla-filter",
                  placeholder: "SLA",
                  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ slaFilter: $event }))
                }, null, 8, ["value", "options", "loading", "variables"])
              ]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true)
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Property",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: __props.query.slaProperty || "sli",
                  options: SLA_PROPERTY,
                  "test-id": "zabbix-sla-property",
                  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ slaProperty: String($event) }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Interval",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: __props.query.slaInterval || "none",
                  options: SLA_INTERVAL,
                  "test-id": "zabbix-sla-interval",
                  "onUpdate:value": _cache[3] || (_cache[3] = ($event) => patch({ slaInterval: String($event) }))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ServicesQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["__scopeId", "data-v-e28f273d"]]);
const _hoisted_1$x = {
  class: "fields",
  "data-testid": "zabbix-fields-macros"
};
const _sfc_main$A = /* @__PURE__ */ defineComponent({
  __name: "MacrosQueryEditor",
  props: {
    query: {},
    datasourceUid: {},
    datasourceApi: {}
  },
  emits: ["update:query"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$x, [
        createVNode(CascadeFilters, {
          query: __props.query,
          "datasource-uid": __props.datasourceUid,
          "datasource-api": __props.datasourceApi,
          fields: ["group", "host", "macro"],
          "onUpdate:query": _cache[0] || (_cache[0] = ($event) => emit("update:query", $event))
        }, null, 8, ["query", "datasource-uid", "datasource-api"])
      ]);
    };
  }
});
const MacrosQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-65d7b236"]]);
const ITEM_COUNT_WARNING_THRESHOLD = 500;
const TIME_RANGE_WARNING_THRESHOLD_DAYS = 365;
function getTimeRangeDurationDays(range) {
  const from = range?.from?.valueOf?.() ?? NaN;
  const to = range?.to?.valueOf?.() ?? NaN;
  if (!Number.isFinite(from) || !Number.isFinite(to) || to < from) return 0;
  return (to - from) / (1e3 * 60 * 60 * 24);
}
function isTimeRangeLarge(range, thresholdDays = TIME_RANGE_WARNING_THRESHOLD_DAYS) {
  const days = getTimeRangeDurationDays(range);
  return days >= thresholdDays;
}
function formatDurationDays(days) {
  const whole = Math.floor(days);
  if (whole < 365) return `${whole} 天`;
  const years = Math.floor(whole / 365);
  const rem = whole % 365;
  if (rem === 0) return `${years} 年`;
  return `${years} 年 ${rem} 天`;
}
function shouldWarnItemCount(count, threshold = ITEM_COUNT_WARNING_THRESHOLD) {
  return Number.isFinite(count) && count >= threshold;
}
const _hoisted_1$w = ["data-testid"];
const _hoisted_2$q = {
  class: "editor-alert__icon",
  "aria-hidden": "true"
};
const _hoisted_3$m = { class: "editor-alert__body" };
const _hoisted_4$h = { class: "editor-alert__title" };
const _hoisted_5$f = {
  key: 0,
  class: "editor-alert__msg"
};
const _sfc_main$z = /* @__PURE__ */ defineComponent({
  __name: "EditorAlert",
  props: {
    title: {},
    message: { default: "" },
    testId: { default: "zabbix-editor-alert" },
    severity: { default: "warning" }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["editor-alert", `editor-alert--${__props.severity}`]),
        role: "status",
        "aria-live": "polite",
        "data-testid": __props.testId
      }, [
        createElementVNode("span", _hoisted_2$q, [
          createVNode(unref(GIcon), { name: "exclamation-triangle" })
        ]),
        createElementVNode("div", _hoisted_3$m, [
          createElementVNode(
            "strong",
            _hoisted_4$h,
            toDisplayString(__props.title),
            1
            /* TEXT */
          ),
          __props.message ? (openBlock(), createElementBlock(
            "p",
            _hoisted_5$f,
            toDisplayString(__props.message),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          renderSlot(_ctx.$slots, "default", {}, void 0, true)
        ])
      ], 10, _hoisted_1$w);
    };
  }
});
const EditorAlert = /* @__PURE__ */ _export_sfc(_sfc_main$z, [["__scopeId", "data-v-300ed766"]]);
const _sfc_main$y = /* @__PURE__ */ defineComponent({
  __name: "ItemCountWarning",
  props: {
    itemCount: {},
    threshold: { default: ITEM_COUNT_WARNING_THRESHOLD }
  },
  setup(__props) {
    const props = __props;
    const visible = computed(
      () => shouldWarnItemCount(props.itemCount, props.threshold)
    );
    return (_ctx, _cache) => {
      return visible.value ? (openBlock(), createBlock(EditorAlert, {
        key: 0,
        title: "监控项数量过多",
        message: `此查询匹配 ${__props.itemCount} 个监控项，可能返回大量数据，请缩小筛选范围。`,
        "test-id": "zabbix-item-count-warning"
      }, null, 8, ["message"])) : createCommentVNode("v-if", true);
    };
  }
});
const _sfc_main$x = /* @__PURE__ */ defineComponent({
  __name: "TimeRangeWarning",
  props: {
    range: {}
  },
  setup(__props) {
    const props = __props;
    const visible = computed(
      () => props.range ? isTimeRangeLarge(props.range) : false
    );
    const duration = computed(
      () => props.range ? formatDurationDays(getTimeRangeDurationDays(props.range)) : ""
    );
    return (_ctx, _cache) => {
      return visible.value ? (openBlock(), createBlock(EditorAlert, {
        key: 0,
        title: "时间范围过大",
        message: `当前选择的时间范围为 ${duration.value}。该查询可能返回大量数据并耗时较长。`,
        "test-id": "zabbix-time-range-warning"
      }, null, 8, ["message"])) : createCommentVNode("v-if", true);
    };
  }
});
const _hoisted_1$v = {
  key: 0,
  class: "opts",
  "data-testid": "zabbix-query-options"
};
const _hoisted_2$p = ["aria-expanded"];
const _hoisted_3$l = { class: "chev" };
const _hoisted_4$g = {
  key: 0,
  class: "summary",
  "data-testid": "zabbix-query-options-summary"
};
const _hoisted_5$e = {
  key: 1,
  class: "summary muted"
};
const _hoisted_6$c = {
  class: "opts-body",
  "data-testid": "zabbix-query-options-body"
};
const _hoisted_7$a = {
  key: 1,
  "data-testid": "zabbix-query-options-empty",
  class: "empty"
};
const _sfc_main$w = /* @__PURE__ */ defineComponent({
  __name: "QueryOptionsEditor",
  props: {
    options: {},
    queryType: {}
  },
  emits: ["update:options"],
  setup(__props, { expose: __expose, emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const expanded = ref(false);
    const code = computed(
      () => normalizeZabbixQueryType(props.queryType)
    );
    const show = computed(() => {
      const c = code.value;
      return {
        showDisabled: c === "0" || c === "3",
        skipEmpty: c === "0" || c === "2" || c === "3",
        alignment: c === "0" || c === "1" || c === "3",
        valueMapping: c === "0" || c === "3",
        trends: c === "0" || c === "1" || c === "3",
        severity: c === "4" || c === "5",
        sort: c === "5",
        ack: c === "4" || c === "5",
        maintenance: c === "5",
        proxy: c === "5",
        limit: c === "5",
        timeRange: c === "4" || c === "5",
        fetchHistorical: c === "5",
        count: c === "4",
        any: c !== "6"
      };
    });
    const summary = computed(() => {
      const o = props.options || {};
      const parts = [];
      if (show.value.trends && o.useTrends && o.useTrends !== "default")
        parts.push(`Trends = ${o.useTrends}`);
      if (show.value.showDisabled && o.showDisabledItems)
        parts.push("Show disabled items = true");
      if (show.value.valueMapping && o.useZabbixValueMapping)
        parts.push("Use Zabbix value mapping = true");
      if (show.value.alignment && o.disableDataAlignment)
        parts.push("Disable data alignment = true");
      if (show.value.skipEmpty && o.skipEmptyValues)
        parts.push("Skip empty values = true");
      if (show.value.severity && o.minSeverity != null && o.minSeverity > 0)
        parts.push(`Min severity = ${o.minSeverity}`);
      if (show.value.sort && o.sortProblems && o.sortProblems !== "default")
        parts.push(`Sort = ${o.sortProblems}`);
      if (show.value.ack && o.acknowledged != null && o.acknowledged !== 2)
        parts.push(`Acknowledged = ${o.acknowledged}`);
      if (show.value.maintenance && o.hostsInMaintenance)
        parts.push("Hosts in maintenance = true");
      if (show.value.proxy && o.hostProxy) parts.push("Host proxy = true");
      if (show.value.limit && o.limit != null && o.limit !== 1001)
        parts.push(`Limit = ${o.limit}`);
      if (show.value.timeRange && o.useTimeRange)
        parts.push("Use time range = true");
      if (show.value.fetchHistorical && o.fetchHistoricalItemValue)
        parts.push("Fetch historical item value = true");
      if (show.value.count && o.count) parts.push("Count = true");
      return parts.join(", ");
    });
    function patchOptions(partial) {
      emit("update:options", { ...props.options, ...partial });
    }
    function clampLimit2(v) {
      return Math.min(1001, Math.max(1, Math.floor(v)));
    }
    function clampSeverity(v) {
      return Math.min(5, Math.max(0, Math.floor(v)));
    }
    __expose({ expanded, summary, clampLimit: clampLimit2, clampSeverity });
    return (_ctx, _cache) => {
      return show.value.any ? (openBlock(), createElementBlock("div", _hoisted_1$v, [
        createElementVNode("button", {
          type: "button",
          class: "opts-toggle",
          "data-testid": "zabbix-query-options-toggle",
          "aria-expanded": expanded.value,
          onClick: _cache[0] || (_cache[0] = ($event) => expanded.value = !expanded.value)
        }, [
          createElementVNode(
            "span",
            _hoisted_3$l,
            toDisplayString(expanded.value ? "▾" : "▸"),
            1
            /* TEXT */
          ),
          _cache[15] || (_cache[15] = createElementVNode(
            "strong",
            null,
            "Options",
            -1
            /* CACHED */
          )),
          !expanded.value && summary.value ? (openBlock(), createElementBlock(
            "span",
            _hoisted_4$g,
            toDisplayString(summary.value),
            1
            /* TEXT */
          )) : !expanded.value ? (openBlock(), createElementBlock("span", _hoisted_5$e, "无额外选项")) : createCommentVNode("v-if", true)
        ], 8, _hoisted_2$p),
        withDirectives(createElementVNode(
          "div",
          _hoisted_6$c,
          [
            show.value.trends || show.value.showDisabled || show.value.valueMapping || show.value.alignment ? (openBlock(), createBlock(InlineFieldRow, { key: 0 }, {
              default: withCtx(() => [
                show.value.trends ? (openBlock(), createBlock(InlineField, {
                  key: 0,
                  label: "Trends",
                  "label-width": 10
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GSelect), {
                      value: __props.options.useTrends || "default",
                      options: [
                        { label: "Default", value: "default" },
                        { label: "True", value: "true" },
                        { label: "False", value: "false" }
                      ],
                      "test-id": "zabbix-opt-trends",
                      "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patchOptions({ useTrends: $event }))
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.showDisabled ? (openBlock(), createBlock(InlineField, {
                  key: 1,
                  label: "Show disabled items",
                  "label-width": 18
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.showDisabledItems),
                      "test-id": "zabbix-opt-show-disabled",
                      "onUpdate:checked": _cache[2] || (_cache[2] = ($event) => patchOptions({ showDisabledItems: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.valueMapping ? (openBlock(), createBlock(InlineField, {
                  key: 2,
                  label: "Use Zabbix value mapping",
                  "label-width": 20
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.useZabbixValueMapping),
                      "test-id": "zabbix-opt-value-mapping",
                      "onUpdate:checked": _cache[3] || (_cache[3] = ($event) => patchOptions({ useZabbixValueMapping: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.alignment ? (openBlock(), createBlock(InlineField, {
                  key: 3,
                  label: "Disable data alignment",
                  "label-width": 18
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.disableDataAlignment),
                      "test-id": "zabbix-opt-disable-alignment",
                      "onUpdate:checked": _cache[4] || (_cache[4] = ($event) => patchOptions({ disableDataAlignment: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true)
              ]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            show.value.skipEmpty ? (openBlock(), createBlock(InlineFieldRow, { key: 1 }, {
              default: withCtx(() => [
                createVNode(InlineField, {
                  label: "Skip empty values",
                  "label-width": 16
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.skipEmptyValues),
                      "test-id": "zabbix-opt-skip-empty",
                      "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => patchOptions({ skipEmptyValues: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })
              ]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            show.value.severity || show.value.sort || show.value.ack ? (openBlock(), createBlock(InlineFieldRow, { key: 2 }, {
              default: withCtx(() => [
                show.value.severity ? (openBlock(), createBlock(InlineField, {
                  key: 0,
                  label: "Min severity",
                  "label-width": 12
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      "model-value": __props.options.minSeverity ?? 0,
                      type: "number",
                      "test-id": "zabbix-opt-min-severity",
                      "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => patchOptions({ minSeverity: clampSeverity(Number($event)) }))
                    }, null, 8, ["model-value"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.sort ? (openBlock(), createBlock(InlineField, {
                  key: 1,
                  label: "Sort problems",
                  "label-width": 12
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GSelect), {
                      value: __props.options.sortProblems || "default",
                      options: [
                        { label: "Default", value: "default" },
                        { label: "Last change", value: "lastchange" },
                        { label: "Priority", value: "priority" }
                      ],
                      "test-id": "zabbix-opt-sort",
                      "onUpdate:value": _cache[7] || (_cache[7] = ($event) => patchOptions({ sortProblems: $event }))
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.ack ? (openBlock(), createBlock(InlineField, {
                  key: 2,
                  label: "Acknowledged",
                  "label-width": 12
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GSelect), {
                      value: __props.options.acknowledged ?? 2,
                      options: [
                        { label: "All", value: 2 },
                        { label: "Unacknowledged", value: 0 },
                        { label: "Acknowledged", value: 1 }
                      ],
                      "test-id": "zabbix-opt-ack",
                      "onUpdate:value": _cache[8] || (_cache[8] = ($event) => patchOptions({ acknowledged: Number($event) }))
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true)
              ]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true),
            show.value.maintenance || show.value.proxy || show.value.limit || show.value.timeRange || show.value.fetchHistorical || show.value.count ? (openBlock(), createBlock(InlineFieldRow, { key: 3 }, {
              default: withCtx(() => [
                show.value.maintenance ? (openBlock(), createBlock(InlineField, {
                  key: 0,
                  label: "Hosts in maintenance",
                  "label-width": 18
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.hostsInMaintenance),
                      "test-id": "zabbix-opt-maintenance",
                      "onUpdate:checked": _cache[9] || (_cache[9] = ($event) => patchOptions({ hostsInMaintenance: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.proxy ? (openBlock(), createBlock(InlineField, {
                  key: 1,
                  label: "Show proxy",
                  "label-width": 12
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.hostProxy),
                      "test-id": "zabbix-opt-proxy",
                      "onUpdate:checked": _cache[10] || (_cache[10] = ($event) => patchOptions({ hostProxy: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.limit ? (openBlock(), createBlock(InlineField, {
                  key: 2,
                  label: "Limit",
                  "label-width": 8
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      "model-value": __props.options.limit ?? 1001,
                      type: "number",
                      "test-id": "zabbix-opt-limit",
                      "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => patchOptions({ limit: clampLimit2(Number($event)) }))
                    }, null, 8, ["model-value"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.timeRange ? (openBlock(), createBlock(InlineField, {
                  key: 3,
                  label: "Use time range",
                  "label-width": 14
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.useTimeRange),
                      "test-id": "zabbix-opt-time-range",
                      "onUpdate:checked": _cache[12] || (_cache[12] = ($event) => patchOptions({ useTimeRange: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.fetchHistorical ? (openBlock(), createBlock(InlineField, {
                  key: 4,
                  label: "Historical item value",
                  "label-width": 18
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.fetchHistoricalItemValue),
                      "test-id": "zabbix-opt-historical",
                      "onUpdate:checked": _cache[13] || (_cache[13] = ($event) => patchOptions({ fetchHistoricalItemValue: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true),
                show.value.count ? (openBlock(), createBlock(InlineField, {
                  key: 5,
                  label: "Count only",
                  "label-width": 10
                }, {
                  default: withCtx(() => [
                    createVNode(unref(_sfc_main$4v), {
                      checked: Boolean(__props.options.count),
                      "test-id": "zabbix-opt-count",
                      "onUpdate:checked": _cache[14] || (_cache[14] = ($event) => patchOptions({ count: $event }))
                    }, null, 8, ["checked"])
                  ]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true)
              ]),
              _: 1
              /* STABLE */
            })) : createCommentVNode("v-if", true)
          ],
          512
          /* NEED_PATCH */
        ), [
          [vShow, expanded.value]
        ])
      ])) : (openBlock(), createElementBlock("div", _hoisted_7$a));
    };
  }
});
const QueryOptionsEditor = /* @__PURE__ */ _export_sfc(_sfc_main$w, [["__scopeId", "data-v-06e7e1b4"]]);
const _hoisted_1$u = {
  class: "zbx-qe",
  "data-testid": "query-editor-zabbix"
};
const _sfc_main$v = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {},
    datasourceApi: {},
    variables: {}
  },
  setup(__props, { expose: __expose }) {
    const TYPE_OPTIONS = [
      { label: "指标", value: "0" },
      { label: "IT 服务", value: "1" },
      { label: "文本", value: "2" },
      { label: "监控项 ID", value: "3" },
      { label: "触发器", value: "4" },
      { label: "问题", value: "5" },
      { label: "宏", value: "6" }
    ];
    const props = __props;
    const itemCount = ref(0);
    const query = computed(() => migrateZabbixQuery(props.query || {}));
    const queryType = computed(
      () => normalizeZabbixQueryType(query.value.queryType)
    );
    const datasourceUid = computed(
      () => String(
        props.datasource?.uid || props.query?.datasource?.uid || ""
      )
    );
    const metaApi = computed(
      () => resolveZabbixMetadataApi(
        datasourceUid.value,
        props.datasourceApi || props.datasource || null
      )
    );
    function update(next) {
      const base = props.query;
      props.onChange({
        ...base,
        ...next,
        refId: next.refId ?? base?.refId,
        datasource: next.datasource ?? base?.datasource,
        hide: next.hide ?? base?.hide
      });
    }
    function setQueryType(v) {
      const code = normalizeZabbixQueryType(v);
      update({ ...query.value, queryType: code });
    }
    const legendFormat = computed({
      get: () => String(query.value.legendFormat || ""),
      set: (v) => update({ ...query.value, legendFormat: v })
    });
    const vars = computed(() => props.variables || []);
    __expose({ setQueryType, update, queryType });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$u, [
        createVNode(_sfc_main$x, {
          range: props.range
        }, null, 8, ["range"]),
        queryType.value === "0" ? (openBlock(), createBlock(_sfc_main$y, {
          key: 0,
          "item-count": itemCount.value
        }, null, 8, ["item-count"])) : createCommentVNode("v-if", true),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Query type",
              "label-width": 12,
              "html-for": "zabbix-query-type"
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  id: "zabbix-query-type",
                  value: queryType.value,
                  options: TYPE_OPTIONS,
                  "test-id": "zabbix-query-type",
                  "onUpdate:value": setQueryType
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        queryType.value === "0" ? (openBlock(), createBlock(MetricsQueryEditor, {
          key: 1,
          query: query.value,
          "datasource-uid": datasourceUid.value,
          "datasource-api": metaApi.value,
          variables: vars.value,
          "onUpdate:query": update,
          onItemCountChange: _cache[0] || (_cache[0] = ($event) => itemCount.value = $event)
        }, null, 8, ["query", "datasource-uid", "datasource-api", "variables"])) : queryType.value === "1" ? (openBlock(), createBlock(ServicesQueryEditor, {
          key: 2,
          query: query.value,
          "datasource-uid": datasourceUid.value,
          "datasource-api": metaApi.value,
          variables: vars.value,
          "onUpdate:query": update
        }, null, 8, ["query", "datasource-uid", "datasource-api", "variables"])) : queryType.value === "2" ? (openBlock(), createBlock(TextQueryEditor, {
          key: 3,
          query: query.value,
          "datasource-uid": datasourceUid.value,
          "datasource-api": metaApi.value,
          "onUpdate:query": update
        }, null, 8, ["query", "datasource-uid", "datasource-api"])) : queryType.value === "3" ? (openBlock(), createBlock(ItemIdQueryEditor, {
          key: 4,
          query: query.value,
          "onUpdate:query": update
        }, null, 8, ["query"])) : queryType.value === "4" ? (openBlock(), createBlock(TriggersQueryEditor, {
          key: 5,
          query: query.value,
          "datasource-uid": datasourceUid.value,
          "datasource-api": metaApi.value,
          "onUpdate:query": update
        }, null, 8, ["query", "datasource-uid", "datasource-api"])) : queryType.value === "5" ? (openBlock(), createBlock(ProblemsQueryEditor, {
          key: 6,
          query: query.value,
          "datasource-uid": datasourceUid.value,
          "datasource-api": metaApi.value,
          variables: vars.value,
          "onUpdate:query": update
        }, null, 8, ["query", "datasource-uid", "datasource-api", "variables"])) : queryType.value === "6" ? (openBlock(), createBlock(MacrosQueryEditor, {
          key: 7,
          query: query.value,
          "datasource-uid": datasourceUid.value,
          "datasource-api": metaApi.value,
          "onUpdate:query": update
        }, null, 8, ["query", "datasource-uid", "datasource-api"])) : createCommentVNode("v-if", true),
        createVNode(QueryOptionsEditor, {
          "query-type": queryType.value,
          options: query.value.options || {},
          "onUpdate:options": _cache[1] || (_cache[1] = ($event) => update({ ...query.value, options: $event }))
        }, null, 8, ["query-type", "options"]),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Legend",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(unref(GInput), {
                  modelValue: legendFormat.value,
                  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => legendFormat.value = $event),
                  placeholder: "{{item}}",
                  "test-id": "zabbix-legend"
                }, null, 8, ["modelValue"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(unref(GButton), {
          size: "sm",
          variant: "primary",
          "test-id": "run-query",
          onClick: _cache[3] || (_cache[3] = ($event) => props.onRunQuery?.())
        }, {
          default: withCtx(() => [..._cache[4] || (_cache[4] = [
            createTextVNode(
              "运行查询",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const QueryEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$v, [["__scopeId", "data-v-63f24bf1"]]);
const _hoisted_1$t = {
  class: "zbx-cfg",
  "data-testid": "config-editor-zabbix"
};
const _hoisted_2$o = {
  class: "section",
  "aria-labelledby": "zbx-conn"
};
const _hoisted_3$k = { class: "cred-field" };
const _hoisted_4$f = {
  class: "tip-wrap",
  "data-testid": "zabbix-token-tip",
  tabindex: "0"
};
const _hoisted_5$d = {
  class: "cred-status",
  "data-testid": "zabbix-credential-status"
};
const _hoisted_6$b = {
  key: 0,
  class: "configured"
};
const _hoisted_7$9 = {
  key: 1,
  class: "not-configured"
};
const _hoisted_8$5 = {
  class: "section section-collapsible",
  "data-testid": "zabbix-additional-settings"
};
const _hoisted_9$4 = ["aria-expanded"];
const _hoisted_10$3 = {
  key: 0,
  class: "adv-body",
  role: "region",
  "aria-labelledby": "zbx-extra",
  "data-testid": "zabbix-additional-body"
};
const _hoisted_11$3 = { class: "row" };
const _hoisted_12$3 = {
  key: 1,
  class: "err",
  "data-testid": "zabbix-cache-ttl-error",
  role: "alert"
};
const _hoisted_13$3 = {
  key: 2,
  class: "err",
  "data-testid": "zabbix-timeout-error",
  role: "alert"
};
const _hoisted_14$3 = {
  key: 3,
  class: "err",
  "data-testid": "zabbix-query-timeout-error",
  role: "alert"
};
const _hoisted_15$3 = { class: "row" };
const _hoisted_16$2 = {
  class: "sr-only",
  "data-testid": "zabbix-db-candidates",
  "aria-label": "Direct DB 候选项"
};
const _hoisted_17$2 = ["data-uid", "data-type"];
const _hoisted_18$2 = {
  key: 1,
  class: "err"
};
const _hoisted_19$2 = { class: "row" };
const _hoisted_20$2 = { class: "row" };
const _hoisted_21$1 = { class: "row" };
const _hoisted_22$1 = {
  key: 5,
  "data-testid": "zabbix-enable-writes-warn"
};
const _sfc_main$u = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const DIRECT_DB_TYPES = /* @__PURE__ */ new Set([
      "mysql",
      "postgres",
      "postgresql",
      "grafana-postgresql-datasource",
      "influxdb"
    ]);
    const props = __props;
    const tokenLocal = ref("");
    const usernameLocal = ref("");
    const passwordLocal = ref("");
    const fieldErrors = ref({});
    const directDbCandidates = ref([]);
    const listLoaded = ref(false);
    const credentialConfigured = ref(false);
    const additionalOpen = ref(false);
    const legacyIdMigrated = ref(false);
    const dsUid = computed(() => String(props.options?.uid || "zabbix"));
    const configMigration = computed(
      () => migrateZabbixConfig(
        {
          ...DEFAULT_ZABBIX_OPTIONS,
          ...props.options.jsonData ?? {}
        },
        (numericId) => directDbCandidates.value.find((s) => s.id === numericId)?.uid
      )
    );
    const jsonData = computed(() => configMigration.value.options);
    function emitValidation() {
      const urlValue = String(props.options?.url || "").trim();
      let isValid = Boolean(urlValue) && !configMigration.value.error;
      let message = configMigration.value.error?.message;
      if (!urlValue) {
        isValid = false;
        message = "请填写 Zabbix URL";
      }
      if (jsonData.value.dbConnectionEnable) {
        const uid = String(jsonData.value.dbConnectionDatasourceUID || "").trim();
        if (!uid) {
          isValid = false;
          message = "Direct DB 已启用，请选择数据源 UID";
        } else {
          const found = directDbCandidates.value.find((s) => s.uid === uid);
          if (!found) {
            if (directDbCandidates.value.length > 0 || listLoaded.value) {
              isValid = false;
              message = `找不到 Direct DB 数据源 ${uid}`;
            }
          } else if (!DIRECT_DB_TYPES.has(found.type)) {
            isValid = false;
            message = `数据源类型 ${found.type} 不支持作为 Direct DB`;
          }
        }
      }
      for (const err of Object.values(fieldErrors.value)) {
        if (err) {
          isValid = false;
          message = err;
          break;
        }
      }
      props.onValidationChange?.({ isValid, message });
    }
    function patchJson(patch, url2) {
      const options = props.options;
      const next = {
        ...options,
        ...url2 != null ? { url: url2 } : {},
        jsonData: { ...jsonData.value, ...patch }
      };
      props.onOptionsChange(next);
    }
    async function refreshCredentialStatus() {
      const cred = await getRuntimeCredential(dsUid.value);
      credentialConfigured.value = Boolean(
        cred && (cred.value || cred.username || cred.password || cred.headers && Object.keys(cred.headers).length)
      );
    }
    function setToken(value) {
      tokenLocal.value = value;
      setRuntimeCredential(dsUid.value, value ? { kind: "apiKey", value } : null);
      void refreshCredentialStatus();
    }
    function setBasic(username, password) {
      usernameLocal.value = username;
      passwordLocal.value = password;
      setRuntimeCredential(
        dsUid.value,
        username || password ? { kind: "basic", username, password } : null
      );
      void refreshCredentialStatus();
    }
    function clearCredentials() {
      tokenLocal.value = "";
      usernameLocal.value = "";
      passwordLocal.value = "";
      setRuntimeCredential(dsUid.value, null);
      credentialConfigured.value = false;
    }
    const url = computed({
      get: () => String(props.options?.url || ""),
      set: (v) => patchJson({}, v)
    });
    const authType = computed({
      get: () => jsonData.value.authType === "userLogin" ? "userLogin" : "token",
      set: (v) => {
        const next = v === "userLogin" ? "userLogin" : "token";
        tokenLocal.value = "";
        usernameLocal.value = "";
        passwordLocal.value = "";
        setRuntimeCredential(dsUid.value, null);
        credentialConfigured.value = false;
        patchJson({ authType: next });
      }
    });
    const trends = computed({
      get: () => Boolean(jsonData.value.trends),
      set: (v) => patchJson({ trends: v })
    });
    const trendsFrom = computed({
      get: () => String(jsonData.value.trendsFrom || "7d"),
      set: (v) => patchJson({ trendsFrom: v })
    });
    const trendsRange = computed({
      get: () => String(jsonData.value.trendsRange || "4d"),
      set: (v) => patchJson({ trendsRange: v })
    });
    const cacheTTL = computed({
      get: () => String(jsonData.value.cacheTTL || "1h"),
      set: (v) => {
        const s = String(v || "").trim();
        if (!s || !isValidDurationString(s)) {
          fieldErrors.value = {
            ...fieldErrors.value,
            cacheTTL: "缓存 TTL 必须是合法 duration，例如 1h / 5m / 30s"
          };
        } else {
          const { cacheTTL: _drop, ...rest } = fieldErrors.value;
          fieldErrors.value = rest;
        }
        patchJson({ cacheTTL: s });
      }
    });
    const timeoutSeconds = computed({
      get: () => Math.max(1, Math.round(Number(jsonData.value.timeout || 3e4) / 1e3)),
      set: (v) => {
        const sec = Number(v);
        if (!Number.isFinite(sec) || sec <= 0 || !Number.isInteger(sec)) {
          fieldErrors.value = {
            ...fieldErrors.value,
            timeout: "超时必须为正整数（秒）"
          };
          return;
        }
        const { timeout: _t, ...rest } = fieldErrors.value;
        fieldErrors.value = rest;
        patchJson({ timeout: Math.round(sec) * 1e3 });
      }
    });
    const queryTimeoutSeconds = computed({
      get: () => Math.max(
        1,
        Math.round(Number(jsonData.value.queryTimeout || 6e4) / 1e3)
      ),
      set: (v) => {
        const sec = Number(v);
        if (!Number.isFinite(sec) || sec <= 0 || !Number.isInteger(sec)) {
          fieldErrors.value = {
            ...fieldErrors.value,
            queryTimeout: "查询超时必须为正整数（秒）"
          };
          return;
        }
        const { queryTimeout: _q, ...rest } = fieldErrors.value;
        fieldErrors.value = rest;
        patchJson({ queryTimeout: Math.round(sec) * 1e3 });
      }
    });
    const dbConnectionEnable = computed({
      get: () => Boolean(jsonData.value.dbConnectionEnable),
      set: (v) => patchJson({ dbConnectionEnable: v })
    });
    function setDbUid(uid) {
      const candidate = directDbCandidates.value.find((s) => s.uid === uid);
      patchJson({
        dbConnectionDatasourceUID: uid || void 0,
        dbConnectionDatasourceName: candidate?.name
      });
    }
    const dbConnectionDatasourceUID = computed({
      get: () => String(jsonData.value.dbConnectionDatasourceUID || ""),
      set: (v) => setDbUid(v)
    });
    const selectedDbType = computed(() => {
      const uid = String(jsonData.value.dbConnectionDatasourceUID || "");
      return directDbCandidates.value.find((s) => s.uid === uid)?.type || "";
    });
    const showRetentionPolicy = computed(
      () => Boolean(jsonData.value.dbConnectionEnable) && selectedDbType.value === "influxdb"
    );
    const retentionPolicy = computed({
      get: () => String(jsonData.value.dbConnectionRetentionPolicy || ""),
      set: (v) => patchJson({ dbConnectionRetentionPolicy: v })
    });
    const disableReadOnlyUsersAck = computed({
      get: () => Boolean(jsonData.value.disableReadOnlyUsersAck),
      set: (v) => patchJson({ disableReadOnlyUsersAck: v })
    });
    const disableDataAlignment = computed({
      get: () => Boolean(jsonData.value.disableDataAlignment),
      set: (v) => patchJson({ disableDataAlignment: v })
    });
    const authPlacement = computed({
      get: () => jsonData.value.authPlacement || "auto",
      set: (v) => patchJson({ authPlacement: v })
    });
    const historyPageLimit2 = computed({
      get: () => Number(jsonData.value.historyPageLimit ?? 1e4),
      set: (v) => patchJson({ historyPageLimit: Math.max(1, Number(v) || 1e4) })
    });
    const historyBatchSize2 = computed({
      get: () => Number(jsonData.value.historyBatchSize ?? 100),
      set: (v) => patchJson({ historyBatchSize: Math.max(1, Number(v) || 100) })
    });
    const historyConcurrency = computed({
      get: () => Number(jsonData.value.historyConcurrency ?? 4),
      set: (v) => patchJson({ historyConcurrency: Math.max(1, Number(v) || 4) })
    });
    const metadataPageLimit = computed({
      get: () => Number(jsonData.value.metadataPageLimit ?? 1e3),
      set: (v) => patchJson({ metadataPageLimit: Math.max(1, Number(v) || 1e3) })
    });
    const enableWrites = computed({
      get: () => Boolean(jsonData.value.enableWrites),
      set: (v) => patchJson({ enableWrites: v })
    });
    const dbOptions = computed(
      () => directDbCandidates.value.map((s) => ({
        label: `${s.name} (${s.type})`,
        value: s.uid
      }))
    );
    async function loadCandidates() {
      try {
        const list = await listDataSources();
        directDbCandidates.value = (list || []).filter(
          (s) => DIRECT_DB_TYPES.has(String(s.type || ""))
        );
      } catch {
        directDbCandidates.value = [];
      } finally {
        listLoaded.value = true;
        if (!legacyIdMigrated.value) {
          const raw = props.options?.jsonData ?? {};
          const hasLegacyId = Number(raw.dbConnectionDatasourceId) > 0 || raw.dbConnection && typeof raw.dbConnection === "object" && Number(raw.dbConnection.datasourceId) > 0;
          const migUid = configMigration.value.options.dbConnectionDatasourceUID;
          if (hasLegacyId && migUid) {
            const candidate = directDbCandidates.value.find(
              (s) => s.uid === migUid
            );
            patchJson({
              dbConnectionDatasourceUID: migUid,
              dbConnectionDatasourceName: candidate?.name ?? configMigration.value.options.dbConnectionDatasourceName
            });
          }
          legacyIdMigrated.value = true;
        }
        emitValidation();
      }
    }
    onMounted(async () => {
      await loadCandidates();
      await refreshCredentialStatus();
      emitValidation();
    });
    onUnmounted(() => {
      tokenLocal.value = "";
      usernameLocal.value = "";
      passwordLocal.value = "";
    });
    watch(
      () => [
        props.options,
        directDbCandidates.value,
        fieldErrors.value,
        listLoaded.value
      ],
      () => emitValidation(),
      { deep: true }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$t, [
        createVNode(unref(_sfc_main$4y), {
          layout: "vertical",
          "test-id": "zabbix-config-form"
        }, {
          default: withCtx(() => [
            createElementVNode("section", _hoisted_2$o, [
              _cache[26] || (_cache[26] = createElementVNode(
                "h4",
                { id: "zbx-conn" },
                "Zabbix 连接",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInlineField), {
                label: "URL",
                required: true,
                grow: ""
              }, {
                default: withCtx(() => [
                  createVNode(unref(GInput), {
                    id: "zabbix-url",
                    modelValue: url.value,
                    "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => url.value = $event),
                    placeholder: "https://zabbix.example/api_jsonrpc.php",
                    "test-id": "zabbix-url"
                  }, null, 8, ["modelValue"])
                ]),
                _: 1
                /* STABLE */
              }),
              createVNode(unref(GInlineField), {
                label: "认证方式",
                grow: ""
              }, {
                default: withCtx(() => [
                  createVNode(unref(GSelect), {
                    id: "zabbix-auth-type",
                    value: authType.value,
                    options: [
                      { label: "API Token", value: "token" },
                      { label: "用户名/密码", value: "userLogin" }
                    ],
                    "test-id": "zabbix-auth-type",
                    "onUpdate:value": _cache[1] || (_cache[1] = ($event) => authType.value = $event === "userLogin" ? "userLogin" : "token")
                  }, null, 8, ["value"])
                ]),
                _: 1
                /* STABLE */
              }),
              authType.value === "token" ? (openBlock(), createBlock(unref(GInlineField), {
                key: 0,
                label: "API Token",
                grow: ""
              }, {
                default: withCtx(() => [
                  createElementVNode("div", _hoisted_3$k, [
                    createVNode(unref(GInput), {
                      id: "zabbix-token",
                      "model-value": tokenLocal.value,
                      type: "password",
                      autocomplete: "off",
                      "test-id": "zabbix-token",
                      "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => setToken(String($event)))
                    }, null, 8, ["model-value"]),
                    createVNode(unref(_sfc_main$4r), { title: "凭据仅保存在运行时内存，不会写入 jsonData、URL 或日志" }, {
                      default: withCtx(() => [
                        createElementVNode("span", _hoisted_4$f, [
                          createVNode(unref(GIcon), {
                            name: "info",
                            size: 14
                          })
                        ])
                      ]),
                      _: 1
                      /* STABLE */
                    })
                  ])
                ]),
                _: 1
                /* STABLE */
              })) : (openBlock(), createElementBlock(
                Fragment,
                { key: 1 },
                [
                  createVNode(unref(GInlineField), {
                    label: "用户名",
                    grow: ""
                  }, {
                    default: withCtx(() => [
                      createVNode(unref(GInput), {
                        id: "zabbix-username",
                        "model-value": usernameLocal.value,
                        "test-id": "zabbix-username",
                        autocomplete: "off",
                        "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => setBasic(String($event), passwordLocal.value))
                      }, null, 8, ["model-value"])
                    ]),
                    _: 1
                    /* STABLE */
                  }),
                  createVNode(unref(GInlineField), {
                    label: "密码",
                    grow: ""
                  }, {
                    default: withCtx(() => [
                      createVNode(unref(GInput), {
                        id: "zabbix-password",
                        "model-value": passwordLocal.value,
                        type: "password",
                        autocomplete: "off",
                        "test-id": "zabbix-password",
                        "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => setBasic(usernameLocal.value, String($event)))
                      }, null, 8, ["model-value"])
                    ]),
                    _: 1
                    /* STABLE */
                  })
                ],
                64
                /* STABLE_FRAGMENT */
              )),
              createElementVNode("div", _hoisted_5$d, [
                credentialConfigured.value ? (openBlock(), createElementBlock("span", _hoisted_6$b, "已配置凭据")) : (openBlock(), createElementBlock("span", _hoisted_7$9, "未配置凭据")),
                credentialConfigured.value || tokenLocal.value || usernameLocal.value || passwordLocal.value ? (openBlock(), createBlock(unref(GButton), {
                  key: 2,
                  variant: "secondary",
                  size: "sm",
                  "test-id": "zabbix-clear-credentials",
                  onClick: clearCredentials
                }, {
                  default: withCtx(() => [..._cache[25] || (_cache[25] = [
                    createTextVNode(
                      " 清除凭据 ",
                      -1
                      /* CACHED */
                    )
                  ])]),
                  _: 1
                  /* STABLE */
                })) : createCommentVNode("v-if", true)
              ])
            ]),
            createElementVNode("section", _hoisted_8$5, [
              createElementVNode("button", {
                type: "button",
                class: "adv-toggle",
                "data-testid": "zabbix-additional-toggle",
                "aria-expanded": additionalOpen.value,
                onClick: _cache[5] || (_cache[5] = ($event) => additionalOpen.value = !additionalOpen.value),
                onKeydown: [
                  _cache[6] || (_cache[6] = withKeys(withModifiers(($event) => additionalOpen.value = !additionalOpen.value, ["prevent"]), ["enter"])),
                  _cache[7] || (_cache[7] = withKeys(withModifiers(($event) => additionalOpen.value = !additionalOpen.value, ["prevent"]), ["space"]))
                ]
              }, [
                createVNode(unref(GIcon), {
                  name: additionalOpen.value ? "angle-right" : "angle-right",
                  size: 14,
                  class: normalizeClass([{ "is-open": additionalOpen.value }, "chevron"])
                }, null, 8, ["name", "class"]),
                _cache[27] || (_cache[27] = createElementVNode(
                  "h4",
                  { id: "zbx-extra" },
                  "附加设置",
                  -1
                  /* CACHED */
                ))
              ], 40, _hoisted_9$4),
              additionalOpen.value ? (openBlock(), createElementBlock("div", _hoisted_10$3, [
                _cache[34] || (_cache[34] = createElementVNode(
                  "h5",
                  null,
                  "Zabbix API / 查询 / 趋势",
                  -1
                  /* CACHED */
                )),
                createElementVNode("label", _hoisted_11$3, [
                  createVNode(unref(_sfc_main$4v), {
                    checked: trends.value,
                    "test-id": "zabbix-trends",
                    "onUpdate:checked": _cache[8] || (_cache[8] = ($event) => trends.value = $event)
                  }, null, 8, ["checked"]),
                  _cache[28] || (_cache[28] = createTextVNode(
                    " 启用趋势 ",
                    -1
                    /* CACHED */
                  ))
                ]),
                trends.value ? (openBlock(), createElementBlock(
                  Fragment,
                  { key: 0 },
                  [
                    createVNode(unref(GInlineField), {
                      label: "趋势起始",
                      grow: ""
                    }, {
                      default: withCtx(() => [
                        createVNode(unref(GInput), {
                          id: "zabbix-trends-from",
                          modelValue: trendsFrom.value,
                          "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => trendsFrom.value = $event),
                          "test-id": "zabbix-trends-from"
                        }, null, 8, ["modelValue"])
                      ]),
                      _: 1
                      /* STABLE */
                    }),
                    createVNode(unref(GInlineField), {
                      label: "趋势范围",
                      grow: ""
                    }, {
                      default: withCtx(() => [
                        createVNode(unref(GInput), {
                          id: "zabbix-trends-range",
                          modelValue: trendsRange.value,
                          "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => trendsRange.value = $event),
                          "test-id": "zabbix-trends-range"
                        }, null, 8, ["modelValue"])
                      ]),
                      _: 1
                      /* STABLE */
                    })
                  ],
                  64
                  /* STABLE_FRAGMENT */
                )) : createCommentVNode("v-if", true),
                createVNode(unref(GInlineField), {
                  label: "缓存 TTL",
                  grow: ""
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-cache-ttl",
                      modelValue: cacheTTL.value,
                      "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => cacheTTL.value = $event),
                      "test-id": "zabbix-cache-ttl"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                fieldErrors.value.cacheTTL ? (openBlock(), createElementBlock(
                  "p",
                  _hoisted_12$3,
                  toDisplayString(fieldErrors.value.cacheTTL),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                createVNode(unref(GInlineField), {
                  label: "连接超时（秒）",
                  grow: "",
                  tooltip: "jsonData.timeout，内部以毫秒存储"
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-timeout",
                      "model-value": timeoutSeconds.value,
                      type: "number",
                      "test-id": "zabbix-timeout",
                      "aria-invalid": Boolean(fieldErrors.value.timeout) || void 0,
                      "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => timeoutSeconds.value = Number($event))
                    }, null, 8, ["model-value", "aria-invalid"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                fieldErrors.value.timeout ? (openBlock(), createElementBlock(
                  "p",
                  _hoisted_13$3,
                  toDisplayString(fieldErrors.value.timeout),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                createVNode(unref(GInlineField), {
                  label: "查询超时（秒）",
                  grow: "",
                  tooltip: "jsonData.queryTimeout，内部以毫秒存储"
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-query-timeout",
                      "model-value": queryTimeoutSeconds.value,
                      type: "number",
                      "test-id": "zabbix-query-timeout",
                      "aria-invalid": Boolean(fieldErrors.value.queryTimeout) || void 0,
                      "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => queryTimeoutSeconds.value = Number($event))
                    }, null, 8, ["model-value", "aria-invalid"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                fieldErrors.value.queryTimeout ? (openBlock(), createElementBlock(
                  "p",
                  _hoisted_14$3,
                  toDisplayString(fieldErrors.value.queryTimeout),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                _cache[35] || (_cache[35] = createElementVNode(
                  "h5",
                  null,
                  "Direct DB",
                  -1
                  /* CACHED */
                )),
                createElementVNode("label", _hoisted_15$3, [
                  createVNode(unref(_sfc_main$4v), {
                    checked: dbConnectionEnable.value,
                    "test-id": "zabbix-direct-db",
                    "onUpdate:checked": _cache[14] || (_cache[14] = ($event) => dbConnectionEnable.value = $event)
                  }, null, 8, ["checked"]),
                  _cache[29] || (_cache[29] = createTextVNode(
                    " 启用 Direct DB ",
                    -1
                    /* CACHED */
                  ))
                ]),
                dbConnectionEnable.value ? (openBlock(), createElementBlock(
                  Fragment,
                  { key: 4 },
                  [
                    createVNode(unref(GInlineField), {
                      label: "数据库数据源",
                      grow: ""
                    }, {
                      default: withCtx(() => [
                        createVNode(unref(GSelect), {
                          id: "zabbix-db-uid",
                          value: dbConnectionDatasourceUID.value,
                          options: dbOptions.value,
                          "allow-clear": "",
                          placeholder: "选择 PostgreSQL / MySQL / InfluxDB",
                          "test-id": "zabbix-db-uid",
                          "onUpdate:value": _cache[15] || (_cache[15] = ($event) => dbConnectionDatasourceUID.value = String($event || ""))
                        }, null, 8, ["value", "options"])
                      ]),
                      _: 1
                      /* STABLE */
                    }),
                    createElementVNode("ul", _hoisted_16$2, [
                      (openBlock(true), createElementBlock(
                        Fragment,
                        null,
                        renderList(directDbCandidates.value, (c) => {
                          return openBlock(), createElementBlock("li", {
                            key: c.uid,
                            "data-uid": c.uid,
                            "data-type": c.type
                          }, toDisplayString(c.name), 9, _hoisted_17$2);
                        }),
                        128
                        /* KEYED_FRAGMENT */
                      ))
                    ]),
                    showRetentionPolicy.value ? (openBlock(), createBlock(unref(GInlineField), {
                      key: 0,
                      label: "Retention Policy",
                      grow: ""
                    }, {
                      default: withCtx(() => [
                        createVNode(unref(GInput), {
                          id: "zabbix-retention-policy",
                          modelValue: retentionPolicy.value,
                          "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => retentionPolicy.value = $event),
                          "test-id": "zabbix-retention-policy"
                        }, null, 8, ["modelValue"])
                      ]),
                      _: 1
                      /* STABLE */
                    })) : createCommentVNode("v-if", true),
                    configMigration.value.error ? (openBlock(), createElementBlock(
                      "p",
                      _hoisted_18$2,
                      toDisplayString(configMigration.value.error.message),
                      1
                      /* TEXT */
                    )) : createCommentVNode("v-if", true)
                  ],
                  64
                  /* STABLE_FRAGMENT */
                )) : createCommentVNode("v-if", true),
                _cache[36] || (_cache[36] = createElementVNode(
                  "h5",
                  null,
                  "权限与写操作",
                  -1
                  /* CACHED */
                )),
                createElementVNode("label", _hoisted_19$2, [
                  createVNode(unref(_sfc_main$4v), {
                    checked: disableReadOnlyUsersAck.value,
                    "test-id": "zabbix-disable-readonly-ack",
                    "onUpdate:checked": _cache[17] || (_cache[17] = ($event) => disableReadOnlyUsersAck.value = $event)
                  }, null, 8, ["checked"]),
                  _cache[30] || (_cache[30] = createTextVNode(
                    " 禁止只读用户确认问题 ",
                    -1
                    /* CACHED */
                  ))
                ]),
                createElementVNode("label", _hoisted_20$2, [
                  createVNode(unref(_sfc_main$4v), {
                    checked: disableDataAlignment.value,
                    "test-id": "zabbix-disable-alignment",
                    "onUpdate:checked": _cache[18] || (_cache[18] = ($event) => disableDataAlignment.value = $event)
                  }, null, 8, ["checked"]),
                  _cache[31] || (_cache[31] = createTextVNode(
                    " 禁用数据对齐 ",
                    -1
                    /* CACHED */
                  ))
                ]),
                createElementVNode("label", _hoisted_21$1, [
                  createVNode(unref(_sfc_main$4v), {
                    checked: enableWrites.value,
                    "test-id": "zabbix-enable-writes",
                    "onUpdate:checked": _cache[19] || (_cache[19] = ($event) => enableWrites.value = $event)
                  }, null, 8, ["checked"]),
                  _cache[32] || (_cache[32] = createTextVNode(
                    " 启用写操作（确认/关闭/脚本） ",
                    -1
                    /* CACHED */
                  ))
                ]),
                enableWrites.value ? (openBlock(), createElementBlock("div", _hoisted_22$1, [
                  createVNode(unref(GAlert), {
                    severity: "warning",
                    title: "写操作风险"
                  }, {
                    default: withCtx(() => [..._cache[33] || (_cache[33] = [
                      createTextVNode(
                        " 写操作需服务端另配 ZABBIX_LIVE_WRITES=1，且账号具备对应权限。请谨慎开启。 ",
                        -1
                        /* CACHED */
                      )
                    ])]),
                    _: 1
                    /* STABLE */
                  })
                ])) : createCommentVNode("v-if", true),
                _cache[37] || (_cache[37] = createElementVNode(
                  "h5",
                  null,
                  "高级 RPC 调优",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInlineField), {
                  label: "认证位置",
                  grow: ""
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GSelect), {
                      id: "zabbix-auth-placement",
                      value: authPlacement.value,
                      options: [
                        { label: "自动探测", value: "auto" },
                        { label: "请求体", value: "body" },
                        { label: "请求头", value: "header" }
                      ],
                      "test-id": "zabbix-auth-placement",
                      "onUpdate:value": _cache[20] || (_cache[20] = ($event) => authPlacement.value = $event)
                    }, null, 8, ["value"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                createVNode(unref(GInlineField), {
                  label: "历史分页大小",
                  grow: "",
                  tooltip: "jsonData.historyPageLimit"
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-history-page-limit",
                      modelValue: historyPageLimit2.value,
                      "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => historyPageLimit2.value = $event),
                      type: "number",
                      "test-id": "zabbix-history-page-limit"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                createVNode(unref(GInlineField), {
                  label: "历史批大小",
                  grow: "",
                  tooltip: "jsonData.historyBatchSize"
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-history-batch-size",
                      modelValue: historyBatchSize2.value,
                      "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => historyBatchSize2.value = $event),
                      type: "number",
                      "test-id": "zabbix-history-batch-size"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                createVNode(unref(GInlineField), {
                  label: "历史并发数",
                  grow: "",
                  tooltip: "jsonData.historyConcurrency"
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-history-concurrency",
                      modelValue: historyConcurrency.value,
                      "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => historyConcurrency.value = $event),
                      type: "number",
                      "test-id": "zabbix-history-concurrency"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                  /* STABLE */
                }),
                createVNode(unref(GInlineField), {
                  label: "元数据分页大小",
                  grow: "",
                  tooltip: "jsonData.metadataPageLimit"
                }, {
                  default: withCtx(() => [
                    createVNode(unref(GInput), {
                      id: "zabbix-metadata-page-limit",
                      modelValue: metadataPageLimit.value,
                      "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => metadataPageLimit.value = $event),
                      type: "number",
                      "test-id": "zabbix-metadata-page-limit"
                    }, null, 8, ["modelValue"])
                  ]),
                  _: 1
                  /* STABLE */
                })
              ])) : createCommentVNode("v-if", true)
            ])
          ]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const ConfigEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$u, [["__scopeId", "data-v-43b4b06f"]]);
const _hoisted_1$s = {
  class: "var-qe",
  "data-testid": "zabbix-variable-query-editor"
};
const _hoisted_2$n = {
  key: 0,
  class: "legacy",
  "data-testid": "zabbix-var-legacy",
  role: "status"
};
const _hoisted_3$j = {
  key: 0,
  class: "row"
};
const _sfc_main$t = /* @__PURE__ */ defineComponent({
  __name: "VariableQueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    datasource: {}
  },
  setup(__props) {
    const props = __props;
    const isLegacyString = computed(
      () => typeof props.query === "string" && isLegacyRaw(String(props.query))
    );
    function isLegacyRaw(t2) {
      const s = t2.trim();
      if (!s) return false;
      if (/\{[^}]+\}/.test(s)) return true;
      if (s.includes(".") && !s.includes(":") && !s.startsWith("{")) return true;
      return false;
    }
    function asObject() {
      if (typeof props.query === "string") {
        if (isLegacyRaw(props.query))
          return parseLegacyVariableQuery(props.query);
        return parseZabbixVariableQuery(props.query);
      }
      if (props.query && typeof props.query === "object") {
        const q = props.query;
        if (q.queryType) return { ...q };
        if (typeof q.query === "string") {
          if (isLegacyRaw(q.query)) return parseLegacyVariableQuery(q.query);
          return parseZabbixVariableQuery(q.query);
        }
      }
      return { queryType: "group", filter: "" };
    }
    const model = computed(() => asObject());
    const queryType = computed(() => String(model.value.queryType || "group"));
    const legacyReadonly = computed(
      () => Boolean(model.value.legacy || isLegacyString.value)
    );
    function emitPatch(partial) {
      if (legacyReadonly.value) return;
      props.onChange({
        ...model.value,
        ...partial,
        legacy: void 0,
        legacyRaw: void 0
      });
    }
    const typeOptions = [
      { label: "Group / 主机组", value: "group" },
      { label: "Host / 主机", value: "host" },
      { label: "Application / 应用集", value: "application" },
      { label: "Item Tag / 监控项标签", value: "itemTag" },
      { label: "Item / 监控项", value: "item" },
      { label: "Item values / 监控项值", value: "itemValues" },
      { label: "Host Tag / 主机标签", value: "hostTag" },
      { label: "Proxy / 代理", value: "proxy" },
      { label: "Service / 服务", value: "service" },
      { label: "SLA", value: "sla" },
      { label: "Trigger / 触发器", value: "trigger" }
    ];
    const showGroup = computed(
      () => [
        "group",
        "host",
        "application",
        "item",
        "itemTag",
        "hostTag",
        "itemValues",
        "trigger"
      ].includes(queryType.value)
    );
    const showHost = computed(
      () => [
        "host",
        "application",
        "item",
        "itemTag",
        "hostTag",
        "itemValues",
        "trigger"
      ].includes(queryType.value)
    );
    const showApplication = computed(
      () => ["application", "item", "itemValues"].includes(queryType.value)
    );
    const showItemTag = computed(
      () => queryType.value === "itemTag" || queryType.value === "item"
    );
    const showItem = computed(
      () => queryType.value === "item" || queryType.value === "itemValues"
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$s, [
        legacyReadonly.value ? (openBlock(), createElementBlock("div", _hoisted_2$n, [
          _cache[7] || (_cache[7] = createElementVNode(
            "strong",
            null,
            "Legacy Query（只读）",
            -1
            /* CACHED */
          )),
          createElementVNode(
            "code",
            null,
            toDisplayString(model.value.legacyRaw || (typeof __props.query === "string" ? __props.query : "")),
            1
            /* TEXT */
          ),
          _cache[8] || (_cache[8] = createElementVNode(
            "p",
            null,
            " 旧版点路径 / 花括号语法已解析为只读回显，请新建变量迁移到结构化类型。 ",
            -1
            /* CACHED */
          ))
        ])) : createCommentVNode("v-if", true),
        _cache[14] || (_cache[14] = createElementVNode(
          "label",
          null,
          "变量类型",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          value: queryType.value,
          options: typeOptions,
          disabled: legacyReadonly.value,
          "test-id": "zabbix-var-type",
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => emitPatch({ queryType: String($event) }))
        }, null, 8, ["value", "disabled"]),
        showGroup.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            _cache[9] || (_cache[9] = createElementVNode(
              "label",
              null,
              "Group",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "model-value": String(
                model.value.group ?? (queryType.value === "group" ? model.value.filter : "") ?? ""
              ),
              disabled: legacyReadonly.value,
              "test-id": "zabbix-var-group",
              "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => queryType.value === "group" ? emitPatch({ filter: String($event) }) : emitPatch({ group: String($event) }))
            }, null, 8, ["model-value", "disabled"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        showHost.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 2 },
          [
            _cache[10] || (_cache[10] = createElementVNode(
              "label",
              null,
              "Host",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "model-value": String(model.value.host ?? (queryType.value === "host" ? model.value.filter : "") ?? ""),
              disabled: legacyReadonly.value,
              "test-id": "zabbix-var-host",
              "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => queryType.value === "host" ? emitPatch({ filter: String($event) }) : emitPatch({ host: String($event) }))
            }, null, 8, ["model-value", "disabled"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        showApplication.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 3 },
          [
            _cache[11] || (_cache[11] = createElementVNode(
              "label",
              null,
              "Application",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "model-value": String(
                model.value.application ?? (queryType.value === "application" ? model.value.filter : "") ?? ""
              ),
              disabled: legacyReadonly.value,
              "test-id": "zabbix-var-application",
              "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => queryType.value === "application" ? emitPatch({ filter: String($event) }) : emitPatch({ application: String($event) }))
            }, null, 8, ["model-value", "disabled"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        showItemTag.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 4 },
          [
            _cache[12] || (_cache[12] = createElementVNode(
              "label",
              null,
              "Item Tag",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "model-value": String(
                model.value.itemTag ?? (queryType.value === "itemTag" ? model.value.filter : "") ?? ""
              ),
              disabled: legacyReadonly.value,
              "test-id": "zabbix-var-item-tag",
              "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => queryType.value === "itemTag" ? emitPatch({ filter: String($event) }) : emitPatch({ itemTag: String($event) }))
            }, null, 8, ["model-value", "disabled"])
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true),
        showItem.value ? (openBlock(), createElementBlock(
          Fragment,
          { key: 5 },
          [
            createElementVNode(
              "label",
              null,
              toDisplayString(queryType.value === "itemValues" ? "Item / Item id" : "Item"),
              1
              /* TEXT */
            ),
            createVNode(unref(GInput), {
              "model-value": String(
                queryType.value === "itemValues" ? model.value.item ?? model.value.filter ?? "" : model.value.filter ?? ""
              ),
              disabled: legacyReadonly.value,
              "test-id": "zabbix-var-item",
              "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => queryType.value === "itemValues" ? emitPatch({ item: String($event) }) : emitPatch({ filter: String($event) }))
            }, null, 8, ["model-value", "disabled"]),
            queryType.value === "item" ? (openBlock(), createElementBlock("label", _hoisted_3$j, [
              createVNode(unref(_sfc_main$4v), {
                checked: Boolean(model.value.showDisabled),
                disabled: legacyReadonly.value,
                "test-id": "zabbix-var-show-disabled",
                "onUpdate:checked": _cache[6] || (_cache[6] = ($event) => emitPatch({ showDisabled: $event }))
              }, null, 8, ["checked", "disabled"]),
              _cache[13] || (_cache[13] = createTextVNode(
                " 显示已禁用 ",
                -1
                /* CACHED */
              ))
            ])) : createCommentVNode("v-if", true)
          ],
          64
          /* STABLE_FRAGMENT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const VariableQueryEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$t, [["__scopeId", "data-v-d3cd6955"]]);
const _hoisted_1$r = {
  class: "anno-qe",
  "data-testid": "zabbix-annotation-query-editor"
};
const _hoisted_2$m = { class: "row" };
const _hoisted_3$i = { class: "row" };
const _hoisted_4$e = { class: "row" };
const _sfc_main$s = /* @__PURE__ */ defineComponent({
  __name: "AnnotationQueryEditor",
  props: {
    annotation: {},
    onChange: { type: Function },
    datasource: {},
    variables: {}
  },
  setup(__props) {
    const SEVERITY_LABELS = [
      { label: "Not classified", value: 0 },
      { label: "Information", value: 1 },
      { label: "Warning", value: 2 },
      { label: "Average", value: 3 },
      { label: "High", value: 4 },
      { label: "Disaster", value: 5 }
    ];
    const props = __props;
    const prepared = computed(
      () => prepareZabbixAnnotation(props.annotation || {})
    );
    const target = computed(
      () => prepared.value.target || {}
    );
    const options = computed(
      () => target.value.options || {}
    );
    function patchTarget(partial) {
      const nextTarget = {
        ...target.value,
        ...partial,
        options: {
          ...options.value,
          ...partial.options || {}
        }
      };
      props.onChange({
        ...props.annotation,
        name: props.annotation.name,
        enable: props.annotation.enable,
        iconColor: props.annotation.iconColor,
        target: nextTarget
      });
    }
    function filterOf(key) {
      const f = target.value[key];
      if (f && typeof f === "object") return String(f.filter || "");
      return String(f || "");
    }
    function setFilter(key, value) {
      patchTarget({ [key]: { filter: value } });
    }
    function setOption(key, value) {
      patchTarget({ options: { ...options.value, [key]: value } });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$r, [
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Group",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterOf("group"),
                  variables: __props.variables,
                  "test-id": "zabbix-anno-group",
                  placeholder: "Group",
                  "onUpdate:value": _cache[0] || (_cache[0] = ($event) => setFilter("group", $event))
                }, null, 8, ["value", "variables"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Host",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterOf("host"),
                  variables: __props.variables,
                  "test-id": "zabbix-anno-host",
                  placeholder: "Host",
                  "onUpdate:value": _cache[1] || (_cache[1] = ($event) => setFilter("host", $event))
                }, null, 8, ["value", "variables"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Application",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterOf("application"),
                  variables: __props.variables,
                  "test-id": "zabbix-anno-application",
                  placeholder: "Application",
                  "onUpdate:value": _cache[2] || (_cache[2] = ($event) => setFilter("application", $event))
                }, null, 8, ["value", "variables"])
              ]),
              _: 1
              /* STABLE */
            }),
            createVNode(InlineField, {
              label: "Trigger",
              "label-width": 12,
              grow: ""
            }, {
              default: withCtx(() => [
                createVNode(MetricPicker, {
                  value: filterOf("trigger"),
                  variables: __props.variables,
                  "test-id": "zabbix-anno-trigger",
                  placeholder: "Trigger",
                  "onUpdate:value": _cache[3] || (_cache[3] = ($event) => setFilter("trigger", $event))
                }, null, 8, ["value", "variables"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createVNode(InlineFieldRow, null, {
          default: withCtx(() => [
            createVNode(InlineField, {
              label: "Min severity",
              "label-width": 12
            }, {
              default: withCtx(() => [
                createVNode(unref(GSelect), {
                  value: options.value.minSeverity ?? 0,
                  options: SEVERITY_LABELS,
                  "test-id": "zabbix-anno-min-severity",
                  "onUpdate:value": _cache[4] || (_cache[4] = ($event) => setOption("minSeverity", Number($event)))
                }, null, 8, ["value"])
              ]),
              _: 1
              /* STABLE */
            })
          ]),
          _: 1
          /* STABLE */
        }),
        createElementVNode("label", _hoisted_2$m, [
          createVNode(unref(_sfc_main$4v), {
            checked: Boolean(options.value.showOkEvents),
            "test-id": "zabbix-anno-show-ok",
            "onUpdate:checked": _cache[5] || (_cache[5] = ($event) => setOption("showOkEvents", $event))
          }, null, 8, ["checked"]),
          _cache[8] || (_cache[8] = createTextVNode(
            " 显示 OK 事件 ",
            -1
            /* CACHED */
          ))
        ]),
        createElementVNode("label", _hoisted_3$i, [
          createVNode(unref(_sfc_main$4v), {
            checked: Boolean(options.value.hideAcknowledged),
            "test-id": "zabbix-anno-hide-ack",
            "onUpdate:checked": _cache[6] || (_cache[6] = ($event) => setOption("hideAcknowledged", $event))
          }, null, 8, ["checked"]),
          _cache[9] || (_cache[9] = createTextVNode(
            " 隐藏已确认 ",
            -1
            /* CACHED */
          ))
        ]),
        createElementVNode("label", _hoisted_4$e, [
          createVNode(unref(_sfc_main$4v), {
            checked: Boolean(options.value.showHostname),
            "test-id": "zabbix-anno-show-hostname",
            "onUpdate:checked": _cache[7] || (_cache[7] = ($event) => setOption("showHostname", $event))
          }, null, 8, ["checked"]),
          _cache[10] || (_cache[10] = createTextVNode(
            " 显示主机名 ",
            -1
            /* CACHED */
          ))
        ])
      ]);
    };
  }
});
const AnnotationQueryEditor$1 = /* @__PURE__ */ _export_sfc(_sfc_main$s, [["__scopeId", "data-v-6a0e5f1b"]]);
const meta$1 = {
  id: "alexanderzobnin-zabbix-datasource",
  name: "Zabbix",
  metrics: true,
  backend: true,
  capabilities: ZABBIX_CAPABILITIES
};
const plugin$2 = createDataSourcePlugin({
  meta: meta$1,
  QueryEditor: QueryEditor$1,
  ConfigEditor: ConfigEditor$1,
  VariableQueryEditor: VariableQueryEditor$1,
  AnnotationQueryEditor: AnnotationQueryEditor$1,
  createDataSource: (instance) => createZabbixDataSource(instance, meta$1)
});
const module$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: plugin$2,
  plugin: plugin$2
}, Symbol.toStringTag, { value: "Module" }));
const DEFAULT_ISSUES_OPTIONS = {
  layout: "table",
  pageSize: 50,
  showTraceDetail: true,
  sources: { logs: true, traces: true, alerts: true },
  attributeFilters: [],
  severities: [],
  sort: "time",
  highlightNew: true,
  highlightWindowMs: 5 * 60 * 1e3,
  showAttributes: true,
  showTraceLink: true,
  showDatasource: false
};
function col(frame, name) {
  const field = frame.fields.find(
    (f) => f.name.toLowerCase() === name.toLowerCase()
  );
  return field?.values || [];
}
function getAt(frame, names, i) {
  for (const n of names) {
    const v = col(frame, n)[i];
    if (v != null && v !== "") return v;
  }
  return void 0;
}
function toMs(v) {
  const n = Number(v ?? 0);
  if (!Number.isFinite(n) || n <= 0) return 0;
  if (n >= 1e9 && n < 1e12) return n * 1e3;
  return n;
}
function severityRank(s) {
  const k = String(s || "").toLowerCase();
  if (k === "critical" || k === "fatal") return 5;
  if (k === "error") return 4;
  if (k === "warning" || k === "warn") return 3;
  if (k === "info") return 2;
  if (k === "ok" || k === "resolved") return 1;
  return 0;
}
function inferSource(frame, row) {
  const meta2 = frame.meta || {};
  const hint = String(
    meta2.signal || meta2.preferredVisualisationType || meta2.custom?.signal || ""
  ).toLowerCase();
  if (hint.includes("alert") || row.status === "firing" || row.status === "pending")
    return "alert";
  if (hint.includes("trace") || row.traceId) return "trace";
  if (hint.includes("log")) return "log";
  if (row.alertId) return "alert";
  if (row.traceId) return "trace";
  return "log";
}
function parseAttributes(raw) {
  if (!raw) return {};
  if (typeof raw === "object" && !Array.isArray(raw)) {
    const out = {};
    for (const [k, v] of Object.entries(raw))
      out[k] = String(v);
    return out;
  }
  if (typeof raw === "string") {
    try {
      return parseAttributes(JSON.parse(raw));
    } catch {
      return {};
    }
  }
  return {};
}
function matchAttr(filters, attrs, optionErrors) {
  for (const f of filters || []) {
    const val = attrs[f.key] ?? "";
    if (f.operator === "=") {
      if (val !== f.value) return false;
    } else if (f.operator === "!=") {
      if (val === f.value) return false;
    } else if (f.operator === "=~" || f.operator === "!~") {
      try {
        const re = new RegExp(f.value);
        const ok2 = re.test(val);
        if (f.operator === "=~" ? !ok2 : ok2) return false;
      } catch {
        optionErrors.push(`无效属性正则: ${f.key} ${f.operator} ${f.value}`);
        return true;
      }
    }
  }
  return true;
}
function isDefaultIncluded(issue) {
  const sev = String(issue.severity || "").toLowerCase();
  const status = String(issue.status || "").toLowerCase();
  if (issue.source === "log") {
    return sev === "error" || sev === "fatal" || sev === "critical";
  }
  if (issue.source === "trace") {
    return sev === "error" || status === "error" || status === "fault";
  }
  if (issue.source === "alert") {
    return status === "firing" || status === "pending";
  }
  return true;
}
function framesToIssues(frames = [], options = {}) {
  const opts = {
    ...DEFAULT_ISSUES_OPTIONS,
    ...options,
    sources: { ...DEFAULT_ISSUES_OPTIONS.sources, ...options.sources || {} }
  };
  const notices = [];
  const optionErrors = [];
  const byId2 = /* @__PURE__ */ new Map();
  for (const frame of frames) {
    const n = frame.length || frame.fields[0]?.values?.length || 0;
    if (!n) continue;
    const dsUid = String(frame.meta?.datasourceUid || "");
    const dsName = String(frame.meta?.datasourceName || "");
    for (let i = 0; i < n; i++) {
      const id = String(
        getAt(frame, ["id", "alertId", "alert_id", "eventId"], i) ?? `${dsUid}-${i}`
      );
      const title = String(
        getAt(frame, ["title", "name", "message", "body", "summary"], i) ?? ""
      );
      const service = String(
        getAt(frame, ["service", "serviceName", "service_name"], i) ?? ""
      );
      const severity = String(
        getAt(frame, ["severity", "priority", "level"], i) ?? ""
      );
      const status = String(getAt(frame, ["status", "state"], i) ?? "");
      const traceId = getAt(frame, ["traceId", "trace_id", "traceID"], i);
      const time = toMs(
        getAt(frame, ["Time", "time", "timestamp", "ts"], i) || Date.now()
      );
      const durationMs = Number(
        getAt(frame, ["duration", "durationMs", "duration_ms"], i) ?? NaN
      );
      const environment = getAt(frame, ["environment", "env"], i);
      const operation = getAt(frame, ["operation", "operationName", "name"], i);
      const alertId = getAt(frame, ["alertId", "alert_id"], i);
      const attributes = parseAttributes(
        getAt(frame, ["attributes", "labels", "tags"], i)
      );
      const draft = {
        id,
        title,
        service,
        severity,
        status,
        source: "log",
        traceId: traceId != null ? String(traceId) : void 0,
        time: time || Date.now(),
        durationMs: Number.isFinite(durationMs) ? durationMs : void 0,
        attributes,
        datasourceUid: dsUid || void 0,
        datasourceName: dsName || void 0,
        environment: environment != null ? String(environment) : void 0,
        operation: operation != null ? String(operation) : void 0,
        alertId: alertId != null ? String(alertId) : void 0
      };
      draft.source = inferSource(frame, draft);
      if (draft.source === "log" && !opts.sources.logs) continue;
      if (draft.source === "trace" && !opts.sources.traces) continue;
      if (draft.source === "alert" && !opts.sources.alerts) continue;
      if (!isDefaultIncluded(draft) && !(opts.severities || []).length) {
        if (["info", "ok", "resolved", "debug"].includes(
          String(draft.severity || draft.status).toLowerCase()
        )) {
          continue;
        }
        if (!isDefaultIncluded(draft)) continue;
      }
      if (opts.service && draft.service && draft.service !== opts.service)
        continue;
      if (opts.environment && draft.environment && draft.environment !== opts.environment)
        continue;
      if (opts.operation && draft.operation && draft.operation !== opts.operation)
        continue;
      if (opts.minDurationMs != null && (draft.durationMs ?? 0) < opts.minDurationMs)
        continue;
      if (opts.maxDurationMs != null && (draft.durationMs ?? Infinity) > opts.maxDurationMs)
        continue;
      if ((opts.severities || []).length) {
        const sev = String(draft.severity || "").toLowerCase();
        if (!opts.severities.map((s) => s.toLowerCase()).includes(sev))
          continue;
      }
      if (!matchAttr(
        opts.attributeFilters || [],
        draft.attributes || {},
        optionErrors
      ))
        continue;
      const prev = byId2.get(draft.id);
      if (!prev || draft.time >= prev.time) byId2.set(draft.id, draft);
    }
  }
  if (!frames.length) notices.push("无数据帧");
  let issues = Array.from(byId2.values());
  if (opts.sort === "severity") {
    issues.sort(
      (a, b) => severityRank(b.severity) - severityRank(a.severity) || b.time - a.time
    );
  } else if (opts.sort === "duration") {
    issues.sort(
      (a, b) => (b.durationMs || 0) - (a.durationMs || 0) || b.time - a.time
    );
  } else {
    issues.sort((a, b) => b.time - a.time);
  }
  if (opts.limit && opts.limit > 0) issues = issues.slice(0, opts.limit);
  return { issues, notices, optionErrors: Array.from(new Set(optionErrors)) };
}
function issuesFromPanelData(data, options) {
  return framesToIssues(data?.series || [], options);
}
function resolveApi(preferredUid) {
  if (preferredUid) {
    const byUid2 = getRuntimeDataSource(String(preferredUid));
    if (byUid2?.mutate) return byUid2;
  }
  const all = listRuntimeDataSources();
  return all.find(
    (ds2) => ds2?.mutate && (ds2.type === "signoz" || String(ds2.uid || "").includes("signoz"))
  ) || all.find((ds2) => ds2?.mutate);
}
async function runIssueAction(issue, action, message, gate) {
  if (issue.source !== "alert") {
    return {
      status: "error",
      message: "仅 alert 来源支持动作（trace/log issue 只读）"
    };
  }
  const api = resolveApi(issue.datasourceUid);
  if (!api?.mutate) {
    return { status: "error", message: "当前数据源不支持动作" };
  }
  const alertId = issue.alertId || issue.id;
  const res = await api.mutate({
    action,
    payload: { alertId, source: "alert", message }
  });
  if (res?.status !== "success") {
    return { status: "error", message: res?.message || "动作失败" };
  }
  return { status: "success", message: res.message || "ok", data: res.data };
}
const _hoisted_1$q = {
  class: "tbl",
  "data-testid": "issues-table"
};
const _hoisted_2$l = { key: 0 };
const _hoisted_3$h = ["data-testid", "onClick"];
const _hoisted_4$d = { key: 0 };
const _hoisted_5$c = ["onClick"];
const _hoisted_6$a = ["onClick"];
const _hoisted_7$8 = {
  key: 1,
  class: "ro"
};
const _sfc_main$r = /* @__PURE__ */ defineComponent({
  __name: "IssuesTable",
  props: {
    items: {},
    options: {}
  },
  emits: ["select", "acknowledge", "resolve"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    function sevColor(sev) {
      const s = String(sev || "").toLowerCase();
      if (s === "critical" || s === "fatal") return "#d32f2f";
      if (s === "error") return "#f44336";
      if (s === "warning" || s === "warn") return "#ff9800";
      if (s === "info") return "#2196f3";
      return "#9e9e9e";
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("table", _hoisted_1$q, [
        createElementVNode("thead", null, [
          createElementVNode("tr", null, [
            _cache[1] || (_cache[1] = createElementVNode(
              "th",
              null,
              "时间",
              -1
              /* CACHED */
            )),
            _cache[2] || (_cache[2] = createElementVNode(
              "th",
              null,
              "来源",
              -1
              /* CACHED */
            )),
            _cache[3] || (_cache[3] = createElementVNode(
              "th",
              null,
              "服务",
              -1
              /* CACHED */
            )),
            _cache[4] || (_cache[4] = createElementVNode(
              "th",
              null,
              "标题",
              -1
              /* CACHED */
            )),
            _cache[5] || (_cache[5] = createElementVNode(
              "th",
              null,
              "严重性",
              -1
              /* CACHED */
            )),
            _cache[6] || (_cache[6] = createElementVNode(
              "th",
              null,
              "状态",
              -1
              /* CACHED */
            )),
            __props.options.showDatasource ? (openBlock(), createElementBlock("th", _hoisted_2$l, "数据源")) : createCommentVNode("v-if", true),
            _cache[7] || (_cache[7] = createElementVNode(
              "th",
              null,
              "动作",
              -1
              /* CACHED */
            ))
          ])
        ]),
        createElementVNode("tbody", null, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(__props.items, (issue) => {
              return openBlock(), createElementBlock("tr", {
                key: issue.id,
                "data-testid": `issue-${issue.id}`,
                onClick: ($event) => emit("select", issue)
              }, [
                createElementVNode(
                  "td",
                  null,
                  toDisplayString(new Date(issue.time).toLocaleString()),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "td",
                  null,
                  toDisplayString(issue.source),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "td",
                  null,
                  toDisplayString(issue.service),
                  1
                  /* TEXT */
                ),
                createElementVNode(
                  "td",
                  null,
                  toDisplayString(issue.title),
                  1
                  /* TEXT */
                ),
                createElementVNode("td", null, [
                  createElementVNode(
                    "span",
                    {
                      class: "sev",
                      style: normalizeStyle({ background: sevColor(issue.severity) })
                    },
                    toDisplayString(issue.severity || "—"),
                    5
                    /* TEXT, STYLE */
                  )
                ]),
                createElementVNode(
                  "td",
                  null,
                  toDisplayString(issue.status),
                  1
                  /* TEXT */
                ),
                __props.options.showDatasource ? (openBlock(), createElementBlock(
                  "td",
                  _hoisted_4$d,
                  toDisplayString(issue.datasourceName || issue.datasourceUid),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true),
                createElementVNode("td", {
                  onClick: _cache[0] || (_cache[0] = withModifiers(() => {
                  }, ["stop"]))
                }, [
                  issue.source === "alert" ? (openBlock(), createElementBlock(
                    Fragment,
                    { key: 0 },
                    [
                      createElementVNode("button", {
                        type: "button",
                        "data-testid": "issue-ack",
                        onClick: ($event) => emit("acknowledge", issue)
                      }, " 确认 ", 8, _hoisted_5$c),
                      createElementVNode("button", {
                        type: "button",
                        "data-testid": "issue-resolve",
                        onClick: ($event) => emit("resolve", issue)
                      }, " 解决 ", 8, _hoisted_6$a)
                    ],
                    64
                    /* STABLE_FRAGMENT */
                  )) : (openBlock(), createElementBlock("span", _hoisted_7$8, "只读"))
                ])
              ], 8, _hoisted_3$h);
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ])
      ]);
    };
  }
});
const IssuesTable = /* @__PURE__ */ _export_sfc(_sfc_main$r, [["__scopeId", "data-v-52987685"]]);
const _hoisted_1$p = {
  class: "list",
  "data-testid": "issues-list"
};
const _hoisted_2$k = ["data-testid", "onClick"];
const _hoisted_3$g = { class: "title" };
const _hoisted_4$c = { class: "meta" };
const _sfc_main$q = /* @__PURE__ */ defineComponent({
  __name: "IssuesList",
  props: {
    items: {},
    options: {}
  },
  emits: ["select"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    function sevColor(sev) {
      const s = String(sev || "").toLowerCase();
      if (s === "critical" || s === "fatal") return "#d32f2f";
      if (s === "error") return "#f44336";
      if (s === "warning" || s === "warn") return "#ff9800";
      return "#9e9e9e";
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("ul", _hoisted_1$p, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.items, (issue) => {
            return openBlock(), createElementBlock("li", {
              key: issue.id,
              "data-testid": `issue-${issue.id}`,
              onClick: ($event) => emit("select", issue)
            }, [
              createElementVNode(
                "span",
                {
                  class: "sev",
                  style: normalizeStyle({ background: sevColor(issue.severity) })
                },
                toDisplayString(issue.severity || issue.source),
                5
                /* TEXT, STYLE */
              ),
              createElementVNode(
                "span",
                _hoisted_3$g,
                toDisplayString(issue.title),
                1
                /* TEXT */
              ),
              createElementVNode(
                "span",
                _hoisted_4$c,
                toDisplayString(issue.service) + " · " + toDisplayString(new Date(issue.time).toLocaleString()),
                1
                /* TEXT */
              )
            ], 8, _hoisted_2$k);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const IssuesList = /* @__PURE__ */ _export_sfc(_sfc_main$q, [["__scopeId", "data-v-8c6eb442"]]);
const _hoisted_1$o = {
  class: "detail",
  "data-testid": "issue-detail"
};
const _hoisted_2$j = { key: 0 };
const _hoisted_3$f = { "data-testid": "issue-trace-id" };
const _hoisted_4$b = ["href"];
const _hoisted_5$b = {
  key: 1,
  "data-testid": "issue-attributes"
};
const _hoisted_6$9 = {
  key: 2,
  "data-testid": "issue-detail-loading"
};
const _hoisted_7$7 = {
  key: 3,
  class: "err",
  role: "alert"
};
const _hoisted_8$4 = {
  key: 4,
  "data-testid": "issue-spans",
  class: "block"
};
const _hoisted_9$3 = { class: "span-tree" };
const _hoisted_10$2 = ["data-span-id"];
const _hoisted_11$2 = { class: "muted" };
const _hoisted_12$2 = {
  key: 0,
  class: "sub",
  "data-testid": "issue-span-events"
};
const _hoisted_13$2 = {
  key: 1,
  class: "sub",
  "data-testid": "issue-span-attrs"
};
const _hoisted_14$2 = {
  key: 5,
  "data-testid": "issue-related-logs",
  class: "block"
};
const _hoisted_15$2 = { class: "muted" };
const _sfc_main$p = /* @__PURE__ */ defineComponent({
  __name: "IssueDetails",
  props: {
    issue: {},
    options: {},
    range: {}
  },
  setup(__props) {
    const props = __props;
    const spans = ref([]);
    const logs = ref([]);
    const loading = ref(false);
    const error = ref("");
    let controller = null;
    let seq = 0;
    const dataLink = computed(() => {
      if (!props.issue.traceId) return "";
      const tid = encodeURIComponent(props.issue.traceId);
      return `/d/signoz-traces/signoz-traces?var-traceId=${tid}`;
    });
    function fieldCol(frame, name) {
      const f = (frame?.fields || []).find(
        (x) => String(x.name).toLowerCase() === name.toLowerCase()
      );
      return f?.values || [];
    }
    function framesToSpanRows(frames) {
      const out = [];
      for (const fr of frames || []) {
        const n = fr.fields?.[0]?.values?.length || 0;
        const spanId = fieldCol(fr, "spanId");
        const parent = fieldCol(fr, "parentSpanId");
        const name = fieldCol(fr, "name");
        const service = fieldCol(fr, "serviceName").length ? fieldCol(fr, "serviceName") : fieldCol(fr, "service");
        const duration = fieldCol(fr, "duration");
        const attributes = fieldCol(fr, "attributes");
        const events = fieldCol(fr, "events");
        for (let i = 0; i < n; i++) {
          out.push({
            spanId: String(spanId[i] ?? ""),
            parentSpanId: String(parent[i] ?? ""),
            name: String(name[i] ?? ""),
            service: String(service[i] ?? ""),
            duration: Number(duration[i] ?? 0),
            attributes: attributes[i] != null ? String(attributes[i]) : void 0,
            events: events[i] != null ? String(events[i]) : void 0
          });
        }
      }
      return out;
    }
    function framesToLogRows(frames) {
      const out = [];
      for (const fr of frames || []) {
        const n = fr.fields?.[0]?.values?.length || 0;
        const time = fieldCol(fr, "Time").length ? fieldCol(fr, "Time") : fieldCol(fr, "time");
        const line = fieldCol(fr, "Line").length ? fieldCol(fr, "Line") : fieldCol(fr, "line");
        const service = fieldCol(fr, "service");
        const severity = fieldCol(fr, "severity");
        const spanId = fieldCol(fr, "spanId");
        for (let i = 0; i < n; i++) {
          out.push({
            time: Number(time[i] ?? 0),
            line: String(line[i] ?? ""),
            service: String(service[i] ?? ""),
            severity: String(severity[i] ?? ""),
            spanId: String(spanId[i] ?? "")
          });
        }
      }
      return out;
    }
    async function loadDetail() {
      if (!props.options.showTraceDetail) return;
      if (!props.issue.traceId || !props.issue.datasourceUid) {
        spans.value = [];
        logs.value = [];
        return;
      }
      controller?.abort();
      controller = new AbortController();
      const my = ++seq;
      loading.value = true;
      error.value = "";
      try {
        const api = getRuntimeDataSource(String(props.issue.datasourceUid));
        if (!api?.getMetadata) {
          loading.value = false;
          return;
        }
        const fromMs = props.range?.fromMs ?? Date.now() - 36e5;
        const toMs2 = props.range?.toMs ?? Date.now();
        let spanFrames = [];
        if (typeof api.getTraceWaterfall === "function") {
          const wf = await api.getTraceWaterfall(
            { traceId: props.issue.traceId, selectedSpanId: "" },
            controller.signal
          );
          spanFrames = wf?.frames || (Array.isArray(wf) ? wf : []);
        } else {
          const traceRes = await api.getMetadata(
            { type: "traceById", traceId: props.issue.traceId },
            controller.signal
          );
          spanFrames = traceRes?.frames || [];
        }
        const logRes = await api.getMetadata(
          { type: "relatedLogs", traceId: props.issue.traceId, fromMs, toMs: toMs2 },
          controller.signal
        );
        if (my !== seq) return;
        spans.value = framesToSpanRows(spanFrames);
        logs.value = framesToLogRows(logRes?.frames || []);
      } catch (e) {
        if (e?.name === "AbortError") return;
        if (my === seq) error.value = e instanceof Error ? e.message : String(e);
      } finally {
        if (my === seq) loading.value = false;
      }
    }
    watch(
      () => [
        props.issue.id,
        props.issue.traceId,
        props.range?.fromMs,
        props.range?.toMs
      ],
      () => void loadDetail(),
      { immediate: true }
    );
    onBeforeUnmount(() => {
      controller?.abort();
      seq += 1;
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("aside", _hoisted_1$o, [
        createElementVNode(
          "h4",
          null,
          toDisplayString(__props.issue.title),
          1
          /* TEXT */
        ),
        createElementVNode(
          "p",
          null,
          "服务: " + toDisplayString(__props.issue.service),
          1
          /* TEXT */
        ),
        createElementVNode(
          "p",
          null,
          " 来源: " + toDisplayString(__props.issue.source) + " · 严重性: " + toDisplayString(__props.issue.severity) + " · 状态: " + toDisplayString(__props.issue.status),
          1
          /* TEXT */
        ),
        __props.issue.traceId ? (openBlock(), createElementBlock("p", _hoisted_2$j, [
          _cache[1] || (_cache[1] = createTextVNode(
            " Trace: ",
            -1
            /* CACHED */
          )),
          createElementVNode(
            "span",
            _hoisted_3$f,
            toDisplayString(__props.issue.traceId),
            1
            /* TEXT */
          ),
          __props.options.showTraceLink && dataLink.value ? (openBlock(), createElementBlock("a", {
            key: 0,
            href: dataLink.value,
            "data-testid": "issue-trace-link",
            onClick: _cache[0] || (_cache[0] = withModifiers(() => {
            }, ["stop"]))
          }, " 打开 ", 8, _hoisted_4$b)) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true),
        __props.options.showAttributes && __props.issue.attributes ? (openBlock(), createElementBlock("div", _hoisted_5$b, [
          createElementVNode("table", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(__props.issue.attributes, (v, k) => {
                return openBlock(), createElementBlock("tr", { key: k }, [
                  createElementVNode(
                    "td",
                    null,
                    toDisplayString(k),
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "td",
                    null,
                    toDisplayString(v),
                    1
                    /* TEXT */
                  )
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true),
        loading.value ? (openBlock(), createElementBlock("div", _hoisted_6$9, "加载详情…")) : createCommentVNode("v-if", true),
        error.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_7$7,
          toDisplayString(error.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        spans.value.length ? (openBlock(), createElementBlock("div", _hoisted_8$4, [
          createElementVNode(
            "h5",
            null,
            "Spans (" + toDisplayString(spans.value.length) + ")",
            1
            /* TEXT */
          ),
          createElementVNode("ul", _hoisted_9$3, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(spans.value, (s) => {
                return openBlock(), createElementBlock("li", {
                  key: s.spanId,
                  "data-span-id": s.spanId
                }, [
                  createElementVNode(
                    "strong",
                    null,
                    toDisplayString(s.service),
                    1
                    /* TEXT */
                  ),
                  createTextVNode(
                    " · " + toDisplayString(s.name) + " ",
                    1
                    /* TEXT */
                  ),
                  createElementVNode(
                    "span",
                    _hoisted_11$2,
                    toDisplayString(s.duration.toFixed?.(2) ?? s.duration) + "ms",
                    1
                    /* TEXT */
                  ),
                  s.events ? (openBlock(), createElementBlock(
                    "div",
                    _hoisted_12$2,
                    " events: " + toDisplayString(s.events),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true),
                  s.attributes ? (openBlock(), createElementBlock(
                    "div",
                    _hoisted_13$2,
                    " attrs: " + toDisplayString(s.attributes),
                    1
                    /* TEXT */
                  )) : createCommentVNode("v-if", true)
                ], 8, _hoisted_10$2);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true),
        logs.value.length ? (openBlock(), createElementBlock("div", _hoisted_14$2, [
          createElementVNode(
            "h5",
            null,
            "Related logs (" + toDisplayString(logs.value.length) + ")",
            1
            /* TEXT */
          ),
          createElementVNode("ul", null, [
            (openBlock(true), createElementBlock(
              Fragment,
              null,
              renderList(logs.value, (l, i) => {
                return openBlock(), createElementBlock("li", {
                  key: i,
                  "data-testid": "issue-log-row"
                }, [
                  createElementVNode(
                    "span",
                    _hoisted_15$2,
                    toDisplayString(l.severity),
                    1
                    /* TEXT */
                  ),
                  createTextVNode(
                    " " + toDisplayString(l.line),
                    1
                    /* TEXT */
                  )
                ]);
              }),
              128
              /* KEYED_FRAGMENT */
            ))
          ])
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const IssueDetails = /* @__PURE__ */ _export_sfc(_sfc_main$p, [["__scopeId", "data-v-42ce578f"]]);
const _hoisted_1$n = {
  class: "signoz-issues",
  "data-testid": "signoz-issues-panel"
};
const _hoisted_2$i = { class: "toolbar" };
const _hoisted_3$e = {
  key: 0,
  "data-testid": "issue-action-msg"
};
const _hoisted_4$a = {
  key: 1,
  class: "err",
  "data-testid": "issue-action-error",
  role: "alert"
};
const _hoisted_5$a = {
  key: 0,
  "data-testid": "issues-empty"
};
const _hoisted_6$8 = {
  key: 3,
  class: "pager"
};
const _hoisted_7$6 = ["disabled"];
const _hoisted_8$3 = ["disabled"];
const _hoisted_9$2 = {
  key: 5,
  class: "confirm",
  "data-testid": "issue-action-confirm",
  role: "dialog"
};
const _sfc_main$o = /* @__PURE__ */ defineComponent({
  __name: "IssuesPanel",
  props: {
    id: {},
    data: {},
    options: {},
    fieldConfig: {},
    width: {},
    height: {},
    timeRange: {},
    replaceVariables: { type: Function },
    title: {},
    transparent: { type: Boolean }
  },
  setup(__props) {
    const props = __props;
    const options = computed(() => ({
      ...DEFAULT_ISSUES_OPTIONS,
      ...props.options || {},
      sources: {
        ...DEFAULT_ISSUES_OPTIONS.sources,
        ...props.options?.sources || {}
      }
    }));
    const alertFrames = ref([]);
    const actionMsg = ref("");
    const actionError = ref("");
    const selected = ref(null);
    const page = ref(0);
    const confirmIssue = ref(null);
    const confirmAction = ref(null);
    let alertsController = null;
    let alertsSeq = 0;
    const baseModel = computed(
      () => issuesFromPanelData(props.data, options.value)
    );
    const mergedFrames = computed(() => [
      ...props.data?.series || [],
      ...alertFrames.value
    ]);
    const model = computed(() => {
      if (!alertFrames.value.length) return baseModel.value;
      return framesToIssues(mergedFrames.value, options.value);
    });
    const issues = computed(() => model.value.issues);
    const notices = computed(() => [
      ...model.value.notices,
      ...model.value.optionErrors
    ]);
    const pageSize = computed(() => options.value.pageSize || 50);
    const pageItems = computed(() => {
      const start = page.value * pageSize.value;
      return issues.value.slice(start, start + pageSize.value);
    });
    const range = computed(() => {
      const r = props.data?.timeRange || props.timeRange;
      return {
        fromMs: r?.from?.valueOf?.() ?? Date.now() - 36e5,
        toMs: r?.to?.valueOf?.() ?? Date.now()
      };
    });
    function collectSigNozUids() {
      const uids = /* @__PURE__ */ new Set();
      for (const fr of props.data?.series || []) {
        const u = fr.meta?.datasourceUid;
        if (u) uids.add(String(u));
      }
      const dsRef = props.data?.request?.targets?.[0]?.datasource || props.datasource;
      const uid = typeof dsRef === "string" ? dsRef : dsRef?.uid;
      if (uid) uids.add(String(uid));
      if (!uids.size) {
        for (const ds2 of listRuntimeDataSources()) {
          if (ds2?.type === "signoz" || String(ds2?.uid || "").includes("signoz"))
            uids.add(String(ds2.uid));
        }
      }
      return Array.from(uids);
    }
    async function loadAlertsMetadata() {
      if (!options.value.sources?.alerts) {
        alertFrames.value = [];
        return;
      }
      alertsController?.abort();
      alertsController = new AbortController();
      const my = ++alertsSeq;
      const frames = [];
      for (const uid of collectSigNozUids()) {
        const api = getRuntimeDataSource(uid);
        if (!api?.getMetadata) continue;
        try {
          const res = await api.getMetadata(
            {
              type: "alerts",
              fromMs: range.value.fromMs,
              toMs: range.value.toMs,
              service: options.value.service,
              environment: options.value.environment,
              severities: options.value.severities
            },
            alertsController.signal
          );
          if (my !== alertsSeq) return;
          for (const fr of res?.frames || []) {
            frames.push({
              ...fr,
              meta: { ...fr.meta || {}, datasourceUid: uid, signal: "alerts" }
            });
          }
        } catch (e) {
          if (e?.name === "AbortError") return;
        }
      }
      if (my === alertsSeq) alertFrames.value = frames;
    }
    watch(
      () => [
        options.value.sources?.alerts,
        options.value.service,
        options.value.environment,
        range.value.fromMs,
        range.value.toMs,
        props.data?.series?.length
      ],
      () => void loadAlertsMetadata(),
      { immediate: true }
    );
    onBeforeUnmount(() => {
      alertsController?.abort();
      alertsSeq += 1;
    });
    function requestAction(issue, action) {
      confirmIssue.value = issue;
      confirmAction.value = action;
    }
    async function confirmRun() {
      if (!confirmIssue.value || !confirmAction.value) return;
      actionMsg.value = "";
      actionError.value = "";
      const res = await runIssueAction(confirmIssue.value, confirmAction.value);
      if (res.status === "success") {
        actionMsg.value = res.message || "ok";
        await loadAlertsMetadata();
      } else {
        actionError.value = res.message || "动作失败";
      }
      confirmIssue.value = null;
      confirmAction.value = null;
    }
    function cancelConfirm() {
      confirmIssue.value = null;
      confirmAction.value = null;
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$n, [
        createElementVNode("div", _hoisted_2$i, [
          createElementVNode(
            "span",
            null,
            "Issues " + toDisplayString(issues.value.length),
            1
            /* TEXT */
          ),
          actionMsg.value ? (openBlock(), createElementBlock(
            "span",
            _hoisted_3$e,
            toDisplayString(actionMsg.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          actionError.value ? (openBlock(), createElementBlock(
            "span",
            _hoisted_4$a,
            toDisplayString(actionError.value),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true)
        ]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(notices.value, (n) => {
            return openBlock(), createElementBlock(
              "div",
              {
                key: n,
                class: "notice",
                role: "status"
              },
              toDisplayString(n),
              1
              /* TEXT */
            );
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        !issues.value.length ? (openBlock(), createElementBlock("div", _hoisted_5$a, " 当前筛选条件下没有 Issues ")) : options.value.layout === "table" ? (openBlock(), createBlock(IssuesTable, {
          key: 1,
          items: pageItems.value,
          options: options.value,
          onSelect: _cache[0] || (_cache[0] = ($event) => selected.value = $event),
          onAcknowledge: _cache[1] || (_cache[1] = ($event) => requestAction($event, "signoz.acknowledge")),
          onResolve: _cache[2] || (_cache[2] = ($event) => requestAction($event, "signoz.resolve"))
        }, null, 8, ["items", "options"])) : (openBlock(), createBlock(IssuesList, {
          key: 2,
          items: pageItems.value,
          options: options.value,
          onSelect: _cache[3] || (_cache[3] = ($event) => selected.value = $event)
        }, null, 8, ["items", "options"])),
        issues.value.length > pageSize.value ? (openBlock(), createElementBlock("div", _hoisted_6$8, [
          createElementVNode("button", {
            type: "button",
            disabled: page.value === 0,
            "data-testid": "issues-prev",
            onClick: _cache[4] || (_cache[4] = ($event) => page.value--)
          }, " 上一页 ", 8, _hoisted_7$6),
          createElementVNode(
            "span",
            null,
            toDisplayString(page.value + 1) + " / " + toDisplayString(Math.max(1, Math.ceil(issues.value.length / pageSize.value))),
            1
            /* TEXT */
          ),
          createElementVNode("button", {
            type: "button",
            disabled: (page.value + 1) * pageSize.value >= issues.value.length,
            "data-testid": "issues-next",
            onClick: _cache[5] || (_cache[5] = ($event) => page.value++)
          }, " 下一页 ", 8, _hoisted_8$3)
        ])) : createCommentVNode("v-if", true),
        selected.value && options.value.showTraceDetail ? (openBlock(), createBlock(IssueDetails, {
          key: 4,
          issue: selected.value,
          options: options.value,
          range: range.value
        }, null, 8, ["issue", "options", "range"])) : createCommentVNode("v-if", true),
        confirmIssue.value && confirmAction.value ? (openBlock(), createElementBlock("div", _hoisted_9$2, [
          createElementVNode(
            "p",
            null,
            " 确认对 alert " + toDisplayString(confirmIssue.value.alertId || confirmIssue.value.id) + " 执行 " + toDisplayString(confirmAction.value) + "？ ",
            1
            /* TEXT */
          ),
          createElementVNode("button", {
            type: "button",
            "data-testid": "issue-confirm-ok",
            onClick: confirmRun
          }, " 确认 "),
          createElementVNode("button", {
            type: "button",
            "data-testid": "issue-confirm-cancel",
            onClick: cancelConfirm
          }, " 取消 ")
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const IssuesPanel = /* @__PURE__ */ _export_sfc(_sfc_main$o, [["__scopeId", "data-v-921da130"]]);
const plugin$1 = new VuePanelPlugin(
  { id: "signoz-issues", name: "SigNoz 可观测性问题", state: "stable" },
  IssuesPanel
).setPanelOptions((builder) => {
  builder.addNumber(
    {
      id: "pageSize",
      path: "pageSize",
      name: "每页条数",
      editor: "number"
    },
    50
  ).addBoolean(
    {
      id: "showTraceDetail",
      path: "showTraceDetail",
      name: "显示 Trace 详情",
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "showAttributes",
      path: "showAttributes",
      name: "显示属性",
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "showTraceLink",
      path: "showTraceLink",
      name: "显示 Trace 链接",
      editor: "boolean"
    },
    true
  ).addBoolean(
    {
      id: "showDatasource",
      path: "showDatasource",
      name: "显示数据源",
      editor: "boolean"
    },
    false
  );
}).setRuntimeConsumedPaths([
  "layout",
  "pageSize",
  "showTraceDetail",
  "sources",
  "service",
  "environment",
  "operation",
  "attributeFilters",
  "severities",
  "minDurationMs",
  "maxDurationMs",
  "sort",
  "limit",
  "highlightNew",
  "highlightWindowMs",
  "showAttributes",
  "showTraceLink",
  "showDatasource"
]).register();
const module$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: plugin$1
}, Symbol.toStringTag, { value: "Module" }));
function nextQueryName(items) {
  const used = new Set(items.map((item) => item.spec.name));
  for (const name of "ABCDEFGHIJKLMNOPQRSTUVWXYZ") {
    if (!used.has(name)) return name;
  }
  let index2 = 1;
  while (used.has(`Q${index2}`)) index2 += 1;
  return `Q${index2}`;
}
function nextFormulaName(items) {
  const used = new Set(items.map((item) => item.spec.name));
  let index2 = 1;
  while (used.has(`F${index2}`)) index2 += 1;
  return `F${index2}`;
}
function deepClone(v) {
  return JSON.parse(JSON.stringify(v));
}
function cloneBuilderSpec(spec) {
  return deepClone(spec);
}
function emptyState(mode2 = "builder") {
  return {
    activeQueryType: mode2,
    builder: {
      queries: [defaultBuilderSpec("A", "traces")],
      formulas: [],
      traceOperators: []
    },
    promql: [],
    clickhouseSql: []
  };
}
function toEditorState(query) {
  const q = query || {};
  if (q.editor && typeof q.editor === "object") {
    return deepClone(q.editor);
  }
  const items = Array.isArray(q.queries) ? q.queries : [];
  if (!items.length) return emptyState();
  const modes = /* @__PURE__ */ new Set();
  const state2 = emptyState();
  state2.builder.queries = [];
  for (const item of items) {
    if (item.type === "builder_formula") {
      const f = item.spec;
      state2.builder.formulas.push(
        deepClone({
          name: f?.name || "F1",
          expression: f?.expression || "",
          disabled: Boolean(f?.disabled),
          legend: f?.legend || "",
          order: Array.isArray(f?.order) ? f.order : [],
          limit: f?.limit
        })
      );
      modes.add("builder");
      continue;
    }
    if (item.type === "builder_trace_operator") {
      state2.builder.traceOperators.push(
        deepClone(item.spec)
      );
      modes.add("builder");
      continue;
    }
    if (item.type !== "builder_query") continue;
    const qt = item.queryType || "builder";
    modes.add(qt);
    if (qt === "promql") {
      state2.promql.push({
        name: item.spec?.name || "A",
        query: String(item.rawQuery || ""),
        legend: item.rawLegend || item.spec?.legend,
        disabled: item.spec?.disabled
      });
    } else if (qt === "clickhouse_sql") {
      state2.clickhouseSql.push({
        name: item.spec?.name || "A",
        query: String(item.rawQuery || ""),
        legend: item.rawLegend || item.spec?.legend,
        disabled: item.spec?.disabled
      });
    } else {
      state2.builder.queries.push(cloneBuilderSpec(item.spec));
    }
  }
  if (!state2.builder.queries.length) {
    state2.builder.queries = [defaultBuilderSpec("A", "traces")];
  }
  const modeList = [...modes].filter(
    (m) => m === "builder" || m === "promql" || m === "clickhouse_sql"
  );
  if (modeList.length > 1) {
    state2.legacyMixed = true;
    state2.legacySchema1 = deepClone(items);
    state2.activeQueryType = modeList[0] || "builder";
  } else {
    state2.activeQueryType = modeList[0] || "builder";
  }
  return state2;
}
function fromEditorState(state2, base = {}) {
  if (state2.legacyMixed && state2.legacySchema1?.length) {
    return {
      refId: base.refId || "A",
      schema: 1,
      ...base,
      queries: deepClone(state2.legacySchema1),
      editor: deepClone(state2)
    };
  }
  const queries = [];
  if (state2.activeQueryType === "builder") {
    for (const spec of state2.builder.queries) {
      queries.push({
        type: "builder_query",
        queryType: "builder",
        spec: cloneBuilderSpec(spec)
      });
    }
    for (const f of state2.builder.formulas) {
      queries.push({ type: "builder_formula", spec: deepClone(f) });
    }
    for (const t2 of state2.builder.traceOperators) {
      queries.push({ type: "builder_trace_operator", spec: deepClone(t2) });
    }
  } else if (state2.activeQueryType === "promql") {
    for (const r of state2.promql.length ? state2.promql : [{ name: "A", query: "" }]) {
      queries.push({
        type: "builder_query",
        queryType: "promql",
        rawQuery: r.query,
        rawLegend: r.legend,
        spec: {
          ...defaultBuilderSpec(r.name, "metrics"),
          disabled: r.disabled,
          legend: r.legend
        }
      });
    }
  } else {
    for (const r of state2.clickhouseSql.length ? state2.clickhouseSql : [{ name: "A", query: "" }]) {
      queries.push({
        type: "builder_query",
        queryType: "clickhouse_sql",
        rawQuery: r.query,
        rawLegend: r.legend,
        spec: {
          ...defaultBuilderSpec(r.name, "logs"),
          disabled: r.disabled,
          legend: r.legend
        }
      });
    }
  }
  return {
    refId: base.refId || "A",
    schema: 2,
    apiProfile: base.apiProfile || "signoz-v5",
    requestType: base.requestType || "time_series",
    ...base,
    queries,
    editor: deepClone(state2)
  };
}
function commitGlobalMode(state2, mode2) {
  const next = deepClone(state2);
  next.activeQueryType = mode2;
  next.legacyMixed = false;
  next.legacySchema1 = void 0;
  return next;
}
const _hoisted_1$m = {
  class: "field-key-select",
  "data-testid": "signoz-field-key-select"
};
const _hoisted_2$h = {
  key: 0,
  class: "err",
  "data-testid": "signoz-field-key-error",
  role: "status"
};
const _sfc_main$n = /* @__PURE__ */ defineComponent({
  __name: "FieldKeySelect",
  props: {
    modelValue: {},
    multiple: { type: Boolean },
    signal: {},
    metricName: {},
    datasourceApi: {},
    placeholder: {},
    testId: {},
    numberOnly: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const options = ref([]);
    const loading = ref(false);
    const error = ref("");
    let timer = null;
    let abort = null;
    function fieldFromValue(name) {
      const hit = options.value.find((o) => o.value === name)?.field;
      return hit || {
        name,
        fieldDataType: "string",
        fieldContext: "tag"
      };
    }
    function currentNames() {
      const mv = props.modelValue;
      if (mv == null || mv === "") return [];
      if (typeof mv === "string") return mv ? [mv] : [];
      if (Array.isArray(mv))
        return mv.map((f) => typeof f === "string" ? f : f.name).filter(Boolean);
      return [mv.name].filter(Boolean);
    }
    async function search(text) {
      if (!props.datasourceApi?.getMetadata) {
        options.value = currentNames().map((n) => ({ label: n, value: n }));
        return;
      }
      abort?.abort();
      abort = new AbortController();
      loading.value = true;
      error.value = "";
      try {
        const res = await props.datasourceApi.getMetadata(
          {
            type: "attributeKeys",
            signal: props.signal || "metrics",
            metricName: props.metricName,
            search: text || void 0
          },
          abort.signal
        );
        let fields = Array.isArray(res?.values) ? res.values : [];
        if (props.numberOnly) {
          fields = fields.filter(
            (f) => f.fieldDataType === "float64" || f.fieldDataType === "int64"
          );
        }
        options.value = fields.map((f) => ({
          label: f.fieldContext ? `${f.name} (${f.fieldContext})` : f.name,
          value: f.name,
          field: f
        }));
      } catch (e) {
        if (e?.name === "AbortError") return;
        error.value = e?.message || String(e);
        options.value = currentNames().map((n) => ({ label: n, value: n }));
      } finally {
        loading.value = false;
      }
    }
    function debounceSearch(text) {
      if (timer) clearTimeout(timer);
      timer = setTimeout(() => search(text), 300);
    }
    function onChange(val) {
      if (props.multiple) {
        const names = Array.isArray(val) ? val.map(String) : val ? [String(val)] : [];
        emit(
          "update:modelValue",
          names.map((n) => fieldFromValue(n))
        );
        return;
      }
      const name = val == null || val === "" ? null : String(val);
      emit("update:modelValue", name ? fieldFromValue(name) : null);
    }
    watch(
      () => [props.signal, props.metricName, Boolean(props.datasourceApi)],
      () => {
        search("");
      },
      { immediate: true }
    );
    onBeforeUnmount(() => {
      if (timer) clearTimeout(timer);
      abort?.abort();
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$m, [
        createVNode(unref(GSelect), {
          value: __props.multiple ? currentNames() : currentNames()[0],
          options: options.value,
          mode: __props.multiple ? "multiple" : void 0,
          "show-search": "",
          "allow-clear": "",
          placeholder: __props.placeholder || "搜索字段…",
          loading: loading.value,
          "test-id": __props.testId || "signoz-field-key",
          onSearch: _cache[0] || (_cache[0] = ($event) => debounceSearch(String($event || ""))),
          "onUpdate:value": onChange
        }, null, 8, ["value", "options", "mode", "placeholder", "loading", "test-id"]),
        error.value ? (openBlock(), createElementBlock(
          "p",
          _hoisted_2$h,
          toDisplayString(error.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const FieldKeySelect = /* @__PURE__ */ _export_sfc(_sfc_main$n, [["__scopeId", "data-v-de824783"]]);
const _hoisted_1$l = {
  class: "group-by",
  "data-testid": "signoz-group-by-editor"
};
const _sfc_main$m = /* @__PURE__ */ defineComponent({
  __name: "GroupByEditor",
  props: {
    modelValue: {},
    signal: {},
    metricName: {},
    datasourceApi: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function asText() {
      return (props.modelValue || []).map((f) => f.name).join(",");
    }
    function fromText(v) {
      const next = String(v || "").split(",").map((s) => s.trim()).filter(Boolean).map((name) => ({
        name,
        fieldDataType: "string",
        fieldContext: "tag"
      }));
      emit("update:modelValue", next);
    }
    function onSelect(v) {
      const list = Array.isArray(v) ? v : v ? [v] : [];
      emit("update:modelValue", list);
    }
    function addField() {
      emit("update:modelValue", [
        ...props.modelValue || [],
        { name: "", fieldDataType: "string", fieldContext: "tag" }
      ]);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$l, [
        __props.datasourceApi?.getMetadata ? (openBlock(), createBlock(FieldKeySelect, {
          key: 0,
          "model-value": __props.modelValue || [],
          multiple: "",
          signal: __props.signal || "metrics",
          "metric-name": __props.metricName,
          "datasource-api": __props.datasourceApi,
          "test-id": "signoz-group-by",
          "onUpdate:modelValue": onSelect
        }, null, 8, ["model-value", "signal", "metric-name", "datasource-api"])) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createVNode(unref(GInput), {
              "model-value": asText(),
              placeholder: "service,name",
              "test-id": "signoz-group-by",
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => fromText(String($event)))
            }, null, 8, ["model-value"]),
            createVNode(unref(GButton), {
              size: "sm",
              variant: "secondary",
              type: "button",
              "test-id": "signoz-group-by-add",
              onClick: addField
            }, {
              default: withCtx(() => [..._cache[1] || (_cache[1] = [
                createTextVNode(
                  "+",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            })
          ],
          64
          /* STABLE_FRAGMENT */
        ))
      ]);
    };
  }
});
const GroupByEditor = /* @__PURE__ */ _export_sfc(_sfc_main$m, [["__scopeId", "data-v-8436cf39"]]);
const _hoisted_1$k = {
  class: "groupby-field-select",
  "data-testid": "signoz-groupby-field-select"
};
const _sfc_main$l = /* @__PURE__ */ defineComponent({
  __name: "GroupByFieldSelect",
  props: {
    modelValue: {},
    signal: {},
    metricName: {},
    datasourceApi: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$k, [
        createVNode(GroupByEditor, {
          "model-value": __props.modelValue,
          signal: __props.signal,
          "metric-name": __props.metricName,
          "datasource-api": __props.datasourceApi,
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
        }, null, 8, ["model-value", "signal", "metric-name", "datasource-api"])
      ]);
    };
  }
});
const GroupByFieldSelect = /* @__PURE__ */ _export_sfc(_sfc_main$l, [["__scopeId", "data-v-959f1373"]]);
const _hoisted_1$j = {
  class: "fn-ed",
  "data-testid": "signoz-function-editor",
  "data-matrix-id": "signoz-functions"
};
const _hoisted_2$g = {
  key: 0,
  "data-testid": "signoz-functions",
  class: "fn-anchor",
  "aria-hidden": "true"
};
const _hoisted_3$d = {
  key: 1,
  class: "warn",
  "data-testid": "signoz-function-unsupported",
  role: "status"
};
const _sfc_main$k = /* @__PURE__ */ defineComponent({
  __name: "FunctionEditor",
  props: {
    modelValue: {},
    unsupported: {},
    catalog: {},
    capabilities: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const catalog = computed(() => {
      if (props.catalog?.length) return props.catalog;
      if (props.capabilities) {
        return functionsForEditor(props.capabilities).map((f) => ({
          name: f.name
        }));
      }
      return SIGNOZ_FUNCTION_CATALOG;
    });
    const options = computed(
      () => catalog.value.map((c) => ({ label: c.name, value: c.name }))
    );
    function updateAt(index2, patch) {
      const next = (props.modelValue || []).map((f, i) => {
        if (i !== index2) return f;
        const merged = { ...f, ...patch };
        if (patch.name && patch.name !== f.name) {
          merged.args = normalizeFunctionArgs(
            patch.name,
            (merged.args || []).map((a) => a.value)
          );
        }
        return merged;
      });
      emit("update:modelValue", next);
    }
    function setArgs(index2, text) {
      const fn = (props.modelValue || [])[index2];
      const parts = String(text || "").split(",").map((s) => s.trim()).filter((s) => s !== "");
      const args = normalizeFunctionArgs(fn?.name || "", parts);
      updateAt(index2, { args });
    }
    function argsText(f) {
      return (f.args || []).map((a) => a.value).join(",");
    }
    function add() {
      const first = catalog.value[0]?.name || "absolute";
      emit("update:modelValue", [
        ...props.modelValue || [],
        { name: first, args: [] }
      ]);
    }
    function removeAt(index2) {
      emit(
        "update:modelValue",
        (props.modelValue || []).filter((_, i) => i !== index2)
      );
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$j, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.modelValue || [], (fn, index2) => {
            return openBlock(), createElementBlock("div", {
              key: index2,
              class: "fn-row"
            }, [
              createVNode(unref(GSelect), {
                value: fn.name,
                options: options.value,
                "test-id": "signoz-functions",
                "onUpdate:value": ($event) => updateAt(index2, { name: String($event) })
              }, null, 8, ["value", "options", "onUpdate:value"]),
              createVNode(unref(GInput), {
                "model-value": argsText(fn),
                placeholder: "args (comma-separated)",
                "test-id": `signoz-function-args-${index2}`,
                "onUpdate:modelValue": ($event) => setArgs(index2, String($event))
              }, null, 8, ["model-value", "test-id", "onUpdate:modelValue"]),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "secondary",
                type: "button",
                onClick: ($event) => removeAt(index2)
              }, {
                default: withCtx(() => [..._cache[0] || (_cache[0] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        !(__props.modelValue || []).length ? (openBlock(), createElementBlock("span", _hoisted_2$g)) : createCommentVNode("v-if", true),
        createVNode(unref(GButton), {
          size: "sm",
          variant: "secondary",
          type: "button",
          "test-id": "signoz-function-add",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              " + 函数 ",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        }),
        __props.unsupported?.length ? (openBlock(), createElementBlock(
          "p",
          _hoisted_3$d,
          " 已保存但不支持的函数: " + toDisplayString(__props.unsupported.join(", ")) + "（未删除，请调整或恢复 capability） ",
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const FunctionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__scopeId", "data-v-1ad190f2"]]);
const _hoisted_1$i = {
  class: "multi-agg",
  "data-testid": "signoz-multi-agg"
};
const _sfc_main$j = /* @__PURE__ */ defineComponent({
  __name: "MultiAggEditor",
  props: {
    modelValue: {},
    signal: {},
    datasourceApi: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const FN_OPTIONS = [
      "count",
      "count_distinct",
      "sum",
      "avg",
      "min",
      "max",
      "p05",
      "p10",
      "p50",
      "p90",
      "p95",
      "p99",
      "rate",
      "rate_sum",
      "rate_avg"
    ].map((v) => ({ label: v, value: v }));
    const props = __props;
    const emit = __emit;
    function rows() {
      return props.modelValue?.length ? props.modelValue : [{ expression: "count()" }];
    }
    function parseFn(expression) {
      const m = String(expression || "").match(/^([a-zA-Z0-9_]+)/);
      return m?.[1] || "count";
    }
    function parseField(expression) {
      const m = String(expression || "").match(/\(([^)]*)\)/);
      return (m?.[1] || "").trim();
    }
    function setAt(index2, fn, field) {
      const next = rows().map((r, i) => {
        if (i !== index2) return r;
        const expression = fn === "count" ? "count()" : `${fn}(${field || ""})`;
        return { ...r, expression, timeAggregation: fn };
      });
      emit("update:modelValue", next);
    }
    function add() {
      emit("update:modelValue", [...rows(), { expression: "count()" }]);
    }
    function removeAt(index2) {
      const next = rows().filter((_, i) => i !== index2);
      emit("update:modelValue", next.length ? next : [{ expression: "count()" }]);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$i, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(rows(), (row, index2) => {
            return openBlock(), createElementBlock("div", {
              key: index2,
              class: "row"
            }, [
              createVNode(unref(GSelect), {
                value: parseFn(row.expression),
                options: unref(FN_OPTIONS),
                "test-id": `signoz-multi-agg-fn-${index2}`,
                "onUpdate:value": ($event) => setAt(index2, String($event), parseField(row.expression))
              }, null, 8, ["value", "options", "test-id", "onUpdate:value"]),
              parseFn(row.expression) !== "count" ? (openBlock(), createBlock(FieldKeySelect, {
                key: 0,
                "model-value": parseField(row.expression) ? {
                  name: parseField(row.expression),
                  fieldDataType: "float64",
                  fieldContext: "tag"
                } : null,
                signal: __props.signal || "logs",
                "datasource-api": __props.datasourceApi,
                "number-only": "",
                "test-id": `signoz-multi-agg-field-${index2}`,
                "onUpdate:modelValue": ($event) => setAt(
                  index2,
                  parseFn(row.expression),
                  $event && typeof $event === "object" && "name" in $event ? String($event.name) : ""
                )
              }, null, 8, ["model-value", "signal", "datasource-api", "test-id", "onUpdate:modelValue"])) : (openBlock(), createBlock(unref(GInput), {
                key: 1,
                "model-value": "",
                disabled: "",
                placeholder: "count() 无字段",
                "test-id": `signoz-multi-agg-field-${index2}`
              }, null, 8, ["test-id"])),
              createVNode(unref(GButton), {
                size: "sm",
                variant: "secondary",
                type: "button",
                onClick: ($event) => removeAt(index2)
              }, {
                default: withCtx(() => [..._cache[0] || (_cache[0] = [
                  createTextVNode(
                    "×",
                    -1
                    /* CACHED */
                  )
                ])]),
                _: 1
                /* STABLE */
              }, 8, ["onClick"])
            ]);
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(unref(GButton), {
          size: "sm",
          variant: "secondary",
          type: "button",
          "test-id": "signoz-multi-agg-add",
          onClick: add
        }, {
          default: withCtx(() => [..._cache[1] || (_cache[1] = [
            createTextVNode(
              "+ 聚合",
              -1
              /* CACHED */
            )
          ])]),
          _: 1
          /* STABLE */
        })
      ]);
    };
  }
});
const MultiAggEditor = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__scopeId", "data-v-af460cc0"]]);
const _hoisted_1$h = {
  class: "expr-agg",
  "data-testid": "signoz-expression-aggregation-editor"
};
const _hoisted_2$f = {
  key: 0,
  class: "expr-agg-row"
};
const _sfc_main$i = /* @__PURE__ */ defineComponent({
  __name: "ExpressionAggregationEditor",
  props: {
    aggregations: {},
    signal: {},
    datasourceApi: {},
    testIdPrefix: {},
    multi: { type: Boolean }
  },
  emits: ["update:aggregations"],
  setup(__props, { emit: __emit }) {
    const EXPRESSION_PRESETS = [
      { label: "count()", value: "count()" },
      { label: "rate()", value: "rate()" },
      { label: "avg()", value: "avg()" },
      { label: "sum()", value: "sum()" },
      { label: "min()", value: "min()" },
      { label: "max()", value: "max()" },
      { label: "p50()", value: "p50()" },
      { label: "p90()", value: "p90()" },
      { label: "p95()", value: "p95()" },
      { label: "p99()", value: "p99()" }
    ];
    const props = __props;
    const emit = __emit;
    const tid = (base) => props.testIdPrefix ? `${base}-${props.testIdPrefix}` : base;
    const primaryExpr = computed({
      get: () => {
        const a = props.aggregations?.[0];
        if (!a) return "count()";
        if (a.kind === "expression" || a.expression)
          return String(a.expression || "count()");
        return String(a.timeAggregation || "count()");
      },
      set: (v) => {
        const expr = !v ? "count()" : v.includes("(") ? v : v === "count" ? "count()" : v;
        emit("update:aggregations", [{ kind: "expression", expression: expr }]);
      }
    });
    function onMulti(v) {
      const next = (v || []).map((a) => {
        if (a?.kind === "metric") return a;
        return {
          kind: "expression",
          expression: String(a?.expression || a?.timeAggregation || "count()"),
          ...a?.alias != null ? { alias: String(a.alias) } : {}
        };
      });
      emit(
        "update:aggregations",
        next.length ? next : [{ kind: "expression", expression: "count()" }]
      );
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$h, [
        !__props.multi ? (openBlock(), createElementBlock("div", _hoisted_2$f, [
          _cache[1] || (_cache[1] = createElementVNode(
            "span",
            { class: "qb-label" },
            "聚合",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: primaryExpr.value,
            options: EXPRESSION_PRESETS,
            "allow-clear": "",
            "test-id": tid("signoz-aggregation"),
            class: "qb-flex",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => primaryExpr.value = String($event || "count()"))
          }, null, 8, ["value", "test-id"])
        ])) : (openBlock(), createBlock(MultiAggEditor, {
          key: 1,
          "model-value": __props.aggregations,
          signal: __props.signal,
          "datasource-api": __props.datasourceApi,
          "onUpdate:modelValue": onMulti
        }, null, 8, ["model-value", "signal", "datasource-api"]))
      ]);
    };
  }
});
const ExpressionAggregationEditor = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__scopeId", "data-v-77f32c7d"]]);
const METRIC_AGG_CATALOG = {
  Sum: {
    time: ["rate", "increase"],
    space: ["sum", "avg", "min", "max", "count"],
    hideTimeAggregation: false
  },
  Gauge: {
    time: ["latest", "sum", "avg", "min", "max", "count", "count_distinct"],
    space: ["sum", "avg", "min", "max", "count"],
    hideTimeAggregation: false
  },
  Histogram: {
    time: [],
    space: ["p50", "p75", "p90", "p95", "p99"],
    hideTimeAggregation: true
  },
  ExponentialHistogram: {
    time: [],
    space: ["p50", "p75", "p90", "p95", "p99"],
    hideTimeAggregation: true
  },
  unknown: {
    time: [
      "latest",
      "sum",
      "avg",
      "min",
      "max",
      "count",
      "count_distinct",
      "rate",
      "increase"
    ],
    space: [
      "sum",
      "avg",
      "min",
      "max",
      "count",
      "p50",
      "p75",
      "p90",
      "p95",
      "p99"
    ],
    hideTimeAggregation: false
  }
};
function normalizeCatalogKind(type) {
  const t2 = String(type || "").toLowerCase();
  if (t2.includes("exp") && t2.includes("hist")) return "ExponentialHistogram";
  if (t2.includes("hist")) return "Histogram";
  if (t2 === "sum" || t2.startsWith("sum")) return "Sum";
  if (t2.includes("gauge")) return "Gauge";
  if (t2.includes("counter")) return "Sum";
  return "unknown";
}
function timeAggregationOptions(type) {
  const kind2 = normalizeCatalogKind(type);
  return METRIC_AGG_CATALOG[kind2].time.map((v) => ({ label: v, value: v }));
}
function spaceAggregationOptions(type) {
  const kind2 = normalizeCatalogKind(type);
  return METRIC_AGG_CATALOG[kind2].space.map((v) => ({ label: v, value: v }));
}
function shouldHideTimeAggregation(type) {
  return METRIC_AGG_CATALOG[normalizeCatalogKind(type)].hideTimeAggregation;
}
function coerceAggregationsForMetricType(type, current) {
  const timeOpts = timeAggregationOptions(type).map((o) => o.value);
  const spaceOpts = spaceAggregationOptions(type).map((o) => o.value);
  const hideTime = shouldHideTimeAggregation(type);
  const timeAggregation = hideTime ? void 0 : timeOpts.includes(String(current.timeAggregation || "")) ? current.timeAggregation : timeOpts[0];
  const spaceAggregation = spaceOpts.includes(
    String(current.spaceAggregation || "")
  ) ? current.spaceAggregation : spaceOpts[0];
  return { timeAggregation, spaceAggregation, hideTime };
}
const _hoisted_1$g = {
  class: "qb-metrics-agg-grid",
  "data-testid": "signoz-metric-aggregation-fields"
};
const _hoisted_2$e = {
  key: 0,
  class: "qb-metrics-agg-cell"
};
const _hoisted_3$c = { class: "qb-metrics-agg-cell" };
const _hoisted_4$9 = { class: "qb-metrics-agg-cell" };
const _hoisted_5$9 = { class: "qb-metrics-agg-cell" };
const _sfc_main$h = /* @__PURE__ */ defineComponent({
  __name: "MetricAggregationFields",
  props: {
    metricType: {},
    timeAggregation: {},
    spaceAggregation: {},
    stepInterval: {},
    testIdPrefix: {}
  },
  emits: ["update:metricType", "update:timeAggregation", "update:spaceAggregation", "update:stepInterval"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const tid = (base) => props.testIdPrefix ? `${base}-${props.testIdPrefix}` : base;
    const timeOpts = computed(() => timeAggregationOptions(props.metricType));
    const spaceOpts = computed(() => spaceAggregationOptions(props.metricType));
    const hideTime = computed(() => shouldHideTimeAggregation(props.metricType));
    watch(
      () => props.metricType,
      (t2) => {
        const c = coerceAggregationsForMetricType(t2, {
          timeAggregation: props.timeAggregation,
          spaceAggregation: props.spaceAggregation
        });
        if (!c.hideTime && c.timeAggregation != null && c.timeAggregation !== props.timeAggregation) {
          emit("update:timeAggregation", c.timeAggregation);
        }
        if (c.spaceAggregation != null && c.spaceAggregation !== props.spaceAggregation) {
          emit("update:spaceAggregation", c.spaceAggregation);
        }
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$g, [
        !hideTime.value ? (openBlock(), createElementBlock("div", _hoisted_2$e, [
          _cache[4] || (_cache[4] = createElementVNode(
            "span",
            { class: "qb-label" },
            "Time Agg",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: __props.timeAggregation || void 0,
            options: timeOpts.value,
            "allow-clear": "",
            "test-id": tid("signoz-aggregation"),
            class: "qb-flex",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => emit("update:timeAggregation", String($event || "")))
          }, null, 8, ["value", "options", "test-id"])
        ])) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_3$c, [
          _cache[5] || (_cache[5] = createElementVNode(
            "span",
            { class: "qb-label" },
            "Space Agg",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: __props.spaceAggregation || void 0,
            options: spaceOpts.value,
            "allow-clear": "",
            "test-id": tid("signoz-space-agg"),
            class: "qb-flex",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => emit("update:spaceAggregation", String($event || "")))
          }, null, 8, ["value", "options", "test-id"])
        ]),
        createElementVNode("div", _hoisted_4$9, [
          _cache[6] || (_cache[6] = createElementVNode(
            "span",
            { class: "qb-label" },
            "类型",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: __props.metricType,
            options: [
              { label: "Gauge", value: "gauge" },
              { label: "Sum", value: "sum" },
              { label: "Histogram", value: "histogram" }
            ],
            "test-id": tid("signoz-metric-type"),
            class: "qb-flex",
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => emit("update:metricType", String($event)))
          }, null, 8, ["value", "test-id"])
        ]),
        createElementVNode("div", _hoisted_5$9, [
          _cache[7] || (_cache[7] = createElementVNode(
            "span",
            { class: "qb-label" },
            "Step",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.stepInterval != null ? String(__props.stepInterval) : "",
            placeholder: "auto",
            "test-id": tid("signoz-offset"),
            class: "qb-flex",
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit(
              "update:stepInterval",
              String($event) === "" ? null : Number($event)
            ))
          }, null, 8, ["model-value", "test-id"])
        ])
      ]);
    };
  }
});
const MetricAggregationFields = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__scopeId", "data-v-1d3e0cd0"]]);
const _hoisted_1$f = {
  class: "qb-addons-bar",
  "data-testid": "signoz-query-addons"
};
const _hoisted_2$d = ["data-testid", "onClick"];
const _sfc_main$g = /* @__PURE__ */ defineComponent({
  __name: "QueryAddons",
  props: {
    active: {}
  },
  emits: ["toggle"],
  setup(__props, { emit: __emit }) {
    const ADDON_DEFS = [
      { key: "group_by", label: "Group By" },
      { key: "having", label: "Having" },
      { key: "limit", label: "Limit" },
      { key: "order_by", label: "Order By" }
    ];
    const props = __props;
    const emit = __emit;
    function on(key) {
      return props.active.includes(key);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$f, [
        (openBlock(), createElementBlock(
          Fragment,
          null,
          renderList(ADDON_DEFS, (addon) => {
            return createElementVNode("button", {
              key: addon.key,
              type: "button",
              class: normalizeClass(["qb-addon-btn", { "qb-addon-btn--active": on(addon.key) }]),
              "data-testid": `signoz-addon-${addon.key}`,
              onClick: ($event) => emit("toggle", addon.key)
            }, toDisplayString(addon.label), 11, _hoisted_2$d);
          }),
          64
          /* STABLE_FRAGMENT */
        ))
      ]);
    };
  }
});
const QueryAddons = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-88bb0a01"]]);
const _hoisted_1$e = {
  class: "lqs",
  "data-testid": "signoz-log-query-search"
};
const _hoisted_2$c = ["value", "placeholder", "data-testid"];
const _hoisted_3$b = {
  key: 0,
  class: "lqs-status lqs-status--error",
  title: "引号未闭合"
};
const _hoisted_4$8 = {
  key: 0,
  class: "lqs-dropdown-loading"
};
const _hoisted_5$8 = ["onMousedown"];
const _hoisted_6$7 = { class: "lqs-dropdown-item-label" };
const _hoisted_7$5 = {
  key: 0,
  class: "lqs-dropdown-item-meta"
};
const _sfc_main$f = /* @__PURE__ */ defineComponent({
  ...{ name: "LogQuerySearch" },
  __name: "LogQuerySearch",
  props: {
    modelValue: {},
    placeholder: { default: "输入过滤表达式，例如 service.name = 'frontend' AND body CONTAINS 'error'" },
    signal: { default: "logs" },
    metricName: {},
    datasourceApi: {},
    testId: {}
  },
  emits: ["update:modelValue", "run"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const OP_DEFS = [
      { value: "=", meta: "Equal to", types: ["string", "number", "boolean", "keyword"] },
      { value: "!=", meta: "Not equal to", types: ["string", "number", "boolean", "keyword"] },
      { value: ">", meta: "Greater than", types: ["number"] },
      { value: ">=", meta: "Greater than or equal", types: ["number"] },
      { value: "<", meta: "Less than", types: ["number"] },
      { value: "<=", meta: "Less than or equal", types: ["number"] },
      { value: "IN", meta: "In list", types: ["string", "number", "keyword"] },
      { value: "NOT IN", meta: "Not in list", types: ["string", "number", "keyword"] },
      { value: "LIKE", meta: "Like", types: ["string", "keyword"] },
      { value: "ILIKE", meta: "Case-insensitive like", types: ["string", "keyword"] },
      { value: "CONTAINS", meta: "Contains", types: ["string", "keyword"] },
      { value: "NOT CONTAINS", meta: "Not contains", types: ["string", "keyword"] },
      { value: "EXISTS", meta: "Exists", types: ["string", "number", "boolean", "keyword"] },
      { value: "NOT EXISTS", meta: "Not exists", types: ["string", "number", "boolean", "keyword"] },
      { value: "REGEXP", meta: "Regular expression", types: ["string", "keyword"] },
      { value: "BETWEEN", meta: "Between", types: ["number"] }
    ];
    const CONJ_OPS = [
      { label: "AND", value: "AND", kind: "conj", meta: "and" },
      { label: "OR", value: "OR", kind: "conj", meta: "or" }
    ];
    const NON_VALUE_OPS = /* @__PURE__ */ new Set(["EXISTS", "NOT EXISTS"]);
    const wrapEl = ref(null);
    const inputEl = ref(null);
    const local = ref(props.modelValue || "");
    const open = ref(false);
    const loading = ref(false);
    const options = ref([]);
    const activeIdx = ref(0);
    const dropStyle = ref({});
    const suggestMode = ref("key");
    const keyTypeMap = ref({});
    let abort = null;
    let debounce = null;
    const showValidation = computed(() => {
      const s = local.value;
      const q = (s.match(/'/g) || []).length;
      const dq = (s.match(/"/g) || []).length;
      return q % 2 === 1 || dq % 2 === 1;
    });
    watch(
      () => props.modelValue,
      (v) => {
        if (v !== local.value) local.value = v || "";
      }
    );
    function commit(v, caret) {
      local.value = v;
      emit("update:modelValue", v);
      void nextTick(() => {
        const el = inputEl.value;
        if (!el) return;
        el.focus();
        const pos = caret == null ? v.length : Math.min(caret, v.length);
        el.setSelectionRange(pos, pos);
      });
    }
    function onInput(e) {
      const v = e.target.value;
      local.value = v;
      emit("update:modelValue", v);
      scheduleSuggest();
    }
    function onKeydown(e) {
      if (e.key === "Enter" && !e.shiftKey) {
        if (open.value && options.value[activeIdx.value]) {
          e.preventDefault();
          applyOpt(options.value[activeIdx.value]);
          return;
        }
        e.preventDefault();
        open.value = false;
        emit("run", local.value);
        return;
      }
      if (e.key === "Tab" && open.value && options.value[activeIdx.value]) {
        e.preventDefault();
        applyOpt(options.value[activeIdx.value]);
        return;
      }
      if (!open.value) return;
      if (e.key === "ArrowDown") {
        e.preventDefault();
        activeIdx.value = Math.min(activeIdx.value + 1, options.value.length - 1);
      } else if (e.key === "ArrowUp") {
        e.preventDefault();
        activeIdx.value = Math.max(activeIdx.value - 1, 0);
      } else if (e.key === "Escape") {
        open.value = false;
      }
    }
    function tokenAtCursor(text = local.value, pos) {
      const el = inputEl.value;
      const caret = pos ?? el?.selectionStart ?? text.length;
      const left = text.slice(0, caret);
      const parts = left.split(/\s+(?:AND|OR)\s+/i);
      const seg = parts[parts.length - 1] ?? "";
      const completePair = /^\s*(\S+)\s+(NOT\s+)?(EXISTS|NOT\s+EXISTS|=|!=|>=|<=|>|<|IN|NOT\s+IN|LIKE|ILIKE|CONTAINS|NOT\s+CONTAINS|REGEXP|BETWEEN)\s+(?:('[^']*'|"[^"]*"|\[[^\]]*\]|\S+))\s+$/i;
      if (completePair.test(seg) || /^\s*(\S+)\s+(NOT\s+)?EXISTS\s+$/i.test(seg)) {
        return { prefix: "", mode: "conj" };
      }
      const keyOnly = seg.match(/^\s*([a-zA-Z0-9_.[\]/-]*)$/);
      if (keyOnly) {
        const k = keyOnly[1] || "";
        if (!k) return { prefix: "", mode: "key" };
        if (/\s$/.test(seg)) return { prefix: "", mode: "op", key: k.trim() };
        return { prefix: k, mode: "key" };
      }
      const keySpace = seg.match(/^\s*([a-zA-Z0-9_.[\]/-]+)\s+$/);
      if (keySpace) {
        return { prefix: "", mode: "op", key: keySpace[1] };
      }
      const keyOp = seg.match(
        /^\s*([a-zA-Z0-9_.[\]/-]+)\s+(NOT\s+)?([A-Za-z!<>=]+)?(\s*)$/
      );
      if (keyOp) {
        const key = keyOp[1];
        const notPrefix = keyOp[2] || "";
        const opPart = (notPrefix + (keyOp[3] || "")).trim();
        const trailingSpace = keyOp[4] || "";
        if (!opPart) return { prefix: "", mode: "op", key };
        if (!trailingSpace) return { prefix: opPart, mode: "op", key };
        const opUpper = opPart.replace(/\s+/g, " ").toUpperCase();
        if (NON_VALUE_OPS.has(opUpper)) {
          return { prefix: "", mode: "conj", key, op: opUpper };
        }
        return { prefix: "", mode: "value", key, op: opUpper };
      }
      const keyOpVal = seg.match(
        /^\s*([a-zA-Z0-9_.[\]/-]+)\s+(NOT\s+(?:IN|EXISTS|CONTAINS|LIKE|ILIKE)|EXISTS|IN|LIKE|ILIKE|CONTAINS|REGEXP|BETWEEN|=|!=|>=|<=|>|<)\s+([\s\S]*)$/i
      );
      if (keyOpVal) {
        const key = keyOpVal[1];
        const op = keyOpVal[2].replace(/\s+/g, " ").toUpperCase();
        const rest = keyOpVal[3] ?? "";
        if (NON_VALUE_OPS.has(op)) {
          return { prefix: "", mode: "conj", key, op };
        }
        if (/^\s*('[^']*'|"[^"]*"|\[[^\]]*\])\s+$/.test(rest) || /^\s*\S+\s+$/.test(rest)) {
          return { prefix: "", mode: "conj", key, op };
        }
        const prefix = rest.trim().replace(/^['"]|['"]$/g, "").replace(/^\[|\]$/g, "");
        return { prefix, mode: "value", key, op };
      }
      return { prefix: "", mode: "key" };
    }
    function scheduleSuggest(immediate = false) {
      if (debounce) clearTimeout(debounce);
      if (immediate) {
        void loadSuggest();
        return;
      }
      debounce = setTimeout(() => void loadSuggest(), 120);
    }
    async function loadSuggest() {
      const ctx = tokenAtCursor();
      suggestMode.value = ctx.mode;
      activeIdx.value = 0;
      if (ctx.mode === "op") {
        const keyType = (ctx.key && keyTypeMap.value[ctx.key] || "string").toLowerCase();
        const q = (ctx.prefix || "").toUpperCase();
        options.value = OP_DEFS.filter((o) => {
          if (q && !o.value.toUpperCase().includes(q)) return false;
          if (!o.types) return true;
          if (keyType === "number" || keyType === "float" || keyType === "int") {
            return o.types.includes("number");
          }
          if (keyType === "boolean" || keyType === "bool") {
            return o.types.includes("boolean");
          }
          return o.types.includes("string") || o.types.includes("keyword");
        }).map((o) => ({
          label: o.value,
          value: o.value,
          meta: o.meta,
          kind: "op"
        }));
        open.value = options.value.length > 0;
        await nextTick();
        placeDropdown();
        return;
      }
      if (ctx.mode === "conj") {
        options.value = CONJ_OPS;
        open.value = true;
        await nextTick();
        placeDropdown();
        return;
      }
      if (!props.datasourceApi?.getMetadata) {
        options.value = [];
        open.value = false;
        return;
      }
      abort?.abort();
      abort = new AbortController();
      loading.value = true;
      try {
        if (ctx.mode === "key") {
          const res = await props.datasourceApi.getMetadata(
            {
              type: "attributeKeys",
              signal: props.signal || "logs",
              metricName: props.metricName,
              search: ctx.prefix || void 0
            },
            abort.signal
          );
          const vals = Array.isArray(res?.values) ? res.values : [];
          const nextMap = { ...keyTypeMap.value };
          options.value = vals.map((v) => {
            const name = String(v?.name ?? v?.key ?? v ?? "").trim();
            if (!name) return null;
            const ft = String(
              v?.fieldDataType || v?.dataType || v?.type || "string"
            );
            nextMap[name] = ft;
            return {
              label: name,
              value: name,
              kind: "key",
              meta: ft,
              fieldType: ft
            };
          }).filter(Boolean);
          keyTypeMap.value = nextMap;
          if (ctx.prefix) {
            const p = ctx.prefix.toLowerCase();
            options.value = options.value.filter(
              (o) => o.label.toLowerCase().includes(p)
            );
          }
        } else {
          const key = ctx.key || "";
          if (!key) {
            options.value = [];
            open.value = false;
            return;
          }
          const res = await props.datasourceApi.getMetadata(
            {
              type: "attributeValues",
              signal: props.signal || "logs",
              metricName: props.metricName,
              attributeKey: key,
              search: ctx.prefix || void 0
            },
            abort.signal
          );
          const vals = Array.isArray(res?.values) ? res.values : [];
          options.value = vals.map((v) => {
            const raw = v == null ? "" : typeof v === "object" ? String(v.value ?? v.name ?? "") : String(v);
            if (raw === "") return null;
            return {
              label: raw,
              value: raw,
              kind: "value",
              meta: "value"
            };
          }).filter(Boolean);
          if (ctx.prefix) {
            const p = ctx.prefix.toLowerCase();
            options.value = options.value.filter(
              (o) => o.label.toLowerCase().includes(p)
            );
          }
        }
        open.value = options.value.length > 0 || loading.value;
        await nextTick();
        placeDropdown();
      } catch (e) {
        if (e?.name === "AbortError") return;
        options.value = [];
        open.value = false;
      } finally {
        loading.value = false;
      }
    }
    function placeDropdown() {
      const el = wrapEl.value;
      if (!el) return;
      const r = el.getBoundingClientRect();
      dropStyle.value = {
        position: "fixed",
        top: `${r.bottom + 4}px`,
        left: `${r.left}px`,
        width: `${Math.max(r.width, 320)}px`,
        zIndex: "3000"
      };
    }
    function quoteValue(insert, op) {
      if (op === "IN" || op === "NOT IN") {
        if (insert.startsWith("[")) return insert;
        const needsQuote2 = !/^\d+(\.\d+)?$/.test(insert) && insert !== "true" && insert !== "false";
        const lit = needsQuote2 ? `'${insert.replace(/'/g, "\\'")}'` : insert;
        return `[${lit}]`;
      }
      const needsQuote = !/^\d+(\.\d+)?$/.test(insert) && insert !== "true" && insert !== "false";
      return needsQuote ? `'${insert.replace(/'/g, "\\'")}'` : insert;
    }
    function applyOpt(opt) {
      const el = inputEl.value;
      const text = local.value;
      const pos = el?.selectionStart ?? text.length;
      const left = text.slice(0, pos);
      const right = text.slice(pos);
      const mode2 = suggestMode.value;
      const ctx = tokenAtCursor(text, pos);
      let next = text;
      let caret = pos;
      if (mode2 === "key" || opt.kind === "key") {
        const replaced = left.replace(/([a-zA-Z0-9_.[\]/-]*)$/, `${opt.value} `);
        next = replaced + right;
        caret = replaced.length;
        if (opt.fieldType) keyTypeMap.value[opt.value] = opt.fieldType;
      } else if (mode2 === "op" || opt.kind === "op") {
        const m = left.match(/^(.*?\S)(\s+)(\S*)$/);
        if (m) {
          const base = m[1] + m[2] + opt.value + " ";
          next = base + right;
          caret = base.length;
        } else {
          next = left.replace(/(\S*)$/, `${opt.value} `) + right;
          caret = next.length - right.length;
        }
      } else if (mode2 === "conj" || opt.kind === "conj") {
        const base = left.replace(/\s*$/, ` ${opt.value} `);
        next = base + right;
        caret = base.length;
      } else {
        const lit = quoteValue(opt.value, ctx.op);
        const m = left.match(
          /^(.*?(?:=|!=|>=|<=|>|<|IN|NOT IN|LIKE|ILIKE|CONTAINS|NOT CONTAINS|REGEXP|BETWEEN)\s+)([\s\S]*)$/i
        );
        if (m) {
          const base = m[1] + lit + " ";
          next = base + right;
          caret = base.length;
        } else {
          const base = left.replace(/(['"]?)[^'"=\s[\]]*$/, lit + " ");
          next = base + right;
          caret = base.length;
        }
      }
      commit(next, caret);
      void nextTick(() => {
        scheduleSuggest(true);
      });
    }
    function onFocus() {
      scheduleSuggest(true);
    }
    function onDocClick(e) {
      if (!wrapEl.value) return;
      if (!wrapEl.value.contains(e.target)) {
        const drop = document.querySelector('[data-testid="signoz-lqs-dropdown"]');
        if (drop && drop.contains(e.target)) return;
        open.value = false;
      }
    }
    onMounted(() => document.addEventListener("mousedown", onDocClick, true));
    onBeforeUnmount(() => {
      document.removeEventListener("mousedown", onDocClick, true);
      abort?.abort();
      if (debounce) clearTimeout(debounce);
    });
    watch(
      () => [props.signal, props.metricName],
      () => {
        if (open.value) scheduleSuggest(true);
      }
    );
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$e, [
        createElementVNode(
          "div",
          {
            ref_key: "wrapEl",
            ref: wrapEl,
            class: normalizeClass(["lqs-editor-wrap", { "lqs-editor-wrap--error": showValidation.value }])
          },
          [
            _cache[0] || (_cache[0] = createElementVNode(
              "span",
              {
                class: "lqs-lead",
                "aria-hidden": "true"
              },
              "⌕",
              -1
              /* CACHED */
            )),
            createElementVNode("input", {
              ref_key: "inputEl",
              ref: inputEl,
              class: "lqs-editor",
              type: "text",
              value: local.value,
              placeholder: __props.placeholder,
              "data-testid": __props.testId || "signoz-filter",
              autocomplete: "off",
              spellcheck: "false",
              onInput,
              onKeydown,
              onFocus
            }, null, 40, _hoisted_2$c),
            showValidation.value ? (openBlock(), createElementBlock("span", _hoisted_3$b, "!")) : createCommentVNode("v-if", true)
          ],
          2
          /* CLASS */
        ),
        (openBlock(), createBlock(Teleport, { to: "body" }, [
          open.value ? (openBlock(), createElementBlock(
            "ul",
            {
              key: 0,
              class: "lqs-dropdown",
              style: normalizeStyle(dropStyle.value),
              role: "listbox",
              "data-testid": "signoz-lqs-dropdown"
            },
            [
              loading.value && !options.value.length ? (openBlock(), createElementBlock("li", _hoisted_4$8, " 加载中… ")) : createCommentVNode("v-if", true),
              (openBlock(true), createElementBlock(
                Fragment,
                null,
                renderList(options.value, (opt, i) => {
                  return openBlock(), createElementBlock("li", {
                    key: opt.kind + opt.value + i,
                    role: "option",
                    class: normalizeClass(["lqs-dropdown-item", { "lqs-dropdown-item--active": i === activeIdx.value }]),
                    onMousedown: withModifiers(($event) => applyOpt(opt), ["prevent"])
                  }, [
                    createElementVNode(
                      "span",
                      _hoisted_6$7,
                      toDisplayString(opt.label),
                      1
                      /* TEXT */
                    ),
                    opt.meta ? (openBlock(), createElementBlock(
                      "span",
                      _hoisted_7$5,
                      toDisplayString(opt.meta),
                      1
                      /* TEXT */
                    )) : createCommentVNode("v-if", true)
                  ], 42, _hoisted_5$8);
                }),
                128
                /* KEYED_FRAGMENT */
              ))
            ],
            4
            /* STYLE */
          )) : createCommentVNode("v-if", true)
        ]))
      ]);
    };
  }
});
const LogQuerySearch = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-eacfa99b"]]);
function validateFilterExpression(expr) {
  const s = String(expr || "");
  let depth = 0;
  let inQuote = false;
  let escape = false;
  for (let i = 0; i < s.length; i++) {
    const ch = s[i];
    if (escape) {
      escape = false;
      continue;
    }
    if (ch === "\\" && inQuote) {
      escape = true;
      continue;
    }
    if (ch === "'") {
      inQuote = !inQuote;
      continue;
    }
    if (inQuote) continue;
    if (ch === "(") depth++;
    if (ch === ")") {
      depth--;
      if (depth < 0)
        return { ok: false, message: "多余的右括号", column: i + 1 };
    }
  }
  if (inQuote) return { ok: false, message: "未闭合的引号", column: s.length };
  if (depth !== 0)
    return { ok: false, message: "括号未闭合", column: s.length };
  return { ok: true };
}
const _hoisted_1$d = {
  class: "filter-expr-editor",
  "data-testid": "signoz-filter-expression-editor"
};
const _hoisted_2$b = {
  key: 0,
  class: "err",
  "data-testid": "signoz-filter-syntax-error"
};
const _hoisted_3$a = { key: 0 };
const _sfc_main$e = /* @__PURE__ */ defineComponent({
  __name: "FilterExpressionEditor",
  props: {
    modelValue: {},
    signal: {},
    metricName: {},
    datasourceApi: {},
    testId: {}
  },
  emits: ["update:modelValue", "run"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const validation = computed(() => validateFilterExpression(props.modelValue));
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$d, [
        createVNode(LogQuerySearch, {
          "model-value": __props.modelValue,
          signal: __props.signal,
          "metric-name": __props.metricName,
          "datasource-api": __props.datasourceApi,
          "test-id": __props.testId || "signoz-filter",
          "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event)),
          onRun: _cache[1] || (_cache[1] = ($event) => emit("run", $event))
        }, null, 8, ["model-value", "signal", "metric-name", "datasource-api", "test-id"]),
        !validation.value.ok ? (openBlock(), createElementBlock("p", _hoisted_2$b, [
          createTextVNode(
            toDisplayString(validation.value.message),
            1
            /* TEXT */
          ),
          validation.value.column ? (openBlock(), createElementBlock(
            "span",
            _hoisted_3$a,
            "（列 " + toDisplayString(validation.value.column) + "）",
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const FilterExpressionEditor = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-2d171e85"]]);
const AGG_MATRIX = {
  gauge: {
    time: ["latest", "avg", "sum", "min", "max", "count", "count_distinct"],
    space: ["avg", "sum", "min", "max", "count"]
  },
  sum: {
    time: ["rate", "increase"],
    space: ["sum", "avg", "min", "max", "count"]
  },
  counter: {
    time: ["rate", "increase"],
    space: ["sum", "avg", "min", "max", "count"]
  },
  histogram: {
    time: [],
    space: ["p50", "p75", "p90", "p95", "p99"],
    hideTimeAgg: true
  },
  summary: {
    time: ["avg", "sum", "min", "max", "count"],
    space: ["avg", "sum", "min", "max", "count"]
  },
  unknown: {
    time: [
      "latest",
      "sum",
      "avg",
      "min",
      "max",
      "count",
      "count_distinct",
      "rate",
      "increase"
    ],
    space: ["sum", "avg", "min", "max", "count", "p50", "p95", "p99"]
  }
};
function normalizeMetricKind(type) {
  const t2 = String(type || "").toLowerCase();
  if (t2.includes("hist")) return "histogram";
  if (t2.includes("summary")) return "summary";
  if (t2.includes("counter")) return "counter";
  if (t2 === "sum" || t2.startsWith("sum")) return "sum";
  if (t2.includes("gauge")) return "gauge";
  return "unknown";
}
function timeAggOptionsFor(type) {
  const kind2 = normalizeMetricKind(type);
  const list = AGG_MATRIX[kind2].time;
  const seen = /* @__PURE__ */ new Set();
  const out = [];
  for (const v of list) {
    const key = v.toLowerCase();
    if (seen.has(key)) continue;
    seen.add(key);
    out.push({ label: v, value: v });
  }
  return out;
}
function spaceAggOptionsFor(type) {
  const kind2 = normalizeMetricKind(type);
  const list = AGG_MATRIX[kind2].space;
  const seen = /* @__PURE__ */ new Set();
  const out = [];
  for (const v of list) {
    const key = v.toLowerCase();
    if (seen.has(key)) continue;
    seen.add(key);
    out.push({ label: v, value: v });
  }
  return out;
}
const _hoisted_1$c = {
  class: "qb-elements",
  "data-testid": "signoz-signal-builder-form"
};
const _hoisted_2$a = {
  key: 0,
  class: "qb-meta-err",
  "data-testid": "signoz-builder-meta-error"
};
const _hoisted_3$9 = {
  key: 1,
  class: "qb-meta-loading",
  "data-testid": "signoz-builder-meta-loading"
};
const _hoisted_4$7 = { class: "qb-row qb-row--filter" };
const _hoisted_5$7 = { class: "qb-metric-option" };
const _hoisted_6$6 = { class: "qb-metric-name" };
const _hoisted_7$4 = {
  key: 0,
  class: "qb-metric-type"
};
const _hoisted_8$2 = { class: "qb-row qb-row--agg" };
const _hoisted_9$1 = ["data-testid"];
const _hoisted_10$1 = {
  key: 2,
  class: "qb-addons-content"
};
const _hoisted_11$1 = {
  key: 0,
  class: "qb-addon-cell qb-addon-cell--full"
};
const _hoisted_12$1 = {
  key: 1,
  class: "qb-addon-cell"
};
const _hoisted_13$1 = {
  key: 2,
  class: "qb-addon-cell"
};
const _hoisted_14$1 = {
  key: 3,
  class: "qb-addon-cell"
};
const _hoisted_15$1 = {
  key: 4,
  class: "qb-addon-cell"
};
const _hoisted_16$1 = {
  key: 5,
  class: "qb-addon-cell qb-addon-cell--full"
};
const _hoisted_17$1 = {
  key: 0,
  class: "qb-warn"
};
const _hoisted_18$1 = {
  key: 6,
  class: "qb-addon-cell"
};
const _hoisted_19$1 = {
  key: 7,
  class: "qb-addon-cell"
};
const _hoisted_20$1 = {
  key: 8,
  class: "qb-addon-cell qb-addon-cell--full qb-more-grid"
};
const _hoisted_21 = { class: "qb-metrics-agg-cell" };
const _hoisted_22 = { class: "qb-metrics-agg-cell" };
const _hoisted_23 = {
  key: 0,
  class: "qb-metrics-agg-cell"
};
const _hoisted_24 = {
  key: 1,
  class: "qb-metrics-agg-cell"
};
const _hoisted_25 = {
  key: 2,
  class: "qb-metrics-agg-cell"
};
const _hoisted_26 = {
  key: 3,
  class: "qb-metrics-agg-cell"
};
const _hoisted_27 = {
  key: 4,
  class: "qb-metrics-agg-cell"
};
const _hoisted_28 = {
  key: 5,
  class: "qb-metrics-agg-cell"
};
const _hoisted_29 = {
  key: 6,
  class: "qb-metrics-agg-cell"
};
const _hoisted_30 = { class: "qb-metrics-agg-cell" };
const _hoisted_31 = { class: "qb-metrics-agg-cell" };
const _hoisted_32 = {
  class: "sr-only",
  "aria-hidden": "true"
};
const _hoisted_33 = ["data-testid"];
const _hoisted_34 = ["data-testid"];
const _hoisted_35 = ["data-testid"];
const _hoisted_36 = ["data-testid"];
const _hoisted_37 = ["data-testid"];
const _hoisted_38 = ["data-testid"];
const _hoisted_39 = ["data-testid"];
const _hoisted_40 = {
  key: 7,
  "data-testid": "signoz-group-by"
};
const _hoisted_41 = ["data-testid"];
const _hoisted_42 = ["data-testid"];
const _hoisted_43 = ["data-testid"];
const _hoisted_44 = ["data-testid"];
const _hoisted_45 = ["data-testid"];
const _hoisted_46 = ["data-testid"];
const _hoisted_47 = ["data-testid"];
const _hoisted_48 = ["data-testid"];
const _hoisted_49 = ["data-testid"];
const _hoisted_50 = ["data-testid"];
const _hoisted_51 = ["data-testid"];
const _hoisted_52 = ["data-testid"];
const _sfc_main$d = /* @__PURE__ */ defineComponent({
  __name: "SignalBuilderForm",
  props: {
    spec: {},
    isPrimary: { type: Boolean },
    datasourceApi: {},
    capabilities: {}
  },
  emits: ["update:spec", "run"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const metricType = ref("gauge");
    const services = ref([]);
    const operations = ref([]);
    const metrics = ref([]);
    const metaError = ref("");
    const metaLoading = ref(false);
    const activeAddons = ref([]);
    function toggleAddon(key) {
      if (activeAddons.value.includes(key)) {
        activeAddons.value = activeAddons.value.filter((k) => k !== key);
      } else {
        activeAddons.value = [...activeAddons.value, key];
      }
    }
    function addonOn(key) {
      return activeAddons.value.includes(key);
    }
    const caps2 = computed(
      () => props.capabilities || {
        builder: true,
        formula: true,
        promql: true,
        clickhouseSql: true,
        traceOperator: true,
        subQuery: false,
        join: false,
        anomaly: false,
        distribution: false,
        alerts: false
      }
    );
    const unsupportedFns = computed(() => {
      const names = (props.spec.functions || []).map((f) => f.name);
      return names.filter(
        (n) => n === "anomaly" ? !caps2.value.anomaly : !STABLE_FUNCTIONS.includes(n)
      );
    });
    computed(() => timeAggOptionsFor(metricType.value));
    computed(() => spaceAggOptionsFor(metricType.value));
    function patch(partial) {
      emit("update:spec", { ...props.spec, ...partial });
    }
    function setSecondaryMeta(key, raw) {
      const cur = props.spec.secondaryAggregations?.[0] || {};
      const value = key === "stepInterval" ? String(raw ?? "") === "" ? void 0 : Number(raw) : String(raw ?? "");
      patch({
        secondaryAggregations: [
          {
            ...cur,
            [key]: value,
            expression: cur.expression || secondaryAgg.value || void 0
          }
        ]
      });
    }
    function setSpaceAgg(v) {
      const agg = props.spec.aggregations?.[0] || {};
      patch({
        aggregations: [
          {
            ...agg,
            spaceAggregation: v || void 0,
            metricName: agg.metricName || metric.value
          }
        ]
      });
    }
    const metric = computed({
      get: () => props.spec.aggregations?.[0]?.metricName || "",
      set: (v) => {
        const agg = props.spec.aggregations?.[0] || {};
        const next = {
          ...agg,
          metricName: v,
          timeAggregation: agg.timeAggregation || "avg",
          spaceAggregation: agg.spaceAggregation || "avg"
        };
        if (props.spec.signal === "metrics") delete next.expression;
        patch({ aggregations: [next] });
        void loadMetricMeta(v);
      }
    });
    async function loadMetricMeta(name) {
      if (!name || !props.datasourceApi?.getMetadata) return;
      try {
        const res = await props.datasourceApi.getMetadata({
          type: "metrics",
          search: name
        });
        const list = Array.isArray(res?.values) ? res.values : [];
        const hit = list.find((m) => m.metricName === name) || list[0];
        if (hit?.type) {
          const kind2 = normalizeMetricKind(hit.type);
          if (kind2 === "histogram") metricType.value = "histogram";
          else if (kind2 === "counter" || kind2 === "sum") metricType.value = "sum";
          else if (kind2 === "gauge") metricType.value = "gauge";
          const agg = props.spec.aggregations?.[0] || {};
          patch({
            aggregations: [
              {
                ...agg,
                metricName: name,
                metricType: hit.type,
                temporality: hit.temporality || agg.temporality
              }
            ]
          });
        }
      } catch {
      }
    }
    const aggregation = computed({
      get: () => props.spec.signal === "metrics" ? props.spec.aggregations?.[0]?.timeAggregation || "" : props.spec.aggregations?.[0]?.expression || props.spec.aggregations?.[0]?.timeAggregation || "",
      set: (v) => {
        const agg = props.spec.aggregations?.[0] || {};
        if (props.spec.signal === "metrics") {
          const next = {
            ...agg,
            timeAggregation: v || "avg",
            spaceAggregation: agg.spaceAggregation || "avg",
            metricName: agg.metricName || metric.value
          };
          delete next.expression;
          patch({ aggregations: [next] });
          return;
        }
        const expr = v || "count()";
        patch({
          aggregations: [
            {
              expression: expr.includes("(") ? expr : expr === "count" ? "count()" : expr
            }
          ]
        });
      }
    });
    const filter2 = computed({
      get: () => props.spec.filter?.expression || "",
      set: (v) => patch({ filter: { expression: v } })
    });
    const having = computed({
      get: () => props.spec.having?.expression || "",
      set: (v) => patch({ having: { expression: v } })
    });
    const order = computed({
      get: () => {
        const o = props.spec.order?.[0];
        if (!o) return "";
        return (o.direction === "desc" ? "-" : "") + o.key.name;
      },
      set: (v) => {
        const s = String(v || "");
        patch({
          order: s ? [
            {
              key: { name: s.replace(/^-/, "") },
              direction: s.startsWith("-") ? "desc" : "asc"
            }
          ] : []
        });
      }
    });
    const limit = computed({
      get: () => props.spec.limit != null ? String(props.spec.limit) : "",
      set: (v) => patch({ limit: v === "" ? void 0 : Number(v) })
    });
    computed({
      get: () => props.spec.offset != null ? String(props.spec.offset) : "",
      set: (v) => patch({ offset: v === "" ? void 0 : Number(v) })
    });
    const selectFieldsText = computed({
      get: () => (props.spec.selectFields || []).map((f) => f.name).join(","),
      set: (v) => {
        const fields = String(v || "").split(",").map((s) => s.trim()).filter(Boolean).map((name) => ({
          name,
          fieldDataType: "string",
          fieldContext: "tag"
        }));
        patch({ selectFields: fields });
      }
    });
    const limitByText = computed({
      get: () => (props.spec.limitBy?.keys || []).join(","),
      set: (v) => {
        const keys = String(v || "").split(",").map((s) => s.trim()).filter(Boolean);
        if (!keys.length) {
          patch({ limitBy: void 0 });
          return;
        }
        patch({
          limitBy: {
            keys,
            value: props.spec.limitBy?.value ?? props.spec.limit ?? 10
          }
        });
      }
    });
    const limitByValue = computed({
      get: () => props.spec.limitBy?.value != null ? String(props.spec.limitBy.value) : "",
      set: (v) => {
        const keys = props.spec.limitBy?.keys || [];
        if (!keys.length && !v) {
          patch({ limitBy: void 0 });
          return;
        }
        patch({
          limitBy: {
            keys: keys.length ? keys : [],
            value: v === "" ? void 0 : Number(v)
          }
        });
      }
    });
    const secondaryAgg = computed({
      get: () => props.spec.secondaryAggregations?.[0]?.expression || props.spec.secondaryAggregations?.[0]?.timeAggregation || "",
      set: (v) => {
        if (!v) {
          patch({ secondaryAggregations: void 0 });
          return;
        }
        patch({
          secondaryAggregations: [
            {
              expression: v,
              timeAggregation: v,
              metricName: metric.value || void 0
            }
          ]
        });
      }
    });
    const legend = computed({
      get: () => props.spec.legend || "",
      set: (v) => patch({ legend: v })
    });
    const service = computed({
      get: () => props.spec.service || "",
      set: (v) => patch({ service: v })
    });
    const operation = computed({
      get: () => props.spec.operation || "",
      set: (v) => patch({ operation: v })
    });
    const source = computed({
      get: () => props.spec.source || "",
      set: (v) => patch({ source: v })
    });
    const environment = computed({
      get: () => props.spec.environment || "",
      set: (v) => patch({ environment: v })
    });
    const tags = computed({
      get: () => (props.spec.tags || []).map((t2) => `${t2.key}${t2.operator}${t2.value}`).join(","),
      set: (v) => {
        const next = String(v || "").split(",").map((s) => s.trim()).filter(Boolean).map((pair) => {
          const m = pair.match(/^([^=!~]+)(=~|!~|=|!=)(.*)$/);
          if (m) {
            return {
              key: m[1].trim(),
              operator: m[2],
              value: m[3].trim()
            };
          }
          const [key, ...rest] = pair.split("=");
          return {
            key: key.trim(),
            operator: "=",
            value: rest.join("=").trim()
          };
        });
        patch({ tags: next });
      }
    });
    const minDuration = computed({
      get: () => props.spec.duration && (props.spec.duration.operator === ">" || props.spec.duration.operator === ">=") ? String(props.spec.duration.value) : "",
      set: (v) => {
        if (!v) {
          patch({ duration: void 0 });
          return;
        }
        patch({ duration: { operator: ">=", value: Number(v) || 0, unit: "ms" } });
      }
    });
    const maxDuration = computed({
      get: () => props.spec.duration && (props.spec.duration.operator === "<" || props.spec.duration.operator === "<=") ? String(props.spec.duration.value) : "",
      set: (v) => {
        if (!v) {
          if (props.spec.duration && (props.spec.duration.operator === ">" || props.spec.duration.operator === ">=")) {
            return;
          }
          patch({ duration: void 0 });
          return;
        }
        patch({ duration: { operator: "<=", value: Number(v) || 0, unit: "ms" } });
      }
    });
    const signal = computed(() => props.spec.signal);
    const showMetrics = computed(() => signal.value === "metrics");
    const metricSelectOptions = computed(
      () => metrics.value.map((m) => ({
        label: m.label,
        value: m.value,
        type: m.type
      }))
    );
    const showLogsTraces = computed(
      () => signal.value === "logs" || signal.value === "traces"
    );
    const showTraces = computed(() => signal.value === "traces");
    async function loadMeta() {
      metaError.value = "";
      metaLoading.value = true;
      services.value = [];
      operations.value = [];
      metrics.value = [];
      try {
        const api = props.datasourceApi;
        if (!api || typeof api.getMetadata !== "function") {
          metaError.value = api ? "" : "未绑定数据源元数据 API";
          return;
        }
        const [svcRes, metricRes] = await Promise.all([
          api.getMetadata({ type: "services" }).catch((e) => {
            throw e;
          }),
          showMetrics.value ? api.getMetadata({ type: "metrics" }).catch(() => ({ values: [] })) : Promise.resolve({ values: [] })
        ]);
        services.value = (svcRes?.values || []).map((v) => ({
          label: String(typeof v === "string" ? v : v.text || v.value || v),
          value: String(typeof v === "string" ? v : v.value || v.text || v)
        }));
        metrics.value = (metricRes?.values || []).map((m) => ({
          label: String(m.metricName || m),
          value: String(m.metricName || m),
          type: m.type || m.metricType || m.temporality || void 0
        }));
        if (props.spec.service) {
          try {
            const opRes = await api.getMetadata({
              type: "operations",
              service: props.spec.service
            });
            operations.value = (opRes?.values || []).map((v) => ({
              label: v,
              value: v
            }));
          } catch {
            operations.value = [];
          }
        }
      } catch (e) {
        const msg = e instanceof Error ? e.message : String(e);
        metaError.value = msg.includes("UNSUPPORTED_CAPABILITY") ? msg : `元数据加载失败: ${msg}`;
        services.value = [];
        operations.value = [];
        metrics.value = [];
      } finally {
        metaLoading.value = false;
      }
    }
    onMounted(() => void loadMeta());
    watch(
      () => [props.datasourceApi, props.spec.signal, props.spec.service],
      () => void loadMeta()
    );
    function filterMetricOption(input, option) {
      const q = String(input || "").toLowerCase();
      if (!q) return true;
      const label = String(option?.label ?? option?.value ?? "").toLowerCase();
      return label.includes(q);
    }
    function onMetricDropdown(visible) {
      if (visible && !metrics.value.length) void loadMeta();
    }
    function onMetricSelect(v) {
      metric.value = v == null ? "" : String(v);
    }
    function onFilterRun(_v) {
      emit("run");
    }
    const tid = (base) => props.isPrimary ? base : `${base}-${props.spec.name}`;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$c, [
        metaError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_2$a,
          toDisplayString(metaError.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        metaLoading.value ? (openBlock(), createElementBlock("div", _hoisted_3$9, " 加载元数据… ")) : createCommentVNode("v-if", true),
        createCommentVNode(" FILTER row — 1:1 argus-web QueryBuilder "),
        createElementVNode("div", _hoisted_4$7, [
          showMetrics.value ? (openBlock(), createBlock(unref(Select), {
            key: 0,
            value: metric.value || void 0,
            "show-search": "",
            "allow-clear": "",
            options: metricSelectOptions.value,
            "filter-option": filterMetricOption,
            loading: metaLoading.value,
            "option-filter-prop": "label",
            "option-label-prop": "label",
            placeholder: "选择指标",
            class: "qb-sel-metric",
            "data-testid": tid("signoz-metric"),
            "popup-class-name": "qb-metric-dropdown",
            onDropdownVisibleChange: onMetricDropdown,
            "onUpdate:value": onMetricSelect
          }, {
            option: withCtx(({ label, type }) => [
              createElementVNode("div", _hoisted_5$7, [
                createElementVNode(
                  "span",
                  _hoisted_6$6,
                  toDisplayString(label),
                  1
                  /* TEXT */
                ),
                type ? (openBlock(), createElementBlock(
                  "span",
                  _hoisted_7$4,
                  toDisplayString(type),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ])
            ]),
            _: 1
            /* STABLE */
          }, 8, ["value", "options", "loading", "data-testid"])) : createCommentVNode("v-if", true),
          createVNode(FilterExpressionEditor, {
            "model-value": filter2.value,
            signal: __props.spec.signal,
            "metric-name": metric.value || void 0,
            "datasource-api": __props.datasourceApi,
            "test-id": tid("signoz-filter"),
            class: "qb-lqs",
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => filter2.value = $event),
            onRun: onFilterRun
          }, null, 8, ["model-value", "signal", "metric-name", "datasource-api", "test-id"])
        ]),
        createCommentVNode(" AGG row "),
        createElementVNode("div", _hoisted_8$2, [
          showMetrics.value ? (openBlock(), createBlock(MetricAggregationFields, {
            key: 0,
            "metric-type": metricType.value,
            "time-aggregation": aggregation.value || "",
            "space-aggregation": __props.spec.aggregations?.[0]?.spaceAggregation || "",
            "step-interval": __props.spec.stepInterval,
            "test-id-prefix": __props.isPrimary ? void 0 : __props.spec.name,
            "onUpdate:metricType": _cache[1] || (_cache[1] = ($event) => metricType.value = $event),
            "onUpdate:timeAggregation": _cache[2] || (_cache[2] = ($event) => aggregation.value = $event),
            "onUpdate:spaceAggregation": _cache[3] || (_cache[3] = ($event) => setSpaceAgg($event)),
            "onUpdate:stepInterval": _cache[4] || (_cache[4] = ($event) => patch({ stepInterval: $event }))
          }, null, 8, ["metric-type", "time-aggregation", "space-aggregation", "step-interval", "test-id-prefix"])) : (openBlock(), createElementBlock(
            Fragment,
            { key: 1 },
            [
              createVNode(ExpressionAggregationEditor, {
                aggregations: __props.spec.aggregations || [],
                signal: __props.spec.signal,
                "datasource-api": __props.datasourceApi,
                multi: "",
                class: "qb-flex",
                "onUpdate:aggregations": _cache[5] || (_cache[5] = ($event) => patch({ aggregations: $event }))
              }, null, 8, ["aggregations", "signal", "datasource-api"]),
              createElementVNode("span", {
                class: "sr-only",
                "data-testid": tid("signoz-aggregation")
              }, null, 8, _hoisted_9$1),
              showLogsTraces.value ? (openBlock(), createBlock(unref(GInput), {
                key: 0,
                modelValue: source.value,
                "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => source.value = $event),
                class: "qb-source",
                "test-id": tid("signoz-source"),
                placeholder: "source"
              }, null, 8, ["modelValue", "test-id"])) : createCommentVNode("v-if", true)
            ],
            64
            /* STABLE_FRAGMENT */
          ))
        ]),
        createCommentVNode(" Add-ons content "),
        activeAddons.value.length ? (openBlock(), createElementBlock("div", _hoisted_10$1, [
          addonOn("group_by") ? (openBlock(), createElementBlock("div", _hoisted_11$1, [
            _cache[28] || (_cache[28] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Group By",
              -1
              /* CACHED */
            )),
            createVNode(GroupByFieldSelect, {
              "model-value": __props.spec.groupBy || [],
              signal: __props.spec.signal,
              "metric-name": metric.value,
              "datasource-api": __props.datasourceApi,
              class: "qb-flex",
              "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => patch({ groupBy: $event }))
            }, null, 8, ["model-value", "signal", "metric-name", "datasource-api"])
          ])) : createCommentVNode("v-if", true),
          addonOn("having") ? (openBlock(), createElementBlock("div", _hoisted_12$1, [
            _cache[29] || (_cache[29] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Having",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: having.value,
              "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => having.value = $event),
              class: "qb-flex",
              "test-id": tid("signoz-having"),
              placeholder: "avg >= 1"
            }, null, 8, ["modelValue", "test-id"])
          ])) : createCommentVNode("v-if", true),
          addonOn("limit") ? (openBlock(), createElementBlock("div", _hoisted_13$1, [
            _cache[30] || (_cache[30] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Limit",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: limit.value,
              "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => limit.value = $event),
              class: "qb-flex",
              "test-id": tid("signoz-limit"),
              placeholder: "100"
            }, null, 8, ["modelValue", "test-id"])
          ])) : createCommentVNode("v-if", true),
          addonOn("order_by") ? (openBlock(), createElementBlock("div", _hoisted_14$1, [
            _cache[31] || (_cache[31] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Order By",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: order.value,
              "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => order.value = $event),
              class: "qb-flex",
              "test-id": tid("signoz-order"),
              placeholder: "value 或 -value"
            }, null, 8, ["modelValue", "test-id"])
          ])) : createCommentVNode("v-if", true),
          addonOn("legend_format") ? (openBlock(), createElementBlock("div", _hoisted_15$1, [
            _cache[32] || (_cache[32] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Legend",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: legend.value,
              "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => legend.value = $event),
              class: "qb-flex",
              "test-id": tid("signoz-legend"),
              placeholder: "{{service.name}}"
            }, null, 8, ["modelValue", "test-id"])
          ])) : createCommentVNode("v-if", true),
          addonOn("functions") ? (openBlock(), createElementBlock("div", _hoisted_16$1, [
            _cache[33] || (_cache[33] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Functions",
              -1
              /* CACHED */
            )),
            createVNode(FunctionEditor, {
              "model-value": __props.spec.functions || [],
              "test-id": tid("signoz-functions"),
              "onUpdate:modelValue": _cache[12] || (_cache[12] = ($event) => patch({ functions: $event }))
            }, null, 8, ["model-value", "test-id"]),
            unsupportedFns.value.length ? (openBlock(), createElementBlock(
              "span",
              _hoisted_17$1,
              "不支持: " + toDisplayString(unsupportedFns.value.join(", ")),
              1
              /* TEXT */
            )) : createCommentVNode("v-if", true)
          ])) : createCommentVNode("v-if", true),
          addonOn("service") ? (openBlock(), createElementBlock("div", _hoisted_18$1, [
            _cache[34] || (_cache[34] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Service",
              -1
              /* CACHED */
            )),
            createVNode(unref(GSelect), {
              value: service.value || void 0,
              options: services.value,
              "allow-clear": "",
              "test-id": tid("signoz-service"),
              class: "qb-flex",
              "onUpdate:value": _cache[13] || (_cache[13] = ($event) => service.value = String($event || ""))
            }, null, 8, ["value", "options", "test-id"])
          ])) : createCommentVNode("v-if", true),
          addonOn("service") ? (openBlock(), createElementBlock("div", _hoisted_19$1, [
            _cache[35] || (_cache[35] = createElementVNode(
              "span",
              { class: "qb-label" },
              "Operation",
              -1
              /* CACHED */
            )),
            operations.value.length ? (openBlock(), createBlock(unref(GSelect), {
              key: 0,
              value: operation.value || void 0,
              options: operations.value,
              "allow-clear": "",
              "test-id": tid("signoz-operation"),
              class: "qb-flex",
              "onUpdate:value": _cache[14] || (_cache[14] = ($event) => operation.value = String($event || ""))
            }, null, 8, ["value", "options", "test-id"])) : (openBlock(), createBlock(unref(GInput), {
              key: 1,
              modelValue: operation.value,
              "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => operation.value = $event),
              class: "qb-flex",
              "test-id": tid("signoz-operation")
            }, null, 8, ["modelValue", "test-id"]))
          ])) : createCommentVNode("v-if", true),
          addonOn("more") ? (openBlock(), createElementBlock("div", _hoisted_20$1, [
            createElementVNode("div", _hoisted_21, [
              _cache[36] || (_cache[36] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Environment",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: environment.value,
                "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => environment.value = $event),
                "test-id": tid("signoz-environment"),
                class: "qb-flex"
              }, null, 8, ["modelValue", "test-id"])
            ]),
            createElementVNode("div", _hoisted_22, [
              _cache[37] || (_cache[37] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Tags",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: tags.value,
                "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => tags.value = $event),
                "test-id": tid("signoz-tags"),
                class: "qb-flex",
                placeholder: "k=v,k2=v2"
              }, null, 8, ["modelValue", "test-id"])
            ]),
            showTraces.value ? (openBlock(), createElementBlock("div", _hoisted_23, [
              _cache[38] || (_cache[38] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Min duration",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: minDuration.value,
                "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => minDuration.value = $event),
                "test-id": tid("signoz-min-duration"),
                class: "qb-flex"
              }, null, 8, ["modelValue", "test-id"])
            ])) : createCommentVNode("v-if", true),
            showTraces.value ? (openBlock(), createElementBlock("div", _hoisted_24, [
              _cache[39] || (_cache[39] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Max duration",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: maxDuration.value,
                "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => maxDuration.value = $event),
                "test-id": tid("signoz-max-duration"),
                class: "qb-flex"
              }, null, 8, ["modelValue", "test-id"])
            ])) : createCommentVNode("v-if", true),
            showMetrics.value ? (openBlock(), createElementBlock("div", _hoisted_25, [
              _cache[40] || (_cache[40] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Secondary agg",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: secondaryAgg.value,
                "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => secondaryAgg.value = $event),
                "test-id": tid("signoz-secondary-agg"),
                class: "qb-flex"
              }, null, 8, ["modelValue", "test-id"])
            ])) : createCommentVNode("v-if", true),
            showMetrics.value ? (openBlock(), createElementBlock("div", _hoisted_26, [
              _cache[41] || (_cache[41] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Sec. step",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                "model-value": __props.spec.secondaryAggregations?.[0]?.stepInterval != null ? String(__props.spec.secondaryAggregations?.[0]?.stepInterval) : "",
                "test-id": tid("signoz-secondary-step"),
                class: "qb-flex",
                "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => setSecondaryMeta("stepInterval", $event))
              }, null, 8, ["model-value", "test-id"])
            ])) : createCommentVNode("v-if", true),
            showMetrics.value ? (openBlock(), createElementBlock("div", _hoisted_27, [
              _cache[42] || (_cache[42] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Sec. alias",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                "model-value": String(__props.spec.secondaryAggregations?.[0]?.alias || ""),
                "test-id": tid("signoz-secondary-alias"),
                class: "qb-flex",
                "onUpdate:modelValue": _cache[22] || (_cache[22] = ($event) => setSecondaryMeta("alias", $event))
              }, null, 8, ["model-value", "test-id"])
            ])) : createCommentVNode("v-if", true),
            showLogsTraces.value ? (openBlock(), createElementBlock("div", _hoisted_28, [
              _cache[43] || (_cache[43] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Cursor",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                "model-value": __props.spec.cursor || "",
                "test-id": tid("signoz-cursor"),
                class: "qb-flex",
                "onUpdate:modelValue": _cache[23] || (_cache[23] = ($event) => patch({ cursor: String($event || "") || void 0 }))
              }, null, 8, ["model-value", "test-id"])
            ])) : createCommentVNode("v-if", true),
            showLogsTraces.value ? (openBlock(), createElementBlock("div", _hoisted_29, [
              _cache[44] || (_cache[44] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Offset",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                "model-value": __props.spec.offset != null ? String(__props.spec.offset) : "",
                "test-id": tid("signoz-offset-page"),
                class: "qb-flex",
                "onUpdate:modelValue": _cache[24] || (_cache[24] = ($event) => patch({
                  offset: String($event) === "" ? void 0 : Number($event)
                }))
              }, null, 8, ["model-value", "test-id"])
            ])) : createCommentVNode("v-if", true),
            createElementVNode("div", _hoisted_30, [
              _cache[45] || (_cache[45] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Select",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: selectFieldsText.value,
                "onUpdate:modelValue": _cache[25] || (_cache[25] = ($event) => selectFieldsText.value = $event),
                "test-id": tid("signoz-select-fields"),
                class: "qb-flex",
                placeholder: "field.a,field.b"
              }, null, 8, ["modelValue", "test-id"])
            ]),
            createElementVNode("div", _hoisted_31, [
              _cache[46] || (_cache[46] = createElementVNode(
                "span",
                { class: "qb-label" },
                "Limit by",
                -1
                /* CACHED */
              )),
              createVNode(unref(GInput), {
                modelValue: limitByText.value,
                "onUpdate:modelValue": _cache[26] || (_cache[26] = ($event) => limitByText.value = $event),
                "test-id": tid("signoz-limit-by"),
                class: "qb-flex",
                placeholder: "key1,key2"
              }, null, 8, ["modelValue", "test-id"]),
              createVNode(unref(GInput), {
                modelValue: limitByValue.value,
                "onUpdate:modelValue": _cache[27] || (_cache[27] = ($event) => limitByValue.value = $event),
                "test-id": tid("signoz-limit-by-value"),
                style: { "width": "64px" },
                placeholder: "N"
              }, null, 8, ["modelValue", "test-id"])
            ])
          ])) : createCommentVNode("v-if", true)
        ])) : createCommentVNode("v-if", true),
        createCommentVNode(" always-available anchors for test matrix when advanced fields not opened "),
        createElementVNode("div", _hoisted_32, [
          !addonOn("having") ? (openBlock(), createElementBlock("span", {
            key: 0,
            "data-testid": tid("signoz-having")
          }, null, 8, _hoisted_33)) : createCommentVNode("v-if", true),
          !addonOn("limit") ? (openBlock(), createElementBlock("span", {
            key: 1,
            "data-testid": tid("signoz-limit")
          }, null, 8, _hoisted_34)) : createCommentVNode("v-if", true),
          !addonOn("order_by") ? (openBlock(), createElementBlock("span", {
            key: 2,
            "data-testid": tid("signoz-order")
          }, null, 8, _hoisted_35)) : createCommentVNode("v-if", true),
          !addonOn("legend_format") ? (openBlock(), createElementBlock("span", {
            key: 3,
            "data-testid": tid("signoz-legend")
          }, null, 8, _hoisted_36)) : createCommentVNode("v-if", true),
          !addonOn("functions") ? (openBlock(), createElementBlock("span", {
            key: 4,
            "data-testid": tid("signoz-functions")
          }, null, 8, _hoisted_37)) : createCommentVNode("v-if", true),
          !addonOn("service") ? (openBlock(), createElementBlock("span", {
            key: 5,
            "data-testid": tid("signoz-service")
          }, null, 8, _hoisted_38)) : createCommentVNode("v-if", true),
          !addonOn("service") ? (openBlock(), createElementBlock("span", {
            key: 6,
            "data-testid": tid("signoz-operation")
          }, null, 8, _hoisted_39)) : createCommentVNode("v-if", true),
          !addonOn("group_by") ? (openBlock(), createElementBlock("span", _hoisted_40)) : createCommentVNode("v-if", true),
          !addonOn("more") ? (openBlock(), createElementBlock("span", {
            key: 8,
            "data-testid": tid("signoz-tags")
          }, null, 8, _hoisted_41)) : createCommentVNode("v-if", true),
          !addonOn("more") ? (openBlock(), createElementBlock("span", {
            key: 9,
            "data-testid": tid("signoz-environment")
          }, null, 8, _hoisted_42)) : createCommentVNode("v-if", true),
          !addonOn("more") && showTraces.value ? (openBlock(), createElementBlock("span", {
            key: 10,
            "data-testid": tid("signoz-min-duration")
          }, null, 8, _hoisted_43)) : createCommentVNode("v-if", true),
          !addonOn("more") && showTraces.value ? (openBlock(), createElementBlock("span", {
            key: 11,
            "data-testid": tid("signoz-max-duration")
          }, null, 8, _hoisted_44)) : createCommentVNode("v-if", true),
          !addonOn("more") ? (openBlock(), createElementBlock("span", {
            key: 12,
            "data-testid": tid("signoz-select-fields")
          }, null, 8, _hoisted_45)) : createCommentVNode("v-if", true),
          !addonOn("more") ? (openBlock(), createElementBlock("span", {
            key: 13,
            "data-testid": tid("signoz-limit-by")
          }, null, 8, _hoisted_46)) : createCommentVNode("v-if", true),
          !addonOn("more") ? (openBlock(), createElementBlock("span", {
            key: 14,
            "data-testid": tid("signoz-limit-by-value")
          }, null, 8, _hoisted_47)) : createCommentVNode("v-if", true),
          !addonOn("more") && showMetrics.value ? (openBlock(), createElementBlock("span", {
            key: 15,
            "data-testid": tid("signoz-secondary-agg")
          }, null, 8, _hoisted_48)) : createCommentVNode("v-if", true),
          !addonOn("more") && showMetrics.value ? (openBlock(), createElementBlock("span", {
            key: 16,
            "data-testid": tid("signoz-secondary-step")
          }, null, 8, _hoisted_49)) : createCommentVNode("v-if", true),
          !addonOn("more") && showMetrics.value ? (openBlock(), createElementBlock("span", {
            key: 17,
            "data-testid": tid("signoz-secondary-alias")
          }, null, 8, _hoisted_50)) : createCommentVNode("v-if", true),
          !addonOn("more") && showLogsTraces.value ? (openBlock(), createElementBlock("span", {
            key: 18,
            "data-testid": tid("signoz-cursor")
          }, null, 8, _hoisted_51)) : createCommentVNode("v-if", true),
          !addonOn("more") && showLogsTraces.value ? (openBlock(), createElementBlock("span", {
            key: 19,
            "data-testid": tid("signoz-offset-page")
          }, null, 8, _hoisted_52)) : createCommentVNode("v-if", true)
        ]),
        createCommentVNode(" AddOns toggle bar "),
        createVNode(QueryAddons, {
          active: activeAddons.value,
          onToggle: toggleAddon
        }, null, 8, ["active"])
      ]);
    };
  }
});
const SignalBuilderForm = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__scopeId", "data-v-96356868"]]);
const _hoisted_1$b = ["data-signal-kind"];
const _sfc_main$c = /* @__PURE__ */ defineComponent({
  __name: "BuilderFields",
  props: {
    spec: {},
    isPrimary: { type: Boolean },
    datasourceApi: {},
    capabilities: {}
  },
  emits: ["update:spec", "run"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const signalKind = computed(
      () => props.spec.signal === "metrics" ? "metrics" : "non-metrics"
    );
    function onUpdate(spec) {
      emit("update:spec", spec);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "signoz-builder-fields",
        "data-testid": "signoz-builder-fields",
        "data-signal-kind": signalKind.value
      }, [
        createCommentVNode(" metrics: MetricAggregationFields / metric meta path "),
        signalKind.value === "metrics" ? (openBlock(), createBlock(SignalBuilderForm, {
          key: 0,
          spec: __props.spec,
          "is-primary": __props.isPrimary,
          "datasource-api": __props.datasourceApi,
          capabilities: __props.capabilities,
          "onUpdate:spec": onUpdate,
          onRun: _cache[0] || (_cache[0] = ($event) => emit("run"))
        }, null, 8, ["spec", "is-primary", "datasource-api", "capabilities"])) : (openBlock(), createElementBlock(
          Fragment,
          { key: 1 },
          [
            createCommentVNode(" logs | traces | other: ExpressionAggregationEditor / filter path "),
            createVNode(SignalBuilderForm, {
              spec: __props.spec,
              "is-primary": __props.isPrimary,
              "datasource-api": __props.datasourceApi,
              capabilities: __props.capabilities,
              "onUpdate:spec": onUpdate,
              onRun: _cache[1] || (_cache[1] = ($event) => emit("run"))
            }, null, 8, ["spec", "is-primary", "datasource-api", "capabilities"])
          ],
          2112
          /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
        ))
      ], 8, _hoisted_1$b);
    };
  }
});
const BuilderFields = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-af9483d6"]]);
const _hoisted_1$a = {
  class: "formula-fields",
  "data-testid": "signoz-formula-fields"
};
const _hoisted_2$9 = { class: "row" };
const _hoisted_3$8 = {
  key: 0,
  class: "err",
  "data-testid": "signoz-formula-error",
  role: "alert"
};
const _hoisted_4$6 = { class: "row" };
const _hoisted_5$6 = { class: "row" };
const _hoisted_6$5 = { class: "row" };
const _sfc_main$b = /* @__PURE__ */ defineComponent({
  __name: "FormulaFields",
  props: {
    item: {},
    allItems: {}
  },
  emits: ["update"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const availableNames = computed(() => props.allItems.map((i) => i.spec.name));
    const formulaNames = computed(
      () => props.allItems.filter((i) => i.type === "builder_formula").map((i) => i.spec.name)
    );
    const validation = computed(() => {
      const v = validateFormulaExpression(
        props.item.spec.expression,
        availableNames.value,
        [
          ...formulaNames.value.filter((n) => n !== props.item.spec.name),
          props.item.spec.name
        ]
      );
      if (!v.ok) return v;
      const cycle = detectFormulaCycle(
        props.allItems.filter(
          (i) => i.type === "builder_formula"
        ).map(
          (i) => i.spec.name === props.item.spec.name ? { name: i.spec.name, expression: props.item.spec.expression } : { name: i.spec.name, expression: i.spec.expression }
        )
      );
      if (cycle) return { ok: false, message: `循环引用: ${cycle}` };
      return { ok: true };
    });
    function patch(partial) {
      emit("update", {
        type: "builder_formula",
        spec: { ...props.item.spec, ...partial }
      });
    }
    const orderText = computed({
      get: () => {
        const o = props.item.spec.order?.[0];
        if (!o) return "";
        return (o.direction === "desc" ? "-" : "") + o.key.name;
      },
      set: (v) => {
        const s = String(v || "");
        patch({
          order: s ? [
            {
              key: { name: s.replace(/^-/, "") },
              direction: s.startsWith("-") ? "desc" : "asc"
            }
          ] : []
        });
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$a, [
        createElementVNode("div", _hoisted_2$9, [
          _cache[4] || (_cache[4] = createElementVNode(
            "label",
            null,
            "Expression",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.expression,
            "test-id": "signoz-formula-expression",
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => patch({ expression: String($event) }))
          }, null, 8, ["model-value"])
        ]),
        !validation.value.ok ? (openBlock(), createElementBlock(
          "div",
          _hoisted_3$8,
          toDisplayString(validation.value.message),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createElementVNode("div", _hoisted_4$6, [
          _cache[5] || (_cache[5] = createElementVNode(
            "label",
            null,
            "Legend",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.legend,
            "test-id": "signoz-formula-legend",
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => patch({ legend: String($event) }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_5$6, [
          _cache[6] || (_cache[6] = createElementVNode(
            "label",
            null,
            "Order",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": orderText.value,
            "test-id": "signoz-formula-order",
            placeholder: "value or -value",
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => orderText.value = String($event))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_6$5, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "Limit",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.limit != null ? String(__props.item.spec.limit) : "",
            "test-id": "signoz-formula-limit",
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => patch({ limit: String($event) === "" ? void 0 : Number($event) }))
          }, null, 8, ["model-value"])
        ])
      ]);
    };
  }
});
const FormulaFields = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-493000e4"]]);
const FORBIDDEN_SQL_START = /^(insert|update|delete|drop|alter|truncate|create|replace|grant|revoke)\b/i;
function validateRawQuery(mode2, text) {
  const raw = String(text ?? "");
  if (mode2 === "promql") {
    if (!raw.trim()) return { ok: true, diagnostics: [] };
    const r = parsePromqlToAst(raw);
    const diagnostics = (r.diagnostics || []).filter((d) => d.severity === "error").map((d) => ({
      from: d.range?.from ?? 0,
      to: d.range?.to ?? raw.length,
      message: d.message || "PromQL 语法错误"
    }));
    return { ok: diagnostics.length === 0, diagnostics };
  }
  if (mode2 === "clickhouse_sql" || mode2 === "sql") {
    return validateSql(raw);
  }
  return { ok: true, diagnostics: [] };
}
function validateSql(raw) {
  const trimmed = raw.trim();
  if (!trimmed) return { ok: true, diagnostics: [] };
  let i = 0;
  let depth = 0;
  let inSingle = false;
  let inDouble = false;
  let inLineComment = false;
  let inBlockComment = false;
  const statements = [];
  let start = 0;
  let buf = "";
  const pushStmt = (end) => {
    const t2 = buf.trim();
    if (t2) statements.push({ from: start, text: t2 });
    buf = "";
    start = end + 1;
  };
  while (i < raw.length) {
    const c = raw[i];
    const n = raw[i + 1];
    if (inLineComment) {
      if (c === "\n") inLineComment = false;
      i += 1;
      continue;
    }
    if (inBlockComment) {
      if (c === "*" && n === "/") {
        inBlockComment = false;
        i += 2;
        continue;
      }
      i += 1;
      continue;
    }
    if (inSingle) {
      if (c === "\\") {
        buf += c + (n || "");
        i += 2;
        continue;
      }
      if (c === "'") {
        inSingle = false;
      }
      buf += c;
      i += 1;
      continue;
    }
    if (inDouble) {
      if (c === "\\") {
        buf += c + (n || "");
        i += 2;
        continue;
      }
      if (c === '"') {
        inDouble = false;
      }
      buf += c;
      i += 1;
      continue;
    }
    if (c === "-" && n === "-") {
      inLineComment = true;
      i += 2;
      continue;
    }
    if (c === "/" && n === "*") {
      inBlockComment = true;
      i += 2;
      continue;
    }
    if (c === "'") {
      inSingle = true;
      buf += c;
      i += 1;
      continue;
    }
    if (c === '"') {
      inDouble = true;
      buf += c;
      i += 1;
      continue;
    }
    if (c === "(") {
      depth += 1;
      buf += c;
      i += 1;
      continue;
    }
    if (c === ")") {
      depth = Math.max(0, depth - 1);
      buf += c;
      i += 1;
      continue;
    }
    if (c === ";" && depth === 0) {
      pushStmt(i);
      const rest = raw.slice(i + 1).trim();
      if (rest) {
        return {
          ok: false,
          diagnostics: [
            {
              from: i + 1,
              to: raw.length,
              message: "只允许单个 SELECT/WITH 语句"
            }
          ]
        };
      }
      i += 1;
      continue;
    }
    buf += c;
    i += 1;
  }
  if (buf.trim()) pushStmt(raw.length - 1);
  if (statements.length === 0) return { ok: true, diagnostics: [] };
  if (statements.length > 1) {
    return {
      ok: false,
      diagnostics: [
        {
          from: statements[1].from,
          to: raw.length,
          message: "只允许单个 SELECT/WITH 语句"
        }
      ]
    };
  }
  const stmt = statements[0].text;
  if (FORBIDDEN_SQL_START.test(stmt)) {
    return {
      ok: false,
      diagnostics: [
        {
          from: statements[0].from,
          to: statements[0].from + Math.min(12, stmt.length),
          message: "禁止 INSERT/UPDATE/DELETE/DROP 等写语句"
        }
      ]
    };
  }
  if (!/^(with|select)\b/i.test(stmt)) {
    return {
      ok: false,
      diagnostics: [
        {
          from: statements[0].from,
          to: statements[0].from + Math.min(12, stmt.length),
          message: "SQL 必须以 SELECT 或 WITH 开头"
        }
      ]
    };
  }
  return { ok: true, diagnostics: [] };
}
function formatRawQuery(mode2, text) {
  const raw = String(text ?? "");
  const v = validateRawQuery(mode2, raw);
  if (!v.ok) return raw;
  if (mode2 === "promql") {
    return raw.replace(/[ \t]+/g, " ").replace(/\s*\n\s*/g, "\n").trim();
  }
  if (mode2 === "clickhouse_sql" || mode2 === "sql") {
    return formatSql(raw);
  }
  return raw;
}
function formatSql(raw) {
  const clauses = [
    "SELECT",
    "FROM",
    "WHERE",
    "GROUP BY",
    "ORDER BY",
    "LIMIT",
    "HAVING",
    "WITH"
  ];
  let out = "";
  let i = 0;
  let inSingle = false;
  let inDouble = false;
  while (i < raw.length) {
    const c = raw[i];
    if (inSingle) {
      out += c;
      if (c === "'" && raw[i - 1] !== "\\") inSingle = false;
      i += 1;
      continue;
    }
    if (inDouble) {
      out += c;
      if (c === '"' && raw[i - 1] !== "\\") inDouble = false;
      i += 1;
      continue;
    }
    if (c === "'") {
      inSingle = true;
      out += c;
      i += 1;
      continue;
    }
    if (c === '"') {
      inDouble = true;
      out += c;
      i += 1;
      continue;
    }
    let matched = false;
    for (const cl of clauses) {
      if (raw.slice(i, i + cl.length).toUpperCase() === cl) {
        const before = out.trimEnd();
        if (before && !before.endsWith("\n")) out = before + "\n";
        out += cl;
        i += cl.length;
        matched = true;
        break;
      }
    }
    if (matched) continue;
    if (c === " " || c === "	" || c === "\n" || c === "\r") {
      if (!out.endsWith(" ") && !out.endsWith("\n") && out.length) out += " ";
      i += 1;
      continue;
    }
    out += c;
    i += 1;
  }
  return out.trim();
}
const _hoisted_1$9 = {
  class: "raw-qe",
  "data-testid": "signoz-raw-query-editor"
};
const _hoisted_2$8 = { class: "row" };
const _hoisted_3$7 = ["id"];
const _sfc_main$a = /* @__PURE__ */ defineComponent({
  __name: "RawQueryEditor",
  props: {
    modelValue: {},
    mode: {},
    testId: {}
  },
  emits: ["update:modelValue"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const validation = computed(
      () => validateRawQuery(props.mode, props.modelValue)
    );
    const describedBy = computed(
      () => validation.value.ok ? void 0 : `${props.testId || "signoz-raw"}-diag`
    );
    const language = computed(() => {
      if (props.mode === "clickhouse_sql" || props.mode === "sql") return "sql";
      if (props.mode === "promql") return "promql";
      return "plaintext";
    });
    function format() {
      emit("update:modelValue", formatRawQuery(props.mode, props.modelValue));
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$9, [
        createElementVNode("div", _hoisted_2$8, [
          createVNode(unref(GCodeEditor), {
            value: __props.modelValue,
            language: language.value,
            height: "140",
            "test-id": __props.testId || "signoz-raw-editor",
            "onUpdate:value": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", String($event)))
          }, null, 8, ["value", "language", "test-id"]),
          createVNode(unref(GButton), {
            size: "sm",
            variant: "secondary",
            type: "button",
            "test-id": "signoz-raw-format",
            title: "格式化（仅在校验通过时生效）",
            onClick: format
          }, {
            default: withCtx(() => [..._cache[1] || (_cache[1] = [
              createTextVNode(
                " 格式化 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ]),
        !validation.value.ok ? (openBlock(), createElementBlock("div", {
          key: 0,
          id: describedBy.value,
          class: "diag",
          role: "alert",
          "data-testid": "signoz-raw-diagnostics"
        }, [
          (openBlock(true), createElementBlock(
            Fragment,
            null,
            renderList(validation.value.diagnostics, (d, i) => {
              return openBlock(), createElementBlock(
                "div",
                { key: i },
                " [" + toDisplayString(d.from) + "-" + toDisplayString(d.to) + "] " + toDisplayString(d.message),
                1
                /* TEXT */
              );
            }),
            128
            /* KEYED_FRAGMENT */
          ))
        ], 8, _hoisted_3$7)) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const RawQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-fc4435e8"]]);
const _hoisted_1$8 = {
  class: "trace-op",
  "data-testid": "signoz-trace-operator-fields"
};
const _hoisted_2$7 = { class: "row" };
const _hoisted_3$6 = { class: "row" };
const _hoisted_4$5 = { class: "row" };
const _hoisted_5$5 = { class: "row" };
const _hoisted_6$4 = { class: "row" };
const _hoisted_7$3 = { class: "row" };
const _hoisted_8$1 = { class: "row" };
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
  __name: "TraceOperatorFields",
  props: {
    item: {}
  },
  emits: ["update"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function patch(partial) {
      emit("update", {
        type: "builder_trace_operator",
        spec: { ...props.item.spec, ...partial }
      });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$8, [
        createElementVNode("div", _hoisted_2$7, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "Expression",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.expression,
            placeholder: "A => B",
            "test-id": "signoz-trace-op-expression",
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => patch({ expression: String($event) }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_3$6, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "Return spans",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: __props.item.spec.returnSpansFrom || "all",
            options: [
              { label: "all", value: "all" },
              { label: "root", value: "root" },
              { label: "leaves", value: "leaves" },
              { label: "matched", value: "matched" }
            ],
            "test-id": "signoz-trace-op-return",
            "onUpdate:value": _cache[1] || (_cache[1] = ($event) => patch({ returnSpansFrom: String($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_4$5, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "Filter",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.filter?.expression || "",
            placeholder: "hasError = true",
            "test-id": "signoz-trace-op-filter",
            "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => patch({ filter: { expression: String($event) } }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_5$5, [
          _cache[10] || (_cache[10] = createElementVNode(
            "label",
            null,
            "Group by",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": (__props.item.spec.groupBy || []).map((f) => f.name || f).join(","),
            placeholder: "service.name,name",
            "test-id": "signoz-trace-op-groupby",
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => patch({
              groupBy: String($event || "").split(",").map((s) => s.trim()).filter(Boolean).map((name) => ({
                name,
                fieldDataType: "string",
                fieldContext: "tag"
              }))
            }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_6$4, [
          _cache[11] || (_cache[11] = createElementVNode(
            "label",
            null,
            "Having",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.having?.expression || "",
            placeholder: "count() > 1",
            "test-id": "signoz-trace-op-having",
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => patch({ having: { expression: String($event) } }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_7$3, [
          _cache[12] || (_cache[12] = createElementVNode(
            "label",
            null,
            "Aggregations",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": (__props.item.spec.aggregations || []).map((a) => a.expression || a.timeAggregation || "").join(";"),
            placeholder: "count(); p95(durationNano)",
            "test-id": "signoz-trace-op-aggs",
            "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => {
              patch({
                aggregations: String($event || "").split(";").map((s) => s.trim()).filter(Boolean).map((expression) => ({ expression }))
              });
            })
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_8$1, [
          _cache[13] || (_cache[13] = createElementVNode(
            "label",
            null,
            "Legend",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.legend || "",
            "test-id": "signoz-trace-op-legend",
            "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => patch({ legend: String($event) }))
          }, null, 8, ["model-value"])
        ])
      ]);
    };
  }
});
const TraceOperatorFields = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-f0fb0a41"]]);
const _hoisted_1$7 = {
  class: "join",
  "data-testid": "signoz-join-fields"
};
const _hoisted_2$6 = { class: "row" };
const _hoisted_3$5 = { class: "row" };
const _hoisted_4$4 = { class: "row" };
const _hoisted_5$4 = { class: "row" };
const _hoisted_6$3 = { class: "row" };
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
  __name: "JoinFields",
  props: {
    item: {}
  },
  emits: ["update"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    function patch(partial) {
      emit("update", {
        type: "builder_join",
        spec: { ...props.item.spec, ...partial }
      });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$7, [
        createElementVNode("div", _hoisted_2$6, [
          _cache[5] || (_cache[5] = createElementVNode(
            "label",
            null,
            "Left",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.left,
            "test-id": "signoz-join-left",
            "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => patch({ left: String($event) }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_3$5, [
          _cache[6] || (_cache[6] = createElementVNode(
            "label",
            null,
            "Right",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.right,
            "test-id": "signoz-join-right",
            "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => patch({ right: String($event) }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_4$4, [
          _cache[7] || (_cache[7] = createElementVNode(
            "label",
            null,
            "Type",
            -1
            /* CACHED */
          )),
          createVNode(unref(GSelect), {
            value: __props.item.spec.type,
            options: [
              { label: "inner", value: "inner" },
              { label: "left", value: "left" },
              { label: "right", value: "right" },
              { label: "full", value: "full" }
            ],
            "test-id": "signoz-join-type",
            "onUpdate:value": _cache[2] || (_cache[2] = ($event) => patch({ type: String($event) }))
          }, null, 8, ["value"])
        ]),
        createElementVNode("div", _hoisted_5$4, [
          _cache[8] || (_cache[8] = createElementVNode(
            "label",
            null,
            "On",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.on || "",
            placeholder: "A.service = B.service AND A.env = B.env",
            "test-id": "signoz-join-on",
            "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => patch({ on: String($event) }))
          }, null, 8, ["model-value"])
        ]),
        createElementVNode("div", _hoisted_6$3, [
          _cache[9] || (_cache[9] = createElementVNode(
            "label",
            null,
            "Limit",
            -1
            /* CACHED */
          )),
          createVNode(unref(GInput), {
            "model-value": __props.item.spec.limit != null ? String(__props.item.spec.limit) : "",
            "test-id": "signoz-join-limit",
            "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => patch({ limit: String($event) === "" ? void 0 : Number($event) }))
          }, null, 8, ["model-value"])
        ])
      ]);
    };
  }
});
const JoinFields = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__scopeId", "data-v-8d63785f"]]);
const _hoisted_1$6 = { class: "qb-row qb-row--where" };
const _hoisted_2$5 = ["title", "data-testid"];
const _hoisted_3$4 = ["data-testid"];
const _hoisted_4$3 = ["data-testid", "title"];
const _hoisted_5$3 = ["data-testid"];
const _hoisted_6$2 = { class: "qb-row-actions" };
const _hoisted_7$2 = ["title", "data-testid"];
const _hoisted_8 = ["data-testid"];
const _hoisted_9 = ["disabled", "data-testid"];
const _hoisted_10 = {
  key: 0,
  class: "qb-warn",
  "data-testid": "signoz-mode-blocked",
  role: "status"
};
const _hoisted_11 = {
  key: 1,
  class: "qb-warn",
  "data-testid": "signoz-item-capability-error",
  role: "status"
};
const _hoisted_12 = { class: "qb-body-inner" };
const _hoisted_13 = {
  key: 3,
  class: "qb-row qb-row--filter",
  "data-testid": "signoz-subquery-fields"
};
const _hoisted_14 = { class: "subq-note" };
const _hoisted_15 = {
  key: 1,
  class: "qb-row qb-row--filter qb-raw-row"
};
const _hoisted_16 = { class: "qb-label" };
const _hoisted_17 = {
  key: 2,
  class: "hidden-anchors",
  "aria-hidden": "true",
  "data-testid": "signoz-matrix-anchors"
};
const _hoisted_18 = {
  key: 3,
  class: "hidden-anchors",
  "aria-hidden": "true",
  "data-testid": "signoz-matrix-anchors"
};
const _hoisted_19 = {
  key: 0,
  "data-matrix-id": "signoz-expr"
};
const _hoisted_20 = {
  key: 1,
  "data-matrix-id": "signoz-raw-editor"
};
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
  __name: "QueryItemRow",
  props: {
    item: {},
    index: {},
    allItems: {},
    profile: {},
    capabilities: {},
    isPrimary: { type: Boolean },
    canDelete: { type: Boolean },
    datasourceApi: {},
    globalMode: {}
  },
  emits: ["update", "copy", "remove", "run"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const collapsed = ref(false);
    const isFormula = computed(() => props.item.type === "builder_formula");
    const isTraceOp = computed(() => props.item.type === "builder_trace_operator");
    const isJoin = computed(() => props.item.type === "builder_join");
    const isSubQuery = computed(() => props.item.type === "builder_sub_query");
    const isBuilderQuery = computed(() => props.item.type === "builder_query");
    const itemValidation = computed(
      () => validateSavedItem(props.item, props.capabilities)
    );
    const signal = computed(() => {
      if (props.item.type === "builder_query")
        return props.item.spec.signal || "metrics";
      if (props.item.type === "builder_sub_query")
        return props.item.spec.signal || "metrics";
      return "metrics";
    });
    const mode2 = computed(() => {
      if (props.globalMode) return props.globalMode;
      if (props.item.type === "builder_query")
        return props.item.queryType || "builder";
      return "builder";
    });
    const lockMode = computed(() => props.globalMode != null);
    const modeBlockedReason = computed(() => {
      if (!isBuilderQuery.value) return "";
      if (!props.profile.signals.includes(signal.value)) {
        return `当前 profile 不支持 signal=${signal.value}`;
      }
      if (!isModeAllowed(props.profile, signal.value, mode2.value)) {
        return `当前 profile 不允许 ${signal.value}/${mode2.value}`;
      }
      if (mode2.value === "builder" && !props.capabilities.builder) {
        return "builder 当前 capability 不可用";
      }
      if (mode2.value === "promql" && !props.capabilities.promql) {
        return "promql 当前 capability 不可用";
      }
      if (mode2.value === "clickhouse_sql" && !props.capabilities.clickhouseSql) {
        return "clickhouse_sql 当前 capability 不可用";
      }
      return "";
    });
    const signalOptions = computed(() => {
      const all = ["metrics", "logs", "traces"];
      return all.map((s) => ({
        label: s,
        value: s,
        disabled: !props.profile.signals.includes(s)
      }));
    });
    const modeOptions = computed(() => {
      const allowed = props.profile.queryModesBySignal?.[signal.value] || [];
      return [
        { label: "Builder", value: "builder", cap: props.capabilities.builder },
        { label: "PromQL", value: "promql", cap: props.capabilities.promql },
        {
          label: "ClickHouse SQL",
          value: "clickhouse_sql",
          cap: props.capabilities.clickhouseSql
        }
      ].map((o) => ({
        label: o.label,
        value: o.value,
        disabled: !o.cap || (allowed.length > 0 ? !allowed.includes(o.value) : true)
      }));
    });
    function updateItem(next) {
      emit("update", next);
    }
    function setSignal(v) {
      if (props.item.type !== "builder_query") return;
      const s = String(v);
      const prev = props.item.spec.signal || "metrics";
      if (s === prev) {
        updateItem({ ...props.item, spec: { ...props.item.spec, signal: s } });
        return;
      }
      const aggregations = defaultAggregationsForSignal(
        s
      );
      updateItem({
        ...props.item,
        spec: {
          ...props.item.spec,
          signal: s,
          aggregations,
          source: s === "metrics" ? props.item.spec.source : void 0
        }
      });
    }
    function setMode(v) {
      if (props.item.type !== "builder_query") return;
      const m = String(v);
      const next = {
        ...props.item,
        queryType: m
      };
      if (m === "promql" && !String(next.rawQuery || "").trim()) {
        next.rawQuery = "up";
      }
      if (m === "clickhouse_sql" && !String(next.rawQuery || "").trim()) {
        next.rawQuery = "SELECT 1";
      }
      updateItem(next);
    }
    function toggleDisabled() {
      if (props.item.type === "builder_formula") {
        updateItem({
          type: "builder_formula",
          spec: { ...props.item.spec, disabled: !props.item.spec.disabled }
        });
        return;
      }
      if (props.item.type === "builder_trace_operator") {
        updateItem({
          type: "builder_trace_operator",
          spec: { ...props.item.spec, disabled: !props.item.spec.disabled }
        });
        return;
      }
      if (props.item.type === "builder_join") {
        updateItem({
          type: "builder_join",
          spec: { ...props.item.spec, disabled: !props.item.spec.disabled }
        });
        return;
      }
      if (props.item.type === "builder_sub_query") {
        updateItem({
          type: "builder_sub_query",
          spec: { ...props.item.spec, disabled: !props.item.spec.disabled }
        });
        return;
      }
      updateItem({
        ...props.item,
        spec: { ...props.item.spec, disabled: !props.item.spec.disabled }
      });
    }
    function setRaw(v) {
      if (props.item.type !== "builder_query") return;
      updateItem({ ...props.item, rawQuery: v });
    }
    function setSpec(spec) {
      if (props.item.type !== "builder_query") return;
      updateItem({
        type: "builder_query",
        queryType: props.item.queryType,
        rawQuery: props.item.rawQuery,
        rawLegend: props.item.rawLegend,
        spec: {
          ...defaultBuilderSpec(props.item.spec.name, props.item.spec.signal),
          ...spec
        }
      });
    }
    const disabled = computed(() => Boolean(props.item.spec.disabled));
    const tid = (base) => props.isPrimary ? base : `${base}-${props.item.spec.name}`;
    const nameLabel = computed(() => String(props.item.spec?.name || "?"));
    const typeBadge = computed(() => {
      if (isFormula.value) return "Formula";
      if (isTraceOp.value) return "Trace Operator";
      if (isJoin.value) return "Join";
      if (isSubQuery.value) return "Sub Query";
      return "";
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock(
        "div",
        {
          class: normalizeClass(["qb-body query-row", { "qb-body--disabled": disabled.value, disabled: disabled.value, collapsed: collapsed.value }]),
          "data-testid": "signoz-query-item-row"
        },
        [
          createCommentVNode(" WHERE row: chevron + chip + signal + mode + actions "),
          createElementVNode("div", _hoisted_1$6, [
            createElementVNode("button", {
              type: "button",
              class: "qb-btn-icon qb-collapse-btn",
              title: collapsed.value ? "展开" : "折叠",
              "data-testid": tid("signoz-row-collapse"),
              onClick: _cache[0] || (_cache[0] = ($event) => collapsed.value = !collapsed.value)
            }, toDisplayString(collapsed.value ? "▸" : "▾"), 9, _hoisted_2$5),
            createElementVNode("span", {
              class: normalizeClass(["qb-chip", { "qb-chip--formula": isFormula.value }]),
              "data-testid": tid("signoz-row-name")
            }, toDisplayString(nameLabel.value), 11, _hoisted_3$4),
            isBuilderQuery.value ? (openBlock(), createElementBlock(
              Fragment,
              { key: 0 },
              [
                createVNode(unref(GSelect), {
                  value: signal.value,
                  options: signalOptions.value,
                  "test-id": tid("signoz-signal"),
                  class: "qb-sel-signal",
                  "onUpdate:value": setSignal
                }, null, 8, ["value", "options", "test-id"]),
                !lockMode.value ? (openBlock(), createBlock(unref(GSelect), {
                  key: 0,
                  value: mode2.value,
                  options: modeOptions.value,
                  "test-id": tid("signoz-mode"),
                  class: "qb-sel-mode",
                  "onUpdate:value": setMode
                }, null, 8, ["value", "options", "test-id"])) : (openBlock(), createElementBlock("span", {
                  key: 1,
                  class: "qb-mode-badge",
                  "data-testid": tid("signoz-mode-locked"),
                  title: "全局模式: " + mode2.value
                }, toDisplayString(mode2.value), 9, _hoisted_4$3))
              ],
              64
              /* STABLE_FRAGMENT */
            )) : (openBlock(), createElementBlock("span", {
              key: 1,
              class: "qb-type-badge",
              "data-testid": isFormula.value ? "signoz-formula-badge" : "signoz-item-badge"
            }, toDisplayString(typeBadge.value), 9, _hoisted_5$3)),
            _cache[4] || (_cache[4] = createElementVNode(
              "div",
              { class: "qb-spacer" },
              null,
              -1
              /* CACHED */
            )),
            createElementVNode("div", _hoisted_6$2, [
              createElementVNode("button", {
                type: "button",
                class: "qb-btn-icon",
                title: disabled.value ? "启用" : "禁用",
                "data-testid": tid("signoz-row-enable"),
                onClick: toggleDisabled
              }, toDisplayString(disabled.value ? "○" : "●"), 9, _hoisted_7$2),
              createElementVNode("button", {
                type: "button",
                class: "qb-btn-icon",
                title: "复制",
                "data-testid": tid("signoz-row-copy"),
                onClick: _cache[1] || (_cache[1] = ($event) => emit("copy"))
              }, " ⧉ ", 8, _hoisted_8),
              createElementVNode("button", {
                type: "button",
                class: "qb-btn-icon qb-btn-icon--danger",
                title: "删除",
                disabled: !__props.canDelete,
                "data-testid": tid("signoz-row-delete"),
                onClick: _cache[2] || (_cache[2] = ($event) => emit("remove"))
              }, " ✕ ", 8, _hoisted_9)
            ])
          ]),
          modeBlockedReason.value ? (openBlock(), createElementBlock(
            "div",
            _hoisted_10,
            toDisplayString(modeBlockedReason.value) + "（已保留查询文本，运行前请切换） ",
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          !itemValidation.value.ok ? (openBlock(), createElementBlock(
            "div",
            _hoisted_11,
            toDisplayString(itemValidation.value.message),
            1
            /* TEXT */
          )) : createCommentVNode("v-if", true),
          withDirectives(createElementVNode(
            "div",
            _hoisted_12,
            [
              isFormula.value && __props.item.type === "builder_formula" ? (openBlock(), createBlock(FormulaFields, {
                key: 0,
                item: __props.item,
                "all-items": __props.allItems,
                onUpdate: updateItem
              }, null, 8, ["item", "all-items"])) : isTraceOp.value && __props.item.type === "builder_trace_operator" ? (openBlock(), createBlock(TraceOperatorFields, {
                key: 1,
                item: __props.item,
                onUpdate: updateItem
              }, null, 8, ["item"])) : isJoin.value && __props.item.type === "builder_join" ? (openBlock(), createBlock(JoinFields, {
                key: 2,
                item: __props.item,
                onUpdate: updateItem
              }, null, 8, ["item"])) : isSubQuery.value && __props.item.type === "builder_sub_query" ? (openBlock(), createElementBlock("div", _hoisted_13, [
                _cache[5] || (_cache[5] = createElementVNode(
                  "span",
                  { class: "qb-label" },
                  "Expression",
                  -1
                  /* CACHED */
                )),
                createElementVNode(
                  "span",
                  _hoisted_14,
                  toDisplayString(__props.item.spec.expression || "(sub_query)"),
                  1
                  /* TEXT */
                )
              ])) : __props.item.type === "builder_query" ? (openBlock(), createElementBlock(
                Fragment,
                { key: 4 },
                [
                  mode2.value === "builder" ? (openBlock(), createBlock(BuilderFields, {
                    key: 0,
                    spec: __props.item.spec,
                    "is-primary": __props.isPrimary,
                    "datasource-api": __props.datasourceApi,
                    capabilities: __props.capabilities,
                    "onUpdate:spec": setSpec,
                    onRun: _cache[3] || (_cache[3] = ($event) => emit("run"))
                  }, null, 8, ["spec", "is-primary", "datasource-api", "capabilities"])) : (openBlock(), createElementBlock("div", _hoisted_15, [
                    createElementVNode(
                      "span",
                      _hoisted_16,
                      toDisplayString(mode2.value === "promql" ? "PromQL" : "SQL"),
                      1
                      /* TEXT */
                    ),
                    createVNode(RawQueryEditor, {
                      "model-value": __props.item.rawQuery || "",
                      mode: mode2.value,
                      "test-id": tid(mode2.value === "promql" ? "signoz-expr" : "signoz-raw-editor"),
                      class: "qb-flex",
                      "onUpdate:modelValue": setRaw
                    }, null, 8, ["model-value", "mode", "test-id"])
                  ])),
                  __props.isPrimary && mode2.value === "builder" ? (openBlock(), createElementBlock("div", _hoisted_17, [..._cache[6] || (_cache[6] = [
                    createElementVNode(
                      "span",
                      { "data-matrix-id": "signoz-expr" },
                      null,
                      -1
                      /* CACHED */
                    ),
                    createElementVNode(
                      "span",
                      { "data-matrix-id": "signoz-raw-editor" },
                      null,
                      -1
                      /* CACHED */
                    ),
                    createElementVNode(
                      "span",
                      { "data-matrix-id": "signoz-min-duration" },
                      null,
                      -1
                      /* CACHED */
                    ),
                    createElementVNode(
                      "span",
                      { "data-matrix-id": "signoz-max-duration" },
                      null,
                      -1
                      /* CACHED */
                    )
                  ])])) : createCommentVNode("v-if", true),
                  __props.isPrimary && mode2.value !== "builder" ? (openBlock(), createElementBlock("div", _hoisted_18, [
                    mode2.value !== "promql" ? (openBlock(), createElementBlock("span", _hoisted_19)) : createCommentVNode("v-if", true),
                    mode2.value === "promql" ? (openBlock(), createElementBlock("span", _hoisted_20)) : createCommentVNode("v-if", true),
                    _cache[7] || (_cache[7] = createStaticVNode('<span data-matrix-id="signoz-metric" data-v-9aca9681></span><span data-matrix-id="signoz-aggregation" data-v-9aca9681></span><span data-matrix-id="signoz-filter" data-v-9aca9681></span><span data-matrix-id="signoz-having" data-v-9aca9681></span><span data-matrix-id="signoz-group-by" data-v-9aca9681></span><span data-matrix-id="signoz-order" data-v-9aca9681></span><span data-matrix-id="signoz-limit" data-v-9aca9681></span><span data-matrix-id="signoz-legend" data-v-9aca9681></span><span data-matrix-id="signoz-functions" data-v-9aca9681></span><span data-matrix-id="signoz-service" data-v-9aca9681></span><span data-matrix-id="signoz-operation" data-v-9aca9681></span><span data-matrix-id="signoz-tags" data-v-9aca9681></span><span data-matrix-id="signoz-min-duration" data-v-9aca9681></span><span data-matrix-id="signoz-max-duration" data-v-9aca9681></span>', 14))
                  ])) : createCommentVNode("v-if", true)
                ],
                64
                /* STABLE_FRAGMENT */
              )) : createCommentVNode("v-if", true)
            ],
            512
            /* NEED_PATCH */
          ), [
            [vShow, !collapsed.value]
          ])
        ],
        2
        /* CLASS */
      );
    };
  }
});
const QueryItemRow = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__scopeId", "data-v-9aca9681"]]);
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
  __name: "BuilderQueryRow",
  props: {
    item: {},
    index: {},
    allItems: {},
    profile: {},
    capabilities: {},
    isPrimary: { type: Boolean },
    canDelete: { type: Boolean },
    datasourceApi: {},
    globalMode: {}
  },
  emits: ["update", "copy", "remove", "run"],
  setup(__props) {
    return (_ctx, _cache) => {
      return openBlock(), createBlock(QueryItemRow, {
        item: __props.item,
        index: __props.index,
        "all-items": __props.allItems,
        profile: __props.profile,
        capabilities: __props.capabilities,
        "is-primary": __props.isPrimary,
        "can-delete": __props.canDelete,
        "datasource-api": __props.datasourceApi,
        "global-mode": __props.globalMode,
        onUpdate: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update", $event)),
        onCopy: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("copy")),
        onRemove: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("remove")),
        onRun: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("run"))
      }, null, 8, ["item", "index", "all-items", "profile", "capabilities", "is-primary", "can-delete", "datasource-api", "global-mode"]);
    };
  }
});
const _hoisted_1$5 = {
  class: "signoz-builder-editor",
  "data-testid": "signoz-builder-editor"
};
const _sfc_main$5 = /* @__PURE__ */ defineComponent({
  __name: "BuilderEditor",
  props: {
    items: {},
    profile: {},
    capabilities: {},
    datasourceApi: {},
    globalMode: {}
  },
  emits: ["update", "copy", "remove", "run"],
  setup(__props, { emit: __emit }) {
    const emit = __emit;
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$5, [
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(__props.items, (item, index2) => {
            return openBlock(), createBlock(_sfc_main$6, {
              key: item.spec.name + "-" + index2,
              item,
              index: index2,
              "all-items": __props.items,
              profile: __props.profile,
              capabilities: __props.capabilities,
              "is-primary": index2 === 0,
              "can-delete": __props.items.length > 1,
              "datasource-api": __props.datasourceApi,
              "global-mode": __props.globalMode,
              onUpdate: ($event) => emit("update", index2, $event),
              onCopy: ($event) => emit("copy", index2),
              onRemove: ($event) => emit("remove", index2),
              onRun: _cache[0] || (_cache[0] = ($event) => emit("run"))
            }, null, 8, ["item", "index", "all-items", "profile", "capabilities", "is-primary", "can-delete", "datasource-api", "global-mode", "onUpdate", "onCopy", "onRemove"]);
          }),
          128
          /* KEYED_FRAGMENT */
        ))
      ]);
    };
  }
});
const BuilderEditor = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-2a339bb2"]]);
const _hoisted_1$4 = {
  class: "signoz-query-type-tabs",
  "data-testid": "signoz-query-type-tabs",
  role: "tablist"
};
const _hoisted_2$4 = ["aria-selected", "aria-disabled", "disabled", "title", "data-testid", "onClick"];
const _hoisted_3$3 = {
  key: 0,
  class: "signoz-qtt-legacy",
  "data-testid": "signoz-legacy-mixed-warning",
  role: "status"
};
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
  __name: "QueryTypeTabs",
  props: {
    mode: {},
    blocked: {},
    legacyMixed: { type: Boolean }
  },
  emits: ["update:mode"],
  setup(__props, { emit: __emit }) {
    const props = __props;
    const emit = __emit;
    const TABS = [
      { value: "builder", label: "Query Builder" },
      { value: "promql", label: "PromQL" },
      { value: "clickhouse_sql", label: "ClickHouse SQL" }
    ];
    function isBlocked(mode2) {
      return Boolean(props.blocked?.[mode2]);
    }
    function select(mode2) {
      if (isBlocked(mode2) || mode2 === props.mode) return;
      emit("update:mode", mode2);
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$4, [
        (openBlock(), createElementBlock(
          Fragment,
          null,
          renderList(TABS, (tab) => {
            return createElementVNode("button", {
              key: tab.value,
              type: "button",
              role: "tab",
              class: normalizeClass(["signoz-qtt-tab", {
                "signoz-qtt-tab--active": __props.mode === tab.value,
                "signoz-qtt-tab--disabled": isBlocked(tab.value)
              }]),
              "aria-selected": __props.mode === tab.value,
              "aria-disabled": isBlocked(tab.value) ? "true" : "false",
              disabled: isBlocked(tab.value),
              title: __props.blocked?.[tab.value] || tab.label,
              "data-testid": tab.value === "builder" ? "signoz-mode" : `signoz-mode-${tab.value}`,
              onClick: ($event) => select(tab.value)
            }, toDisplayString(tab.label), 11, _hoisted_2$4);
          }),
          64
          /* STABLE_FRAGMENT */
        )),
        __props.legacyMixed ? (openBlock(), createElementBlock("p", _hoisted_3$3, " 检测到旧版混合查询模式。请选择全局模式以升级；未确认前仍使用原 schema 序列化。 ")) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const QueryTypeTabs = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-73ad8c79"]]);
const _hoisted_1$3 = {
  class: "signoz-qe",
  "data-testid": "query-editor-signoz"
};
const _hoisted_2$3 = {
  key: 0,
  class: "err"
};
const _hoisted_3$2 = { class: "qe-toolbar" };
const _hoisted_4$2 = { class: "qe-request-type" };
const _hoisted_5$2 = { class: "qb-footer" };
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
  __name: "QueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    onRunQuery: { type: Function },
    datasource: {},
    range: {},
    datasourceApi: {}
  },
  setup(__props) {
    const props = __props;
    const query = computed(() => migrateSigNozQuery(props.query || {}));
    const editorState = computed(() => toEditorState(query.value));
    const items = computed(() => {
      const q = query.value;
      if (Array.isArray(q.queries) && q.queries.length) return q.queries;
      return fromEditorState(editorState.value, q).queries;
    });
    const globalMode = computed(
      () => editorState.value.activeQueryType || "builder"
    );
    const jsonData = computed(
      () => props.datasource?.jsonData || {}
    );
    const profile = computed(() => {
      const jd = jsonData.value;
      const apiProfile = jd.apiProfile || query.value.apiProfile || "signoz-v5";
      return resolveSigNozProfile({ ...jd, apiProfile });
    });
    const capabilities = computed(
      () => resolveEditorCapabilities({
        profile: profile.value,
        options: jsonData.value
      })
    );
    const requestTypeOptions = computed(
      () => allowedRequestTypes(capabilities.value).map((t2) => ({ label: t2, value: t2 }))
    );
    const modeBlocked = computed(() => {
      const out = {};
      if (!capabilities.value.builder)
        out.builder = "builder 当前 capability 不可用";
      if (!capabilities.value.promql) out.promql = "promql 当前 capability 不可用";
      if (!capabilities.value.clickhouseSql)
        out.clickhouse_sql = "clickhouse_sql 当前 capability 不可用";
      return out;
    });
    const validationErrors = computed(
      () => items.value.map((item) => {
        const v = validateSavedItem(item, capabilities.value);
        return v.ok ? null : { name: item.spec.name, message: v.message };
      }).filter(Boolean)
    );
    const metaApi = ref(null);
    const metaError = ref("");
    function resolveApi2() {
      const uid = String(
        props.datasource?.uid || props.query?.datasource?.uid || ""
      );
      if (uid) {
        const registered2 = getRuntimeDataSource(uid);
        if (registered2) return registered2;
      }
      return props.datasourceApi || props.datasource || null;
    }
    onMounted(() => {
      metaApi.value = resolveApi2();
    });
    watch(
      () => [props.datasource?.uid, props.datasourceApi],
      () => {
        metaApi.value = resolveApi2();
      }
    );
    function commitQueries(nextItems, extra = {}) {
      const base = props.query;
      const first = nextItems.find((i) => i.type === "builder_query") || nextItems[0];
      const flat = {};
      if (first && first.type === "builder_query") {
        flat.signal = first.spec.signal;
        flat.expr = first.rawQuery || "";
        flat.service = first.spec.service;
        flat.operation = first.spec.operation;
        flat.legendFormat = first.rawLegend || first.spec.legend || "";
        flat.limit = first.spec.limit;
      }
      const formula = nextItems.find((i) => i.type === "builder_formula");
      if (formula && formula.type === "builder_formula") {
        flat.formula = formula.spec.expression;
      }
      const rebuilt = toEditorState({ queries: nextItems });
      rebuilt.activeQueryType = globalMode.value;
      const stillMixed = Boolean(editorState.value.legacyMixed && !extra && false);
      const next = {
        ...query.value,
        ...flat,
        ...extra,
        refId: base?.refId ?? query.value.refId,
        datasource: base?.datasource ?? query.value.datasource,
        hide: base?.hide ?? query.value.hide,
        schema: stillMixed ? 1 : 2,
        queries: nextItems,
        editor: rebuilt
      };
      if (editorState.value.legacyMixed && editorState.value.legacySchema1) {
        next.editor.legacyMixed = true;
        next.editor.legacySchema1 = editorState.value.legacySchema1;
        next.schema = 1;
      }
      props.onChange(next);
    }
    function commitEditor(nextState, extra = {}) {
      const base = props.query;
      const wire = fromEditorState(nextState, {
        ...query.value,
        ...extra,
        refId: base?.refId ?? query.value.refId,
        datasource: base?.datasource ?? query.value.datasource,
        hide: base?.hide ?? query.value.hide
      });
      const first = wire.queries.find((i) => i.type === "builder_query");
      if (first && first.type === "builder_query") {
        wire.signal = first.spec.signal;
        wire.expr = first.rawQuery || "";
        wire.legendFormat = first.rawLegend || first.spec.legend || "";
        wire.limit = first.spec.limit;
      }
      props.onChange(wire);
    }
    function setGlobalMode(mode2) {
      if (modeBlocked.value[mode2]) return;
      let st = commitGlobalMode(editorState.value, mode2);
      if (mode2 === "promql" && !st.promql.length) {
        st = {
          ...st,
          promql: [{ name: "A", query: "up" }]
        };
      }
      if (mode2 === "clickhouse_sql" && !st.clickhouseSql.length) {
        st = {
          ...st,
          clickhouseSql: [{ name: "A", query: "SELECT 1" }]
        };
      }
      if (mode2 === "builder" && !st.builder.queries.length) {
        st = {
          ...st,
          builder: {
            ...st.builder,
            queries: [defaultBuilderSpec("A", "traces")]
          }
        };
      }
      commitEditor(st);
    }
    function setRequestType(v) {
      commitQueries(items.value, { requestType: String(v) });
    }
    function updateAt(index2, item) {
      const next = items.value.map((it, i) => i === index2 ? item : it);
      commitQueries(next);
    }
    function addQuery() {
      if (!capabilities.value.builder && !capabilities.value.promql) return;
      const name = nextQueryName(items.value);
      const signal = profile.value.signals[0] || "traces";
      const mode2 = globalMode.value;
      const item = mode2 === "promql" ? defaultPromItem(name, "") : mode2 === "clickhouse_sql" ? {
        type: "builder_query",
        queryType: "clickhouse_sql",
        spec: defaultBuilderSpec(
          name,
          signal === "metrics" ? "logs" : signal
        ),
        rawQuery: "",
        rawLegend: ""
      } : {
        type: "builder_query",
        queryType: "builder",
        spec: defaultBuilderSpec(name, signal),
        rawQuery: "",
        rawLegend: ""
      };
      commitQueries([...items.value, item]);
    }
    function addFormula() {
      if (!capabilities.value.formula) return;
      if (globalMode.value !== "builder") {
        setGlobalMode("builder");
      }
      const current = items.value;
      const name = nextFormulaName(current);
      const item = {
        type: "builder_formula",
        spec: {
          name,
          expression: current.find((i) => i.type === "builder_query")?.spec.name || "A",
          disabled: false,
          legend: "",
          order: []
        }
      };
      const asBuilder = current.map((it) => {
        if (it.type !== "builder_query") return it;
        return { ...it, queryType: "builder" };
      });
      commitQueries([...asBuilder, item]);
    }
    function addTraceOperator() {
      if (!capabilities.value.traceOperator || globalMode.value !== "builder")
        return;
      const name = nextQueryName(items.value);
      const item = {
        type: "builder_trace_operator",
        spec: { name, expression: "", disabled: false, legend: "" }
      };
      commitQueries([...items.value, item]);
    }
    function addJoin() {
      if (!capabilities.value.join || globalMode.value !== "builder") return;
      const name = nextQueryName(items.value);
      const item = {
        type: "builder_join",
        spec: {
          name,
          left: "A",
          right: "B",
          type: "inner",
          on: "",
          disabled: false
        }
      };
      commitQueries([...items.value, item]);
    }
    function copyAt(index2) {
      const src = items.value[index2];
      if (!src) return;
      if (src.type === "builder_formula") {
        const name2 = nextFormulaName(items.value);
        commitQueries([
          ...items.value,
          {
            type: "builder_formula",
            spec: { ...src.spec, name: name2 }
          }
        ]);
        return;
      }
      const name = nextQueryName(items.value);
      commitQueries([
        ...items.value,
        {
          ...src,
          spec: { ...src.spec, name },
          rawQuery: src.rawQuery,
          rawLegend: src.rawLegend
        }
      ]);
    }
    function removeAt(index2) {
      if (items.value.length <= 1) return;
      commitQueries(items.value.filter((_, i) => i !== index2));
    }
    onMounted(() => {
      if (!items.value.length) {
        commitQueries([
          {
            type: "builder_query",
            queryType: "builder",
            spec: defaultBuilderSpec("A", "traces"),
            rawQuery: "",
            rawLegend: ""
          }
        ]);
      }
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$3, [
        metaError.value ? (openBlock(), createElementBlock(
          "div",
          _hoisted_2$3,
          toDisplayString(metaError.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true),
        createCommentVNode(" Time range comes from Grafana Explore/Dashboard external picker (no internal clock). "),
        createElementVNode("div", _hoisted_3$2, [
          _cache[3] || (_cache[3] = createElementVNode(
            "div",
            {
              class: "qe-toolbar-note",
              "data-testid": "signoz-external-time-note"
            },
            " 时间范围使用页面顶部时间选择器 ",
            -1
            /* CACHED */
          )),
          createElementVNode("div", _hoisted_4$2, [
            _cache[2] || (_cache[2] = createElementVNode(
              "span",
              { class: "qe-rt-label" },
              "requestType",
              -1
              /* CACHED */
            )),
            createVNode(unref(GSelect), {
              value: query.value.requestType || "time_series",
              options: requestTypeOptions.value,
              "test-id": "signoz-request-type",
              "onUpdate:value": setRequestType
            }, null, 8, ["value", "options"])
          ])
        ]),
        createVNode(QueryTypeTabs, {
          mode: globalMode.value,
          blocked: modeBlocked.value,
          "legacy-mixed": Boolean(editorState.value.legacyMixed),
          "onUpdate:mode": setGlobalMode
        }, null, 8, ["mode", "blocked", "legacy-mixed"]),
        (openBlock(true), createElementBlock(
          Fragment,
          null,
          renderList(validationErrors.value, (err) => {
            return openBlock(), createElementBlock(
              "div",
              {
                key: err.name + err.message,
                class: "warn",
                "data-testid": "signoz-capability-error",
                role: "status"
              },
              toDisplayString(err.name) + ": " + toDisplayString(err.message),
              1
              /* TEXT */
            );
          }),
          128
          /* KEYED_FRAGMENT */
        )),
        createVNode(BuilderEditor, {
          items: items.value,
          profile: profile.value,
          capabilities: capabilities.value,
          "datasource-api": metaApi.value,
          "global-mode": globalMode.value,
          onUpdate: updateAt,
          onCopy: copyAt,
          onRemove: removeAt,
          onRun: _cache[0] || (_cache[0] = ($event) => props.onRunQuery?.())
        }, null, 8, ["items", "profile", "capabilities", "datasource-api", "global-mode"]),
        createElementVNode("div", _hoisted_5$2, [
          createElementVNode("button", {
            type: "button",
            class: "qb-add-btn",
            "data-testid": "signoz-add-query",
            onClick: addQuery
          }, " + 添加查询 "),
          capabilities.value.formula ? (openBlock(), createElementBlock("button", {
            key: 0,
            type: "button",
            class: "qb-add-btn",
            "data-testid": "signoz-add-formula",
            onClick: addFormula
          }, " + 添加公式 ")) : createCommentVNode("v-if", true),
          capabilities.value.traceOperator && globalMode.value === "builder" ? (openBlock(), createElementBlock("button", {
            key: 1,
            type: "button",
            class: "qb-add-btn",
            "data-testid": "signoz-add-trace-operator",
            onClick: addTraceOperator
          }, " + Trace Operator ")) : createCommentVNode("v-if", true),
          capabilities.value.join && globalMode.value === "builder" ? (openBlock(), createElementBlock("button", {
            key: 2,
            type: "button",
            class: "qb-add-btn",
            "data-testid": "signoz-add-join",
            onClick: addJoin
          }, " + Join ")) : createCommentVNode("v-if", true),
          _cache[5] || (_cache[5] = createElementVNode(
            "div",
            { class: "qb-footer-spacer" },
            null,
            -1
            /* CACHED */
          )),
          createVNode(unref(GButton), {
            size: "sm",
            variant: "primary",
            type: "button",
            "test-id": "run-query",
            onClick: _cache[1] || (_cache[1] = ($event) => props.onRunQuery?.())
          }, {
            default: withCtx(() => [..._cache[4] || (_cache[4] = [
              createTextVNode(
                " 运行查询 ",
                -1
                /* CACHED */
              )
            ])]),
            _: 1
            /* STABLE */
          })
        ])
      ]);
    };
  }
});
const QueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-82079c89"]]);
const _hoisted_1$2 = ["data-save-allowed"];
const _hoisted_2$2 = ["checked"];
const _hoisted_3$1 = {
  key: 0,
  "data-testid": "signoz-session-login-msg"
};
const _hoisted_4$1 = ["data-ok"];
const _hoisted_5$1 = {
  key: 0,
  class: "block",
  "data-testid": "signoz-save-blocked"
};
const _hoisted_6$1 = { "data-testid": "signoz-test-message" };
const _hoisted_7$1 = { class: "hint" };
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  __name: "ConfigEditor",
  props: {
    options: {},
    onOptionsChange: { type: Function },
    onValidationChange: { type: Function }
  },
  setup(__props) {
    const props = __props;
    const tokenLocal = ref("");
    const refreshTokenLocal = ref("");
    const sessionEmail = ref("");
    const sessionPassword = ref("");
    const rememberPassword = ref(false);
    const sessionLoginLoading = ref(false);
    const sessionLoginMessage = ref("");
    const testMessage = ref("");
    const testLoading = ref(false);
    const jsonData = computed(
      () => migrateSigNozConfig(
        props.options?.jsonData || {}
      )
    );
    const profile = computed(() => resolveSigNozProfile(jsonData.value));
    function patchJson(patch, url2) {
      const options = props.options;
      const nextJson = migrateSigNozConfig({ ...jsonData.value, ...patch });
      props.onOptionsChange({
        ...options,
        ...url2 != null ? { url: url2 } : {},
        jsonData: nextJson
      });
      emitValidation(nextJson, url2 != null ? url2 : String(options?.url || ""));
    }
    function emitValidation(jd = jsonData.value, url2 = String(props.options?.url || "")) {
      let isValid = Boolean(String(url2).trim());
      let message;
      if (!isValid) message = "请填写 Base URL";
      if (jd.apiProfile === "custom") {
        const sig = buildCustomHealthSignature(url2, jd);
        if (!jd.customHealthOk || jd.customHealthSignature !== sig) {
          isValid = false;
          message = "custom profile 必须先通过健康检查";
        }
      }
      props.onValidationChange?.({ isValid, message });
    }
    const url = computed({
      get: () => String(props.options?.url || ""),
      set: (v) => patchJson({}, v)
    });
    const apiProfile = computed({
      get: () => jsonData.value.apiProfile,
      set: (v) => patchJson({
        apiProfile: v,
        customHealthOk: v === "custom" ? false : jsonData.value.customHealthOk,
        customHealthSignature: v === "custom" ? "" : jsonData.value.customHealthSignature
      })
    });
    const organizationId = computed({
      get: () => String(jsonData.value.organizationId || ""),
      set: (v) => patchJson({ organizationId: v })
    });
    const defaultEnvironment = computed({
      get: () => String(jsonData.value.defaultEnvironment || ""),
      set: (v) => patchJson({ defaultEnvironment: v })
    });
    const timeout = computed({
      get: () => Number(jsonData.value.timeout || 3e4),
      set: (v) => patchJson({ timeout: Number(v) || 3e4 })
    });
    const cacheTTL = computed({
      get: () => String(jsonData.value.metadataCacheTTL || "5m"),
      set: (v) => patchJson({ metadataCacheTTL: v })
    });
    const credentialKind = computed({
      get: () => jsonData.value.credentialKind || "bearer",
      set: (v) => patchJson({ credentialKind: v })
    });
    const headerName = computed({
      get: () => String(jsonData.value.credentialHeaderName || ""),
      set: (v) => patchJson({ credentialHeaderName: v })
    });
    function setToken(v) {
      tokenLocal.value = v;
      const uid = String(props.options?.uid || "signoz");
      const kind2 = credentialKind.value;
      if (!v) {
        setRuntimeCredential(uid, null);
        return;
      }
      if (kind2 === "apiKey" || kind2 === "signozApiKey") {
        setRuntimeCredential(uid, {
          kind: "apiKey",
          value: v,
          headerName: headerName.value || (kind2 === "signozApiKey" ? "SIGNOZ-API-KEY" : "X-API-Key")
        });
      } else if (kind2 === "headers") {
        const h2 = headerName.value || "Authorization";
        setRuntimeCredential(uid, { kind: "headers", headers: { [h2]: v } });
      } else if (kind2 === "session") {
        setRuntimeCredential(uid, {
          kind: "session",
          value: v || void 0,
          refreshToken: refreshTokenLocal.value || void 0,
          email: sessionEmail.value || void 0,
          password: rememberPassword.value ? sessionPassword.value || void 0 : void 0,
          orgID: organizationId.value || void 0,
          rememberPassword: rememberPassword.value
        });
      } else if (kind2 === "proxy") {
        setRuntimeCredential(uid, { kind: "headers", headers: {} });
      } else {
        setRuntimeCredential(uid, { kind: "bearer", value: v });
      }
    }
    async function loginSession() {
      const uid = String(props.options?.uid || "signoz");
      const baseUrl2 = String(props.options?.url || "").trim();
      if (!baseUrl2) {
        sessionLoginMessage.value = "请先填写 Base URL";
        return;
      }
      if (!sessionEmail.value || !sessionPassword.value) {
        sessionLoginMessage.value = "请填写邮箱和密码";
        return;
      }
      sessionLoginLoading.value = true;
      sessionLoginMessage.value = "";
      try {
        const next = await refreshSession({
          uid,
          baseUrl: baseUrl2,
          credential: {
            kind: "session",
            email: sessionEmail.value,
            password: sessionPassword.value,
            orgID: organizationId.value || void 0,
            rememberPassword: rememberPassword.value
          }
        });
        tokenLocal.value = next.value || "";
        refreshTokenLocal.value = next.refreshToken || "";
        if (next.orgID) {
          patchJson({ organizationId: next.orgID });
        }
        setToken(tokenLocal.value);
        sessionLoginMessage.value = "登录成功，access/refresh 已写入 runtime 内存";
      } catch (e) {
        sessionLoginMessage.value = String(e?.message || e || "登录失败");
      } finally {
        sessionLoginLoading.value = false;
      }
    }
    function patchCustomPath(key, value) {
      patchJson({
        [key]: value,
        customHealthOk: false,
        customHealthSignature: ""
      });
    }
    const canSave = computed(() => {
      if (apiProfile.value !== "custom") return Boolean(url.value.trim());
      const sig = buildCustomHealthSignature(url.value, jsonData.value);
      return Boolean(
        jsonData.value.customHealthOk && jsonData.value.customHealthSignature === sig && url.value.trim()
      );
    });
    async function testHealth() {
      testLoading.value = true;
      testMessage.value = "检测中…";
      try {
        const ds2 = createSignozDataSource(
          {
            uid: props.options?.uid || "signoz-cfg",
            name: props.options?.name || "SigNoz",
            type: "signoz",
            url: url.value,
            jsonData: jsonData.value,
            meta: { id: "signoz", name: "SigNoz" }
          },
          { id: "signoz", name: "SigNoz" }
        );
        const res = await ds2.testDatasource();
        const ok2 = res.status === "success";
        if (apiProfile.value === "custom") {
          if (ok2) {
            const sig = buildCustomHealthSignature(url.value, jsonData.value);
            patchJson({ customHealthOk: true, customHealthSignature: sig });
          } else {
            patchJson({ customHealthOk: false, customHealthSignature: "" });
          }
        }
        testMessage.value = res.message || (ok2 ? "OK" : "failed");
      } catch (e) {
        if (apiProfile.value === "custom")
          patchJson({ customHealthOk: false, customHealthSignature: "" });
        testMessage.value = e instanceof Error ? e.message : String(e);
      } finally {
        testLoading.value = false;
      }
    }
    watch(
      () => props.options,
      () => emitValidation(),
      { deep: true, immediate: true }
    );
    onUnmounted(() => {
      tokenLocal.value = "";
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: "signoz-cfg",
        "data-testid": "config-editor-signoz",
        "data-save-allowed": String(canSave.value)
      }, [
        createVNode(unref(_sfc_main$4y), { layout: "vertical" }, {
          default: withCtx(() => [
            _cache[37] || (_cache[37] = createElementVNode(
              "h4",
              null,
              "连接",
              -1
              /* CACHED */
            )),
            _cache[38] || (_cache[38] = createElementVNode(
              "label",
              null,
              "Base URL",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: url.value,
              "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => url.value = $event),
              placeholder: "http://localhost:3301",
              "test-id": "signoz-url"
            }, null, 8, ["modelValue"]),
            _cache[39] || (_cache[39] = createElementVNode(
              "label",
              null,
              "API Profile",
              -1
              /* CACHED */
            )),
            createVNode(unref(GSelect), {
              modelValue: apiProfile.value,
              "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => apiProfile.value = $event),
              options: [
                { label: "prometheus-compatible", value: "prometheus-compatible" },
                { label: "argus-v5 (Argus /api/apm)", value: "argus-v5" },
                { label: "signoz-v5", value: "signoz-v5" },
                { label: "signoz-v3", value: "signoz-v3" },
                { label: "signoz-v4", value: "signoz-v4" },
                { label: "custom", value: "custom" }
              ],
              "test-id": "signoz-profile"
            }, null, 8, ["modelValue"]),
            _cache[40] || (_cache[40] = createElementVNode(
              "label",
              null,
              "Organization ID",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: organizationId.value,
              "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => organizationId.value = $event),
              "test-id": "signoz-organization-id"
            }, null, 8, ["modelValue"]),
            _cache[41] || (_cache[41] = createElementVNode(
              "label",
              null,
              "Default Environment",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: defaultEnvironment.value,
              "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => defaultEnvironment.value = $event),
              "test-id": "signoz-environment"
            }, null, 8, ["modelValue"]),
            _cache[42] || (_cache[42] = createElementVNode(
              "label",
              null,
              "超时 (ms)",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "model-value": timeout.value,
              type: "number",
              "test-id": "signoz-timeout",
              "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => timeout.value = Number($event))
            }, null, 8, ["model-value"]),
            _cache[43] || (_cache[43] = createElementVNode(
              "label",
              null,
              "元数据缓存 TTL",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: cacheTTL.value,
              "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => cacheTTL.value = $event),
              "test-id": "signoz-cache-ttl"
            }, null, 8, ["modelValue"]),
            _cache[44] || (_cache[44] = createElementVNode(
              "h4",
              null,
              "认证",
              -1
              /* CACHED */
            )),
            _cache[45] || (_cache[45] = createElementVNode(
              "label",
              null,
              "Credential Kind",
              -1
              /* CACHED */
            )),
            createVNode(unref(GSelect), {
              modelValue: credentialKind.value,
              "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => credentialKind.value = $event),
              options: [
                { label: "Bearer / API Token", value: "bearer" },
                { label: "API Key", value: "apiKey" },
                { label: "Headers", value: "headers" },
                { label: "邮箱密码会话", value: "session" }
              ],
              "test-id": "signoz-credential-kind"
            }, null, 8, ["modelValue"]),
            _cache[46] || (_cache[46] = createElementVNode(
              "label",
              null,
              "Header Name",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              modelValue: headerName.value,
              "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => headerName.value = $event),
              "test-id": "signoz-header-name",
              placeholder: "X-API-Key / Authorization"
            }, null, 8, ["modelValue"]),
            _cache[47] || (_cache[47] = createElementVNode(
              "label",
              null,
              "Token / Secret（runtime only）",
              -1
              /* CACHED */
            )),
            createVNode(unref(GInput), {
              "model-value": tokenLocal.value,
              type: "password",
              autocomplete: "off",
              "test-id": "signoz-token",
              "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => setToken(String($event)))
            }, null, 8, ["model-value"]),
            credentialKind.value === "session" ? (openBlock(), createElementBlock(
              Fragment,
              { key: 0 },
              [
                _cache[23] || (_cache[23] = createElementVNode(
                  "label",
                  null,
                  "Refresh Token（runtime only，用于 /sessions/rotate）",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": refreshTokenLocal.value,
                  type: "password",
                  autocomplete: "off",
                  "test-id": "signoz-refresh-token",
                  "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => {
                    refreshTokenLocal.value = String($event);
                    setToken(tokenLocal.value);
                  })
                }, null, 8, ["model-value"]),
                _cache[24] || (_cache[24] = createElementVNode(
                  "label",
                  null,
                  "邮箱",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": sessionEmail.value,
                  "test-id": "signoz-session-email",
                  "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => {
                    sessionEmail.value = String($event);
                    setToken(tokenLocal.value);
                  })
                }, null, 8, ["model-value"]),
                _cache[25] || (_cache[25] = createElementVNode(
                  "label",
                  null,
                  "密码（仅 runtime 内存）",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": sessionPassword.value,
                  type: "password",
                  autocomplete: "off",
                  "test-id": "signoz-session-password",
                  "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => {
                    sessionPassword.value = String($event);
                    setToken(tokenLocal.value);
                  })
                }, null, 8, ["model-value"]),
                createElementVNode("label", null, [
                  createElementVNode("input", {
                    type: "checkbox",
                    "data-testid": "signoz-remember-password",
                    checked: rememberPassword.value,
                    onChange: _cache[12] || (_cache[12] = ($event) => {
                      rememberPassword.value = $event.target.checked;
                      setToken(tokenLocal.value);
                    })
                  }, null, 40, _hoisted_2$2),
                  _cache[22] || (_cache[22] = createTextVNode(
                    " 记住密码用于自动续期 ",
                    -1
                    /* CACHED */
                  ))
                ]),
                createVNode(unref(GButton), {
                  "html-type": "button",
                  "test-id": "signoz-session-login",
                  loading: sessionLoginLoading.value,
                  disabled: sessionLoginLoading.value,
                  onClick: loginSession
                }, {
                  default: withCtx(() => [
                    createTextVNode(
                      toDisplayString(sessionLoginLoading.value ? "登录中…" : "邮箱密码登录并获取 token"),
                      1
                      /* TEXT */
                    )
                  ]),
                  _: 1
                  /* STABLE */
                }, 8, ["loading", "disabled"]),
                sessionLoginMessage.value ? (openBlock(), createElementBlock(
                  "p",
                  _hoisted_3$1,
                  toDisplayString(sessionLoginMessage.value),
                  1
                  /* TEXT */
                )) : createCommentVNode("v-if", true)
              ],
              64
              /* STABLE_FRAGMENT */
            )) : createCommentVNode("v-if", true),
            apiProfile.value === "custom" ? (openBlock(), createElementBlock(
              Fragment,
              { key: 1 },
              [
                _cache[26] || (_cache[26] = createElementVNode(
                  "h4",
                  null,
                  "Custom Endpoints",
                  -1
                  /* CACHED */
                )),
                _cache[27] || (_cache[27] = createElementVNode(
                  "label",
                  null,
                  "Health",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customHealthPath || "",
                  "test-id": "signoz-custom-health",
                  "onUpdate:modelValue": _cache[13] || (_cache[13] = ($event) => patchCustomPath("customHealthPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[28] || (_cache[28] = createElementVNode(
                  "label",
                  null,
                  "Metrics",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customMetricsPath || "",
                  "test-id": "signoz-custom-metrics",
                  "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => patchCustomPath("customMetricsPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[29] || (_cache[29] = createElementVNode(
                  "label",
                  null,
                  "Logs",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customLogsPath || "",
                  "test-id": "signoz-custom-logs",
                  "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => patchCustomPath("customLogsPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[30] || (_cache[30] = createElementVNode(
                  "label",
                  null,
                  "Traces",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customTracesPath || "",
                  "test-id": "signoz-custom-traces",
                  "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => patchCustomPath("customTracesPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[31] || (_cache[31] = createElementVNode(
                  "label",
                  null,
                  "Alerts",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customAlertsPath || "",
                  "test-id": "signoz-custom-alerts",
                  "onUpdate:modelValue": _cache[17] || (_cache[17] = ($event) => patchCustomPath("customAlertsPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[32] || (_cache[32] = createElementVNode(
                  "label",
                  null,
                  "Trace by ID",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customTraceByIdPath || "",
                  "test-id": "signoz-custom-trace-detail",
                  "onUpdate:modelValue": _cache[18] || (_cache[18] = ($event) => patchCustomPath("customTraceByIdPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[33] || (_cache[33] = createElementVNode(
                  "label",
                  null,
                  "Metadata",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customMetadataPath || "",
                  "test-id": "signoz-custom-metadata",
                  "onUpdate:modelValue": _cache[19] || (_cache[19] = ($event) => patchCustomPath("customMetadataPath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[34] || (_cache[34] = createElementVNode(
                  "label",
                  null,
                  "Acknowledge",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customAcknowledgePath || "",
                  "test-id": "signoz-custom-acknowledge",
                  "onUpdate:modelValue": _cache[20] || (_cache[20] = ($event) => patchCustomPath("customAcknowledgePath", String($event)))
                }, null, 8, ["model-value"]),
                _cache[35] || (_cache[35] = createElementVNode(
                  "label",
                  null,
                  "Resolve",
                  -1
                  /* CACHED */
                )),
                createVNode(unref(GInput), {
                  "model-value": jsonData.value.customResolvePath || "",
                  "test-id": "signoz-custom-resolve",
                  "onUpdate:modelValue": _cache[21] || (_cache[21] = ($event) => patchCustomPath("customResolvePath", String($event)))
                }, null, 8, ["model-value"]),
                createElementVNode("div", {
                  class: "health",
                  "data-ok": String(jsonData.value.customHealthOk),
                  "data-testid": "signoz-health-status"
                }, toDisplayString(jsonData.value.customHealthOk ? "已通过" : "未通过"), 9, _hoisted_4$1),
                !canSave.value ? (openBlock(), createElementBlock("div", _hoisted_5$1, " 保存已阻止：custom 未通过 health ")) : createCommentVNode("v-if", true)
              ],
              64
              /* STABLE_FRAGMENT */
            )) : createCommentVNode("v-if", true),
            createVNode(unref(GButton), {
              variant: "primary",
              loading: testLoading.value,
              "test-id": "signoz-health-test",
              onClick: testHealth
            }, {
              default: withCtx(() => [..._cache[36] || (_cache[36] = [
                createTextVNode(
                  " 测试连接 / 健康检查 ",
                  -1
                  /* CACHED */
                )
              ])]),
              _: 1
              /* STABLE */
            }, 8, ["loading"]),
            createElementVNode(
              "span",
              _hoisted_6$1,
              toDisplayString(testMessage.value),
              1
              /* TEXT */
            ),
            createElementVNode(
              "pre",
              _hoisted_7$1,
              toDisplayString(JSON.stringify(profile.value.endpoints, null, 2)),
              1
              /* TEXT */
            )
          ]),
          _: 1
          /* STABLE */
        })
      ], 8, _hoisted_1$2);
    };
  }
});
const ConfigEditor = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-93134fd7"]]);
const _hoisted_1$1 = { "data-testid": "signoz-variable-query-editor" };
const _hoisted_2$1 = { key: 0 };
const _hoisted_3 = { key: 2 };
const _hoisted_4 = { key: 4 };
const _hoisted_5 = { key: 6 };
const _hoisted_6 = { key: 8 };
const _hoisted_7 = {
  key: 10,
  class: "warn",
  "data-testid": "signoz-var-unsupported",
  role: "status"
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  __name: "VariableQueryEditor",
  props: {
    query: {},
    onChange: { type: Function },
    datasource: {}
  },
  setup(__props) {
    const props = __props;
    function model() {
      if (typeof props.query === "string") {
        try {
          return JSON.parse(props.query);
        } catch {
          return { type: "service", search: props.query };
        }
      }
      return props.query?.type ? props.query : { type: "service", search: props.query?.query || "" };
    }
    const m = computed(() => model());
    const jsonData = computed(
      () => props.datasource?.jsonData || {}
    );
    const profile = computed(() => resolveSigNozProfile(jsonData.value));
    const caps2 = computed(
      () => resolveEditorCapabilities({
        profile: profile.value,
        options: jsonData.value
      })
    );
    function patch(p) {
      props.onChange({ ...m.value, ...p });
    }
    const unsupportedReason = computed(() => {
      const type = String(m.value.type || "service");
      const blocked = caps2.value?.unsupportedVariableTypes;
      if (blocked?.includes(type)) {
        return `当前 API Profile 不支持变量类型「${type}」`;
      }
      if (type === "clickhouse_query" && caps2.value?.clickhouseSql === false) {
        return "当前 Profile 未启用 ClickHouse SQL 变量";
      }
      return "";
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1$1, [
        _cache[7] || (_cache[7] = createElementVNode(
          "label",
          null,
          "变量类型",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          value: m.value.type || "service",
          options: [
            { label: "Environment", value: "environment" },
            { label: "Service", value: "service" },
            { label: "Operation", value: "operation" },
            { label: "Metric", value: "metric" },
            { label: "Attribute Key", value: "attributeKey" },
            { label: "Attribute Value", value: "attributeValue" },
            { label: "Dynamic (field+source)", value: "dynamic" },
            { label: "ClickHouse Query", value: "clickhouse_query" }
          ],
          "test-id": "signoz-var-type",
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patch({ type: String($event) }))
        }, null, 8, ["value"]),
        _cache[8] || (_cache[8] = createElementVNode(
          "label",
          null,
          "搜索",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          "model-value": String(m.value.search || ""),
          "test-id": "signoz-var-search",
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => patch({ search: String($event) }))
        }, null, 8, ["model-value"]),
        m.value.type === "operation" ? (openBlock(), createElementBlock("label", _hoisted_2$1, "Service")) : createCommentVNode("v-if", true),
        m.value.type === "operation" ? (openBlock(), createBlock(unref(GInput), {
          key: 1,
          "model-value": String(m.value.service || ""),
          "test-id": "signoz-var-service",
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => patch({ service: String($event) }))
        }, null, 8, ["model-value"])) : createCommentVNode("v-if", true),
        m.value.type === "attributeValue" || m.value.type === "attributeKey" ? (openBlock(), createElementBlock("label", _hoisted_3, "Key / Metric")) : createCommentVNode("v-if", true),
        m.value.type === "attributeValue" ? (openBlock(), createBlock(unref(GInput), {
          key: 3,
          "model-value": String(m.value.key || ""),
          "test-id": "signoz-var-key",
          "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => patch({ key: String($event) }))
        }, null, 8, ["model-value"])) : createCommentVNode("v-if", true),
        m.value.type === "dynamic" ? (openBlock(), createElementBlock("label", _hoisted_4, "Field")) : createCommentVNode("v-if", true),
        m.value.type === "dynamic" ? (openBlock(), createBlock(unref(GInput), {
          key: 5,
          "model-value": String(m.value.field || m.value.key || ""),
          "test-id": "signoz-var-dynamic-field",
          "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => patch({ field: String($event) }))
        }, null, 8, ["model-value"])) : createCommentVNode("v-if", true),
        m.value.type === "dynamic" ? (openBlock(), createElementBlock("label", _hoisted_5, "Source")) : createCommentVNode("v-if", true),
        m.value.type === "dynamic" ? (openBlock(), createBlock(unref(GSelect), {
          key: 7,
          value: m.value.source || m.value.signal || "metrics",
          options: [
            { label: "metrics", value: "metrics" },
            { label: "logs", value: "logs" },
            { label: "traces", value: "traces" }
          ],
          "test-id": "signoz-var-dynamic-source",
          "onUpdate:value": _cache[5] || (_cache[5] = ($event) => patch({ source: String($event) }))
        }, null, 8, ["value"])) : createCommentVNode("v-if", true),
        m.value.type === "clickhouse_query" ? (openBlock(), createElementBlock("label", _hoisted_6, "SQL")) : createCommentVNode("v-if", true),
        m.value.type === "clickhouse_query" ? (openBlock(), createBlock(unref(GInput), {
          key: 9,
          "model-value": String(m.value.query || m.value.sql || ""),
          "test-id": "signoz-var-ch-sql",
          "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => patch({ query: String($event) }))
        }, null, 8, ["model-value"])) : createCommentVNode("v-if", true),
        unsupportedReason.value ? (openBlock(), createElementBlock(
          "p",
          _hoisted_7,
          toDisplayString(unsupportedReason.value),
          1
          /* TEXT */
        )) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const VariableQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-96cf0d9a"]]);
const _hoisted_1 = { "data-testid": "signoz-annotation-query-editor" };
const _hoisted_2 = {
  key: 0,
  class: "hint",
  "data-testid": "signoz-anno-alerts-hidden"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "AnnotationQueryEditor",
  props: {
    annotation: {},
    onChange: { type: Function },
    datasource: {}
  },
  setup(__props) {
    const props = __props;
    const target = computed(
      () => props.annotation.target || {}
    );
    const jsonData = computed(
      () => props.datasource?.jsonData || {}
    );
    const profile = computed(() => {
      const jd = jsonData.value;
      const resolved = resolveSigNozProfile(jd);
      if (jd.customAlertsPath && !resolved.endpoints.alertsQuery) {
        return {
          ...resolved,
          endpoints: {
            ...resolved.endpoints,
            alertsQuery: { path: jd.customAlertsPath, method: "POST" }
          }
        };
      }
      return resolved;
    });
    const caps2 = computed(
      () => resolveEditorCapabilities({
        profile: profile.value,
        options: jsonData.value
      })
    );
    const sourceOptions = computed(() => {
      const opts = [
        { label: "Error Logs", value: "errorLogs" },
        { label: "Error Spans", value: "errorSpans" }
      ];
      if (caps2.value.alerts) {
        opts.push({ label: "Firing Alerts", value: "firingAlerts" });
      }
      return opts;
    });
    function patchTarget(partial) {
      props.onChange({
        ...props.annotation,
        name: props.annotation.name,
        enable: props.annotation.enable,
        iconColor: props.annotation.iconColor,
        target: { ...target.value, ...partial }
      });
    }
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        _cache[3] || (_cache[3] = createElementVNode(
          "label",
          null,
          "来源",
          -1
          /* CACHED */
        )),
        createVNode(unref(GSelect), {
          value: target.value.source || "errorLogs",
          options: sourceOptions.value,
          "test-id": "signoz-anno-source",
          "onUpdate:value": _cache[0] || (_cache[0] = ($event) => patchTarget({ source: String($event) }))
        }, null, 8, ["value", "options"]),
        _cache[4] || (_cache[4] = createElementVNode(
          "label",
          null,
          "Service",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          "model-value": String(target.value.service || ""),
          "test-id": "signoz-anno-service",
          "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => patchTarget({ service: String($event) }))
        }, null, 8, ["model-value"]),
        _cache[5] || (_cache[5] = createElementVNode(
          "label",
          null,
          "Environment",
          -1
          /* CACHED */
        )),
        createVNode(unref(GInput), {
          "model-value": String(target.value.environment || ""),
          "test-id": "signoz-anno-environment",
          "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => patchTarget({ environment: String($event) }))
        }, null, 8, ["model-value"]),
        !caps2.value.alerts ? (openBlock(), createElementBlock("p", _hoisted_2, " Firing Alerts 已隐藏（当前 profile 无 alertsQuery capability） ")) : createCommentVNode("v-if", true)
      ]);
    };
  }
});
const AnnotationQueryEditor = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-5fb7503e"]]);
registerSignozDataSourceFactory(createSignozDataSource);
const meta = {
  id: "signoz",
  name: "SigNoz",
  metrics: true,
  logs: true,
  tracing: true,
  capabilities: SIGNOZ_CAPABILITIES
};
const plugin = createDataSourcePlugin({
  meta,
  QueryEditor,
  ConfigEditor,
  VariableQueryEditor,
  AnnotationQueryEditor,
  createDataSource: (instance) => createSignozDataSource(instance, meta)
});
const module$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: plugin,
  plugin
}, Symbol.toStringTag, { value: "Module" }));
const olApi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  Attribution,
  CircleStyle: Circle,
  Draw,
  Feature,
  Fill,
  GeoJSON,
  HeatmapLayer: Heatmap,
  LineString,
  Map: Map$1,
  OSM,
  Point,
  Polygon,
  ScaleLine,
  Stroke,
  Style,
  TextStyle: Text,
  TileLayer: Tile,
  VectorLayer: Vector,
  VectorSource: Vector$1,
  View,
  XYZ,
  Zoom,
  defaultControls: defaults,
  fromLonLat,
  getArea,
  getLength,
  toLonLat
}, Symbol.toStringTag, { value: "Module" }));
export {
  ActionsEditor,
  DATASOURCE_IDS as BUILTIN_DATASOURCE_IDS,
  BigValue,
  CLASSIC_PALETTE,
  CLASSIC_PALETTE_DARK,
  CLASSIC_PALETTE_LIGHT,
  ColorPicker,
  DATASOURCE_IDS,
  DATA_TRANSFORMER_IDS,
  DashboardGrid,
  DashboardPage,
  DashboardViewer,
  DataLinkBuiltInVars,
  DataLinksEditor,
  DataSourceError,
  DataTransformerID,
  FALLBACK_COLOR,
  FieldColorEditor,
  FieldConfigBuilder,
  FieldMatcherID,
  _sfc_main$4i as FieldNamePicker,
  FieldNamePickerBaseNameMode,
  GAlert,
  GBadge,
  GButton,
  GCard,
  _sfc_main$4u as GCheckbox,
  GCodeEditor,
  GConfirmModal,
  GDatePicker,
  _sfc_main$4s as GDrawer,
  _sfc_main$4y as GForm,
  GIcon,
  GInlineField,
  GInlineFieldRow,
  GInput,
  GLoadingPlaceholder,
  _sfc_main$4A as GModal,
  _sfc_main$3_ as GPagination,
  GPopover,
  GRadioButtonGroup,
  GSegmentInput,
  GSelect,
  GSpinner,
  _sfc_main$4v as GSwitch,
  _sfc_main$4q as GTable,
  _sfc_main$4t as GTabs,
  GTag,
  GToggletip,
  _sfc_main$4r as GTooltip,
  GrafanaAuthError,
  GrafanaDashboard,
  LibraryPanelsDrawer,
  LoadingStateEnum,
  NormalizedHeaders,
  OFFLINE_STORAGE_KEYS,
  OptionsUIBuilder as OptionsBuilder,
  OptionsPane,
  OptionsUIBuilder,
  PANEL_IDS,
  _sfc_main$4c as PanelContextProvider,
  PanelEditor,
  PanelHost,
  PanelInspector,
  QueryScheduler,
  ReducerID,
  RuntimeDataSourceSettingsError,
  SIGNOZ_CAPABILITIES,
  SIGNOZ_DATASOURCE_ID,
  SIGNOZ_PANEL_ID,
  SIGNOZ_PROFILES,
  STANDARD_FIELD_CONFIG,
  STANDARD_OVERRIDE_PROCESSORS,
  ShareDrawer,
  StatsPicker,
  StringArrayEditor,
  THEME_STORAGE_KEY,
  ThresholdsEditor,
  _sfc_main$4f as TimezonePicker,
  UNIT_CATEGORIES,
  UnitPicker,
  V1_SCHEMA_VERSION,
  VUE_PLUGIN_ABI_MAJOR,
  ValueMappingsEditor,
  VariableOrigin,
  VariableSuggestionsScope,
  VizLayout,
  VizLegend,
  VizTooltip,
  VuePanelPlugin,
  ZABBIX_CAPABILITIES,
  ZABBIX_DATASOURCE_ID,
  ZABBIX_PANEL_ID,
  alpha$1 as alpha,
  antDesignThemeTokens,
  applyCredentialHeaders,
  applyDocumentPatches,
  applyFieldOverrides,
  applyGlobalStyles,
  applyGrafanaAuthHeaders,
  applyJsonPatch,
  applyProcessedProperty,
  applyResolvedTheme,
  applyTextDirection,
  applyTheme2CssVars,
  applyThemeVars,
  applyTransformations,
  applyTransformationsWithTrace,
  applyValueMappings,
  asHexString,
  asRgbString,
  assertNoReactPlugins,
  assertSignalSupported,
  assertVuePluginAbi,
  axiosHeadersToRecord,
  backendRequest,
  backendSrv,
  bootstrapGrafanaVue,
  bootstrapObservabilityDataSources,
  buildDataLinkUrl,
  buildDataLinkVars,
  buildPluginMeta,
  clearDatasourceHttpLog,
  clearPluginRegistries,
  clearQueryInspectorStore,
  clearRuntimeCredentials,
  clearRuntimeDataSourceSettings,
  coerceFieldConfigEditorValue,
  colorManipulator,
  commitImport,
  configureBackendSrv,
  configureDatasourceHttpClient,
  configureQueryInspectorStore,
  configureRuntimeCredentials,
  configureRuntimeDataSourceSettings,
  continuousGrYlRd,
  convertV2DashboardToV1,
  createColors,
  createDashboardDocument,
  createDataFrame,
  createDataSourceCatalog,
  createDataSourcePlugin,
  createDefaultBootData,
  createDefaultPanelContext,
  createEmptyDashboardJson,
  createEmptyEditorContext,
  createGlobalStyles,
  createHttpClient,
  createImportWizardState,
  createPanelEditSession,
  createPanelEditorState,
  createPanelPlugin,
  createPanelQueryEngine,
  createPrometheusDataSource$1 as createPrometheusDataSource,
  createSignozDataSource,
  createTheme,
  createThemeFromPreference,
  createVisualizationColors,
  createZabbixDataSource,
  darken,
  dashboardRoundTrip,
  datasourceHttp,
  dateTime,
  decomposeColor,
  defaultObservabilityDataSources,
  defaultRefreshIntervals,
  detectSourceKind,
  detectTextDirection,
  diffJsonPaths,
  displayValueToString,
  dsTypeBadge,
  dsTypeLabel,
  emphasize,
  ensureDatasourceCatalogEntryRegistered,
  flattenUnits,
  flattenV2Layout,
  formatLabels,
  formatSuggestionToken,
  formatUnit,
  formatValue,
  formatValueWithUnit,
  formattedValueToString,
  frameFingerprint,
  frameHasName,
  getActiveThreshold,
  getAppHttp,
  getAtPath,
  getBackendHttp,
  getBackendMode,
  getBootData,
  getBuiltinDatasourceCatalogEntry,
  getClassicPalette$1 as getClassicPalette,
  getContrastRatio,
  getContrastText,
  getDashboardLinkUrl,
  getDataFrameVars,
  getDataLinksVariableSuggestions,
  getDataSourceByUid,
  getDataSourceCatalog,
  getDataSourcePlugin,
  getDatasourceHttpClient,
  getDatasourceHttpLog,
  getDisplayProcessor,
  getEffectiveDefaultDataSource,
  getFieldColor,
  getFieldDisplayName,
  getFieldLinks,
  getFieldMatcher,
  getFieldMatcherInfo,
  getFieldNameOptions,
  getFieldSeriesColor,
  getFrameFieldsDisplayNames,
  getGrafanaAuthSnapshot,
  getGrafanaAuthToken,
  getGrafanaBaseUrl,
  getInterval,
  getLiveDashboardBuilders,
  getLuminance,
  getOptionPath,
  getOverrideProcessor,
  getPanelPlugin,
  getQueryInspectorEntry,
  getQueryInspectorStats,
  getRawDisplayProcessor,
  getResourceHttp,
  getRuntimeCredential,
  getRuntimeDataSourceSettings,
  getTemplateVariableSuggestions,
  getThresholdColor,
  getTransformer,
  getValueFormat,
  grafanaCssVars,
  groupLabelForScope,
  hasPermission,
  hexToRgb,
  hslToRgb,
  iconMap,
  initTheme,
  interpolateDataLinkString,
  intervalToMs,
  isDataSourceError,
  isFeatureEnabled,
  isGrafanaLiveConfigured,
  isKnownOverrideProperty,
  isV2Dashboard,
  isVuePluginManifest,
  lighten,
  listBuiltinDatasourceCatalog,
  listDataSourcePlugins,
  listDataSources,
  listFieldMatchers,
  listImportedDashboards,
  listOverridePickerMatchers,
  listPanelPlugins,
  listQueryInspectorEntries,
  listReducerIds,
  listRuntimeDataSourceSettings,
  listStandardTransformers,
  listTransformerIds,
  listValueFormatIds,
  loadDashboardDocument,
  makeInspectorKey,
  matchField,
  matchFieldWithRegistry,
  matchFrameFilter,
  mergeDataSourceSettings,
  mergeObservabilityDataSourceInput,
  mergeObservabilityDataSourceInputsByUid,
  migrateDashboard,
  migrateV1Dashboard,
  normalizeBaseNameMode,
  normalizeDashboard,
  normalizeDataFrames,
  normalizeDataSourceType,
  normalizeDsType,
  normalizeHideFrom,
  normalizeScaleDistribution,
  normalizeStacking,
  normalizeThresholdsStyle,
  onThemeChange,
  palette,
  panelContextKey,
  parseDashboardDocument,
  parsePath,
  parseWizardPayload,
  parseWizardPayloadAsync,
  preProcessPanelData,
  preserveUnknownFields,
  processOverrideValue,
  providePanelContext,
  putQueryInspectorEntry,
  radioDisplayValue,
  rangeUtil_parse,
  readUrlTheme,
  recomposeColor,
  redactToken,
  reduceField,
  reduceField$1 as reduceFieldFromRegistry,
  refreshImportPreview,
  registerDataSourcePlugin,
  registerI18nCatalog,
  registerLiveDashboardBuilders,
  registerPanelPlugin,
  registerTransformer,
  removeAtPath,
  requireGrafanaAuthToken,
  resetDataSourceCatalog,
  resetHttpClients,
  resetOfflineStorage,
  resolveBackendBootSelection,
  resolveDataLink,
  resolveIcon,
  resolveInitialPreference,
  resolveObservabilityDataSources,
  resolvePluginOptionDescriptors,
  resolveThemeMode,
  resolveThemeModeHint,
  resolveTransformerId,
  resolveV2Datasource,
  resolveVizColor,
  rgbToHex,
  roundTripDashboard,
  runMigrations,
  sanitizeErrorText,
  saveDataSource,
  serializeDashboardDocument,
  setAtPath,
  setBootData,
  setGrafanaAuthToken,
  setLocale,
  setOptionPath,
  setRTL,
  setRuntimeCredential,
  sortThresholds,
  splitOptionPath,
  standardTransformers,
  stringToMs,
  t,
  toDataFrameDTO,
  toSerializableDashboard,
  useBootData,
  useDashboardStore,
  useI18n,
  useLocationService,
  usePanelContext,
  usePermissions,
  useTheme,
  v1Migrations,
  v2ResourceToV1,
  watchSystemTheme,
  withDataSourceContext
};
//# sourceMappingURL=index.js.map
