@hyperdx/cli 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/cli.js +614 -610
  2. package/package.json +9 -10
package/dist/cli.js CHANGED
@@ -53843,9 +53843,9 @@ var require_zod = __commonJS({
53843
53843
  }
53844
53844
  });
53845
53845
 
53846
- // ../common-utils/dist/chunk-3BJ55V2F.js
53847
- var require_chunk_3BJ55V2F = __commonJS({
53848
- "../common-utils/dist/chunk-3BJ55V2F.js"(exports) {
53846
+ // ../common-utils/dist/chunk-JHY6DL4P.js
53847
+ var require_chunk_JHY6DL4P = __commonJS({
53848
+ "../common-utils/dist/chunk-JHY6DL4P.js"(exports) {
53849
53849
  "use strict";
53850
53850
  Object.defineProperty(exports, "__esModule", { value: true });
53851
53851
  function _nullishCoalesce(lhs, rhsFn) {
@@ -53878,226 +53878,229 @@ var require_chunk_3BJ55V2F = __commonJS({
53878
53878
  }
53879
53879
  var _zod = require_zod();
53880
53880
  var l = ((c3) => (c3.Gauge = "gauge", c3.Histogram = "histogram", c3.Sum = "sum", c3.Summary = "summary", c3.ExponentialHistogram = "exponential histogram", c3))(l || {});
53881
- var We2 = exports.b = _zod.z.nativeEnum(l);
53882
- var j2 = exports.c = ((s3) => (s3.Line = "line", s3.StackedBar = "stacked_bar", s3.Table = "table", s3.Pie = "pie", s3.Number = "number", s3.Search = "search", s3.Heatmap = "heatmap", s3.Markdown = "markdown", s3))(j2 || {});
53883
- var y3 = exports.d = _zod.z.object(Object.values(l).reduce((o, i2) => ({ ...o, [i2]: _zod.z.string().optional() }), {})).refine((o) => Object.values(o).some((i2) => i2 && i2.length > 0), { message: "At least one metric table must be specified" });
53881
+ var Ve2 = exports.b = _zod.z.nativeEnum(l);
53882
+ var _2 = exports.c = ((s3) => (s3.Line = "line", s3.StackedBar = "stacked_bar", s3.Table = "table", s3.Pie = "pie", s3.Number = "number", s3.Search = "search", s3.Heatmap = "heatmap", s3.Markdown = "markdown", s3))(_2 || {});
53883
+ var x3 = exports.d = _zod.z.object(Object.values(l).reduce((o, i2) => ({ ...o, [i2]: _zod.z.string().optional() }), {})).refine((o) => Object.values(o).some((i2) => i2 && i2.length > 0), { message: "At least one metric table must be specified" });
53884
53884
  var u2 = exports.e = _zod.z.string().regex(/^\d+ (second|minute|hour|day)$/);
53885
53885
  var g = exports.f = _zod.z.string();
53886
53886
  var n7 = exports.g = _zod.z.enum(["sql", "lucene"]).optional();
53887
- var x3 = exports.h = _zod.z.enum(["avg", "count", "count_distinct", "last_value", "max", "min", "quantile", "sum", "any", "none"]);
53888
- var Y3 = exports.i = _zod.z.enum([...x3.options, "histogram"]);
53889
- var J = exports.j = _zod.z.string().regex(/^(\w+)If(State|Merge)$/);
53890
- var L3 = exports.k = _zod.z.object({ aggFn: _zod.z.union([_zod.z.literal("quantile"), _zod.z.literal("quantileMerge"), _zod.z.literal("histogram"), _zod.z.literal("histogramMerge")]), level: _zod.z.number(), aggCondition: g, aggConditionLanguage: n7, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), isDelta: _zod.z.boolean().optional() }).or(_zod.z.object({ aggFn: _zod.z.union([x3, J]), aggCondition: g, aggConditionLanguage: n7, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), isDelta: _zod.z.boolean().optional() })).or(_zod.z.object({ aggFn: _zod.z.string().optional(), aggCondition: _zod.z.string().optional(), aggConditionLanguage: n7, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), metricType: _zod.z.nativeEnum(l).optional(), isDelta: _zod.z.boolean().optional() })).or(_zod.z.object({ aggFn: _zod.z.string().optional(), aggCondition: _zod.z.string().optional(), aggConditionLanguage: n7.optional(), valueExpression: _zod.z.string(), valueExpressionLanguage: n7, isDelta: _zod.z.boolean().optional() }));
53891
- var f = exports.l = _zod.z.intersection(L3, _zod.z.object({ alias: _zod.z.string().optional(), metricType: _zod.z.nativeEnum(l).optional(), metricName: _zod.z.string().optional(), metricNameSql: _zod.z.string().optional() }));
53892
- var _2 = exports.m = _zod.z.array(f).or(_zod.z.string());
53893
- var N2 = exports.n = _zod.z.intersection(L3, _zod.z.object({ ordering: _zod.z.enum(["ASC", "DESC"]) }));
53894
- var U2 = exports.o = _zod.z.array(N2).or(_zod.z.string());
53895
- var C2 = exports.p = _zod.z.object({ limit: _zod.z.number().optional(), offset: _zod.z.number().optional() });
53896
- var ee2 = exports.q = _zod.z.object({ sql: _zod.z.string(), params: _zod.z.record(_zod.z.string(), _zod.z.any()) });
53897
- var d3 = exports.r = _zod.z.object({ select: _2, from: _zod.z.object({ databaseName: _zod.z.string(), tableName: _zod.z.string() }), where: g, whereLanguage: n7, groupBy: _2.optional(), having: g.optional(), havingLanguage: n7.optional(), orderBy: U2.optional(), limit: C2.optional() });
53898
- var k3 = exports.s = ((p) => (p.Slack = "slack", p.Generic = "generic", p.IncidentIO = "incidentio", p))(k3 || {});
53899
- var A2 = exports.t = _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), name: _zod.z.string(), service: _zod.z.nativeEnum(k3), updatedAt: _zod.z.string(), url: _zod.z.string().optional(), description: _zod.z.string().optional(), queryParams: _zod.z.record(_zod.z.string(), _zod.z.string()).optional(), headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional(), body: _zod.z.string().optional() });
53900
- var T3 = exports.u = ((r) => (r.ABOVE = "above", r.BELOW = "below", r))(T3 || {});
53887
+ var f = exports.h = _zod.z.enum(["avg", "count", "count_distinct", "last_value", "max", "min", "quantile", "sum", "any", "none"]);
53888
+ var N2 = exports.i = _zod.z.enum([...f.options, "histogram"]);
53889
+ var U2 = exports.j = _zod.z.string().regex(/^(\w+)If(State|Merge)$/);
53890
+ var k3 = exports.k = _zod.z.object({ aggFn: _zod.z.union([_zod.z.literal("quantile"), _zod.z.literal("quantileMerge"), _zod.z.literal("histogram"), _zod.z.literal("histogramMerge")]), level: _zod.z.number(), aggCondition: g, aggConditionLanguage: n7, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), isDelta: _zod.z.boolean().optional() }).or(_zod.z.object({ aggFn: _zod.z.union([f, U2]), aggCondition: g, aggConditionLanguage: n7, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), isDelta: _zod.z.boolean().optional() })).or(_zod.z.object({ aggFn: _zod.z.string().optional(), aggCondition: _zod.z.string().optional(), aggConditionLanguage: n7, valueExpression: _zod.z.string(), valueExpressionLanguage: _zod.z.undefined().optional(), metricType: _zod.z.nativeEnum(l).optional(), isDelta: _zod.z.boolean().optional() })).or(_zod.z.object({ aggFn: _zod.z.string().optional(), aggCondition: _zod.z.string().optional(), aggConditionLanguage: n7.optional(), valueExpression: _zod.z.string(), valueExpressionLanguage: n7, isDelta: _zod.z.boolean().optional() }));
53891
+ var C2 = exports.l = _zod.z.intersection(k3, _zod.z.object({ alias: _zod.z.string().optional(), metricType: _zod.z.nativeEnum(l).optional(), metricName: _zod.z.string().optional(), metricNameSql: _zod.z.string().optional() }));
53892
+ var j2 = exports.m = _zod.z.array(C2).or(_zod.z.string());
53893
+ var ee2 = exports.n = _zod.z.intersection(k3, _zod.z.object({ ordering: _zod.z.enum(["ASC", "DESC"]) }));
53894
+ var te2 = exports.o = _zod.z.array(ee2).or(_zod.z.string());
53895
+ var A2 = exports.p = _zod.z.object({ limit: _zod.z.number().optional(), offset: _zod.z.number().optional() });
53896
+ var oe2 = exports.q = _zod.z.object({ sql: _zod.z.string(), params: _zod.z.record(_zod.z.string(), _zod.z.any()) });
53897
+ var d3 = exports.r = _zod.z.object({ select: j2, from: _zod.z.object({ databaseName: _zod.z.string(), tableName: _zod.z.string() }), where: g, whereLanguage: n7, groupBy: j2.optional(), having: g.optional(), havingLanguage: n7.optional(), orderBy: te2.optional(), limit: A2.optional() });
53898
+ var D3 = exports.s = ((p) => (p.Slack = "slack", p.Generic = "generic", p.IncidentIO = "incidentio", p))(D3 || {});
53899
+ var T3 = exports.t = _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), name: _zod.z.string(), service: _zod.z.nativeEnum(D3), updatedAt: _zod.z.string(), url: _zod.z.string().optional(), description: _zod.z.string().optional(), queryParams: _zod.z.record(_zod.z.string(), _zod.z.string()).optional(), headers: _zod.z.record(_zod.z.string(), _zod.z.string()).optional(), body: _zod.z.string().optional() });
53900
+ var E2 = exports.u = ((r) => (r.ABOVE = "above", r.BELOW = "below", r))(E2 || {});
53901
53901
  var h3 = exports.v = ((a3) => (a3.ALERT = "ALERT", a3.DISABLED = "DISABLED", a3.INSUFFICIENT_DATA = "INSUFFICIENT_DATA", a3.OK = "OK", a3))(h3 || {});
53902
- var D3 = exports.w = ((r) => (r.SAVED_SEARCH = "saved_search", r.TILE = "tile", r))(D3 || {});
53903
- var w2 = exports.x = _zod.z.union([_zod.z.literal("1m"), _zod.z.literal("5m"), _zod.z.literal("15m"), _zod.z.literal("30m"), _zod.z.literal("1h"), _zod.z.literal("6h"), _zod.z.literal("12h"), _zod.z.literal("1d")]);
53904
- var te2 = exports.y = { "1m": 1, "5m": 5, "15m": 15, "30m": 30, "1h": 60, "6h": 360, "12h": 720, "1d": 1440 };
53905
- var oe2 = exports.z = _zod.z.literal("webhook");
53906
- var ie2 = exports.A = _zod.z.object({ type: oe2, webhookId: _zod.z.string().nonempty("Webhook ID can't be empty") });
53907
- var ne2 = exports.B = _zod.z.object({ source: _zod.z.literal("saved_search"), groupBy: _zod.z.string().optional(), savedSearchId: _zod.z.string().min(1) });
53908
- var re2 = exports.C = _zod.z.object({ source: _zod.z.literal("tile"), tileId: _zod.z.string().min(1), dashboardId: _zod.z.string().min(1) });
53909
- var q3 = exports.D = (o, i2) => {
53910
- let r = _nullishCoalesce(o.scheduleOffsetMinutes, () => 0), p = te2[o.interval];
53902
+ var w2 = exports.w = ((r) => (r.SAVED_SEARCH = "saved_search", r.TILE = "tile", r))(w2 || {});
53903
+ var q3 = exports.x = _zod.z.union([_zod.z.literal("1m"), _zod.z.literal("5m"), _zod.z.literal("15m"), _zod.z.literal("30m"), _zod.z.literal("1h"), _zod.z.literal("6h"), _zod.z.literal("12h"), _zod.z.literal("1d")]);
53904
+ var ie2 = exports.y = { "1m": 1, "5m": 5, "15m": 15, "30m": 30, "1h": 60, "6h": 360, "12h": 720, "1d": 1440 };
53905
+ var ne2 = exports.z = _zod.z.literal("webhook");
53906
+ var re2 = exports.A = _zod.z.object({ type: ne2, webhookId: _zod.z.string().nonempty("Webhook ID can't be empty") });
53907
+ var ae2 = exports.B = _zod.z.object({ source: _zod.z.literal("saved_search"), groupBy: _zod.z.string().optional(), savedSearchId: _zod.z.string().min(1) });
53908
+ var se2 = exports.C = _zod.z.object({ source: _zod.z.literal("tile"), tileId: _zod.z.string().min(1), dashboardId: _zod.z.string().min(1) });
53909
+ var M4 = exports.D = (o, i2) => {
53910
+ let r = _nullishCoalesce(o.scheduleOffsetMinutes, () => 0), p = ie2[o.interval];
53911
53911
  o.scheduleStartAt != null && r > 0 && i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: "scheduleOffsetMinutes must be 0 when scheduleStartAt is provided", path: ["scheduleOffsetMinutes"] }), r >= p && i2.addIssue({ code: _zod.z.ZodIssueCode.custom, message: `scheduleOffsetMinutes must be less than ${p} minute${p === 1 ? "" : "s"}`, path: ["scheduleOffsetMinutes"] });
53912
53912
  };
53913
- var ae2 = 1e3 * 60 * 60 * 24 * 365;
53914
- var se2 = 1e3 * 60 * 60 * 24 * 365 * 10;
53915
- var pe2 = 1439;
53916
- var le2 = exports.E = _zod.z.union([_zod.z.string().datetime(), _zod.z.null()]).optional().refine((o) => o == null || new Date(o).getTime() <= Date.now() + ae2, { message: "scheduleStartAt must be within 1 year from now" }).refine((o) => o == null || new Date(o).getTime() >= Date.now() - se2, { message: "scheduleStartAt must be within 10 years in the past" });
53917
- var E2 = exports.F = _zod.z.object({ id: _zod.z.string().optional(), interval: w2, scheduleOffsetMinutes: _zod.z.number().int().min(0).max(pe2).optional(), scheduleStartAt: le2, threshold: _zod.z.number(), thresholdType: _zod.z.nativeEnum(T3), channel: ie2, state: _zod.z.nativeEnum(h3).optional(), name: _zod.z.string().min(1).max(512).nullish(), message: _zod.z.string().min(1).max(4096).nullish(), silenced: _zod.z.object({ by: _zod.z.string(), at: _zod.z.string(), until: _zod.z.string() }).optional() });
53918
- var ce2 = exports.G = E2;
53919
- var ge2 = E2.superRefine(q3);
53920
- var M4 = exports.H = E2.extend({ threshold: _zod.z.number() });
53921
- var me2 = M4.superRefine(q3);
53922
- var ue2 = exports.I = _zod.z.union([_zod.z.intersection(ge2, ne2), _zod.z.intersection(me2, re2)]);
53923
- var de2 = exports.J = _zod.z.object({ counts: _zod.z.number(), createdAt: _zod.z.string(), lastValues: _zod.z.array(_zod.z.object({ startTime: _zod.z.string(), count: _zod.z.number() })), state: _zod.z.nativeEnum(h3) });
53924
- var he2 = exports.K = _zod.z.object({ type: _zod.z.literal("sql_ast"), operator: _zod.z.enum(["=", "<", ">", "!=", "<=", ">="]), left: _zod.z.string(), right: _zod.z.string() });
53925
- var S3 = exports.L = _zod.z.union([_zod.z.object({ type: _zod.z.enum(["lucene", "sql"]), condition: _zod.z.string() }), he2]);
53926
- var Oe2 = exports.M = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), select: _zod.z.string(), where: _zod.z.string(), whereLanguage: n7, source: _zod.z.string(), tags: _zod.z.array(_zod.z.string()), orderBy: _zod.z.string().optional(), filters: _zod.z.array(S3).optional(), alerts: _zod.z.array(ue2).optional() });
53927
- var B3 = exports.N = ((t2) => (t2.BytesIEC = "bytes_iec", t2.BytesSI = "bytes_si", t2.BitsIEC = "bits_iec", t2.BitsSI = "bits_si", t2.Kibibytes = "kibibytes", t2.Kilobytes = "kilobytes", t2.Mebibytes = "mebibytes", t2.Megabytes = "megabytes", t2.Gibibytes = "gibibytes", t2.Gigabytes = "gigabytes", t2.Tebibytes = "tebibytes", t2.Terabytes = "terabytes", t2.Pebibytes = "pebibytes", t2.Petabytes = "petabytes", t2.PacketsSec = "packets_sec", t2.BytesSecIEC = "bytes_sec_iec", t2.BytesSecSI = "bytes_sec_si", t2.BitsSecIEC = "bits_sec_iec", t2.BitsSecSI = "bits_sec_si", t2.KibibytesSec = "kibibytes_sec", t2.KibibitsSec = "kibibits_sec", t2.KilobytesSec = "kilobytes_sec", t2.KilobitsSec = "kilobits_sec", t2.MebibytesSec = "mebibytes_sec", t2.MebibitsSec = "mebibits_sec", t2.MegabytesSec = "megabytes_sec", t2.MegabitsSec = "megabits_sec", t2.GibibytesSec = "gibibytes_sec", t2.GibibitsSec = "gibibits_sec", t2.GigabytesSec = "gigabytes_sec", t2.GigabitsSec = "gigabits_sec", t2.TebibytesSec = "tebibytes_sec", t2.TebibitsSec = "tebibits_sec", t2.TerabytesSec = "terabytes_sec", t2.TerabitsSec = "terabits_sec", t2.PebibytesSec = "pebibytes_sec", t2.PebibitsSec = "pebibits_sec", t2.PetabytesSec = "petabytes_sec", t2.PetabitsSec = "petabits_sec", t2.Cps = "cps", t2.Ops = "ops", t2.Rps = "rps", t2.ReadsSec = "reads_sec", t2.Wps = "wps", t2.Iops = "iops", t2.Cpm = "cpm", t2.Opm = "opm", t2.RpmReads = "rpm_reads", t2.Wpm = "wpm", t2))(B3 || {});
53928
- var Se2 = exports.O = _zod.z.object({ output: _zod.z.enum(["currency", "percent", "byte", "time", "number", "data_rate", "throughput"]), numericUnit: _zod.z.nativeEnum(B3).optional(), mantissa: _zod.z.number().int().optional(), thousandSeparated: _zod.z.boolean().optional(), average: _zod.z.boolean().optional(), decimalBytes: _zod.z.boolean().optional(), factor: _zod.z.number().optional(), currencySymbol: _zod.z.string().optional(), unit: _zod.z.string().optional() });
53929
- var F2 = _zod.z.object({ displayType: _zod.z.nativeEnum(j2).optional(), numberFormat: Se2.optional(), granularity: _zod.z.union([u2, _zod.z.literal("auto")]).optional(), compareToPreviousPeriod: _zod.z.boolean().optional(), fillNulls: _zod.z.union([_zod.z.number(), _zod.z.literal(false)]).optional(), alignDateRangeToGranularity: _zod.z.boolean().optional() });
53930
- var R3 = exports.P = F2.extend({ timestampValueExpression: _zod.z.string(), implicitColumnExpression: _zod.z.string().optional(), sampleWeightExpression: _zod.z.string().optional(), markdown: _zod.z.string().optional(), filtersLogicalOperator: _zod.z.enum(["AND", "OR"]).optional(), filters: _zod.z.array(S3).optional(), connection: _zod.z.string(), selectGroupBy: _zod.z.boolean().optional(), metricTables: y3.optional(), seriesReturnType: _zod.z.enum(["ratio", "column"]).optional(), eventTableSelect: _zod.z.string().optional(), source: _zod.z.string().optional() });
53931
- var be2 = exports.Q = _zod.z.intersection(R3.partial({ timestampValueExpression: true }), d3);
53932
- var ye2 = _zod.z.intersection(_zod.z.intersection(R3, d3), _zod.z.object({ with: _zod.z.array(_zod.z.object({ name: _zod.z.string(), sql: ee2.optional(), chartConfig: be2.optional(), isSubquery: _zod.z.boolean().optional() })) }).partial());
53933
- var W2 = F2.extend({ configType: _zod.z.literal("sql"), sqlTemplate: _zod.z.string(), connection: _zod.z.string(), source: _zod.z.string().optional() });
53934
- var xe2 = W2.extend({ filters: _zod.z.array(S3).optional(), from: _zod.z.object({ databaseName: _zod.z.string(), tableName: _zod.z.string() }).optional(), implicitColumnExpression: _zod.z.string().optional(), metricTables: y3.optional() });
53935
- var Ve2 = exports.R = _zod.z.union([ye2, xe2]);
53936
- var O3 = _zod.z.object({ name: _zod.z.string().optional(), source: _zod.z.string() }).extend(R3.omit({ connection: true, timestampValueExpression: true, source: true }).shape).extend(d3.omit({ from: true }).shape);
53937
- var fe2 = O3.extend({ alert: _zod.z.union([ce2.optional(), M4.optional()]) });
53938
- var V2 = W2.extend({ name: _zod.z.string().optional() });
53939
- var Ce2 = exports.S = _zod.z.union([fe2, V2]);
53940
- var K3 = exports.T = _zod.z.object({ id: _zod.z.string(), x: _zod.z.number(), y: _zod.z.number(), w: _zod.z.number(), h: _zod.z.number(), config: Ce2, containerId: _zod.z.string().optional() });
53941
- var Ae2 = exports.U = K3.extend({ config: _zod.z.union([O3, V2]) });
53942
- var Te2 = exports.V = _zod.z.object({ id: _zod.z.string().min(1), type: _zod.z.enum(["section"]), title: _zod.z.string().min(1), collapsed: _zod.z.boolean() });
53943
- var Ee2 = exports.W = _zod.z.enum(["QUERY_EXPRESSION"]);
53944
- var v2 = exports.X = _zod.z.object({ id: _zod.z.string(), type: Ee2, name: _zod.z.string().min(1), expression: _zod.z.string().min(1), source: _zod.z.string().min(1), sourceMetricType: _zod.z.nativeEnum(l).optional(), where: _zod.z.string().optional(), whereLanguage: n7 });
53945
- var P2 = exports.Y = ((i2) => (i2.Services = "services", i2))(P2 || {});
53946
- var Ke2 = exports.Z = v2.extend({ presetDashboard: _zod.z.nativeEnum(P2) });
53947
- var Re2 = exports._ = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string().min(1), tiles: _zod.z.array(K3), tags: _zod.z.array(_zod.z.string()), filters: _zod.z.array(v2).optional(), savedQuery: _zod.z.string().nullable().optional(), savedQueryLanguage: n7.nullable().optional(), savedFilterValues: _zod.z.array(S3).optional(), containers: _zod.z.array(Te2).refine((o) => {
53913
+ var pe2 = 1e3 * 60 * 60 * 24 * 365;
53914
+ var le2 = 1e3 * 60 * 60 * 24 * 365 * 10;
53915
+ var ce2 = 1439;
53916
+ var ge2 = exports.E = _zod.z.union([_zod.z.string().datetime(), _zod.z.null()]).optional().refine((o) => o == null || new Date(o).getTime() <= Date.now() + pe2, { message: "scheduleStartAt must be within 1 year from now" }).refine((o) => o == null || new Date(o).getTime() >= Date.now() - le2, { message: "scheduleStartAt must be within 10 years in the past" });
53917
+ var R3 = exports.F = _zod.z.object({ id: _zod.z.string().optional(), interval: q3, scheduleOffsetMinutes: _zod.z.number().int().min(0).max(ce2).optional(), scheduleStartAt: ge2, threshold: _zod.z.number(), thresholdType: _zod.z.nativeEnum(E2), channel: re2, state: _zod.z.nativeEnum(h3).optional(), name: _zod.z.string().min(1).max(512).nullish(), message: _zod.z.string().min(1).max(4096).nullish(), silenced: _zod.z.object({ by: _zod.z.string(), at: _zod.z.string(), until: _zod.z.string() }).optional() });
53918
+ var me2 = exports.G = R3;
53919
+ var ue2 = R3.superRefine(M4);
53920
+ var B3 = exports.H = R3.extend({ threshold: _zod.z.number() });
53921
+ var de2 = B3.superRefine(M4);
53922
+ var F2 = exports.I = _zod.z.union([_zod.z.intersection(ue2, ae2), _zod.z.intersection(de2, se2)]);
53923
+ var he2 = exports.J = _zod.z.object({ counts: _zod.z.number(), createdAt: _zod.z.string(), lastValues: _zod.z.array(_zod.z.object({ startTime: _zod.z.string(), count: _zod.z.number() })), state: _zod.z.nativeEnum(h3) });
53924
+ var Se2 = exports.K = _zod.z.object({ type: _zod.z.literal("sql_ast"), operator: _zod.z.enum(["=", "<", ">", "!=", "<=", ">="]), left: _zod.z.string(), right: _zod.z.string() });
53925
+ var S3 = exports.L = _zod.z.union([_zod.z.object({ type: _zod.z.enum(["lucene", "sql"]), condition: _zod.z.string() }), Se2]);
53926
+ var be2 = exports.M = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), select: _zod.z.string(), where: _zod.z.string(), whereLanguage: n7, source: _zod.z.string(), tags: _zod.z.array(_zod.z.string()), orderBy: _zod.z.string().optional(), filters: _zod.z.array(S3).optional(), alerts: _zod.z.array(F2).optional() });
53927
+ var y3 = _zod.z.object({ email: _zod.z.string(), name: _zod.z.string().optional() }).optional();
53928
+ var Ke2 = exports.N = be2.omit({ alerts: true }).extend({ alerts: _zod.z.array(F2.and(_zod.z.object({ createdBy: y3 }))).optional(), createdAt: _zod.z.string().optional(), updatedAt: _zod.z.string().optional(), createdBy: y3, updatedBy: y3 });
53929
+ var W2 = exports.O = ((t2) => (t2.BytesIEC = "bytes_iec", t2.BytesSI = "bytes_si", t2.BitsIEC = "bits_iec", t2.BitsSI = "bits_si", t2.Kibibytes = "kibibytes", t2.Kilobytes = "kilobytes", t2.Mebibytes = "mebibytes", t2.Megabytes = "megabytes", t2.Gibibytes = "gibibytes", t2.Gigabytes = "gigabytes", t2.Tebibytes = "tebibytes", t2.Terabytes = "terabytes", t2.Pebibytes = "pebibytes", t2.Petabytes = "petabytes", t2.PacketsSec = "packets_sec", t2.BytesSecIEC = "bytes_sec_iec", t2.BytesSecSI = "bytes_sec_si", t2.BitsSecIEC = "bits_sec_iec", t2.BitsSecSI = "bits_sec_si", t2.KibibytesSec = "kibibytes_sec", t2.KibibitsSec = "kibibits_sec", t2.KilobytesSec = "kilobytes_sec", t2.KilobitsSec = "kilobits_sec", t2.MebibytesSec = "mebibytes_sec", t2.MebibitsSec = "mebibits_sec", t2.MegabytesSec = "megabytes_sec", t2.MegabitsSec = "megabits_sec", t2.GibibytesSec = "gibibytes_sec", t2.GibibitsSec = "gibibits_sec", t2.GigabytesSec = "gigabytes_sec", t2.GigabitsSec = "gigabits_sec", t2.TebibytesSec = "tebibytes_sec", t2.TebibitsSec = "tebibits_sec", t2.TerabytesSec = "terabytes_sec", t2.TerabitsSec = "terabits_sec", t2.PebibytesSec = "pebibytes_sec", t2.PebibitsSec = "pebibits_sec", t2.PetabytesSec = "petabytes_sec", t2.PetabitsSec = "petabits_sec", t2.Cps = "cps", t2.Ops = "ops", t2.Rps = "rps", t2.ReadsSec = "reads_sec", t2.Wps = "wps", t2.Iops = "iops", t2.Cpm = "cpm", t2.Opm = "opm", t2.RpmReads = "rpm_reads", t2.Wpm = "wpm", t2))(W2 || {});
53930
+ var ye2 = exports.P = _zod.z.object({ output: _zod.z.enum(["currency", "percent", "byte", "time", "number", "data_rate", "throughput"]), numericUnit: _zod.z.nativeEnum(W2).optional(), mantissa: _zod.z.number().int().optional(), thousandSeparated: _zod.z.boolean().optional(), average: _zod.z.boolean().optional(), decimalBytes: _zod.z.boolean().optional(), factor: _zod.z.number().optional(), currencySymbol: _zod.z.string().optional(), unit: _zod.z.string().optional() });
53931
+ var O3 = _zod.z.object({ displayType: _zod.z.nativeEnum(_2).optional(), numberFormat: ye2.optional(), granularity: _zod.z.union([u2, _zod.z.literal("auto")]).optional(), compareToPreviousPeriod: _zod.z.boolean().optional(), fillNulls: _zod.z.union([_zod.z.number(), _zod.z.literal(false)]).optional(), alignDateRangeToGranularity: _zod.z.boolean().optional() });
53932
+ var v2 = exports.Q = O3.extend({ timestampValueExpression: _zod.z.string(), implicitColumnExpression: _zod.z.string().optional(), sampleWeightExpression: _zod.z.string().optional(), markdown: _zod.z.string().optional(), filtersLogicalOperator: _zod.z.enum(["AND", "OR"]).optional(), filters: _zod.z.array(S3).optional(), connection: _zod.z.string(), selectGroupBy: _zod.z.boolean().optional(), metricTables: x3.optional(), seriesReturnType: _zod.z.enum(["ratio", "column"]).optional(), eventTableSelect: _zod.z.string().optional(), source: _zod.z.string().optional() });
53933
+ var xe2 = exports.R = _zod.z.intersection(v2.partial({ timestampValueExpression: true }), d3);
53934
+ var fe2 = _zod.z.intersection(_zod.z.intersection(v2, d3), _zod.z.object({ with: _zod.z.array(_zod.z.object({ name: _zod.z.string(), sql: oe2.optional(), chartConfig: xe2.optional(), isSubquery: _zod.z.boolean().optional() })) }).partial());
53935
+ var V2 = O3.extend({ configType: _zod.z.literal("sql"), sqlTemplate: _zod.z.string(), connection: _zod.z.string(), source: _zod.z.string().optional() });
53936
+ var Ce2 = V2.extend({ filters: _zod.z.array(S3).optional(), from: _zod.z.object({ databaseName: _zod.z.string(), tableName: _zod.z.string() }).optional(), implicitColumnExpression: _zod.z.string().optional(), metricTables: x3.optional() });
53937
+ var Pe2 = exports.S = _zod.z.union([fe2, Ce2]);
53938
+ var K3 = _zod.z.object({ name: _zod.z.string().optional(), source: _zod.z.string() }).extend(v2.omit({ connection: true, timestampValueExpression: true, source: true }).shape).extend(d3.omit({ from: true }).shape);
53939
+ var Ae2 = K3.extend({ alert: _zod.z.union([me2.optional(), B3.optional()]) });
53940
+ var P2 = V2.extend({ name: _zod.z.string().optional() });
53941
+ var Te2 = exports.T = _zod.z.union([Ae2, P2]);
53942
+ var Q3 = exports.U = _zod.z.object({ id: _zod.z.string(), x: _zod.z.number(), y: _zod.z.number(), w: _zod.z.number(), h: _zod.z.number(), config: Te2, containerId: _zod.z.string().optional() });
53943
+ var Ee2 = exports.V = Q3.extend({ config: _zod.z.union([K3, P2]) });
53944
+ var Re2 = exports.W = _zod.z.object({ id: _zod.z.string().min(1), type: _zod.z.enum(["section"]), title: _zod.z.string().min(1), collapsed: _zod.z.boolean() });
53945
+ var ve2 = exports.X = _zod.z.enum(["QUERY_EXPRESSION"]);
53946
+ var I3 = exports.Y = _zod.z.object({ id: _zod.z.string(), type: ve2, name: _zod.z.string().min(1), expression: _zod.z.string().min(1), source: _zod.z.string().min(1), sourceMetricType: _zod.z.nativeEnum(l).optional(), where: _zod.z.string().optional(), whereLanguage: n7 });
53947
+ var H4 = exports.Z = ((i2) => (i2.Services = "services", i2))(H4 || {});
53948
+ var Qe2 = exports._ = I3.extend({ presetDashboard: _zod.z.nativeEnum(H4) });
53949
+ var Ie2 = exports.$ = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string().min(1), tiles: _zod.z.array(Q3), tags: _zod.z.array(_zod.z.string()), filters: _zod.z.array(I3).optional(), savedQuery: _zod.z.string().nullable().optional(), savedQueryLanguage: n7.nullable().optional(), savedFilterValues: _zod.z.array(S3).optional(), containers: _zod.z.array(Re2).refine((o) => {
53948
53950
  let i2 = o.map((r) => r.id);
53949
53951
  return new Set(i2).size === i2.length;
53950
53952
  }, { message: "Container IDs must be unique" }).optional() });
53951
- var ve2 = exports.$ = Re2.omit({ id: true });
53952
- var Pe2 = exports.aa = ve2.omit({ tags: true }).extend({ version: _zod.z.string().min(1), description: _zod.z.string().optional(), tags: _zod.z.array(_zod.z.string()).optional(), tiles: _zod.z.array(Ae2), filters: _zod.z.array(v2).optional() });
53953
- var Qe2 = exports.ba = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), host: _zod.z.string(), username: _zod.z.string(), password: _zod.z.string().optional(), hyperdxSettingPrefix: _zod.z.string().regex(/^[a-z0-9_]+$/i).optional().nullable() });
53954
- var I3 = exports.ca = _zod.z.object({ fieldMetadataDisabled: _zod.z.boolean().optional(), searchRowLimit: _zod.z.number().optional(), queryTimeout: _zod.z.number().optional(), metadataMaxRowsToRead: _zod.z.number().optional(), parallelizeWhenPossible: _zod.z.boolean().optional(), filterKeysFetchLimit: _zod.z.number().optional() });
53955
- var Ie2 = exports.da = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), allowedAuthMethods: _zod.z.array(_zod.z.literal("password")).optional(), apiKey: _zod.z.string(), hookId: _zod.z.string(), collectorAuthenticationEnforced: _zod.z.boolean() }).merge(I3);
53956
- var Q3 = exports.ea = ((a3) => (a3.Log = "log", a3.Trace = "trace", a3.Session = "session", a3.Metric = "metric", a3))(Q3 || {});
53957
- var ze2 = _zod.z.array(_zod.z.object({ setting: _zod.z.string().min(1), value: _zod.z.string().min(1) })).max(10);
53953
+ var ze2 = exports.aa = Ie2.omit({ id: true });
53954
+ var He2 = exports.ba = ze2.omit({ tags: true }).extend({ version: _zod.z.string().min(1), description: _zod.z.string().optional(), tags: _zod.z.array(_zod.z.string()).optional(), tiles: _zod.z.array(Ee2), filters: _zod.z.array(I3).optional() });
53955
+ var Ge2 = exports.ca = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), host: _zod.z.string(), username: _zod.z.string(), password: _zod.z.string().optional(), hyperdxSettingPrefix: _zod.z.string().regex(/^[a-z0-9_]+$/i).optional().nullable() });
53956
+ var z2 = exports.da = _zod.z.object({ fieldMetadataDisabled: _zod.z.boolean().optional(), searchRowLimit: _zod.z.number().optional(), queryTimeout: _zod.z.number().optional(), metadataMaxRowsToRead: _zod.z.number().optional(), parallelizeWhenPossible: _zod.z.boolean().optional(), filterKeysFetchLimit: _zod.z.number().optional() });
53957
+ var Le2 = exports.ea = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string(), allowedAuthMethods: _zod.z.array(_zod.z.literal("password")).optional(), apiKey: _zod.z.string(), hookId: _zod.z.string(), collectorAuthenticationEnforced: _zod.z.boolean() }).merge(z2);
53958
+ var G3 = exports.fa = ((a3) => (a3.Log = "log", a3.Trace = "trace", a3.Session = "session", a3.Metric = "metric", a3))(G3 || {});
53959
+ var je2 = _zod.z.array(_zod.z.object({ setting: _zod.z.string().min(1), value: _zod.z.string().min(1) })).max(10);
53958
53960
  var _e2 = _zod.z.string().min(1, "Timestamp Column is required");
53959
- var b2 = exports.fa = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string().min(1, "Name is required"), kind: _zod.z.nativeEnum(Q3), connection: _zod.z.string().min(1, "Server Connection is required"), from: _zod.z.object({ databaseName: _zod.z.string().min(1, "Database is required"), tableName: _zod.z.string().min(1, "Table is required") }), querySettings: ze2.optional(), timestampValueExpression: _e2 });
53961
+ var b2 = exports.ga = _zod.z.object({ id: _zod.z.string(), name: _zod.z.string().min(1, "Name is required"), kind: _zod.z.nativeEnum(G3), connection: _zod.z.string().min(1, "Server Connection is required"), from: _zod.z.object({ databaseName: _zod.z.string().min(1, "Database is required"), tableName: _zod.z.string().min(1, "Table is required") }), querySettings: je2.optional(), timestampValueExpression: _e2 });
53960
53962
  var m3 = _zod.z.array(_zod.z.object({ sqlExpression: _zod.z.string().min(1, "Attribute SQL Expression is required"), luceneExpression: _zod.z.string().optional(), alias: _zod.z.string().optional() }));
53961
- var je2 = _zod.z.object({ sourceColumn: _zod.z.string().optional(), aggFn: Y3, mvColumn: _zod.z.string().min(1, "Materialized View Column is required") }).refine(({ sourceColumn: o, aggFn: i2 }) => i2 === "count" || !!_optionalChain([o, "optionalAccess", (_22) => _22.length]), { message: "Materialized View Source Column is required" });
53962
- var H4 = exports.ga = _zod.z.object({ databaseName: _zod.z.string().min(1, "Materialized View Database is required"), tableName: _zod.z.string().min(1, "Materialized View Table is required"), dimensionColumns: _zod.z.string(), minGranularity: u2, minDate: _zod.z.string().datetime().nullish(), timestampColumn: _zod.z.string().min(1, "Materialized View Timestamp column is required"), aggregatedColumns: _zod.z.array(je2).min(1, "At least one aggregated column is required") });
53963
- var G3 = exports.ha = b2.extend({ kind: _zod.z.literal("log"), defaultTableSelectExpression: _zod.z.string().min(1, "Default Select Expression is required"), serviceNameExpression: _zod.z.string().optional(), severityTextExpression: _zod.z.string().optional(), bodyExpression: _zod.z.string().optional(), eventAttributesExpression: _zod.z.string().optional(), resourceAttributesExpression: _zod.z.string().optional(), displayedTimestampValueExpression: _zod.z.string().optional(), metricSourceId: _zod.z.string().optional(), traceSourceId: _zod.z.string().optional(), traceIdExpression: _zod.z.string().optional(), spanIdExpression: _zod.z.string().optional(), implicitColumnExpression: _zod.z.string().optional(), uniqueRowIdExpression: _zod.z.string().optional(), tableFilterExpression: _zod.z.string().optional(), highlightedTraceAttributeExpressions: m3.optional(), highlightedRowAttributeExpressions: m3.optional(), materializedViews: _zod.z.array(H4).optional(), orderByExpression: _zod.z.string().optional() });
53964
- var $ = exports.ia = b2.extend({ kind: _zod.z.literal("trace"), defaultTableSelectExpression: _zod.z.string().min(1, "Default Select Expression is required"), durationExpression: _zod.z.string().min(1, "Duration Expression is required"), durationPrecision: _zod.z.number().min(0).max(9).default(3), traceIdExpression: _zod.z.string().min(1, "Trace ID Expression is required"), spanIdExpression: _zod.z.string().min(1, "Span ID Expression is required"), parentSpanIdExpression: _zod.z.string().min(1, "Parent span ID expression is required"), spanNameExpression: _zod.z.string().min(1, "Span Name Expression is required"), spanKindExpression: _zod.z.string().min(1, "Span Kind Expression is required"), sampleRateExpression: _zod.z.string().optional(), logSourceId: _zod.z.string().optional().nullable(), sessionSourceId: _zod.z.string().optional(), metricSourceId: _zod.z.string().optional(), statusCodeExpression: _zod.z.string().optional(), statusMessageExpression: _zod.z.string().optional(), serviceNameExpression: _zod.z.string().optional(), resourceAttributesExpression: _zod.z.string().optional(), eventAttributesExpression: _zod.z.string().optional(), spanEventsValueExpression: _zod.z.string().optional(), implicitColumnExpression: _zod.z.string().optional(), displayedTimestampValueExpression: _zod.z.string().optional(), highlightedTraceAttributeExpressions: m3.optional(), highlightedRowAttributeExpressions: m3.optional(), materializedViews: _zod.z.array(H4).optional(), orderByExpression: _zod.z.string().optional() });
53965
- var X3 = exports.ja = b2.extend({ kind: _zod.z.literal("session"), traceSourceId: _zod.z.string({ message: "Correlated Trace Source is required" }).min(1, "Correlated Trace Source is required"), resourceAttributesExpression: _zod.z.string().optional() });
53966
- var Z = exports.ka = b2.extend({ kind: _zod.z.literal("metric"), from: _zod.z.object({ databaseName: _zod.z.string().min(1, "Database is required"), tableName: _zod.z.string() }), metricTables: y3, resourceAttributesExpression: _zod.z.string().min(1, "Resource Attributes is required"), serviceNameExpression: _zod.z.string().optional(), logSourceId: _zod.z.string().optional() });
53967
- var He2 = exports.la = _zod.z.discriminatedUnion("kind", [G3, $, X3, Z]);
53968
- var Ge2 = exports.ma = _zod.z.discriminatedUnion("kind", [G3.omit({ id: true }), $.omit({ id: true }), X3.omit({ id: true }), Z.omit({ id: true })]);
53969
- function $e2(o) {
53963
+ var ke3 = _zod.z.object({ sourceColumn: _zod.z.string().optional(), aggFn: N2, mvColumn: _zod.z.string().min(1, "Materialized View Column is required") }).refine(({ sourceColumn: o, aggFn: i2 }) => i2 === "count" || !!_optionalChain([o, "optionalAccess", (_22) => _22.length]), { message: "Materialized View Source Column is required" });
53964
+ var $ = exports.ha = _zod.z.object({ databaseName: _zod.z.string().min(1, "Materialized View Database is required"), tableName: _zod.z.string().min(1, "Materialized View Table is required"), dimensionColumns: _zod.z.string(), minGranularity: u2, minDate: _zod.z.string().datetime().nullish(), timestampColumn: _zod.z.string().min(1, "Materialized View Timestamp column is required"), aggregatedColumns: _zod.z.array(ke3).min(1, "At least one aggregated column is required") });
53965
+ var X3 = exports.ia = b2.extend({ kind: _zod.z.literal("log"), defaultTableSelectExpression: _zod.z.string().min(1, "Default Select Expression is required"), serviceNameExpression: _zod.z.string().optional(), severityTextExpression: _zod.z.string().optional(), bodyExpression: _zod.z.string().optional(), eventAttributesExpression: _zod.z.string().optional(), resourceAttributesExpression: _zod.z.string().optional(), displayedTimestampValueExpression: _zod.z.string().optional(), metricSourceId: _zod.z.string().optional(), traceSourceId: _zod.z.string().optional(), traceIdExpression: _zod.z.string().optional(), spanIdExpression: _zod.z.string().optional(), implicitColumnExpression: _zod.z.string().optional(), uniqueRowIdExpression: _zod.z.string().optional(), tableFilterExpression: _zod.z.string().optional(), highlightedTraceAttributeExpressions: m3.optional(), highlightedRowAttributeExpressions: m3.optional(), materializedViews: _zod.z.array($).optional(), orderByExpression: _zod.z.string().optional() });
53966
+ var Z = exports.ja = b2.extend({ kind: _zod.z.literal("trace"), defaultTableSelectExpression: _zod.z.string().min(1, "Default Select Expression is required"), durationExpression: _zod.z.string().min(1, "Duration Expression is required"), durationPrecision: _zod.z.number().min(0).max(9).default(3), traceIdExpression: _zod.z.string().min(1, "Trace ID Expression is required"), spanIdExpression: _zod.z.string().min(1, "Span ID Expression is required"), parentSpanIdExpression: _zod.z.string().min(1, "Parent span ID expression is required"), spanNameExpression: _zod.z.string().min(1, "Span Name Expression is required"), spanKindExpression: _zod.z.string().min(1, "Span Kind Expression is required"), sampleRateExpression: _zod.z.string().optional(), logSourceId: _zod.z.string().optional().nullable(), sessionSourceId: _zod.z.string().optional(), metricSourceId: _zod.z.string().optional(), statusCodeExpression: _zod.z.string().optional(), statusMessageExpression: _zod.z.string().optional(), serviceNameExpression: _zod.z.string().optional(), resourceAttributesExpression: _zod.z.string().optional(), eventAttributesExpression: _zod.z.string().optional(), spanEventsValueExpression: _zod.z.string().optional(), implicitColumnExpression: _zod.z.string().optional(), displayedTimestampValueExpression: _zod.z.string().optional(), highlightedTraceAttributeExpressions: m3.optional(), highlightedRowAttributeExpressions: m3.optional(), materializedViews: _zod.z.array($).optional(), orderByExpression: _zod.z.string().optional() });
53967
+ var Y3 = exports.ka = b2.extend({ kind: _zod.z.literal("session"), traceSourceId: _zod.z.string({ message: "Correlated Trace Source is required" }).min(1, "Correlated Trace Source is required"), resourceAttributesExpression: _zod.z.string().optional() });
53968
+ var J = exports.la = b2.extend({ kind: _zod.z.literal("metric"), from: _zod.z.object({ databaseName: _zod.z.string().min(1, "Database is required"), tableName: _zod.z.string() }), metricTables: x3, resourceAttributesExpression: _zod.z.string().min(1, "Resource Attributes is required"), serviceNameExpression: _zod.z.string().optional(), logSourceId: _zod.z.string().optional() });
53969
+ var $e2 = exports.ma = _zod.z.discriminatedUnion("kind", [X3, Z, Y3, J]);
53970
+ var Xe2 = exports.na = _zod.z.discriminatedUnion("kind", [X3.omit({ id: true }), Z.omit({ id: true }), Y3.omit({ id: true }), J.omit({ id: true })]);
53971
+ function Ze2(o) {
53970
53972
  return o.kind === "log";
53971
53973
  }
53972
- function Xe2(o) {
53974
+ function Ye2(o) {
53973
53975
  return o.kind === "trace";
53974
53976
  }
53975
- function Ze2(o) {
53977
+ function Je2(o) {
53976
53978
  return o.kind === "session";
53977
53979
  }
53978
- function Ye2(o) {
53980
+ function Ne2(o) {
53979
53981
  return o.kind === "metric";
53980
53982
  }
53981
- function Le2(o) {
53983
+ function De2(o) {
53982
53984
  return o.kind === "trace" && o.sampleRateExpression ? o.sampleRateExpression : void 0;
53983
53985
  }
53984
- function Je2(o) {
53985
- let i2 = Le2(o);
53986
+ function Ue2(o) {
53987
+ let i2 = De2(o);
53986
53988
  return i2 ? { sampleWeightExpression: i2 } : void 0;
53987
53989
  }
53988
- var Ne2 = _zod.z.object({ displayType: _zod.z.enum(["line", "table"]), markdown: _zod.z.string().optional(), select: _zod.z.array(_zod.z.object({ aggregationFunction: x3.describe("SQL-like function to aggregate the property by"), property: _zod.z.string().describe("Property or column to be aggregated (ex. Duration)"), condition: _zod.z.string().optional().describe("SQL filter condition to filter on ex. `SeverityText = 'error'`") })).describe("Array of data series or columns to chart for the user"), groupBy: _zod.z.string().optional().describe("Group by column or properties for the chart"), timeRange: _zod.z.string().default("Past 1h").describe('Time range of data to query for like "Past 1h", "Past 24h"') });
53989
- var z2 = _zod.z.object({ from: d3.shape.from, source: _zod.z.string(), connection: _zod.z.string(), where: g.optional(), whereLanguage: n7, timestampValueExpression: _zod.z.string(), dateRange: _zod.z.tuple([_zod.z.string(), _zod.z.string()]), name: _zod.z.string().optional(), markdown: _zod.z.string().optional() });
53990
- var ke3 = _zod.z.object({ displayType: _zod.z.literal("search"), select: _zod.z.string(), groupBy: _zod.z.string().optional(), limit: _zod.z.object({ limit: _zod.z.number().int().positive() }).optional() }).merge(z2.required({ where: true }));
53991
- var De2 = _zod.z.object({ displayType: _zod.z.literal("table"), select: _zod.z.array(f).min(1), groupBy: _zod.z.string().optional(), granularity: _zod.z.union([u2, _zod.z.literal("auto")]).optional(), limit: C2.optional() }).merge(z2);
53992
- var we2 = _zod.z.object({ displayType: _zod.z.literal("line"), select: _zod.z.array(f).min(1), groupBy: _zod.z.string().optional(), granularity: _zod.z.union([u2, _zod.z.literal("auto")]).optional(), limit: C2.optional() }).merge(z2);
53993
- var Ue2 = exports.ua = _zod.z.discriminatedUnion("displayType", [ke3, De2, we2]);
53994
- var qe2 = exports.va = _zod.z.object({ _id: _zod.z.string(), interval: w2, scheduleOffsetMinutes: _zod.z.number().optional(), scheduleStartAt: _zod.z.union([_zod.z.string(), _zod.z.date()]).nullish(), threshold: _zod.z.number(), thresholdType: _zod.z.nativeEnum(T3), channel: _zod.z.object({ type: _zod.z.string().optional().nullable() }), state: _zod.z.nativeEnum(h3).optional(), source: _zod.z.nativeEnum(D3).optional(), dashboardId: _zod.z.string().optional(), savedSearchId: _zod.z.string().optional(), tileId: _zod.z.string().optional(), name: _zod.z.string().nullish(), message: _zod.z.string().nullish(), createdAt: _zod.z.string(), updatedAt: _zod.z.string(), history: _zod.z.array(de2), dashboard: _zod.z.object({ _id: _zod.z.string(), name: _zod.z.string(), updatedAt: _zod.z.string(), tags: _zod.z.array(_zod.z.string()), tiles: _zod.z.array(_zod.z.object({ id: _zod.z.string(), config: _zod.z.object({ name: _zod.z.string().optional() }) })) }).optional(), savedSearch: _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), name: _zod.z.string(), updatedAt: _zod.z.string(), tags: _zod.z.array(_zod.z.string()) }).optional(), createdBy: _zod.z.object({ email: _zod.z.string(), name: _zod.z.string().optional() }).optional(), silenced: _zod.z.object({ by: _zod.z.string(), at: _zod.z.string(), until: _zod.z.string() }).optional() });
53995
- var et2 = exports.wa = _zod.z.object({ data: _zod.z.array(qe2) });
53996
- var tt2 = exports.xa = _zod.z.object({ data: _zod.z.array(A2) });
53997
- var ot2 = exports.ya = _zod.z.object({ data: A2 });
53998
- var it2 = exports.za = _zod.z.object({ data: A2 });
53999
- var nt2 = exports.Aa = _zod.z.object({ message: _zod.z.string() });
54000
- var rt2 = exports.Ba = _zod.z.object({ _id: _zod.z.string(), allowedAuthMethods: _zod.z.array(_zod.z.literal("password")).optional(), apiKey: _zod.z.string(), name: _zod.z.string(), createdAt: _zod.z.string() });
54001
- var Me2 = exports.Ca = _zod.z.object({ _id: _zod.z.string(), email: _zod.z.string(), name: _zod.z.string().optional(), hasPasswordAuth: _zod.z.boolean(), isCurrentUser: _zod.z.boolean(), groupName: _zod.z.string().optional() });
54002
- var at2 = exports.Da = _zod.z.object({ data: _zod.z.array(Me2) });
54003
- var Be2 = exports.Ea = _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), email: _zod.z.string(), name: _zod.z.string().optional(), url: _zod.z.string() });
54004
- var st2 = exports.Fa = _zod.z.object({ data: _zod.z.array(Be2) });
54005
- var pt2 = exports.Ga = _zod.z.object({ data: _zod.z.array(_zod.z.string()) });
54006
- var lt2 = exports.Ha = I3.partial();
54007
- var ct2 = exports.Ia = _zod.z.object({ newApiKey: _zod.z.string() });
54008
- var gt2 = exports.Ja = _zod.z.object({ isTeamExisting: _zod.z.boolean() });
54009
- var mt2 = exports.Ka = _zod.z.object({ accessKey: _zod.z.string(), createdAt: _zod.z.string(), email: _zod.z.string(), id: _zod.z.string(), name: _zod.z.string(), team: Ie2.pick({ id: true, name: true, allowedAuthMethods: true, apiKey: true }).merge(I3), usageStatsEnabled: _zod.z.boolean(), aiAssistantEnabled: _zod.z.boolean() });
53990
+ var et2 = _zod.z.object({ displayType: _zod.z.enum(["line", "table"]), markdown: _zod.z.string().optional(), select: _zod.z.array(_zod.z.object({ aggregationFunction: f.describe("SQL-like function to aggregate the property by"), property: _zod.z.string().describe("Property or column to be aggregated (ex. Duration)"), condition: _zod.z.string().optional().describe("SQL filter condition to filter on ex. `SeverityText = 'error'`") })).describe("Array of data series or columns to chart for the user"), groupBy: _zod.z.string().optional().describe("Group by column or properties for the chart"), timeRange: _zod.z.string().default("Past 1h").describe('Time range of data to query for like "Past 1h", "Past 24h"') });
53991
+ var L3 = _zod.z.object({ from: d3.shape.from, source: _zod.z.string(), connection: _zod.z.string(), where: g.optional(), whereLanguage: n7, timestampValueExpression: _zod.z.string(), dateRange: _zod.z.tuple([_zod.z.string(), _zod.z.string()]), name: _zod.z.string().optional(), markdown: _zod.z.string().optional() });
53992
+ var we2 = _zod.z.object({ displayType: _zod.z.literal("search"), select: _zod.z.string(), groupBy: _zod.z.string().optional(), limit: _zod.z.object({ limit: _zod.z.number().int().positive() }).optional() }).merge(L3.required({ where: true }));
53993
+ var qe2 = _zod.z.object({ displayType: _zod.z.literal("table"), select: _zod.z.array(C2).min(1), groupBy: _zod.z.string().optional(), granularity: _zod.z.union([u2, _zod.z.literal("auto")]).optional(), limit: A2.optional() }).merge(L3);
53994
+ var Me2 = _zod.z.object({ displayType: _zod.z.literal("line"), select: _zod.z.array(C2).min(1), groupBy: _zod.z.string().optional(), granularity: _zod.z.union([u2, _zod.z.literal("auto")]).optional(), limit: A2.optional() }).merge(L3);
53995
+ var tt2 = exports.va = _zod.z.discriminatedUnion("displayType", [we2, qe2, Me2]);
53996
+ var Be2 = exports.wa = _zod.z.object({ _id: _zod.z.string(), interval: q3, scheduleOffsetMinutes: _zod.z.number().optional(), scheduleStartAt: _zod.z.union([_zod.z.string(), _zod.z.date()]).nullish(), threshold: _zod.z.number(), thresholdType: _zod.z.nativeEnum(E2), channel: _zod.z.object({ type: _zod.z.string().optional().nullable() }), state: _zod.z.nativeEnum(h3).optional(), source: _zod.z.nativeEnum(w2).optional(), dashboardId: _zod.z.string().optional(), savedSearchId: _zod.z.string().optional(), tileId: _zod.z.string().optional(), name: _zod.z.string().nullish(), message: _zod.z.string().nullish(), createdAt: _zod.z.string(), updatedAt: _zod.z.string(), history: _zod.z.array(he2), dashboard: _zod.z.object({ _id: _zod.z.string(), name: _zod.z.string(), updatedAt: _zod.z.string(), tags: _zod.z.array(_zod.z.string()), tiles: _zod.z.array(_zod.z.object({ id: _zod.z.string(), config: _zod.z.object({ name: _zod.z.string().optional() }) })) }).optional(), savedSearch: _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), name: _zod.z.string(), updatedAt: _zod.z.string(), tags: _zod.z.array(_zod.z.string()) }).optional(), createdBy: _zod.z.object({ email: _zod.z.string(), name: _zod.z.string().optional() }).optional(), silenced: _zod.z.object({ by: _zod.z.string(), at: _zod.z.string(), until: _zod.z.string() }).optional() });
53997
+ var ot2 = exports.xa = _zod.z.object({ data: _zod.z.array(Be2) });
53998
+ var it2 = exports.ya = _zod.z.object({ data: _zod.z.array(T3) });
53999
+ var nt2 = exports.za = _zod.z.object({ data: T3 });
54000
+ var rt2 = exports.Aa = _zod.z.object({ data: T3 });
54001
+ var at2 = exports.Ba = _zod.z.object({ message: _zod.z.string() });
54002
+ var st2 = exports.Ca = _zod.z.object({ _id: _zod.z.string(), allowedAuthMethods: _zod.z.array(_zod.z.literal("password")).optional(), apiKey: _zod.z.string(), name: _zod.z.string(), createdAt: _zod.z.string() });
54003
+ var Fe2 = exports.Da = _zod.z.object({ _id: _zod.z.string(), email: _zod.z.string(), name: _zod.z.string().optional(), hasPasswordAuth: _zod.z.boolean(), isCurrentUser: _zod.z.boolean(), groupName: _zod.z.string().optional() });
54004
+ var pt2 = exports.Ea = _zod.z.object({ data: _zod.z.array(Fe2) });
54005
+ var We2 = exports.Fa = _zod.z.object({ _id: _zod.z.string(), createdAt: _zod.z.string(), email: _zod.z.string(), name: _zod.z.string().optional(), url: _zod.z.string() });
54006
+ var lt2 = exports.Ga = _zod.z.object({ data: _zod.z.array(We2) });
54007
+ var ct2 = exports.Ha = _zod.z.object({ data: _zod.z.array(_zod.z.string()) });
54008
+ var gt2 = exports.Ia = z2.partial();
54009
+ var mt2 = exports.Ja = _zod.z.object({ newApiKey: _zod.z.string() });
54010
+ var ut2 = exports.Ka = _zod.z.object({ isTeamExisting: _zod.z.boolean() });
54011
+ var dt2 = exports.La = _zod.z.object({ accessKey: _zod.z.string(), createdAt: _zod.z.string(), email: _zod.z.string(), id: _zod.z.string(), name: _zod.z.string(), team: Le2.pick({ id: true, name: true, allowedAuthMethods: true, apiKey: true }).merge(z2), usageStatsEnabled: _zod.z.boolean(), aiAssistantEnabled: _zod.z.boolean() });
54010
54012
  exports.a = l;
54011
- exports.b = We2;
54012
- exports.c = j2;
54013
- exports.d = y3;
54013
+ exports.b = Ve2;
54014
+ exports.c = _2;
54015
+ exports.d = x3;
54014
54016
  exports.e = u2;
54015
54017
  exports.f = g;
54016
54018
  exports.g = n7;
54017
- exports.h = x3;
54018
- exports.i = Y3;
54019
- exports.j = J;
54020
- exports.k = L3;
54021
- exports.l = f;
54022
- exports.m = _2;
54023
- exports.n = N2;
54024
- exports.o = U2;
54025
- exports.p = C2;
54026
- exports.q = ee2;
54019
+ exports.h = f;
54020
+ exports.i = N2;
54021
+ exports.j = U2;
54022
+ exports.k = k3;
54023
+ exports.l = C2;
54024
+ exports.m = j2;
54025
+ exports.n = ee2;
54026
+ exports.o = te2;
54027
+ exports.p = A2;
54028
+ exports.q = oe2;
54027
54029
  exports.r = d3;
54028
- exports.s = k3;
54029
- exports.t = A2;
54030
- exports.u = T3;
54030
+ exports.s = D3;
54031
+ exports.t = T3;
54032
+ exports.u = E2;
54031
54033
  exports.v = h3;
54032
- exports.w = D3;
54033
- exports.x = w2;
54034
- exports.y = te2;
54035
- exports.z = oe2;
54036
- exports.A = ie2;
54037
- exports.B = ne2;
54038
- exports.C = re2;
54039
- exports.D = q3;
54040
- exports.E = le2;
54041
- exports.F = E2;
54042
- exports.G = ce2;
54043
- exports.H = M4;
54044
- exports.I = ue2;
54045
- exports.J = de2;
54046
- exports.K = he2;
54034
+ exports.w = w2;
54035
+ exports.x = q3;
54036
+ exports.y = ie2;
54037
+ exports.z = ne2;
54038
+ exports.A = re2;
54039
+ exports.B = ae2;
54040
+ exports.C = se2;
54041
+ exports.D = M4;
54042
+ exports.E = ge2;
54043
+ exports.F = R3;
54044
+ exports.G = me2;
54045
+ exports.H = B3;
54046
+ exports.I = F2;
54047
+ exports.J = he2;
54048
+ exports.K = Se2;
54047
54049
  exports.L = S3;
54048
- exports.M = Oe2;
54049
- exports.N = B3;
54050
- exports.O = Se2;
54051
- exports.P = R3;
54052
- exports.Q = be2;
54053
- exports.R = Ve2;
54054
- exports.S = Ce2;
54055
- exports.T = K3;
54056
- exports.U = Ae2;
54057
- exports.V = Te2;
54058
- exports.W = Ee2;
54059
- exports.X = v2;
54060
- exports.Y = P2;
54061
- exports.Z = Ke2;
54062
- exports._ = Re2;
54063
- exports.$ = ve2;
54064
- exports.aa = Pe2;
54065
- exports.ba = Qe2;
54066
- exports.ca = I3;
54067
- exports.da = Ie2;
54068
- exports.ea = Q3;
54069
- exports.fa = b2;
54070
- exports.ga = H4;
54071
- exports.ha = G3;
54072
- exports.ia = $;
54073
- exports.ja = X3;
54074
- exports.ka = Z;
54075
- exports.la = He2;
54076
- exports.ma = Ge2;
54077
- exports.na = $e2;
54078
- exports.oa = Xe2;
54079
- exports.pa = Ze2;
54080
- exports.qa = Ye2;
54081
- exports.ra = Le2;
54082
- exports.sa = Je2;
54083
- exports.ta = Ne2;
54084
- exports.ua = Ue2;
54085
- exports.va = qe2;
54086
- exports.wa = et2;
54087
- exports.xa = tt2;
54088
- exports.ya = ot2;
54089
- exports.za = it2;
54090
- exports.Aa = nt2;
54091
- exports.Ba = rt2;
54092
- exports.Ca = Me2;
54093
- exports.Da = at2;
54094
- exports.Ea = Be2;
54095
- exports.Fa = st2;
54096
- exports.Ga = pt2;
54097
- exports.Ha = lt2;
54098
- exports.Ia = ct2;
54099
- exports.Ja = gt2;
54100
- exports.Ka = mt2;
54050
+ exports.M = be2;
54051
+ exports.N = Ke2;
54052
+ exports.O = W2;
54053
+ exports.P = ye2;
54054
+ exports.Q = v2;
54055
+ exports.R = xe2;
54056
+ exports.S = Pe2;
54057
+ exports.T = Te2;
54058
+ exports.U = Q3;
54059
+ exports.V = Ee2;
54060
+ exports.W = Re2;
54061
+ exports.X = ve2;
54062
+ exports.Y = I3;
54063
+ exports.Z = H4;
54064
+ exports._ = Qe2;
54065
+ exports.$ = Ie2;
54066
+ exports.aa = ze2;
54067
+ exports.ba = He2;
54068
+ exports.ca = Ge2;
54069
+ exports.da = z2;
54070
+ exports.ea = Le2;
54071
+ exports.fa = G3;
54072
+ exports.ga = b2;
54073
+ exports.ha = $;
54074
+ exports.ia = X3;
54075
+ exports.ja = Z;
54076
+ exports.ka = Y3;
54077
+ exports.la = J;
54078
+ exports.ma = $e2;
54079
+ exports.na = Xe2;
54080
+ exports.oa = Ze2;
54081
+ exports.pa = Ye2;
54082
+ exports.qa = Je2;
54083
+ exports.ra = Ne2;
54084
+ exports.sa = De2;
54085
+ exports.ta = Ue2;
54086
+ exports.ua = et2;
54087
+ exports.va = tt2;
54088
+ exports.wa = Be2;
54089
+ exports.xa = ot2;
54090
+ exports.ya = it2;
54091
+ exports.za = nt2;
54092
+ exports.Aa = rt2;
54093
+ exports.Ba = at2;
54094
+ exports.Ca = st2;
54095
+ exports.Da = Fe2;
54096
+ exports.Ea = pt2;
54097
+ exports.Fa = We2;
54098
+ exports.Ga = lt2;
54099
+ exports.Ha = ct2;
54100
+ exports.Ia = gt2;
54101
+ exports.Ja = mt2;
54102
+ exports.Ka = ut2;
54103
+ exports.La = dt2;
54101
54104
  }
54102
54105
  });
54103
54106
 
@@ -54106,98 +54109,99 @@ var require_types2 = __commonJS({
54106
54109
  "../common-utils/dist/types.js"(exports) {
54107
54110
  "use strict";
54108
54111
  Object.defineProperty(exports, "__esModule", { value: true });
54109
- var _chunk3BJ55V2Fjs = require_chunk_3BJ55V2F();
54110
- exports.ALERT_INTERVAL_TO_MINUTES = _chunk3BJ55V2Fjs.y;
54111
- exports.AggregateFunctionSchema = _chunk3BJ55V2Fjs.h;
54112
- exports.AggregateFunctionWithCombinatorsSchema = _chunk3BJ55V2Fjs.j;
54113
- exports.AlertBaseObjectSchema = _chunk3BJ55V2Fjs.F;
54114
- exports.AlertBaseSchema = _chunk3BJ55V2Fjs.G;
54115
- exports.AlertHistorySchema = _chunk3BJ55V2Fjs.J;
54116
- exports.AlertIntervalSchema = _chunk3BJ55V2Fjs.x;
54117
- exports.AlertSchema = _chunk3BJ55V2Fjs.I;
54118
- exports.AlertSource = _chunk3BJ55V2Fjs.w;
54119
- exports.AlertState = _chunk3BJ55V2Fjs.v;
54120
- exports.AlertThresholdType = _chunk3BJ55V2Fjs.u;
54121
- exports.AlertsApiResponseSchema = _chunk3BJ55V2Fjs.wa;
54122
- exports.AlertsPageItemSchema = _chunk3BJ55V2Fjs.va;
54123
- exports.AssistantLineTableConfigSchema = _chunk3BJ55V2Fjs.ta;
54124
- exports.AssistantResponseConfig = _chunk3BJ55V2Fjs.ua;
54125
- exports.BaseSourceSchema = _chunk3BJ55V2Fjs.fa;
54126
- exports.ChSqlSchema = _chunk3BJ55V2Fjs.q;
54127
- exports.ChartAlertBaseSchema = _chunk3BJ55V2Fjs.H;
54128
- exports.ChartConfigSchema = _chunk3BJ55V2Fjs.R;
54129
- exports.ConnectionSchema = _chunk3BJ55V2Fjs.ba;
54130
- exports.CteChartConfigSchema = _chunk3BJ55V2Fjs.Q;
54131
- exports.DashboardContainerSchema = _chunk3BJ55V2Fjs.V;
54132
- exports.DashboardFilterSchema = _chunk3BJ55V2Fjs.X;
54133
- exports.DashboardFilterType = _chunk3BJ55V2Fjs.W;
54134
- exports.DashboardSchema = _chunk3BJ55V2Fjs._;
54135
- exports.DashboardTemplateSchema = _chunk3BJ55V2Fjs.aa;
54136
- exports.DashboardWithoutIdSchema = _chunk3BJ55V2Fjs.$;
54137
- exports.DerivedColumnSchema = _chunk3BJ55V2Fjs.l;
54138
- exports.DisplayType = _chunk3BJ55V2Fjs.c;
54139
- exports.FilterSchema = _chunk3BJ55V2Fjs.L;
54140
- exports.InstallationApiResponseSchema = _chunk3BJ55V2Fjs.Ja;
54141
- exports.InternalAggregateFunctionSchema = _chunk3BJ55V2Fjs.i;
54142
- exports.LimitSchema = _chunk3BJ55V2Fjs.p;
54143
- exports.LogSourceSchema = _chunk3BJ55V2Fjs.ha;
54144
- exports.MaterializedViewConfigurationSchema = _chunk3BJ55V2Fjs.ga;
54145
- exports.MeApiResponseSchema = _chunk3BJ55V2Fjs.Ka;
54146
- exports.MetricSourceSchema = _chunk3BJ55V2Fjs.ka;
54147
- exports.MetricTableSchema = _chunk3BJ55V2Fjs.d;
54148
- exports.MetricsDataType = _chunk3BJ55V2Fjs.a;
54149
- exports.MetricsDataTypeSchema = _chunk3BJ55V2Fjs.b;
54150
- exports.NumberFormatSchema = _chunk3BJ55V2Fjs.O;
54151
- exports.NumericUnit = _chunk3BJ55V2Fjs.N;
54152
- exports.PresetDashboard = _chunk3BJ55V2Fjs.Y;
54153
- exports.PresetDashboardFilterSchema = _chunk3BJ55V2Fjs.Z;
54154
- exports.RootValueExpressionSchema = _chunk3BJ55V2Fjs.k;
54155
- exports.RotateApiKeyApiResponseSchema = _chunk3BJ55V2Fjs.Ia;
54156
- exports.SQLIntervalSchema = _chunk3BJ55V2Fjs.e;
54157
- exports.SavedChartConfigSchema = _chunk3BJ55V2Fjs.S;
54158
- exports.SavedSearchSchema = _chunk3BJ55V2Fjs.M;
54159
- exports.SearchConditionLanguageSchema = _chunk3BJ55V2Fjs.g;
54160
- exports.SearchConditionSchema = _chunk3BJ55V2Fjs.f;
54161
- exports.SelectListSchema = _chunk3BJ55V2Fjs.m;
54162
- exports.SelectSQLStatementSchema = _chunk3BJ55V2Fjs.r;
54163
- exports.SessionSourceSchema = _chunk3BJ55V2Fjs.ja;
54164
- exports.SortSpecificationListSchema = _chunk3BJ55V2Fjs.o;
54165
- exports.SortSpecificationSchema = _chunk3BJ55V2Fjs.n;
54166
- exports.SourceKind = _chunk3BJ55V2Fjs.ea;
54167
- exports.SourceSchema = _chunk3BJ55V2Fjs.la;
54168
- exports.SourceSchemaNoId = _chunk3BJ55V2Fjs.ma;
54169
- exports.SqlAstFilterSchema = _chunk3BJ55V2Fjs.K;
54170
- exports.TeamApiResponseSchema = _chunk3BJ55V2Fjs.Ba;
54171
- exports.TeamClickHouseSettingsSchema = _chunk3BJ55V2Fjs.ca;
54172
- exports.TeamInvitationSchema = _chunk3BJ55V2Fjs.Ea;
54173
- exports.TeamInvitationsApiResponseSchema = _chunk3BJ55V2Fjs.Fa;
54174
- exports.TeamMemberSchema = _chunk3BJ55V2Fjs.Ca;
54175
- exports.TeamMembersApiResponseSchema = _chunk3BJ55V2Fjs.Da;
54176
- exports.TeamSchema = _chunk3BJ55V2Fjs.da;
54177
- exports.TeamTagsApiResponseSchema = _chunk3BJ55V2Fjs.Ga;
54178
- exports.TileSchema = _chunk3BJ55V2Fjs.T;
54179
- exports.TileTemplateSchema = _chunk3BJ55V2Fjs.U;
54180
- exports.TraceSourceSchema = _chunk3BJ55V2Fjs.ia;
54181
- exports.UpdateClickHouseSettingsApiResponseSchema = _chunk3BJ55V2Fjs.Ha;
54182
- exports.WebhookCreateApiResponseSchema = _chunk3BJ55V2Fjs.ya;
54183
- exports.WebhookSchema = _chunk3BJ55V2Fjs.t;
54184
- exports.WebhookService = _chunk3BJ55V2Fjs.s;
54185
- exports.WebhookTestApiResponseSchema = _chunk3BJ55V2Fjs.Aa;
54186
- exports.WebhookUpdateApiResponseSchema = _chunk3BJ55V2Fjs.za;
54187
- exports.WebhooksApiResponseSchema = _chunk3BJ55V2Fjs.xa;
54188
- exports._ChartConfigSchema = _chunk3BJ55V2Fjs.P;
54189
- exports.getSampleWeightExpression = _chunk3BJ55V2Fjs.ra;
54190
- exports.isLogSource = _chunk3BJ55V2Fjs.na;
54191
- exports.isMetricSource = _chunk3BJ55V2Fjs.qa;
54192
- exports.isSessionSource = _chunk3BJ55V2Fjs.pa;
54193
- exports.isTraceSource = _chunk3BJ55V2Fjs.oa;
54194
- exports.pickSampleWeightExpressionProps = _chunk3BJ55V2Fjs.sa;
54195
- exports.scheduleStartAtSchema = _chunk3BJ55V2Fjs.E;
54196
- exports.validateAlertScheduleOffsetMinutes = _chunk3BJ55V2Fjs.D;
54197
- exports.zAlertChannel = _chunk3BJ55V2Fjs.A;
54198
- exports.zAlertChannelType = _chunk3BJ55V2Fjs.z;
54199
- exports.zSavedSearchAlert = _chunk3BJ55V2Fjs.B;
54200
- exports.zTileAlert = _chunk3BJ55V2Fjs.C;
54112
+ var _chunkJHY6DL4Pjs = require_chunk_JHY6DL4P();
54113
+ exports.ALERT_INTERVAL_TO_MINUTES = _chunkJHY6DL4Pjs.y;
54114
+ exports.AggregateFunctionSchema = _chunkJHY6DL4Pjs.h;
54115
+ exports.AggregateFunctionWithCombinatorsSchema = _chunkJHY6DL4Pjs.j;
54116
+ exports.AlertBaseObjectSchema = _chunkJHY6DL4Pjs.F;
54117
+ exports.AlertBaseSchema = _chunkJHY6DL4Pjs.G;
54118
+ exports.AlertHistorySchema = _chunkJHY6DL4Pjs.J;
54119
+ exports.AlertIntervalSchema = _chunkJHY6DL4Pjs.x;
54120
+ exports.AlertSchema = _chunkJHY6DL4Pjs.I;
54121
+ exports.AlertSource = _chunkJHY6DL4Pjs.w;
54122
+ exports.AlertState = _chunkJHY6DL4Pjs.v;
54123
+ exports.AlertThresholdType = _chunkJHY6DL4Pjs.u;
54124
+ exports.AlertsApiResponseSchema = _chunkJHY6DL4Pjs.xa;
54125
+ exports.AlertsPageItemSchema = _chunkJHY6DL4Pjs.wa;
54126
+ exports.AssistantLineTableConfigSchema = _chunkJHY6DL4Pjs.ua;
54127
+ exports.AssistantResponseConfig = _chunkJHY6DL4Pjs.va;
54128
+ exports.BaseSourceSchema = _chunkJHY6DL4Pjs.ga;
54129
+ exports.ChSqlSchema = _chunkJHY6DL4Pjs.q;
54130
+ exports.ChartAlertBaseSchema = _chunkJHY6DL4Pjs.H;
54131
+ exports.ChartConfigSchema = _chunkJHY6DL4Pjs.S;
54132
+ exports.ConnectionSchema = _chunkJHY6DL4Pjs.ca;
54133
+ exports.CteChartConfigSchema = _chunkJHY6DL4Pjs.R;
54134
+ exports.DashboardContainerSchema = _chunkJHY6DL4Pjs.W;
54135
+ exports.DashboardFilterSchema = _chunkJHY6DL4Pjs.Y;
54136
+ exports.DashboardFilterType = _chunkJHY6DL4Pjs.X;
54137
+ exports.DashboardSchema = _chunkJHY6DL4Pjs.$;
54138
+ exports.DashboardTemplateSchema = _chunkJHY6DL4Pjs.ba;
54139
+ exports.DashboardWithoutIdSchema = _chunkJHY6DL4Pjs.aa;
54140
+ exports.DerivedColumnSchema = _chunkJHY6DL4Pjs.l;
54141
+ exports.DisplayType = _chunkJHY6DL4Pjs.c;
54142
+ exports.FilterSchema = _chunkJHY6DL4Pjs.L;
54143
+ exports.InstallationApiResponseSchema = _chunkJHY6DL4Pjs.Ka;
54144
+ exports.InternalAggregateFunctionSchema = _chunkJHY6DL4Pjs.i;
54145
+ exports.LimitSchema = _chunkJHY6DL4Pjs.p;
54146
+ exports.LogSourceSchema = _chunkJHY6DL4Pjs.ia;
54147
+ exports.MaterializedViewConfigurationSchema = _chunkJHY6DL4Pjs.ha;
54148
+ exports.MeApiResponseSchema = _chunkJHY6DL4Pjs.La;
54149
+ exports.MetricSourceSchema = _chunkJHY6DL4Pjs.la;
54150
+ exports.MetricTableSchema = _chunkJHY6DL4Pjs.d;
54151
+ exports.MetricsDataType = _chunkJHY6DL4Pjs.a;
54152
+ exports.MetricsDataTypeSchema = _chunkJHY6DL4Pjs.b;
54153
+ exports.NumberFormatSchema = _chunkJHY6DL4Pjs.P;
54154
+ exports.NumericUnit = _chunkJHY6DL4Pjs.O;
54155
+ exports.PresetDashboard = _chunkJHY6DL4Pjs.Z;
54156
+ exports.PresetDashboardFilterSchema = _chunkJHY6DL4Pjs._;
54157
+ exports.RootValueExpressionSchema = _chunkJHY6DL4Pjs.k;
54158
+ exports.RotateApiKeyApiResponseSchema = _chunkJHY6DL4Pjs.Ja;
54159
+ exports.SQLIntervalSchema = _chunkJHY6DL4Pjs.e;
54160
+ exports.SavedChartConfigSchema = _chunkJHY6DL4Pjs.T;
54161
+ exports.SavedSearchListApiResponseSchema = _chunkJHY6DL4Pjs.N;
54162
+ exports.SavedSearchSchema = _chunkJHY6DL4Pjs.M;
54163
+ exports.SearchConditionLanguageSchema = _chunkJHY6DL4Pjs.g;
54164
+ exports.SearchConditionSchema = _chunkJHY6DL4Pjs.f;
54165
+ exports.SelectListSchema = _chunkJHY6DL4Pjs.m;
54166
+ exports.SelectSQLStatementSchema = _chunkJHY6DL4Pjs.r;
54167
+ exports.SessionSourceSchema = _chunkJHY6DL4Pjs.ka;
54168
+ exports.SortSpecificationListSchema = _chunkJHY6DL4Pjs.o;
54169
+ exports.SortSpecificationSchema = _chunkJHY6DL4Pjs.n;
54170
+ exports.SourceKind = _chunkJHY6DL4Pjs.fa;
54171
+ exports.SourceSchema = _chunkJHY6DL4Pjs.ma;
54172
+ exports.SourceSchemaNoId = _chunkJHY6DL4Pjs.na;
54173
+ exports.SqlAstFilterSchema = _chunkJHY6DL4Pjs.K;
54174
+ exports.TeamApiResponseSchema = _chunkJHY6DL4Pjs.Ca;
54175
+ exports.TeamClickHouseSettingsSchema = _chunkJHY6DL4Pjs.da;
54176
+ exports.TeamInvitationSchema = _chunkJHY6DL4Pjs.Fa;
54177
+ exports.TeamInvitationsApiResponseSchema = _chunkJHY6DL4Pjs.Ga;
54178
+ exports.TeamMemberSchema = _chunkJHY6DL4Pjs.Da;
54179
+ exports.TeamMembersApiResponseSchema = _chunkJHY6DL4Pjs.Ea;
54180
+ exports.TeamSchema = _chunkJHY6DL4Pjs.ea;
54181
+ exports.TeamTagsApiResponseSchema = _chunkJHY6DL4Pjs.Ha;
54182
+ exports.TileSchema = _chunkJHY6DL4Pjs.U;
54183
+ exports.TileTemplateSchema = _chunkJHY6DL4Pjs.V;
54184
+ exports.TraceSourceSchema = _chunkJHY6DL4Pjs.ja;
54185
+ exports.UpdateClickHouseSettingsApiResponseSchema = _chunkJHY6DL4Pjs.Ia;
54186
+ exports.WebhookCreateApiResponseSchema = _chunkJHY6DL4Pjs.za;
54187
+ exports.WebhookSchema = _chunkJHY6DL4Pjs.t;
54188
+ exports.WebhookService = _chunkJHY6DL4Pjs.s;
54189
+ exports.WebhookTestApiResponseSchema = _chunkJHY6DL4Pjs.Ba;
54190
+ exports.WebhookUpdateApiResponseSchema = _chunkJHY6DL4Pjs.Aa;
54191
+ exports.WebhooksApiResponseSchema = _chunkJHY6DL4Pjs.ya;
54192
+ exports._ChartConfigSchema = _chunkJHY6DL4Pjs.Q;
54193
+ exports.getSampleWeightExpression = _chunkJHY6DL4Pjs.sa;
54194
+ exports.isLogSource = _chunkJHY6DL4Pjs.oa;
54195
+ exports.isMetricSource = _chunkJHY6DL4Pjs.ra;
54196
+ exports.isSessionSource = _chunkJHY6DL4Pjs.qa;
54197
+ exports.isTraceSource = _chunkJHY6DL4Pjs.pa;
54198
+ exports.pickSampleWeightExpressionProps = _chunkJHY6DL4Pjs.ta;
54199
+ exports.scheduleStartAtSchema = _chunkJHY6DL4Pjs.E;
54200
+ exports.validateAlertScheduleOffsetMinutes = _chunkJHY6DL4Pjs.D;
54201
+ exports.zAlertChannel = _chunkJHY6DL4Pjs.A;
54202
+ exports.zAlertChannelType = _chunkJHY6DL4Pjs.z;
54203
+ exports.zSavedSearchAlert = _chunkJHY6DL4Pjs.B;
54204
+ exports.zTileAlert = _chunkJHY6DL4Pjs.C;
54201
54205
  }
54202
54206
  });
54203
54207
 
@@ -74139,9 +74143,9 @@ var require_object_hash = __commonJS({
74139
74143
  }
74140
74144
  });
74141
74145
 
74142
- // ../common-utils/dist/chunk-PA2R4K2O.js
74143
- var require_chunk_PA2R4K2O = __commonJS({
74144
- "../common-utils/dist/chunk-PA2R4K2O.js"(exports) {
74146
+ // ../common-utils/dist/chunk-TG7NNTT3.js
74147
+ var require_chunk_TG7NNTT3 = __commonJS({
74148
+ "../common-utils/dist/chunk-TG7NNTT3.js"(exports) {
74145
74149
  "use strict";
74146
74150
  Object.defineProperty(exports, "__esModule", { value: true });
74147
74151
  function _interopRequireDefault(obj) {
@@ -74176,7 +74180,7 @@ var require_chunk_PA2R4K2O = __commonJS({
74176
74180
  return value;
74177
74181
  }
74178
74182
  var _chunkXSPFZE62js = require_chunk_XSPFZE62();
74179
- var _chunk3BJ55V2Fjs = require_chunk_3BJ55V2F();
74183
+ var _chunkJHY6DL4Pjs = require_chunk_JHY6DL4P();
74180
74184
  var _datefns = (init_esm(), __toCommonJS(esm_exports));
74181
74185
  var _datefnstz = require_date_fns_tz();
74182
74186
  var _objecthash = require_object_hash();
@@ -74309,10 +74313,10 @@ var require_chunk_PA2R4K2O = __commonJS({
74309
74313
  };
74310
74314
  function de2(e2, t2, n7 = []) {
74311
74315
  let s3 = { version: "0.1.0", name: e2.name, tags: e2.tags.length > 0 ? e2.tags : void 0, tiles: [] }, r = (i2, u2, a3) => {
74312
- let l = _chunk3BJ55V2Fjs.U.strip().parse(structuredClone(i2)), c3 = l.config;
74316
+ let l = _chunkJHY6DL4Pjs.V.strip().parse(structuredClone(i2)), c3 = l.config;
74313
74317
  return _chunkXSPFZE62js.d.call(void 0, c3) ? c3.source = _nullishCoalesce(u2.find((m3) => m3.id === c3.source), () => ({ name: "" })).name : _chunkXSPFZE62js.c.call(void 0, c3) && (c3.connection = _nullishCoalesce(a3.find((m3) => m3.id === c3.connection), () => ({ name: "" })).name, c3.source && (c3.source = _nullishCoalesce(_optionalChain([u2, "access", (_2) => _2.find, "call", (_2) => _2((m3) => m3.id === c3.source), "optionalAccess", (_3) => _3.name]), () => ""))), l;
74314
74318
  }, o = (i2, u2) => {
74315
- let a3 = _chunk3BJ55V2Fjs.X.strip().parse(structuredClone(i2));
74319
+ let a3 = _chunkJHY6DL4Pjs.Y.strip().parse(structuredClone(i2));
74316
74320
  return a3.source = _nullishCoalesce(_optionalChain([u2, "access", (_4) => _4.find, "call", (_5) => _5((l) => l.id === i2.source), "optionalAccess", (_6) => _6.name]), () => ""), a3;
74317
74321
  };
74318
74322
  for (let i2 of e2.tiles) s3.tiles.push(r(i2, t2, n7));
@@ -74513,9 +74517,9 @@ var require_chunk_PA2R4K2O = __commonJS({
74513
74517
  }
74514
74518
  });
74515
74519
 
74516
- // ../common-utils/dist/chunk-QZUFNMWN.js
74517
- var require_chunk_QZUFNMWN = __commonJS({
74518
- "../common-utils/dist/chunk-QZUFNMWN.js"(exports) {
74520
+ // ../common-utils/dist/chunk-KCHFIBHL.js
74521
+ var require_chunk_KCHFIBHL = __commonJS({
74522
+ "../common-utils/dist/chunk-KCHFIBHL.js"(exports) {
74519
74523
  "use strict";
74520
74524
  Object.defineProperty(exports, "__esModule", { value: true });
74521
74525
  function _nullishCoalesce(lhs, rhsFn) {
@@ -74567,8 +74571,8 @@ var require_chunk_QZUFNMWN = __commonJS({
74567
74571
  }
74568
74572
  return value;
74569
74573
  }
74570
- var _chunkPA2R4K2Ojs = require_chunk_PA2R4K2O();
74571
- var _chunk3BJ55V2Fjs = require_chunk_3BJ55V2F();
74574
+ var _chunkTG7NNTT3js = require_chunk_TG7NNTT3();
74575
+ var _chunkJHY6DL4Pjs = require_chunk_JHY6DL4P();
74572
74576
  var _datefns = (init_esm(), __toCommonJS(esm_exports));
74573
74577
  async function D3(e2, t2, n7) {
74574
74578
  try {
@@ -74589,7 +74593,7 @@ var require_chunk_QZUFNMWN = __commonJS({
74589
74593
  return n7 === "count" ? "sum" : await D3(e2, t2, r) ? n7 : `${n7}Merge`;
74590
74594
  }
74591
74595
  function P2(e2) {
74592
- return !!e2 && _chunk3BJ55V2Fjs.i.safeParse(e2).success;
74596
+ return !!e2 && _chunkJHY6DL4Pjs.i.safeParse(e2).success;
74593
74597
  }
74594
74598
  function G3(e2) {
74595
74599
  return e2.aggFn === "quantile" && "level" in e2 && typeof e2.level == "number";
@@ -74601,11 +74605,11 @@ var require_chunk_QZUFNMWN = __commonJS({
74601
74605
  if (!t2.granularity && !t2.dateRange) return true;
74602
74606
  let n7 = t2.granularity || "auto";
74603
74607
  if (n7 === "auto" && !t2.dateRange) return false;
74604
- let r = n7 === "auto" && t2.dateRange ? _chunkPA2R4K2Ojs.l.call(void 0, t2.dateRange) : n7, s3 = _chunkPA2R4K2Ojs.m.call(void 0, r), u2 = _chunkPA2R4K2Ojs.m.call(void 0, e2.minGranularity);
74608
+ let r = n7 === "auto" && t2.dateRange ? _chunkTG7NNTT3js.l.call(void 0, t2.dateRange) : n7, s3 = _chunkTG7NNTT3js.m.call(void 0, r), u2 = _chunkTG7NNTT3js.m.call(void 0, e2.minGranularity);
74605
74609
  return s3 >= u2 && s3 % u2 === 0;
74606
74610
  }
74607
74611
  function k3(e2, t2) {
74608
- let [n7, r] = e2, s3 = _chunkPA2R4K2Ojs.m.call(void 0, t2), u2 = _datefns.differenceInSeconds.call(void 0, r, n7);
74612
+ let [n7, r] = e2, s3 = _chunkTG7NNTT3js.m.call(void 0, t2), u2 = _datefns.differenceInSeconds.call(void 0, r, n7);
74609
74613
  return Math.floor(u2 / s3);
74610
74614
  }
74611
74615
  function v2(e2, t2) {
@@ -74643,7 +74647,7 @@ var require_chunk_QZUFNMWN = __commonJS({
74643
74647
  if (!W2(t2, e2)) return { errors: [e2.granularity ? `Granularity must be a multiple of the view's granularity (${t2.minGranularity}).` : "The selected date range is too short for the granularity of this materialized view."] };
74644
74648
  let r = { databaseName: t2.databaseName, tableName: t2.tableName, connectionId: e2.connection }, s3 = await Promise.allSettled(e2.select.map((i2) => $(t2, i2, r, n7))), u2 = [], o = [];
74645
74649
  for (let i2 of s3) i2.status === "rejected" ? o.push(i2.reason.message) : u2.push(i2.value);
74646
- return o.length > 0 ? { errors: o } : { optimizedConfig: { ...structuredClone(e2), select: u2, timestampValueExpression: t2.timestampColumn, from: { databaseName: t2.databaseName, tableName: t2.tableName }, ..."dateRange" in e2 && e2.dateRange ? { dateRangeEndInclusive: false, dateRange: _chunkPA2R4K2Ojs.A.call(void 0, e2.dateRange, t2.minGranularity) } : {} } };
74650
+ return o.length > 0 ? { errors: o } : { optimizedConfig: { ...structuredClone(e2), select: u2, timestampValueExpression: t2.timestampColumn, from: { databaseName: t2.databaseName, tableName: t2.tableName }, ..."dateRange" in e2 && e2.dateRange ? { dateRangeEndInclusive: false, dateRange: _chunkTG7NNTT3js.A.call(void 0, e2.dateRange, t2.minGranularity) } : {} } };
74647
74651
  }
74648
74652
  async function K3(e2, t2, n7, r, s3, u2) {
74649
74653
  let o = [], c3;
@@ -74690,11 +74694,11 @@ var require_chunk_QZUFNMWN = __commonJS({
74690
74694
  return `${e2.databaseName}.${e2.tableName}`;
74691
74695
  }
74692
74696
  async function ie2({ chartConfig: e2, keys: t2, source: n7, clickhouseClient: r, metadata: s3, signal: u2 }) {
74693
- let o = (_chunk3BJ55V2Fjs.oa.call(void 0, n7) || _chunk3BJ55V2Fjs.na.call(void 0, n7)) && _optionalChain([n7, "optionalAccess", (_9) => _9.materializedViews]) || [], c3 = new Map(o.map((l) => [x3(l), l])), i2 = /* @__PURE__ */ new Map();
74697
+ let o = (_chunkJHY6DL4Pjs.pa.call(void 0, n7) || _chunkJHY6DL4Pjs.oa.call(void 0, n7)) && _optionalChain([n7, "optionalAccess", (_9) => _9.materializedViews]) || [], c3 = new Map(o.map((l) => [x3(l), l])), i2 = /* @__PURE__ */ new Map();
74694
74698
  for (let [l, m3] of c3.entries()) {
74695
74699
  let g = e2.dateRange ? k3(e2.dateRange, m3.minGranularity) : 1 / 0;
74696
74700
  if (v2(m3, e2) && g >= 3) {
74697
- let f = _chunkPA2R4K2Ojs.e.call(void 0, m3.dimensionColumns), y3 = t2.filter((h3) => f.includes(h3));
74701
+ let f = _chunkTG7NNTT3js.e.call(void 0, m3.dimensionColumns), y3 = t2.filter((h3) => f.includes(h3));
74698
74702
  y3.length > 0 && i2.set(l, y3);
74699
74703
  }
74700
74704
  }
@@ -74726,9 +74730,9 @@ var require_chunk_QZUFNMWN = __commonJS({
74726
74730
  }
74727
74731
  });
74728
74732
 
74729
- // ../common-utils/dist/chunk-LDDGQDAH.js
74730
- var require_chunk_LDDGQDAH = __commonJS({
74731
- "../common-utils/dist/chunk-LDDGQDAH.js"(exports) {
74733
+ // ../common-utils/dist/chunk-AK5NJJI2.js
74734
+ var require_chunk_AK5NJJI2 = __commonJS({
74735
+ "../common-utils/dist/chunk-AK5NJJI2.js"(exports) {
74732
74736
  "use strict";
74733
74737
  Object.defineProperty(exports, "__esModule", { value: true });
74734
74738
  function _nullishCoalesce(lhs, rhsFn) {
@@ -74738,10 +74742,10 @@ var require_chunk_LDDGQDAH = __commonJS({
74738
74742
  return rhsFn();
74739
74743
  }
74740
74744
  }
74741
- var _chunkPA2R4K2Ojs = require_chunk_PA2R4K2O();
74745
+ var _chunkTG7NNTT3js = require_chunk_TG7NNTT3();
74742
74746
  var r = (t2) => {
74743
- let a3 = _nullishCoalesce(t2.granularity, () => "auto"), o = a3 === "auto" && t2.dateRange ? _chunkPA2R4K2Ojs.l.call(void 0, t2.dateRange) : a3;
74744
- return _chunkPA2R4K2Ojs.m.call(void 0, o);
74747
+ let a3 = _nullishCoalesce(t2.granularity, () => "auto"), o = a3 === "auto" && t2.dateRange ? _chunkTG7NNTT3js.l.call(void 0, t2.dateRange) : a3;
74748
+ return _chunkTG7NNTT3js.m.call(void 0, o);
74745
74749
  };
74746
74750
  var e2 = exports.a = { startDateMilliseconds: { name: "startDateMilliseconds", type: "Int64", description: "start of the dashboard date range, in milliseconds since epoch", get: (t2) => t2.dateRange ? t2.dateRange[0].getTime() : void 0 }, endDateMilliseconds: { name: "endDateMilliseconds", type: "Int64", description: "end of the dashboard date range, in milliseconds since epoch", get: (t2) => t2.dateRange ? t2.dateRange[1].getTime() : void 0 }, intervalSeconds: { name: "intervalSeconds", type: "Int64", description: "time bucket size in seconds", get: r }, intervalMilliseconds: { name: "intervalMilliseconds", type: "Int64", description: "time bucket size in milliseconds", get: (t2) => r(t2) * 1e3 } };
74747
74751
  var D3 = exports.b = { line: [e2.startDateMilliseconds, e2.endDateMilliseconds, e2.intervalSeconds, e2.intervalMilliseconds], stacked_bar: [e2.startDateMilliseconds, e2.endDateMilliseconds, e2.intervalSeconds, e2.intervalMilliseconds], table: [e2.startDateMilliseconds, e2.endDateMilliseconds], pie: [e2.startDateMilliseconds, e2.endDateMilliseconds], number: [e2.startDateMilliseconds, e2.endDateMilliseconds], search: [], heatmap: [], markdown: [] };
@@ -74769,24 +74773,24 @@ GROUP BY ServiceName, ts`;
74769
74773
  }
74770
74774
  });
74771
74775
 
74772
- // ../common-utils/dist/chunk-4NHZLI4N.js
74773
- var require_chunk_4NHZLI4N = __commonJS({
74774
- "../common-utils/dist/chunk-4NHZLI4N.js"(exports) {
74776
+ // ../common-utils/dist/chunk-WX4KZTVE.js
74777
+ var require_chunk_WX4KZTVE = __commonJS({
74778
+ "../common-utils/dist/chunk-WX4KZTVE.js"(exports) {
74775
74779
  "use strict";
74776
74780
  Object.defineProperty(exports, "__esModule", { value: true });
74777
- var _chunkLDDGQDAHjs = require_chunk_LDDGQDAH();
74778
- var _chunkPA2R4K2Ojs = require_chunk_PA2R4K2O();
74779
- var _chunk3BJ55V2Fjs = require_chunk_3BJ55V2F();
74781
+ var _chunkAK5NJJI2js = require_chunk_AK5NJJI2();
74782
+ var _chunkTG7NNTT3js = require_chunk_TG7NNTT3();
74783
+ var _chunkJHY6DL4Pjs = require_chunk_JHY6DL4P();
74780
74784
  function $(e2, t2, r, n7) {
74781
74785
  if (t2.length < r || t2.length > n7) {
74782
74786
  let s3 = r === n7 ? `${r}` : `${r}-${n7}`;
74783
74787
  throw new Error(`Macro '${e2}' expects ${s3} argument(s), but got ${t2.length}`);
74784
74788
  }
74785
74789
  }
74786
- var m3 = () => _chunkLDDGQDAHjs.e.call(void 0, "startDateMilliseconds");
74787
- var l = () => _chunkLDDGQDAHjs.e.call(void 0, "endDateMilliseconds");
74788
- var b2 = () => _chunkLDDGQDAHjs.e.call(void 0, "intervalSeconds");
74789
- var w2 = () => _chunkLDDGQDAHjs.e.call(void 0, "intervalMilliseconds");
74790
+ var m3 = () => _chunkAK5NJJI2js.e.call(void 0, "startDateMilliseconds");
74791
+ var l = () => _chunkAK5NJJI2js.e.call(void 0, "endDateMilliseconds");
74792
+ var b2 = () => _chunkAK5NJJI2js.e.call(void 0, "intervalSeconds");
74793
+ var w2 = () => _chunkAK5NJJI2js.e.call(void 0, "intervalMilliseconds");
74790
74794
  var u2 = (e2) => `toDate(fromUnixTimestamp64Milli(${e2}))`;
74791
74795
  var g = (e2) => `toDateTime(fromUnixTimestamp64Milli(${e2}))`;
74792
74796
  var f = (e2) => `fromUnixTimestamp64Milli(${e2})`;
@@ -74819,7 +74823,7 @@ var require_chunk_4NHZLI4N = __commonJS({
74819
74823
  let [t2] = e2;
74820
74824
  return `toStartOfInterval(toDateTime64(${t2}, 3), INTERVAL ${w2()} millisecond)`;
74821
74825
  } }, { name: "interval_s", minArgs: 0, maxArgs: 0, replace: () => b2() }];
74822
- var I3 = exports.a = [...x3.map(({ name: e2, minArgs: t2, maxArgs: r }) => ({ name: e2, minArgs: t2, maxArgs: r })), { name: "filters", minArgs: 0, maxArgs: 0 }, { name: "sourceTable", minArgs: 0, maxArgs: 1 }, ...Object.values(_chunk3BJ55V2Fjs.a).map((e2) => ({ name: `sourceTable(${e2})`, minArgs: 0, maxArgs: 0 }))];
74826
+ var I3 = exports.a = [...x3.map(({ name: e2, minArgs: t2, maxArgs: r }) => ({ name: e2, minArgs: t2, maxArgs: r })), { name: "filters", minArgs: 0, maxArgs: 0 }, { name: "sourceTable", minArgs: 0, maxArgs: 1 }, ...Object.values(_chunkJHY6DL4Pjs.a).map((e2) => ({ name: `sourceTable(${e2})`, minArgs: 0, maxArgs: 0 }))];
74823
74827
  function _2(e2) {
74824
74828
  if (!e2.startsWith("(")) return { args: [], length: 0 };
74825
74829
  let t2 = 0, r = -1;
@@ -74833,7 +74837,7 @@ var require_chunk_4NHZLI4N = __commonJS({
74833
74837
  }
74834
74838
  if (r < 0) return { args: [], length: -1 };
74835
74839
  let n7 = e2.slice(1, r);
74836
- return { args: _chunkPA2R4K2Ojs.e.call(void 0, n7), length: r + 1 };
74840
+ return { args: _chunkTG7NNTT3js.e.call(void 0, n7), length: r + 1 };
74837
74841
  }
74838
74842
  function D3(e2, t2) {
74839
74843
  let r = new RegExp(`\\$__${t2}\\b`, "g"), n7 = [];
@@ -74852,8 +74856,8 @@ var require_chunk_4NHZLI4N = __commonJS({
74852
74856
  if (a3.length === 0 && !r.tableName) throw new Error("Macro '$__sourceTable' requires a source with a table to be selected when no arguments are provided");
74853
74857
  if (a3.length === 0) return `\`${r.databaseName}\`.\`${r.tableName}\``;
74854
74858
  if (!n7) throw new Error("Macro '$__sourceTable(metricType)' with a metric type argument requires a metrics source to be selected");
74855
- let c3 = _chunk3BJ55V2Fjs.b.safeParse(a3[0]);
74856
- if (!c3.success) throw new Error(`Macro '$__sourceTable(metricType)' invalid argument '${a3[0]}'. Expected a valid metrics data type (${Object.values(_chunk3BJ55V2Fjs.a).join(", ")}).`);
74859
+ let c3 = _chunkJHY6DL4Pjs.b.safeParse(a3[0]);
74860
+ if (!c3.success) throw new Error(`Macro '$__sourceTable(metricType)' invalid argument '${a3[0]}'. Expected a valid metrics data type (${Object.values(_chunkJHY6DL4Pjs.a).join(", ")}).`);
74857
74861
  let p = c3.data, d3 = n7[p];
74858
74862
  if (!d3) throw new Error(`Macro '$__sourceTable(metricType)': No table configured for metric type '${p}'.`);
74859
74863
  return `\`${r.databaseName}\`.\`${d3}\``;
@@ -126906,9 +126910,9 @@ var require_lucene = __commonJS({
126906
126910
  }
126907
126911
  });
126908
126912
 
126909
- // ../common-utils/dist/chunk-Z3GGA2U3.js
126910
- var require_chunk_Z3GGA2U3 = __commonJS({
126911
- "../common-utils/dist/chunk-Z3GGA2U3.js"(exports) {
126913
+ // ../common-utils/dist/chunk-ZEYGQWFC.js
126914
+ var require_chunk_ZEYGQWFC = __commonJS({
126915
+ "../common-utils/dist/chunk-ZEYGQWFC.js"(exports) {
126912
126916
  "use strict";
126913
126917
  Object.defineProperty(exports, "__esModule", { value: true });
126914
126918
  function _interopRequireWildcard(obj) {
@@ -126961,15 +126965,15 @@ var require_chunk_Z3GGA2U3 = __commonJS({
126961
126965
  var _class;
126962
126966
  var _class2;
126963
126967
  var _class3;
126964
- var _chunkQZUFNMWNjs = require_chunk_QZUFNMWN();
126965
- var _chunk4NHZLI4Njs = require_chunk_4NHZLI4N();
126966
- var _chunkLDDGQDAHjs = require_chunk_LDDGQDAH();
126967
- var _chunkPA2R4K2Ojs = require_chunk_PA2R4K2O();
126968
+ var _chunkKCHFIBHLjs = require_chunk_KCHFIBHL();
126969
+ var _chunkWX4KZTVEjs = require_chunk_WX4KZTVE();
126970
+ var _chunkAK5NJJI2js = require_chunk_AK5NJJI2();
126971
+ var _chunkTG7NNTT3js = require_chunk_TG7NNTT3();
126968
126972
  var _chunkXSPFZE62js = require_chunk_XSPFZE62();
126969
- var _chunk3BJ55V2Fjs = require_chunk_3BJ55V2F();
126973
+ var _chunkJHY6DL4Pjs = require_chunk_JHY6DL4P();
126970
126974
  var _nodesqlparser = require_node_sql_parser();
126971
- var pe2 = _interopRequireWildcard(_nodesqlparser);
126972
- var ve2 = _interopRequireWildcard(_nodesqlparser);
126975
+ var he2 = _interopRequireWildcard(_nodesqlparser);
126976
+ var Ue2 = _interopRequireWildcard(_nodesqlparser);
126973
126977
  var _objecthash = require_object_hash();
126974
126978
  var _objecthash2 = _interopRequireDefault(_objecthash);
126975
126979
  var _lodash = require_lodash();
@@ -126983,13 +126987,13 @@ var require_chunk_Z3GGA2U3 = __commonJS({
126983
126987
  function et2(e2) {
126984
126988
  return e2.replace(/\\\\/g, "HDX_BACKSLASH_LITERAL").replace("http://", "http_COLON_//").replace("https://", "https_COLON_//").replace(/localhost:(\d{1,5})/, "localhost_COLON_$1").replace(/\\:/g, "HDX_COLON");
126985
126989
  }
126986
- function Ne2(e2) {
126990
+ function we2(e2) {
126987
126991
  return e2.replace(/\\"/g, '"').replace(/HDX_BACKSLASH_LITERAL/g, "\\").replace("http_COLON_//", "http://").replace("https_COLON_//", "https://").replace(/localhost_COLON_(\d{1,5})/, "localhost:$1").replace(/HDX_COLON/g, ":");
126988
126992
  }
126989
- function qe2(e2) {
126993
+ function ke3(e2) {
126990
126994
  return _lucene2.default.parse(et2(e2));
126991
126995
  }
126992
- function we2(e2) {
126996
+ function Re2(e2) {
126993
126997
  let n7 = ((r) => {
126994
126998
  let s3 = r.indexOf("['");
126995
126999
  if (s3 === -1) return;
@@ -126998,8 +127002,8 @@ var require_chunk_Z3GGA2U3 = __commonJS({
126998
127002
  })(e2);
126999
127003
  if (n7) return _sqlstring2.default.format("mapContains(??, ?)", [n7.map, n7.key]);
127000
127004
  }
127001
- var T3 = "<implicit>";
127002
- function ke3(e2) {
127005
+ var N2 = "<implicit>";
127006
+ function De2(e2) {
127003
127007
  return "term" in e2 && e2.term != null;
127004
127008
  }
127005
127009
  function Me2(e2) {
@@ -127023,18 +127027,18 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127023
127027
  if (a3) return a3;
127024
127028
  }
127025
127029
  }
127026
- var ne2 = class {
127030
+ var ae2 = class {
127027
127031
  constructor({ metadata: t2, databaseName: n7, tableName: r, connectionId: s3 }) {
127028
127032
  this.metadata = t2, this.databaseName = n7, this.tableName = r, this.connectionId = s3;
127029
127033
  }
127030
127034
  translateField(t2, n7) {
127031
- return t2 === T3 ? _nullishCoalesce(n7.implicitColumnExpression, () => "event") : `'${t2}'`;
127035
+ return t2 === N2 ? _nullishCoalesce(n7.implicitColumnExpression, () => "event") : `'${t2}'`;
127032
127036
  }
127033
127037
  async getFieldType(t2) {
127034
127038
  let n7 = await Fe2({ field: t2, metadata: this.metadata, databaseName: this.databaseName, tableName: this.tableName, connectionId: this.connectionId }), s3 = t2.split(".").slice(n7 ? n7.name.split(".").length : 0).join(".");
127035
127039
  if (!n7) return { isArray: false, type: null };
127036
127040
  let i2 = x3(n7.type), o = i2 === "array";
127037
- return o && L3(n7.type) && (i2 = L3(n7.type)), { isArray: o, type: i2, fieldPostfix: s3, column: n7.name };
127041
+ return o && B3(n7.type) && (i2 = B3(n7.type)), { isArray: o, type: i2, fieldPostfix: s3, column: n7.name };
127038
127042
  }
127039
127043
  operator(t2) {
127040
127044
  switch (t2) {
@@ -127076,7 +127080,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127076
127080
  }
127077
127081
  async fieldSearch(t2, n7, r, s3, i2, o) {
127078
127082
  let l = n7.trim().match(/\s/) ? `"${n7}"` : n7;
127079
- if (t2 === T3) {
127083
+ if (t2 === N2) {
127080
127084
  let a3 = !o.implicitColumnExpression;
127081
127085
  return `${this.translateField(t2, o)} ${s3 && i2 ? r ? "does not contain" : "contains" : s3 ? r ? "does not end with" : "ends with" : i2 ? r ? "does not start with" : "starts with" : a3 ? r ? "does not have whole word" : "has whole word" : r ? "does not contain" : "contains"} ${l}`;
127082
127086
  } else {
@@ -127088,7 +127092,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127088
127092
  return `${t2} ${s3 ? "is not" : "is"} between ${n7} and ${r}`;
127089
127093
  }
127090
127094
  };
127091
- var ie2 = exports.N = (_class = class {
127095
+ var oe2 = exports.N = (_class = class {
127092
127096
  constructor() {
127093
127097
  _class.prototype.__init.call(this);
127094
127098
  }
@@ -127116,7 +127120,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127116
127120
  async eq(t2, n7, r, s3) {
127117
127121
  let { column: i2, columnJSON: o, found: l, propertyType: a3, isArray: u2, mapKeyIndexExpression: m3, arrayMapKeyExpression: p } = await this.getColumnForField(t2, s3);
127118
127122
  if (!l) return this.NOT_FOUND_QUERY;
127119
- if (i2 && u2) return De2({ column: i2, mapKey: p, term: n7, propertyType: a3, isNegatedField: r, exactMatch: true });
127123
+ if (i2 && u2) return We2({ column: i2, mapKey: p, term: n7, propertyType: a3, isNegatedField: r, exactMatch: true });
127120
127124
  let g = m3 && !r ? ` AND ${m3}` : "";
127121
127125
  if (a3 === "bool") {
127122
127126
  let h3 = `${n7}`.trim().toLowerCase();
@@ -127183,7 +127187,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127183
127187
  return _sqlstring2.default.format(`(${o} ${s3 ? "NOT " : ""}BETWEEN ? AND ?${m3})`, [this.attemptToParseNumber(n7), this.attemptToParseNumber(r)]);
127184
127188
  }
127185
127189
  }, _class);
127186
- function De2({ column: e2, mapKey: t2, term: n7, isNegatedField: r, propertyType: s3, exactMatch: i2 }) {
127190
+ function We2({ column: e2, mapKey: t2, term: n7, isNegatedField: r, propertyType: s3, exactMatch: i2 }) {
127187
127191
  let o = r ? "NOT " : "";
127188
127192
  if (s3 === "number") return _sqlstring2.default.format(`${o}has(?, CAST(?, 'Float64'))`, [_sqlstring2.default.raw(e2), n7]);
127189
127193
  if (s3 === "bool") {
@@ -127201,15 +127205,15 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127201
127205
  let l = s3 === "string" ? "el" : _sqlstring2.default.format("toString(el)", [_sqlstring2.default.raw(e2)]);
127202
127206
  return i2 && s3 === "string" ? _sqlstring2.default.format(`${o}has(?, ?)`, [_sqlstring2.default.raw(e2), n7]) : i2 ? _sqlstring2.default.format(`${o}arrayExists(el -> ${l} = ?, ?)`, [n7, _sqlstring2.default.raw(e2)]) : _sqlstring2.default.format(`${o}arrayExists(el -> ${l} ILIKE ?, ?)`, [`%${n7}%`, _sqlstring2.default.raw(e2)]);
127203
127207
  }
127204
- var J = class extends ie2 {
127208
+ var V2 = class extends oe2 {
127205
127209
  constructor({ metadata: t2, databaseName: n7, tableName: r, connectionId: s3, implicitColumnExpression: i2 }) {
127206
127210
  super(), this.metadata = t2, this.databaseName = n7, this.tableName = r, this.implicitColumnExpression = i2, this.connectionId = s3, this.skipIndicesPromise = this.metadata.getSkipIndices({ databaseName: n7, tableName: r, connectionId: s3 }).catch((o) => (console.error("Error fetching skip indices:", o), [])), this.enableTextIndexPromise = this.metadata.getSetting({ settingName: "enable_full_text_index", connectionId: s3 }).then((o) => o === "1").catch((o) => (console.error("Error fetching enable_full_text_index setting:", o), false));
127207
127211
  }
127208
127212
  async fieldSearch(t2, n7, r, s3, i2, o) {
127209
- let l = t2 === T3, { column: a3, columnJSON: u2, found: m3, propertyType: p, isArray: g, mapKeyIndexExpression: h3, arrayMapKeyExpression: y3 } = await this.getColumnForField(t2, o);
127213
+ let l = t2 === N2, { column: a3, columnJSON: u2, found: m3, propertyType: p, isArray: g, mapKeyIndexExpression: h3, arrayMapKeyExpression: y3 } = await this.getColumnForField(t2, o);
127210
127214
  if (!m3) return this.NOT_FOUND_QUERY;
127211
127215
  let S3 = h3 && !r && (!l || !o.isNegatedAndParenthesized) ? ` AND ${h3}` : "";
127212
- if (g) return De2({ column: a3, mapKey: y3, term: n7, propertyType: p, isNegatedField: r, exactMatch: false });
127216
+ if (g) return We2({ column: a3, mapKey: y3, term: n7, propertyType: p, isNegatedField: r, exactMatch: false });
127213
127217
  if (p === "bool") {
127214
127218
  let f = `${n7}`.trim().toLowerCase();
127215
127219
  return _sqlstring2.default.format(`(?? ${r ? "!" : ""}= ?${S3})`, [a3, f === "true" ? 1 : f === "false" ? 0 : parseInt(f)]);
@@ -127222,19 +127226,19 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127222
127226
  let f = !o.implicitColumnExpression;
127223
127227
  if (s3 || i2) return _sqlstring2.default.format(`(lower(?) ${r ? "NOT " : ""}LIKE lower(?))`, [_sqlstring2.default.raw(a3), `${s3 ? "%" : ""}${n7}${i2 ? "%" : ""}`]);
127224
127228
  if (f) {
127225
- let C2 = await this.enableTextIndexPromise ? await this.findTextIndex(a3) : void 0;
127226
- if (C2 && _optionalChain([_chunkPA2R4K2Ojs.F.call(void 0, C2), "optionalAccess", (_9) => _9.type]) === "splitByNonAlpha") {
127227
- let b2 = this.tokenizeTerm(n7), P2 = this.termHasSeparators(n7), ge2 = _lodash.chunk.call(void 0, b2, Ze2), de2 = ge2.map((Ye2) => _sqlstring2.default.format("hasAllTokens(?, ?)", [_sqlstring2.default.raw(a3), Ye2.join(" ")]));
127228
- return P2 || ge2.length > 1 ? `(${r ? "NOT (" : ""}${[...de2, _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})` : `(${r ? "NOT " : ""}${de2.join(" AND ")})`;
127229
+ let A2 = await this.enableTextIndexPromise ? await this.findTextIndex(a3) : void 0;
127230
+ if (A2 && _optionalChain([_chunkTG7NNTT3js.F.call(void 0, A2), "optionalAccess", (_9) => _9.type]) === "splitByNonAlpha") {
127231
+ let T3 = this.tokenizeTerm(n7), F2 = this.termHasSeparators(n7), W2 = _lodash.chunk.call(void 0, T3, Ze2), L3 = W2.map((Ye2) => _sqlstring2.default.format("hasAllTokens(?, ?)", [_sqlstring2.default.raw(a3), Ye2.join(" ")]));
127232
+ return F2 || W2.length > 1 ? `(${r ? "NOT (" : ""}${[...L3, _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})` : `(${r ? "NOT " : ""}${L3.join(" AND ")})`;
127229
127233
  }
127230
- let A2 = this.termHasSeparators(n7), N2 = await this.findBloomFilterTokensIndex(a3);
127231
- if (N2.found) {
127232
- let b2 = /\blower\s*\(/.test(N2.indexExpression) ? _sqlstring2.default.format("tokens(lower(?))", [n7]) : _sqlstring2.default.format("tokens(?)", [n7]);
127233
- return A2 ? `(${r ? "NOT (" : ""}${[`hasAll(${N2.indexExpression}, ${b2})`, _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})` : `(${r ? "NOT " : ""}hasAll(${N2.indexExpression}, ${b2}))`;
127234
+ let C2 = this.termHasSeparators(n7), b2 = await this.findBloomFilterTokensIndex(a3);
127235
+ if (b2.found) {
127236
+ let T3 = /\blower\s*\(/.test(b2.indexExpression) ? _sqlstring2.default.format("tokens(lower(?))", [n7]) : _sqlstring2.default.format("tokens(?)", [n7]);
127237
+ return C2 ? `(${r ? "NOT (" : ""}${[`hasAll(${b2.indexExpression}, ${T3})`, _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})` : `(${r ? "NOT " : ""}hasAll(${b2.indexExpression}, ${T3}))`;
127234
127238
  }
127235
- if (A2) {
127239
+ if (C2) {
127236
127240
  let I3 = this.tokenizeTerm(n7);
127237
- return `(${r ? "NOT (" : ""}${[...I3.map((b2) => _sqlstring2.default.format("hasToken(lower(?), lower(?))", [_sqlstring2.default.raw(a3), b2])), _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})`;
127241
+ return `(${r ? "NOT (" : ""}${[...I3.map((T3) => _sqlstring2.default.format("hasToken(lower(?), lower(?))", [_sqlstring2.default.raw(a3), T3])), _sqlstring2.default.format("(lower(?) LIKE lower(?))", [_sqlstring2.default.raw(a3), `%${n7}%`])].join(" AND ")}${r ? ")" : ""})`;
127238
127242
  } else return _sqlstring2.default.format(`(${r ? "NOT " : ""}hasToken(lower(?), lower(?)))`, [_sqlstring2.default.raw(a3), n7]);
127239
127243
  }
127240
127244
  }
@@ -127253,7 +127257,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127253
127257
  for (let [l, a3] of i2.entries()) if (a3 === t2) return { materializedTarget: l, materializedName: a3 };
127254
127258
  })();
127255
127259
  if (o) {
127256
- let l = we2(o.materializedTarget);
127260
+ let l = Re2(o.materializedTarget);
127257
127261
  l && (s3.mapKeyIndexExpression = `indexHint(${l})`);
127258
127262
  }
127259
127263
  return s3;
@@ -127263,7 +127267,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127263
127267
  let s3 = r.name.split("."), i2 = t2.split(".").slice(s3.length).join(".");
127264
127268
  if (r.type.startsWith("Map")) {
127265
127269
  let o = _optionalChain([r, "access", (_10) => _10.type, "access", (_11) => _11.match, "call", (_12) => _12(/,\s+(\w+)\)$/), "optionalAccess", (_13) => _13[1]]);
127266
- return { found: true, columnExpression: _sqlstring2.default.format("??[?]", [r.name, i2]), mapKeyIndexExpression: `indexHint(${we2(`${r.name}['${i2}']`)})`, columnType: _nullishCoalesce(o, () => "Unknown") };
127270
+ return { found: true, columnExpression: _sqlstring2.default.format("??[?]", [r.name, i2]), mapKeyIndexExpression: `indexHint(${Re2(`${r.name}['${i2}']`)})`, columnType: _nullishCoalesce(o, () => "Unknown") };
127267
127271
  } else {
127268
127272
  if (r.type.startsWith("JSON")) return { found: true, columnExpression: "", columnExpressionJSON: { string: _sqlstring2.default.format("toString(??)", [t2]), number: _sqlstring2.default.format("dynamicType(??) in (?) and ??", [t2, it2, t2]) }, columnType: "JSON" };
127269
127273
  if (r.type === "String") {
@@ -127285,7 +127289,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127285
127289
  if (!n7 || n7.length === 0) return { found: false };
127286
127290
  let r = n7.filter((s3) => s3.type === "bloom_filter");
127287
127291
  for (let s3 of r) {
127288
- let i2 = v2.parseTokensExpression(s3.expression);
127292
+ let i2 = P2.parseTokensExpression(s3.expression);
127289
127293
  if (i2.hasTokens && this.indexCoversColumn(i2.innerExpression, t2)) return { found: true, indexExpression: s3.expression };
127290
127294
  }
127291
127295
  return { found: false };
@@ -127301,21 +127305,21 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127301
127305
  }
127302
127306
  async getColumnForField(t2, n7) {
127303
127307
  let r = _nullishCoalesce(n7.implicitColumnExpression, () => this.implicitColumnExpression);
127304
- if (t2 === T3 && !r) throw new Error("Can not search bare text without an implicit column set.");
127305
- let s3 = t2 === T3 ? r : t2;
127306
- if (t2 === T3 && r === this.implicitColumnExpression) {
127307
- let a3 = _chunkPA2R4K2Ojs.e.call(void 0, s3);
127308
+ if (t2 === N2 && !r) throw new Error("Can not search bare text without an implicit column set.");
127309
+ let s3 = t2 === N2 ? r : t2;
127310
+ if (t2 === N2 && r === this.implicitColumnExpression) {
127311
+ let a3 = _chunkTG7NNTT3js.e.call(void 0, s3);
127308
127312
  return { column: a3.length > 1 ? `concatWithSeparator(';',${a3.join(",")})` : s3, columnJSON: void 0, propertyType: "string", found: true };
127309
127313
  }
127310
- let i2 = await this.buildColumnExpressionFromField(s3), { type: o, isArray: l } = Oe2(i2.columnType);
127314
+ let i2 = await this.buildColumnExpressionFromField(s3), { type: o, isArray: l } = qe2(i2.columnType);
127311
127315
  return { column: i2.columnExpression, columnJSON: _optionalChain([i2, "optionalAccess", (_17) => _17.columnExpressionJSON]), propertyType: _nullishCoalesce(o, () => void 0), isArray: l, found: i2.found, mapKeyIndexExpression: i2.mapKeyIndexExpression, arrayMapKeyExpression: l ? i2.arrayMapKeyExpression : void 0 };
127312
127316
  }
127313
127317
  };
127314
- async function Re2(e2, t2, n7) {
127315
- let r = e2.field[0] === "-" ? e2.field.slice(1) : e2.field, s3 = e2.field[0] === "-", i2 = e2.field === T3;
127316
- if (ke3(e2)) {
127317
- let o = e2, l = Ne2(o.term);
127318
- if (i2 && o.prefix === "-" && (s3 = true), !i2 && o.prefix === "-" && (l = o.prefix + Ne2(o.term)), o.quoted && !i2) return t2.eq(r, l, s3, n7);
127318
+ async function Ie2(e2, t2, n7) {
127319
+ let r = e2.field[0] === "-" ? e2.field.slice(1) : e2.field, s3 = e2.field[0] === "-", i2 = e2.field === N2;
127320
+ if (De2(e2)) {
127321
+ let o = e2, l = we2(o.term);
127322
+ if (i2 && o.prefix === "-" && (s3 = true), !i2 && o.prefix === "-" && (l = o.prefix + we2(o.term)), o.quoted && !i2) return t2.eq(r, l, s3, n7);
127319
127323
  if (!o.quoted && l === "*") return t2.isNotNull(r, s3, n7);
127320
127324
  if (!o.quoted && l.substring(0, 2) === ">=") return s3 ? t2.lt(r, l.slice(2), n7) : t2.gte(r, l.slice(2), n7);
127321
127325
  if (!o.quoted && l.substring(0, 2) === "<=") return s3 ? t2.gt(r, l.slice(2), n7) : t2.lte(r, l.slice(2), n7);
@@ -127330,32 +127334,32 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127330
127334
  }
127331
127335
  throw new Error(`Unexpected Node type. ${e2}`);
127332
127336
  }
127333
- function Ie2(e2, t2) {
127334
- if (t2.field && t2.parenthesized && t2.field !== T3) {
127337
+ function Oe2(e2, t2) {
127338
+ if (t2.field && t2.parenthesized && t2.field !== N2) {
127335
127339
  let n7 = _optionalChain([t2, "access", (_18) => _18.field, "optionalAccess", (_19) => _19.startsWith, "call", (_20) => _20("-")]) ? t2.field.slice(1) : t2.field;
127336
- return { ...e2, implicitColumnExpression: n7, ...se2(t2) ? { isNegatedAndParenthesized: true } : {} };
127340
+ return { ...e2, implicitColumnExpression: n7, ...le2(t2) ? { isNegatedAndParenthesized: true } : {} };
127337
127341
  } else return e2;
127338
127342
  }
127339
- function se2(e2) {
127343
+ function le2(e2) {
127340
127344
  return e2.parenthesized && _optionalChain([e2, "access", (_21) => _21.field, "optionalAccess", (_22) => _22.startsWith, "call", (_23) => _23("-")]);
127341
127345
  }
127342
- async function W2(e2, t2, n7) {
127343
- if (ke3(e2)) return await Re2(e2, t2, n7);
127344
- if (Me2(e2)) return await Re2(e2, t2, n7);
127346
+ async function U2(e2, t2, n7) {
127347
+ if (De2(e2)) return await Ie2(e2, t2, n7);
127348
+ if (Me2(e2)) return await Ie2(e2, t2, n7);
127345
127349
  if (tt2(e2)) {
127346
- let r = e2, s3 = t2.operator(r.operator, n7), i2 = r.parenthesized, o = Ie2(n7, r);
127347
- return `${se2(r) ? "NOT " : ""}${i2 ? "(" : ""}${rt2(r) ? `${r.start} ` : ""}${await W2(r.left, t2, o)} ${s3} ${await W2(r.right, t2, o)}${i2 ? ")" : ""}`;
127350
+ let r = e2, s3 = t2.operator(r.operator, n7), i2 = r.parenthesized, o = Oe2(n7, r);
127351
+ return `${le2(r) ? "NOT " : ""}${i2 ? "(" : ""}${rt2(r) ? `${r.start} ` : ""}${await U2(r.left, t2, o)} ${s3} ${await U2(r.right, t2, o)}${i2 ? ")" : ""}`;
127348
127352
  }
127349
127353
  if (nt2(e2)) {
127350
- let r = e2, s3 = r.parenthesized, i2 = Ie2(n7, r);
127351
- return `${se2(r) ? "NOT " : ""}${s3 ? "(" : ""}${r.start != null ? `${r.start} ` : ""}${await W2(r.left, t2, i2)}${s3 ? ")" : ""}`;
127354
+ let r = e2, s3 = r.parenthesized, i2 = Oe2(n7, r);
127355
+ return `${le2(r) ? "NOT " : ""}${s3 ? "(" : ""}${r.start != null ? `${r.start} ` : ""}${await U2(r.left, t2, i2)}${s3 ? ")" : ""}`;
127352
127356
  }
127353
127357
  return "";
127354
127358
  }
127355
127359
  async function st2(e2, t2) {
127356
- return await W2(e2, t2, {});
127360
+ return await U2(e2, t2, {});
127357
127361
  }
127358
- var z2 = class {
127362
+ var j2 = class {
127359
127363
  constructor(t2, n7) {
127360
127364
  this.conditions = [], this.searchQ = t2, this.serializer = n7;
127361
127365
  }
@@ -127367,7 +127371,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127367
127371
  }
127368
127372
  async genSearchQuery() {
127369
127373
  if (!this.searchQ) return "";
127370
- let t2 = qe2(this.searchQ);
127374
+ let t2 = ke3(this.searchQ);
127371
127375
  return await st2(t2, this.serializer);
127372
127376
  }
127373
127377
  and(t2) {
@@ -127380,31 +127384,31 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127380
127384
  };
127381
127385
  async function Ht2({ query: e2, metadata: t2, tableConnection: n7 }) {
127382
127386
  try {
127383
- let { tableName: r, databaseName: s3, connectionId: i2 } = n7, o = qe2(e2);
127387
+ let { tableName: r, databaseName: s3, connectionId: i2 } = n7, o = ke3(e2);
127384
127388
  if (o) {
127385
- let l = new ne2({ metadata: t2, tableName: r, databaseName: s3, connectionId: i2 });
127386
- return await W2(o, l, {});
127389
+ let l = new ae2({ metadata: t2, tableName: r, databaseName: s3, connectionId: i2 });
127390
+ return await U2(o, l, {});
127387
127391
  }
127388
127392
  } catch (r) {
127389
127393
  console.warn("Parse failure", e2, r);
127390
127394
  }
127391
127395
  return `Message containing ${e2}`;
127392
127396
  }
127393
- function oe2(e2, t2) {
127397
+ function ce2(e2, t2) {
127394
127398
  return t2 || _sqlstring2.default.format("MetricName = ?", [e2]);
127395
127399
  }
127396
127400
  var lt2 = "TimeUnix";
127397
127401
  var ut2 = exports.b = "__hdx_time_bucket";
127398
- function le2(e2) {
127402
+ function me2(e2) {
127399
127403
  return e2.groupBy != null && e2.groupBy.length > 0;
127400
127404
  }
127401
- function Y3(e2) {
127405
+ function Z(e2) {
127402
127406
  return e2.timestampValueExpression != null && e2.granularity != null;
127403
127407
  }
127404
- var ue2 = (e2) => e2.metricTables != null;
127405
- var Ue2 = exports.f = (e2) => Array.isArray(e2.select) && ue2(e2) ? { ...e2, select: e2.select.map((t2) => ({ ...t2, alias: t2.alias || (t2.isDelta ? `${t2.aggFn}(delta(${t2.metricName}))` : `${t2.aggFn}(${t2.metricName})`) })) } : e2;
127406
- var Be2 = exports.g = (e2) => {
127407
- if (_chunkXSPFZE62js.b.call(void 0, e2) && ue2(e2) && Array.isArray(e2.select)) {
127408
+ var pe2 = (e2) => e2.metricTables != null;
127409
+ var Be2 = exports.f = (e2) => Array.isArray(e2.select) && pe2(e2) ? { ...e2, select: e2.select.map((t2) => ({ ...t2, alias: t2.alias || (t2.isDelta ? `${t2.aggFn}(delta(${t2.metricName}))` : `${t2.aggFn}(${t2.metricName})`) })) } : e2;
127410
+ var Pe2 = exports.g = (e2) => {
127411
+ if (_chunkXSPFZE62js.b.call(void 0, e2) && pe2(e2) && Array.isArray(e2.select)) {
127408
127412
  let t2 = [];
127409
127413
  for (let n7 of e2.select) t2.push({ ...e2, select: [n7] });
127410
127414
  return t2;
@@ -127416,15 +127420,15 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127416
127420
  function xr(e2) {
127417
127421
  return { ...e2, operator: ct2[e2.operator] };
127418
127422
  }
127419
- function U2(e2) {
127423
+ function H4(e2) {
127420
127424
  return e2 != null && e2.trim() != "";
127421
127425
  }
127422
- function Pe2(e2) {
127426
+ function G3(e2) {
127423
127427
  return _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_24) => _24.some, "call", (_25) => _25((t2) => t2.isSubquery !== false)]), () => false);
127424
127428
  }
127425
127429
  var He2 = ({ materializedFields: e2, rawSQL: t2 }) => {
127426
127430
  try {
127427
- let [n7] = _chunkPA2R4K2Ojs.C.call(void 0, t2), r = new ve2.Parser(), s3 = r.astify(n7, { database: "Postgresql" }), i2 = (o) => {
127431
+ let [n7] = _chunkTG7NNTT3js.C.call(void 0, t2), r = new Ue2.Parser(), s3 = r.astify(n7, { database: "Postgresql" }), i2 = (o) => {
127428
127432
  if (o == null) return;
127429
127433
  let l;
127430
127434
  switch (o.type) {
@@ -127467,8 +127471,8 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127467
127471
  return t2;
127468
127472
  }
127469
127473
  };
127470
- var We2 = ({ fn: e2, expr: t2, level: n7, where: r, sampleWeightExpression: s3 }) => {
127471
- let i2 = e2 === "any", o = e2 === "none", l = e2.startsWith("count"), a3 = U2(r), u2 = { UNSAFE_RAW_SQL: i2 || o ? `${t2}` : `toFloat64OrDefault(toString(${t2}))` }, m3 = `${r} AND ${u2.UNSAFE_RAW_SQL} IS NOT NULL`;
127474
+ var Le2 = ({ fn: e2, expr: t2, level: n7, where: r, sampleWeightExpression: s3 }) => {
127475
+ let i2 = e2 === "any", o = e2 === "none", l = e2.startsWith("count"), a3 = H4(r), u2 = { UNSAFE_RAW_SQL: i2 || o ? `${t2}` : `toFloat64OrDefault(toString(${t2}))` }, m3 = `${r} AND ${u2.UNSAFE_RAW_SQL} IS NOT NULL`;
127472
127476
  if (e2.endsWith("Merge")) {
127473
127477
  let p = c3`${{ UNSAFE_RAW_SQL: _nullishCoalesce(t2, () => "") }}`, h3 = n7 && (e2.startsWith("quantile") || e2.startsWith("histogram")) ? c3`(${{ UNSAFE_RAW_SQL: Number.isFinite(n7) ? `${n7}` : "0" }})` : [];
127474
127478
  return a3 ? c3`${e2}If${h3}(${p}, ${{ UNSAFE_RAW_SQL: m3 }})` : c3`${e2}${h3}(${p})`;
@@ -127506,16 +127510,16 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127506
127510
  )`;
127507
127511
  throw new Error("Column is required for all non-count aggregation functions");
127508
127512
  };
127509
- async function K3(e2, t2, n7) {
127513
+ async function X3(e2, t2, n7) {
127510
127514
  if (typeof e2 == "string") return c3`${{ UNSAFE_RAW_SQL: e2 }}`;
127511
127515
  let r;
127512
127516
  try {
127513
- r = Pe2(t2.with) || !t2.from.databaseName ? void 0 : await n7.getMaterializedColumnsLookupTable({ connectionId: t2.connection, databaseName: t2.from.databaseName, tableName: t2.from.tableName });
127517
+ r = G3(t2.with) || !t2.from.databaseName ? void 0 : await n7.getMaterializedColumnsLookupTable({ connectionId: t2.connection, databaseName: t2.from.databaseName, tableName: t2.from.tableName });
127514
127518
  } catch (e3) {
127515
127519
  }
127516
127520
  let s3 = t2.seriesReturnType === "ratio" && e2.length === 2, i2 = await Promise.all(e2.map(async (o) => {
127517
- let l = await F2({ condition: _nullishCoalesce(o.aggCondition, () => ""), from: t2.from, language: _nullishCoalesce(o.aggConditionLanguage, () => "lucene"), implicitColumnExpression: t2.implicitColumnExpression, metadata: n7, connectionId: t2.connection, with: t2.with }), a3;
127518
- o.aggFn == null ? a3 = o.valueExpressionLanguage === "lucene" ? await F2({ condition: o.valueExpression, from: t2.from, language: "lucene", implicitColumnExpression: t2.implicitColumnExpression, metadata: n7, connectionId: t2.connection, with: t2.with }) : c3`${{ UNSAFE_RAW_SQL: o.valueExpression }}` : o.aggFn.startsWith("quantile") || o.aggFn.startsWith("histogram") ? a3 = We2({ fn: o.aggFn, expr: o.valueExpression, level: o.level, where: l.sql, sampleWeightExpression: t2.sampleWeightExpression }) : a3 = We2({ fn: o.aggFn, expr: o.valueExpression, where: l.sql, sampleWeightExpression: t2.sampleWeightExpression });
127521
+ let l = await M4({ condition: _nullishCoalesce(o.aggCondition, () => ""), from: t2.from, language: _nullishCoalesce(o.aggConditionLanguage, () => "lucene"), implicitColumnExpression: t2.implicitColumnExpression, metadata: n7, connectionId: t2.connection, with: t2.with }), a3;
127522
+ o.aggFn == null ? a3 = o.valueExpressionLanguage === "lucene" ? await M4({ condition: o.valueExpression, from: t2.from, language: "lucene", implicitColumnExpression: t2.implicitColumnExpression, metadata: n7, connectionId: t2.connection, with: t2.with }) : c3`${{ UNSAFE_RAW_SQL: o.valueExpression }}` : o.aggFn.startsWith("quantile") || o.aggFn.startsWith("histogram") ? a3 = Le2({ fn: o.aggFn, expr: o.valueExpression, level: o.level, where: l.sql, sampleWeightExpression: t2.sampleWeightExpression }) : a3 = Le2({ fn: o.aggFn, expr: o.valueExpression, where: l.sql, sampleWeightExpression: t2.sampleWeightExpression });
127519
127523
  let u2 = `SELECT ${a3.sql} FROM \`t\``;
127520
127524
  return r && (a3.sql = He2({ materializedFields: r, rawSQL: u2 }).replace(/^SELECT\s+/i, "").replace(/\s+FROM `t`$/i, "")), c3`${a3}${o.alias != null && o.alias.trim() !== "" ? c3` AS "${{ UNSAFE_RAW_SQL: o.alias }}"` : []}`;
127521
127525
  }));
@@ -127524,8 +127528,8 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127524
127528
  function mt2(e2) {
127525
127529
  return typeof e2 == "string" ? c3`${{ UNSAFE_RAW_SQL: e2 }}` : e2.map((t2) => c3`${{ UNSAFE_RAW_SQL: t2.valueExpression }} ${t2.ordering === "DESC" ? "DESC" : "ASC"}`);
127526
127530
  }
127527
- function M4({ interval: e2, timestampValueExpression: t2, dateRange: n7, alias: r = ut2 }) {
127528
- let s3 = { UNSAFE_RAW_SQL: _chunkPA2R4K2Ojs.f.call(void 0, t2) }, i2 = { UNSAFE_RAW_SQL: e2 === "auto" && Array.isArray(n7) ? _chunkPA2R4K2Ojs.l.call(void 0, n7) : e2 };
127531
+ function D3({ interval: e2, timestampValueExpression: t2, dateRange: n7, alias: r = ut2 }) {
127532
+ let s3 = { UNSAFE_RAW_SQL: _chunkTG7NNTT3js.f.call(void 0, t2) }, i2 = { UNSAFE_RAW_SQL: e2 === "auto" && Array.isArray(n7) ? _chunkTG7NNTT3js.l.call(void 0, n7) : e2 };
127529
127533
  return c3`toStartOfInterval(toDateTime(${s3}), INTERVAL ${i2}) AS \`${{ UNSAFE_RAW_SQL: r }}\``;
127530
127534
  }
127531
127535
  async function pt2({ connectionId: e2, databaseName: t2, dateRange: n7, dateRangeEndInclusive: r, dateRangeStartInclusive: s3, includedDataInterval: i2, metadata: o, tableName: l, timestampValueExpression: a3, with: u2 }) {
@@ -127533,65 +127537,65 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127533
127537
  try {
127534
127538
  if (t2 && l && e2) {
127535
127539
  let S3 = await o.getTableMetadata({ databaseName: t2, tableName: l, connectionId: e2 });
127536
- g = _chunkPA2R4K2Ojs.z.call(void 0, a3, _optionalChain([S3, "optionalAccess", (_61) => _61.primary_key]));
127540
+ g = _chunkTG7NNTT3js.z.call(void 0, a3, _optionalChain([S3, "optionalAccess", (_61) => _61.primary_key]));
127537
127541
  }
127538
127542
  } catch (S3) {
127539
127543
  console.warn("Failed to optimize timestampValueExpression", S3);
127540
127544
  }
127541
- let h3 = _chunkPA2R4K2Ojs.e.call(void 0, g), y3 = await Promise.all(h3.map(async (S3) => {
127542
- let f = S3.trim(), _2 = _chunkPA2R4K2Ojs.y.call(void 0, f), C2 = _optionalChain([u2, "optionalAccess", (_62) => _62.length]) || _2 ? null : await o.getColumn({ databaseName: t2, tableName: l, column: f, connectionId: e2 }), A2 = { UNSAFE_RAW_SQL: f };
127543
- C2 == null && !_optionalChain([u2, "optionalAccess", (_63) => _63.length]) && !_2 && console.warn(`Column ${f} not found in ${t2}.${l} while inferring type for time filter`);
127544
- let N2 = i2 ? c3`toStartOfInterval(fromUnixTimestamp64Milli(${{ Int64: m3 }}), INTERVAL ${i2}) - INTERVAL ${i2}` : _2 ? c3`${_2.function}(fromUnixTimestamp64Milli(${{ Int64: m3 }})${_2.formattedRemainingArgs})` : c3`fromUnixTimestamp64Milli(${{ Int64: m3 }})`, I3 = i2 ? c3`toStartOfInterval(fromUnixTimestamp64Milli(${{ Int64: p }}), INTERVAL ${i2}) + INTERVAL ${i2}` : _2 ? c3`${_2.function}(fromUnixTimestamp64Milli(${{ Int64: p }})${_2.formattedRemainingArgs})` : c3`fromUnixTimestamp64Milli(${{ Int64: p }})`, b2 = s3 || _2 ? ">=" : ">", P2 = r || _2 ? "<=" : "<";
127545
- return _optionalChain([C2, "optionalAccess", (_64) => _64.type]) === "Date" ? c3`(${A2} ${b2} toDate(${N2}) AND ${A2} ${P2} toDate(${I3}))` : c3`(${A2} ${b2} ${N2} AND ${A2} ${P2} ${I3})`;
127545
+ let h3 = _chunkTG7NNTT3js.e.call(void 0, g), y3 = await Promise.all(h3.map(async (S3) => {
127546
+ let f = S3.trim(), _2 = _chunkTG7NNTT3js.y.call(void 0, f), A2 = /^toDate\s*\(/.test(f), C2 = G3(u2) || _2 || A2 ? null : await o.getColumn({ databaseName: t2, tableName: l, column: f, connectionId: e2 }), b2 = { UNSAFE_RAW_SQL: f };
127547
+ C2 == null && G3(u2) && !_2 && !A2 && console.warn(`Column ${f} not found in ${t2}.${l} while inferring type for time filter`);
127548
+ let I3 = i2 ? c3`toStartOfInterval(fromUnixTimestamp64Milli(${{ Int64: m3 }}), INTERVAL ${i2}) - INTERVAL ${i2}` : _2 ? c3`${_2.function}(fromUnixTimestamp64Milli(${{ Int64: m3 }})${_2.formattedRemainingArgs})` : c3`fromUnixTimestamp64Milli(${{ Int64: m3 }})`, T3 = i2 ? c3`toStartOfInterval(fromUnixTimestamp64Milli(${{ Int64: p }}), INTERVAL ${i2}) + INTERVAL ${i2}` : _2 ? c3`${_2.function}(fromUnixTimestamp64Milli(${{ Int64: p }})${_2.formattedRemainingArgs})` : c3`fromUnixTimestamp64Milli(${{ Int64: p }})`, F2 = _optionalChain([C2, "optionalAccess", (_62) => _62.type]) === "Date" || A2, W2 = s3 || _2 || F2 ? ">=" : ">", L3 = r || _2 || F2 ? "<=" : "<";
127549
+ return F2 ? c3`(${b2} ${W2} toDate(${I3}) AND ${b2} ${L3} toDate(${T3}))` : c3`(${b2} ${W2} ${I3} AND ${b2} ${L3} ${T3})`;
127546
127550
  }));
127547
127551
  return E2("AND", ...y3);
127548
127552
  }
127549
127553
  async function gt2(e2, t2) {
127550
- let n7 = Y3(e2), r = le2(e2);
127551
- return E2(",", await K3(e2.select, e2, t2), r && e2.selectGroupBy !== false ? await K3(e2.groupBy, e2, t2) : [], n7 ? M4({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : []);
127554
+ let n7 = Z(e2), r = me2(e2);
127555
+ return E2(",", await X3(e2.select, e2, t2), r && e2.selectGroupBy !== false ? await X3(e2.groupBy, e2, t2) : [], n7 ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : []);
127552
127556
  }
127553
- function V2({ from: e2 }) {
127557
+ function K3({ from: e2 }) {
127554
127558
  return E2(".", c3`${e2.databaseName === "" ? "" : { Identifier: e2.databaseName }}`, c3`${{ Identifier: e2.tableName }}`);
127555
127559
  }
127556
127560
  async function Qe2({ condition: e2, language: t2, metadata: n7, from: r, implicitColumnExpression: s3, connectionId: i2, with: o }) {
127557
127561
  let l = e2;
127558
127562
  if (t2 === "lucene") {
127559
- let p = new J({ metadata: n7, databaseName: r.databaseName, tableName: r.tableName, implicitColumnExpression: s3, connectionId: i2 });
127560
- l = await new z2(e2, p).build();
127563
+ let p = new V2({ metadata: n7, databaseName: r.databaseName, tableName: r.tableName, implicitColumnExpression: s3, connectionId: i2 });
127564
+ l = await new j2(e2, p).build();
127561
127565
  }
127562
127566
  let a3;
127563
127567
  try {
127564
- a3 = Pe2(o) || !r.databaseName ? void 0 : await n7.getMaterializedColumnsLookupTable({ connectionId: i2, databaseName: r.databaseName, tableName: r.tableName });
127568
+ a3 = G3(o) || !r.databaseName ? void 0 : await n7.getMaterializedColumnsLookupTable({ connectionId: i2, databaseName: r.databaseName, tableName: r.tableName });
127565
127569
  } catch (e4) {
127566
127570
  }
127567
127571
  let u2 = "SELECT * FROM `t` WHERE ", m3 = `${u2}${l}`;
127568
127572
  return a3 && (l = He2({ materializedFields: a3, rawSQL: m3 }).replace(u2, "")), l;
127569
127573
  }
127570
- async function F2(e2) {
127574
+ async function M4(e2) {
127571
127575
  let t2 = await Qe2(e2);
127572
127576
  return c3`${{ UNSAFE_RAW_SQL: t2 }}`;
127573
127577
  }
127574
- async function j2(e2, t2) {
127578
+ async function Y3(e2, t2) {
127575
127579
  let n7 = [];
127576
- U2(e2.where) && (n7 = k3(await F2({ condition: e2.where, from: e2.from, language: _nullishCoalesce(e2.whereLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }), "(", ")"));
127580
+ H4(e2.where) && (n7 = k3(await M4({ condition: e2.where, from: e2.from, language: _nullishCoalesce(e2.whereLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }), "(", ")"));
127577
127581
  let r = [];
127578
- typeof e2.select != "string" && e2.select.every((i2) => U2(i2.aggCondition)) && (r = (await Promise.all(e2.select.map(async (i2) => U2(i2.aggCondition) ? await F2({ condition: i2.aggCondition, from: e2.from, language: _nullishCoalesce(i2.aggConditionLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }) : null))).filter((i2) => i2 !== null));
127582
+ typeof e2.select != "string" && e2.select.every((i2) => H4(i2.aggCondition)) && (r = (await Promise.all(e2.select.map(async (i2) => H4(i2.aggCondition) ? await M4({ condition: i2.aggCondition, from: e2.from, language: _nullishCoalesce(i2.aggConditionLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }) : null))).filter((i2) => i2 !== null));
127579
127583
  let s3 = await Promise.all(_nullishCoalesce(e2.filters, () => []).map(async (i2) => {
127580
127584
  if (i2.type === "sql_ast") return k3(c3`${{ UNSAFE_RAW_SQL: i2.left }} ${i2.operator} ${{ UNSAFE_RAW_SQL: i2.right }}`, "(", ")");
127581
- if (i2.type === "lucene" || i2.type === "sql") return k3(await F2({ condition: i2.condition, from: e2.from, language: i2.type, implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }), "(", ")");
127585
+ if (i2.type === "lucene" || i2.type === "sql") return k3(await M4({ condition: i2.condition, from: e2.from, language: i2.type, implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with }), "(", ")");
127582
127586
  throw new Error(`Unknown filter type: ${i2.type}`);
127583
127587
  }));
127584
127588
  return E2(" AND ", e2.dateRange != null && e2.timestampValueExpression != null ? await pt2({ timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange, dateRangeStartInclusive: _nullishCoalesce(e2.dateRangeStartInclusive, () => true), dateRangeEndInclusive: _nullishCoalesce(e2.dateRangeEndInclusive, () => true), metadata: t2, connectionId: e2.connection, databaseName: e2.from.databaseName, tableName: e2.from.tableName, with: e2.with, includedDataInterval: e2.includedDataInterval }) : [], n7, k3(E2(" OR ", r), "(", ")"), k3(E2(e2.filtersLogicalOperator === "OR" ? " OR " : " AND ", ...s3), "(", ")"));
127585
127589
  }
127586
127590
  async function dt2(e2, t2) {
127587
- return E2(",", le2(e2) ? await K3(e2.groupBy, e2, t2) : [], Y3(e2) ? M4({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : []);
127591
+ return E2(",", me2(e2) ? await X3(e2.groupBy, e2, t2) : [], Z(e2) ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : []);
127588
127592
  }
127589
127593
  async function ht2(e2, t2) {
127590
- if (U2(e2.having)) return await F2({ condition: e2.having, from: e2.from, language: _nullishCoalesce(e2.havingLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with });
127594
+ if (H4(e2.having)) return await M4({ condition: e2.having, from: e2.from, language: _nullishCoalesce(e2.havingLanguage, () => "sql"), implicitColumnExpression: e2.implicitColumnExpression, metadata: t2, connectionId: e2.connection, with: e2.with });
127591
127595
  }
127592
127596
  function yt2(e2) {
127593
- let t2 = Y3(e2);
127594
- if (!(e2.orderBy == null && !t2)) return E2(",", t2 ? M4({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : [], e2.orderBy != null ? mt2(e2.orderBy) : []);
127597
+ let t2 = Z(e2);
127598
+ if (!(e2.orderBy == null && !t2)) return E2(",", t2 ? D3({ interval: e2.granularity, timestampValueExpression: e2.timestampValueExpression, dateRange: e2.dateRange }) : [], e2.orderBy != null ? mt2(e2.orderBy) : []);
127595
127599
  }
127596
127600
  function ft2(e2) {
127597
127601
  if (e2.limit == null || e2.limit.limit == null) return;
@@ -127599,7 +127603,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127599
127603
  return c3`${{ Int32: e2.limit.limit }}${t2}`;
127600
127604
  }
127601
127605
  function St2(e2, t2) {
127602
- let n7 = _chunkPA2R4K2Ojs.E.call(void 0, t2);
127606
+ let n7 = _chunkTG7NNTT3js.E.call(void 0, t2);
127603
127607
  return E2(", ", [c3`${_nullishCoalesce(e2.settings, () => "")}`, c3`${_nullishCoalesce(n7, () => "")}`]);
127604
127608
  }
127605
127609
  async function _t2(e2, t2, n7) {
@@ -127608,14 +127612,14 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127608
127612
  let { sql: i2, chartConfig: o } = s3;
127609
127613
  if (i2 && o) throw new Error("cannot specify both 'sql' and 'chartConfig' in with clause");
127610
127614
  if (!(i2 || o)) throw new Error("must specify either 'sql' or 'chartConfig' in with clause");
127611
- if (i2 && !_chunk3BJ55V2Fjs.q.safeParse(i2).success) throw new Error("non-conforming sql object in CTE");
127612
- if (o && !_chunk3BJ55V2Fjs.R.safeParse(o).success) throw new Error(`non-conforming chartConfig object in CTE: ${_chunk3BJ55V2Fjs.R.safeParse(o).error}`);
127615
+ if (i2 && !_chunkJHY6DL4Pjs.q.safeParse(i2).success) throw new Error("non-conforming sql object in CTE");
127616
+ if (o && !_chunkJHY6DL4Pjs.S.safeParse(o).success) throw new Error(`non-conforming chartConfig object in CTE: ${_chunkJHY6DL4Pjs.S.safeParse(o).error}`);
127613
127617
  let l = i2 || await w2(o, t2, n7);
127614
127618
  return s3.isSubquery === false ? c3`(${l}) AS ${{ Identifier: s3.name }}` : c3`${s3.name} AS (${l})`;
127615
127619
  })));
127616
127620
  }
127617
127621
  function Et2(e2, t2) {
127618
- let n7 = e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkPA2R4K2Ojs.l.call(void 0, e2.dateRange) : e2.granularity, r = _chunkPA2R4K2Ojs.m.call(void 0, _nullishCoalesce(n7, () => "")), s3 = `(argMax(${t2}, ${e2.timestampValueExpression}) - argMin(${t2}, ${e2.timestampValueExpression}))`, i2 = `date_diff('second', min(toDateTime(${e2.timestampValueExpression})), max(toDateTime(${e2.timestampValueExpression})))`;
127622
+ let n7 = e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkTG7NNTT3js.l.call(void 0, e2.dateRange) : e2.granularity, r = _chunkTG7NNTT3js.m.call(void 0, _nullishCoalesce(n7, () => "")), s3 = `(argMax(${t2}, ${e2.timestampValueExpression}) - argMin(${t2}, ${e2.timestampValueExpression}))`, i2 = `date_diff('second', min(toDateTime(${e2.timestampValueExpression})), max(toDateTime(${e2.timestampValueExpression})))`;
127619
127623
  return `IF(${i2} > 0, ${s3} * ${r} / ${i2}, 0)`;
127620
127624
  }
127621
127625
  async function xt2(e2, t2) {
@@ -127625,12 +127629,12 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127625
127629
  if (!r || !Array.isArray(r)) throw new Error("multi select or string select on metrics not supported");
127626
127630
  let { metricType: a3, metricName: u2, metricNameSql: m3, ...p } = r[0];
127627
127631
  if (a3 === "gauge" && u2 && "gauge" in n7 && n7.gauge) {
127628
- let g = "__hdx_time_bucket2", h3 = M4({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || lt2, dateRange: e2.dateRange, alias: g }), y3 = await j2({ ...e2, from: { ...s3, tableName: n7.gauge }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: oe2(u2, m3) }] }, t2), S3 = p.isDelta ? Et2(e2, "Value") : "last_value(Value)";
127632
+ let g = "__hdx_time_bucket2", h3 = D3({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || lt2, dateRange: e2.dateRange, alias: g }), y3 = await Y3({ ...e2, from: { ...s3, tableName: n7.gauge }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }] }, t2), S3 = p.isDelta ? Et2(e2, "Value") : "last_value(Value)";
127629
127633
  return { ...l, with: [{ name: "Source", sql: c3`
127630
127634
  SELECT
127631
127635
  *,
127632
127636
  cityHash64(mapConcat(ScopeAttributes, ResourceAttributes, Attributes)) AS AttributesHash
127633
- FROM ${V2({ from: { ...s3, tableName: n7.gauge } })}
127637
+ FROM ${K3({ from: { ...s3, tableName: n7.gauge } })}
127634
127638
  WHERE ${y3}
127635
127639
  ` }, { name: "Bucketed", sql: c3`
127636
127640
  SELECT
@@ -127655,7 +127659,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127655
127659
  ORDER BY AttributesHash, ${g}
127656
127660
  ` }], select: [{ ...p, valueExpression: "LastValue", aggCondition: "" }], from: { databaseName: "", tableName: "Bucketed" }, where: "", timestampValueExpression: g, settings: c3`short_circuit_function_evaluation = 'force_enable'` };
127657
127661
  } else if (a3 === "sum" && u2 && "sum" in n7 && n7.sum) {
127658
- let g = "__hdx_time_bucket2", h3 = "`__hdx_value_high`", y3 = "`__hdx_value_high_prev`", S3 = M4({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || "TimeUnix", dateRange: e2.dateRange, alias: g }), f = await j2({ ...e2, from: { ...s3, tableName: n7.sum }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: oe2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkPA2R4K2Ojs.l.call(void 0, e2.dateRange) : e2.granularity }, t2);
127662
+ let g = "__hdx_time_bucket2", h3 = "`__hdx_value_high`", y3 = "`__hdx_value_high_prev`", S3 = D3({ interval: e2.granularity || "auto", timestampValueExpression: e2.timestampValueExpression || "TimeUnix", dateRange: e2.dateRange, alias: g }), f = await Y3({ ...e2, from: { ...s3, tableName: n7.sum }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkTG7NNTT3js.l.call(void 0, e2.dateRange) : e2.granularity }, t2);
127659
127663
  return { ...l, with: [{ name: "Source", sql: c3`
127660
127664
  SELECT
127661
127665
  *,
@@ -127668,7 +127672,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127668
127672
  )
127669
127673
  ) AS Rate,
127670
127674
  IF(AggregationTemporality = 1, Rate, Value) AS Sum
127671
- FROM ${V2({ from: { ...s3, tableName: n7.sum } })}
127675
+ FROM ${K3({ from: { ...s3, tableName: n7.sum } })}
127672
127676
  WHERE ${f}` }, { name: "Bucketed", sql: c3`
127673
127677
  SELECT
127674
127678
  ${S3},
@@ -127698,13 +127702,13 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127698
127702
  ORDER BY AttributesHash, \`${g}\`
127699
127703
  ` }], select: [p.aggFn ? { alias: "Value", ...p, valueExpression: "Rate", aggCondition: "" } : { alias: "Value", ...p, valueExpression: "last_value(Sum)", aggCondition: "" }], from: { databaseName: "", tableName: "Bucketed" }, where: "", timestampValueExpression: `\`${g}\`` };
127700
127704
  } else if (a3 === "histogram" && u2 && "histogram" in n7 && n7.histogram) {
127701
- let { alias: g } = p, h3 = g || "Value", y3 = { ...e2, from: { ...s3, tableName: n7.histogram }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: oe2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkPA2R4K2Ojs.l.call(void 0, e2.dateRange) : e2.granularity }, S3 = Y3(y3) ? M4({ interval: y3.granularity, timestampValueExpression: y3.timestampValueExpression, dateRange: y3.dateRange }) : c3``, f = await j2(y3, t2), _2;
127702
- return le2(e2) && (_2 = E2(",", await K3(e2.groupBy, e2, t2))), { ...l, with: Le2({ select: p, timeBucketSelect: S3.sql ? c3`${S3}` : "TimeUnix AS `__hdx_time_bucket`", groupBy: _2, from: V2({ from: { ...s3, tableName: n7.histogram } }), where: f, valueAlias: h3 }), select: `\`__hdx_time_bucket\`${_2 ? ", group" : ""}, "${h3}"`, from: { databaseName: "", tableName: "metrics" }, where: "", groupBy: void 0, granularity: void 0, timestampValueExpression: "`__hdx_time_bucket`", settings: c3`short_circuit_function_evaluation = 'force_enable'` };
127705
+ let { alias: g } = p, h3 = g || "Value", y3 = { ...e2, from: { ...s3, tableName: n7.histogram }, filters: [..._nullishCoalesce(i2, () => []), { type: "sql", condition: ce2(u2, m3) }], includedDataInterval: e2.granularity === "auto" && Array.isArray(e2.dateRange) ? _chunkTG7NNTT3js.l.call(void 0, e2.dateRange) : e2.granularity }, S3 = Z(y3) ? D3({ interval: y3.granularity, timestampValueExpression: y3.timestampValueExpression, dateRange: y3.dateRange }) : c3``, f = await Y3(y3, t2), _2;
127706
+ return me2(e2) && (_2 = E2(",", await X3(e2.groupBy, e2, t2))), { ...l, with: ve2({ select: p, timeBucketSelect: S3.sql ? c3`${S3}` : "TimeUnix AS `__hdx_time_bucket`", groupBy: _2, from: K3({ from: { ...s3, tableName: n7.histogram } }), where: f, valueAlias: h3 }), select: `\`__hdx_time_bucket\`${_2 ? ", group" : ""}, "${h3}"`, from: { databaseName: "", tableName: "metrics" }, where: "", groupBy: void 0, granularity: void 0, timestampValueExpression: "`__hdx_time_bucket`", settings: c3`short_circuit_function_evaluation = 'force_enable'` };
127703
127707
  }
127704
127708
  throw new Error(`no query support for metric type=${a3}`);
127705
127709
  }
127706
127710
  async function $t(e2, t2) {
127707
- if (!_optionalChain([e2, "access", (_65) => _65.filters, "optionalAccess", (_66) => _66.length]) || !e2.source || !e2.from) return;
127711
+ if (!_optionalChain([e2, "access", (_63) => _63.filters, "optionalAccess", (_64) => _64.length]) || !e2.source || !e2.from) return;
127708
127712
  let n7 = (await Promise.all(e2.filters.map(async (r) => {
127709
127713
  let s3 = e2.from && e2.from.tableName && e2.source;
127710
127714
  if (r.type === "sql_ast") return `(${r.left} ${r.operator} ${r.right})`;
@@ -127717,17 +127721,17 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127717
127721
  return n7.length > 0 ? `(${n7.join(" AND ")})` : void 0;
127718
127722
  }
127719
127723
  async function At2(e2, t2) {
127720
- let n7 = _nullishCoalesce(e2.displayType, () => "table"), r = await $t(e2, t2), s3 = _chunk4NHZLI4Njs.b.call(void 0, e2, r), i2 = _chunkLDDGQDAHjs.b[n7];
127724
+ let n7 = _nullishCoalesce(e2.displayType, () => "table"), r = await $t(e2, t2), s3 = _chunkWX4KZTVEjs.b.call(void 0, e2, r), i2 = _chunkAK5NJJI2js.b[n7];
127721
127725
  return { sql: s3, params: Object.fromEntries(i2.map((o) => [o.name, o.get(e2)])) };
127722
127726
  }
127723
127727
  async function w2(e2, t2, n7) {
127724
127728
  if (_chunkXSPFZE62js.a.call(void 0, e2)) return At2(e2, t2);
127725
- let r = ue2(e2) ? await xt2(e2, t2) : e2, s3 = await _t2(r, t2, n7), i2 = await gt2(r, t2), o = V2(r), l = await j2(r, t2), a3 = await dt2(r, t2), u2 = await ht2(r, t2), m3 = yt2(r), p = ft2(r), g = St2(r, n7);
127726
- return E2(" ", [c3`${_optionalChain([s3, "optionalAccess", (_67) => _67.sql]) ? c3`WITH ${s3}` : ""}`, c3`SELECT ${i2}`, c3`FROM ${o}`, c3`${l.sql ? c3`WHERE ${l}` : ""}`, c3`${_optionalChain([a3, "optionalAccess", (_68) => _68.sql]) ? c3`GROUP BY ${a3}` : ""}`, c3`${_optionalChain([u2, "optionalAccess", (_69) => _69.sql]) ? c3`HAVING ${u2}` : ""}`, c3`${_optionalChain([m3, "optionalAccess", (_70) => _70.sql]) ? c3`ORDER BY ${m3}` : ""}`, c3`${_optionalChain([p, "optionalAccess", (_71) => _71.sql]) ? c3`LIMIT ${p}` : ""}`, c3`${g.sql ? c3`SETTINGS ${g}` : []}`]);
127729
+ let r = pe2(e2) ? await xt2(e2, t2) : e2, s3 = await _t2(r, t2, n7), i2 = await gt2(r, t2), o = K3(r), l = await Y3(r, t2), a3 = await dt2(r, t2), u2 = await ht2(r, t2), m3 = yt2(r), p = ft2(r), g = St2(r, n7);
127730
+ return E2(" ", [c3`${_optionalChain([s3, "optionalAccess", (_65) => _65.sql]) ? c3`WITH ${s3}` : ""}`, c3`SELECT ${i2}`, c3`FROM ${o}`, c3`${l.sql ? c3`WHERE ${l}` : ""}`, c3`${_optionalChain([a3, "optionalAccess", (_66) => _66.sql]) ? c3`GROUP BY ${a3}` : ""}`, c3`${_optionalChain([u2, "optionalAccess", (_67) => _67.sql]) ? c3`HAVING ${u2}` : ""}`, c3`${_optionalChain([m3, "optionalAccess", (_68) => _68.sql]) ? c3`ORDER BY ${m3}` : ""}`, c3`${_optionalChain([p, "optionalAccess", (_69) => _69.sql]) ? c3`LIMIT ${p}` : ""}`, c3`${g.sql ? c3`SETTINGS ${g}` : []}`]);
127727
127731
  }
127728
- var B3 = 3e6;
127732
+ var Q3 = 3e6;
127729
127733
  var Je2 = 1e3;
127730
- var ce2 = exports.n = (_class2 = class {
127734
+ var ge2 = exports.n = (_class2 = class {
127731
127735
  constructor() {
127732
127736
  _class2.prototype.__init2.call(this);
127733
127737
  _class2.prototype.__init3.call(this);
@@ -127758,7 +127762,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127758
127762
  return this.cache.set(t2, n7);
127759
127763
  }
127760
127764
  }, _class2);
127761
- var v2 = exports.o = class {
127765
+ var P2 = exports.o = class {
127762
127766
  constructor(t2, n7, r) {
127763
127767
  this.clickhouseClient = t2, this.cache = n7, r && this.cache.set("clickhouse-settings", r);
127764
127768
  }
@@ -127831,14 +127835,14 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127831
127835
  WITH sampledKeys as (
127832
127836
  SELECT ${{ Identifier: r }}.keys AS keys
127833
127837
  FROM ${R3({ database: t2, table: n7 })} ${p}
127834
- LIMIT ${{ Int32: this.getClickHouseSettings().max_rows_to_read ? Number(this.getClickHouseSettings().max_rows_to_read) : B3 }}
127838
+ LIMIT ${{ Int32: this.getClickHouseSettings().max_rows_to_read ? Number(this.getClickHouseSettings().max_rows_to_read) : Q3 }}
127835
127839
  )
127836
127840
  SELECT groupUniqArrayArray(${{ Int32: s3 }})(keys) as keysArr
127837
127841
  FROM sampledKeys` : g = c3`
127838
127842
  WITH sampledKeys as (
127839
127843
  SELECT ${{ Identifier: r }}.keys AS keysArr
127840
127844
  FROM ${R3({ database: t2, table: n7 })} ${p}
127841
- LIMIT ${{ Int32: this.getClickHouseSettings().max_rows_to_read ? Number(this.getClickHouseSettings().max_rows_to_read) : B3 }}
127845
+ LIMIT ${{ Int32: this.getClickHouseSettings().max_rows_to_read ? Number(this.getClickHouseSettings().max_rows_to_read) : Q3 }}
127842
127846
  )
127843
127847
  SELECT DISTINCT lowCardinalityKeys(arrayJoin(keysArr)) as key
127844
127848
  FROM sampledKeys
@@ -127865,34 +127869,34 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127865
127869
  WHERE value != ''
127866
127870
  LIMIT ${{ Int32: i2 }}
127867
127871
  `;
127868
- return this.cache.getOrFetch(l, async () => await this.clickhouseClient.query({ query: u2.sql, query_params: u2.params, connectionId: o, clickhouse_settings: { max_rows_to_read: String(_nullishCoalesce(this.getClickHouseSettings().max_rows_to_read, () => B3)), read_overflow_mode: "break", ...this.getClickHouseSettings() } }).then((p) => p.json()).then((p) => p.data.map((g) => g.value)));
127872
+ return this.cache.getOrFetch(l, async () => await this.clickhouseClient.query({ query: u2.sql, query_params: u2.params, connectionId: o, clickhouse_settings: { max_rows_to_read: String(_nullishCoalesce(this.getClickHouseSettings().max_rows_to_read, () => Q3)), read_overflow_mode: "break", ...this.getClickHouseSettings() } }).then((p) => p.json()).then((p) => p.data.map((g) => g.value)));
127869
127873
  }
127870
127874
  async getAllFields({ databaseName: t2, tableName: n7, connectionId: r, metricName: s3 }) {
127871
127875
  let i2 = [], o = await this.getColumns({ databaseName: t2, tableName: n7, connectionId: r });
127872
127876
  for (let a3 of o) a3.type !== "JSON" && i2.push({ path: [a3.name], type: a3.type, jsType: x3(a3.type) });
127873
- let l = _nullishCoalesce(X3(o, ["map", "json"]), () => []);
127877
+ let l = _nullishCoalesce(te2(o, ["map", "json"]), () => []);
127874
127878
  return await Promise.all(l.map(async (a3) => {
127875
127879
  if (x3(a3.type) === "json") {
127876
127880
  let g = await this.getJSONKeys({ databaseName: t2, tableName: n7, column: a3.name, connectionId: r, metricName: s3 });
127877
127881
  for (let h3 of g) i2.push({ path: [a3.name, h3.key], type: h3.chType, jsType: x3(h3.chType) });
127878
127882
  return;
127879
127883
  }
127880
- let u2 = await this.getMapKeys({ databaseName: t2, tableName: n7, column: a3.name, connectionId: r, metricName: s3 }), p = _nullishCoalesce(_optionalChain([a3, "access", (_72) => _72.type, "access", (_73) => _73.match, "call", (_74) => _74(/Map\(.+,\s*(.+)\)/), "optionalAccess", (_75) => _75[1]]), () => "String");
127884
+ let u2 = await this.getMapKeys({ databaseName: t2, tableName: n7, column: a3.name, connectionId: r, metricName: s3 }), p = _nullishCoalesce(_optionalChain([a3, "access", (_70) => _70.type, "access", (_71) => _71.match, "call", (_72) => _72(/Map\(.+,\s*(.+)\)/), "optionalAccess", (_73) => _73[1]]), () => "String");
127881
127885
  for (let g of u2) i2.push({ path: [a3.name, g], type: p, jsType: x3(p) });
127882
127886
  })), i2;
127883
127887
  }
127884
127888
  async getTableMetadata({ databaseName: t2, tableName: n7, connectionId: r }) {
127885
127889
  let s3 = await this.queryTableMetadata({ cache: this.cache, database: t2, table: n7, connectionId: r });
127886
- if (_optionalChain([s3, "optionalAccess", (_76) => _76.engine]) === "Distributed") try {
127887
- let { cluster: i2, database: o, table: l } = _nullishCoalesce(_chunkPA2R4K2Ojs.H.call(void 0, s3), () => ({}));
127890
+ if (_optionalChain([s3, "optionalAccess", (_74) => _74.engine]) === "Distributed") try {
127891
+ let { cluster: i2, database: o, table: l } = _nullishCoalesce(_chunkTG7NNTT3js.H.call(void 0, s3), () => ({}));
127888
127892
  if (!o || !l || !i2) throw new Error(`Could not parse underlying local table from Distributed table metadata: ${s3.create_table_query}`);
127889
127893
  let a3 = await this.queryTableMetadata({ cache: this.cache, database: o, table: l, cluster: i2, connectionId: r });
127890
127894
  if (!a3) throw new Error(`Could not find underlying local table metadata for Distributed table: ${o}.${l}`);
127891
- s3 = { ...s3, ..._lodash.pick.call(void 0, a3, ["engine", "engine_full", "partition_key", "sorting_key", "primary_key", "sampling_key"]), create_local_table_query: _optionalChain([a3, "optionalAccess", (_77) => _77.create_table_query]) };
127895
+ s3 = { ...s3, ..._lodash.pick.call(void 0, a3, ["engine", "engine_full", "partition_key", "sorting_key", "primary_key", "sampling_key"]), create_local_table_query: _optionalChain([a3, "optionalAccess", (_75) => _75.create_table_query]) };
127892
127896
  } catch (i2) {
127893
127897
  console.error("Failed to fetch underlying table metadata for Distributed table, using Distributed table metadata as fallback", i2);
127894
127898
  }
127895
- return _optionalChain([s3, "optionalAccess", (_78) => _78.partition_key, "access", (_79) => _79.startsWith, "call", (_80) => _80("(")]) && s3.partition_key.endsWith(")") && (s3.partition_key = s3.partition_key.slice(1, -1)), s3;
127899
+ return _optionalChain([s3, "optionalAccess", (_76) => _76.partition_key, "access", (_77) => _77.startsWith, "call", (_78) => _78("(")]) && s3.partition_key.endsWith(")") && (s3.partition_key = s3.partition_key.slice(1, -1)), s3;
127896
127900
  }
127897
127901
  async getSetting({ settingName: t2, connectionId: n7 }) {
127898
127902
  return this.cache.getOrFetch(`${n7}.${t2}`, async () => {
@@ -127928,8 +127932,8 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127928
127932
  async getSkipIndices({ databaseName: t2, tableName: n7, connectionId: r }) {
127929
127933
  return this.cache.getOrFetch(`${r}.${t2}.${n7}.skipIndices`, async () => {
127930
127934
  let s3 = await this.queryTableMetadata({ cache: this.cache, database: t2, table: n7, connectionId: r }), i2 = t2, o = n7, l;
127931
- if (_optionalChain([s3, "optionalAccess", (_81) => _81.engine]) === "Distributed") {
127932
- let a3 = _chunkPA2R4K2Ojs.H.call(void 0, s3);
127935
+ if (_optionalChain([s3, "optionalAccess", (_79) => _79.engine]) === "Distributed") {
127936
+ let a3 = _chunkTG7NNTT3js.H.call(void 0, s3);
127933
127937
  a3 ? (i2 = a3.database, o = a3.table, l = a3.cluster) : console.error(`Could not parse local table from Distributed table metadata: ${s3.create_table_query}`);
127934
127938
  }
127935
127939
  try {
@@ -127976,40 +127980,40 @@ var require_chunk_Z3GGA2U3 = __commonJS({
127976
127980
  }
127977
127981
  async getValuesDistribution({ chartConfig: t2, key: n7, samples: r = 1e5, limit: s3 = 100, source: i2 }) {
127978
127982
  let o = _lodash.pick.call(void 0, t2, ["connection", "from", "dateRange", "filters", "where", "with"]);
127979
- return this.cache.getOrFetch(`${_chunkPA2R4K2Ojs.I.call(void 0, o)}.${n7}.valuesDistribution`, async () => {
127980
- let l = { ...t2, with: [...t2.with || [], { name: "tableStats", chartConfig: { ..._lodash.omit.call(void 0, t2, ["with", "groupBy", "orderBy", "limit"]), select: `count() as total, greatest(CAST(total / ${r} AS UInt32), 1) as sample_factor` } }], filters: [...t2.filters || [], { type: "sql", condition: `cityHash64(${t2.timestampValueExpression}, rand()) % (SELECT sample_factor FROM tableStats) = 0` }], select: `${n7} AS __hdx_value, count() as __hdx_count, __hdx_count / (sum(__hdx_count) OVER ()) * 100 AS __hdx_percentage`, orderBy: "__hdx_percentage DESC", groupBy: "__hdx_value", limit: { limit: s3 } }, a3 = await w2(l, this, _optionalChain([i2, "optionalAccess", (_82) => _82.querySettings])), u2 = await this.clickhouseClient.query({ query: a3.sql, query_params: a3.params, connectionId: t2.connection, clickhouse_settings: { ...this.getClickHouseSettings(), max_rows_to_group_by: `${s3 * 10}`, group_by_overflow_mode: "any", max_rows_to_read: "0" } }).then((m3) => m3.json());
127983
+ return this.cache.getOrFetch(`${_chunkTG7NNTT3js.I.call(void 0, o)}.${n7}.valuesDistribution`, async () => {
127984
+ let l = { ...t2, with: [...t2.with || [], { name: "tableStats", chartConfig: { ..._lodash.omit.call(void 0, t2, ["with", "groupBy", "orderBy", "limit"]), select: `count() as total, greatest(CAST(total / ${r} AS UInt32), 1) as sample_factor` } }], filters: [...t2.filters || [], { type: "sql", condition: `cityHash64(${t2.timestampValueExpression}, rand()) % (SELECT sample_factor FROM tableStats) = 0` }], select: `${n7} AS __hdx_value, count() as __hdx_count, __hdx_count / (sum(__hdx_count) OVER ()) * 100 AS __hdx_percentage`, orderBy: "__hdx_percentage DESC", groupBy: "__hdx_value", limit: { limit: s3 } }, a3 = await w2(l, this, _optionalChain([i2, "optionalAccess", (_80) => _80.querySettings])), u2 = await this.clickhouseClient.query({ query: a3.sql, query_params: a3.params, connectionId: t2.connection, clickhouse_settings: { ...this.getClickHouseSettings(), max_rows_to_group_by: `${s3 * 10}`, group_by_overflow_mode: "any", max_rows_to_read: "0" } }).then((m3) => m3.json());
127981
127985
  return new Map(u2.data.map(({ __hdx_value: m3, __hdx_percentage: p }) => [m3, Number(p)]));
127982
127986
  });
127983
127987
  }
127984
127988
  async getKeyValues({ chartConfig: t2, keys: n7, limit: r = 20, disableRowLimit: s3 = false, signal: i2, source: o }) {
127985
127989
  let l = { ..._lodash.pick.call(void 0, t2, ["connection", "from", "dateRange", "where", "with", "filters"]), keys: n7, disableRowLimit: s3 };
127986
- return this.cache.getOrFetch(`${_chunkPA2R4K2Ojs.I.call(void 0, l)}.getKeyValues`, async () => {
127990
+ return this.cache.getOrFetch(`${_chunkTG7NNTT3js.I.call(void 0, l)}.getKeyValues`, async () => {
127987
127991
  if (n7.length === 0) return [];
127988
127992
  let a3 = s3 ? { ...t2, select: n7.map((p, g) => `groupUniqArray(${r})(${p}) AS param${g}`).join(", ") } : await (async () => {
127989
127993
  let p = n7.map((g, h3) => `${g} as param${h3}`).join(", ") || "*";
127990
- return { with: [{ name: "sampledData", chartConfig: { ...t2, select: p, limit: { limit: this.getClickHouseSettings().max_rows_to_read ? Number(this.getClickHouseSettings().max_rows_to_read) : B3 } }, isSubquery: true }], select: n7.map((g, h3) => `groupUniqArray(${r})(param${h3}) AS param${h3}`).join(", "), connection: t2.connection, from: { databaseName: "", tableName: "sampledData" }, where: "" };
127991
- })(), u2 = await w2(a3, this, _optionalChain([o, "optionalAccess", (_83) => _83.querySettings])), m3 = await this.clickhouseClient.query({ query: u2.sql, query_params: u2.params, connectionId: t2.connection, clickhouse_settings: s3 ? void 0 : { ...this.getClickHouseSettings(), timeout_overflow_mode: "break", max_execution_time: 15, max_rows_to_read: "0" }, abort_signal: i2 }).then((p) => p.json());
127992
- return Object.entries(_optionalChain([m3, "optionalAccess", (_84) => _84.data, "optionalAccess", (_85) => _85[0]])).map(([p, g]) => ({ key: n7[parseInt(p.replace("param", ""))], value: _optionalChain([g, "optionalAccess", (_86) => _86.filter, "call", (_87) => _87((h3) => h3 != null && h3 !== "")]) }));
127994
+ return { with: [{ name: "sampledData", chartConfig: { ...t2, select: p, limit: { limit: this.getClickHouseSettings().max_rows_to_read ? Number(this.getClickHouseSettings().max_rows_to_read) : Q3 } }, isSubquery: true }], select: n7.map((g, h3) => `groupUniqArray(${r})(param${h3}) AS param${h3}`).join(", "), connection: t2.connection, from: { databaseName: "", tableName: "sampledData" }, where: "" };
127995
+ })(), u2 = await w2(a3, this, _optionalChain([o, "optionalAccess", (_81) => _81.querySettings])), m3 = await this.clickhouseClient.query({ query: u2.sql, query_params: u2.params, connectionId: t2.connection, clickhouse_settings: s3 ? void 0 : { ...this.getClickHouseSettings(), timeout_overflow_mode: "break", max_execution_time: 15, max_rows_to_read: "0" }, abort_signal: i2 }).then((p) => p.json());
127996
+ return Object.entries(_optionalChain([m3, "optionalAccess", (_82) => _82.data, "optionalAccess", (_83) => _83[0]])).map(([p, g]) => ({ key: n7[parseInt(p.replace("param", ""))], value: _optionalChain([g, "optionalAccess", (_84) => _84.filter, "call", (_85) => _85((h3) => h3 != null && h3 !== "")]) }));
127993
127997
  });
127994
127998
  }
127995
127999
  async getKeyValuesWithMVs({ chartConfig: t2, keys: n7, source: r, limit: s3 = 20, disableRowLimit: i2, signal: o }) {
127996
128000
  let l = { ..._lodash.pick.call(void 0, t2, ["connection", "from", "dateRange", "where", "with", "filters"]), keys: n7, disableRowLimit: i2 };
127997
- return this.cache.getOrFetch(`${_chunkPA2R4K2Ojs.I.call(void 0, l)}.getKeyValuesWithMVs`, async () => {
128001
+ return this.cache.getOrFetch(`${_chunkTG7NNTT3js.I.call(void 0, l)}.getKeyValuesWithMVs`, async () => {
127998
128002
  if (n7.length === 0) return [];
127999
- let a3 = { chartConfig: t2, keys: n7 }, m3 = r && (r.kind === "log" || r.kind === "trace") ? await _chunkQZUFNMWNjs.e.call(void 0, { chartConfig: t2, keys: n7, source: r, clickhouseClient: this.clickhouseClient, metadata: this, signal: o }) : [a3];
128003
+ let a3 = { chartConfig: t2, keys: n7 }, m3 = r && (r.kind === "log" || r.kind === "trace") ? await _chunkKCHFIBHLjs.e.call(void 0, { chartConfig: t2, keys: n7, source: r, clickhouseClient: this.clickhouseClient, metadata: this, signal: o }) : [a3];
128000
128004
  return (await Promise.all(m3.map(async ({ chartConfig: g, keys: h3 }) => this.getKeyValues({ chartConfig: g, keys: h3, limit: s3, disableRowLimit: i2, signal: o, source: r })))).flat();
128001
128005
  });
128002
128006
  }
128003
128007
  };
128004
128008
  function kr(e2) {
128005
- return { databaseName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_88) => _88.from, "optionalAccess", (_89) => _89.databaseName]), () => ""), tableName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_90) => _90.from, "optionalAccess", (_91) => _91.tableName]), () => ""), connectionId: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_92) => _92.connection]), () => "") };
128009
+ return { databaseName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_86) => _86.from, "optionalAccess", (_87) => _87.databaseName]), () => ""), tableName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_88) => _88.from, "optionalAccess", (_89) => _89.tableName]), () => ""), connectionId: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_90) => _90.connection]), () => "") };
128006
128010
  }
128007
- function Mr(e2) {
128008
- return { databaseName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_93) => _93.from, "optionalAccess", (_94) => _94.databaseName]), () => ""), tableName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_95) => _95.from, "optionalAccess", (_96) => _96.tableName]), () => ""), connectionId: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_97) => _97.connection]), () => "") };
128011
+ function Dr(e2) {
128012
+ return { databaseName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_91) => _91.from, "optionalAccess", (_92) => _92.databaseName]), () => ""), tableName: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_93) => _93.from, "optionalAccess", (_94) => _94.tableName]), () => ""), connectionId: _nullishCoalesce(_optionalChain([e2, "optionalAccess", (_95) => _95.connection]), () => "") };
128009
128013
  }
128010
- var bt2 = new ce2();
128011
- var ze2 = exports.r = (e2) => new v2(e2, bt2);
128012
- var ae2 = ((u2) => (u2.Array = "array", u2.Date = "date", u2.Map = "map", u2.Number = "number", u2.String = "string", u2.Tuple = "tuple", u2.Bool = "bool", u2.JSON = "json", u2.Dynamic = "dynamic", u2))(ae2 || {});
128014
+ var bt2 = new ge2();
128015
+ var ze2 = exports.r = (e2) => new P2(e2, bt2);
128016
+ var ue2 = ((u2) => (u2.Array = "array", u2.Date = "date", u2.Map = "map", u2.Number = "number", u2.String = "string", u2.Tuple = "tuple", u2.Bool = "bool", u2.JSON = "json", u2.Dynamic = "dynamic", u2))(ue2 || {});
128013
128017
  var Pr = exports.t = (e2) => {
128014
128018
  let t2 = {};
128015
128019
  return e2.headers.forEach((n7, r) => {
@@ -128018,19 +128022,19 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128018
128022
  };
128019
128023
  var x3 = exports.u = (e2) => e2.startsWith("Date") ? "date" : e2.startsWith("Tuple") ? "tuple" : e2.startsWith("Map") ? "map" : e2.startsWith("Array") ? "array" : e2.startsWith("Int") || e2.startsWith("UInt") || e2.startsWith("Float") || e2.startsWith("Nullable(Int") || e2.startsWith("Nullable(UInt") || e2.startsWith("Nullable(Float") ? "number" : e2.startsWith("String") || e2.startsWith("Nullable(String)") || e2.startsWith("FixedString") || e2.startsWith("Enum") || e2.startsWith("UUID") || e2.startsWith("IPv4") || e2.startsWith("IPv6") ? "string" : e2 === "Bool" ? "bool" : e2.startsWith("JSON") ? "json" : e2.startsWith("Dynamic") ? "dynamic" : e2.startsWith("LowCardinality") ? x3(e2.slice(15, -1)) : e2.startsWith("Nullable(") ? x3(e2.slice(9, -1)) : null;
128020
128024
  var Hr = exports.v = (e2) => e2 === "map" || e2 === "array" || e2 === "json" || e2 === "tuple" || e2 === "dynamic";
128021
- var L3 = exports.w = (e2) => {
128025
+ var B3 = exports.w = (e2) => {
128022
128026
  if (e2.trim().startsWith("Array(") && e2.trim().endsWith(")")) {
128023
128027
  let t2 = e2.trim().slice(6, -1);
128024
128028
  return x3(t2);
128025
128029
  }
128026
128030
  return null;
128027
128031
  };
128028
- var Oe2 = exports.x = (e2) => {
128032
+ var qe2 = exports.x = (e2) => {
128029
128033
  let t2 = x3(e2), n7 = t2 === "array";
128030
128034
  if (t2 === "map" || t2 === "tuple") throw new Error("Map or Tuple types cannot be searched with Lucene.");
128031
- return t2 === "date" ? t2 = "number" : t2 === "array" && L3(e2) && (t2 = L3(e2)), { type: t2, isArray: n7 };
128035
+ return t2 === "date" ? t2 = "number" : t2 === "array" && B3(e2) && (t2 = B3(e2)), { type: t2, isArray: n7 };
128032
128036
  };
128033
- var Nt2 = (e2) => Math.abs(_chunkPA2R4K2Ojs.k.call(void 0, `${e2}`));
128037
+ var Nt2 = (e2) => Math.abs(_chunkTG7NNTT3js.k.call(void 0, `${e2}`));
128034
128038
  var $ = (e2) => `HYPERDX_PARAM_${Nt2(e2)}`;
128035
128039
  var c3 = exports.y = (e2, ...t2) => ({ sql: e2.map((r, s3) => {
128036
128040
  let i2 = t2[s3];
@@ -128045,7 +128049,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128045
128049
  }, { sql: "", params: {} });
128046
128050
  var wt2 = (e2) => Array.isArray(e2) ? e2.every((t2) => t2.sql.length === 0) : e2.sql.length === 0;
128047
128051
  var k3 = exports.A = (e2, t2, n7) => wt2(e2) ? [] : c3`${t2}${e2}${n7}`;
128048
- var Z = exports.B = class extends Error {
128052
+ var re2 = exports.B = class extends Error {
128049
128053
  constructor(n7, r) {
128050
128054
  super(n7);
128051
128055
  this.query = r;
@@ -128053,8 +128057,8 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128053
128057
  }
128054
128058
  };
128055
128059
  var Qr = exports.C = (e2) => {
128056
- let t2 = new pe2.Parser(), n7 = _chunkPA2R4K2Ojs.e.call(void 0, e2);
128057
- return _optionalChain([n7, "optionalAccess", (_98) => _98.length]) ? n7.flatMap((r) => {
128060
+ let t2 = new he2.Parser(), n7 = _chunkTG7NNTT3js.e.call(void 0, e2);
128061
+ return _optionalChain([n7, "optionalAccess", (_96) => _96.length]) ? n7.flatMap((r) => {
128058
128062
  try {
128059
128063
  let s3 = /\b[a-zA-Z0-9_]+\[([0-9]+|'[^']*')\]/g, i2 = r.match(s3) || [], l = r.replace(s3, "''").replace(/\.:[a-zA-Z0-9]+/g, ""), a3 = /\b[a-zA-Z0-9_]+\.[a-zA-Z0-9_.]+/g, u2 = l.match(a3) || [], m3 = l.replace(a3, "''"), p = t2.columnList(`select ${m3}`).map((g) => g.split("::")[2]);
128060
128064
  return [.../* @__PURE__ */ new Set([...p, ...u2, ...i2])];
@@ -128069,7 +128073,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128069
128073
  return isNaN(n7) || isNaN(r) || r === 0 ? NaN : n7 / r;
128070
128074
  };
128071
128075
  var It2 = exports.E = (e2) => {
128072
- let t2 = e2.meta, n7 = e2.data, r = Ke2(_nullishCoalesce(t2, () => [])), s3 = _optionalChain([t2, "optionalAccess", (_99) => _99.filter, "call", (_100) => _100((u2) => u2.name !== _optionalChain([r, "optionalAccess", (_101) => _101.name]))]), i2 = _optionalChain([s3, "optionalAccess", (_102) => _102[0]]), o = _optionalChain([s3, "optionalAccess", (_103) => _103[1]]);
128076
+ let t2 = e2.meta, n7 = e2.data, r = Ke2(_nullishCoalesce(t2, () => [])), s3 = _optionalChain([t2, "optionalAccess", (_97) => _97.filter, "call", (_98) => _98((u2) => u2.name !== _optionalChain([r, "optionalAccess", (_99) => _99.name]))]), i2 = _optionalChain([s3, "optionalAccess", (_100) => _100[0]]), o = _optionalChain([s3, "optionalAccess", (_101) => _101[1]]);
128073
128077
  if (!i2 || !o) throw new Error(`Unable to compute ratio - meta information: ${JSON.stringify(t2)}.`);
128074
128078
  let l = `${i2.name}/${o.name}`;
128075
128079
  return { ...e2, data: n7.map((u2) => ({ [l]: Rt2(u2[i2.name], u2[o.name]), ...r ? { [r.name]: u2[r.name] } : {} })), meta: [{ name: l, type: "Float64" }, ...r ? [{ name: r.name, type: r.type }] : []] };
@@ -128090,7 +128094,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128090
128094
  logDebugQuery(t2, n7 = {}) {
128091
128095
  let r = "";
128092
128096
  try {
128093
- r = me2({ sql: t2, params: n7 });
128097
+ r = de2({ sql: t2, params: n7 });
128094
128098
  } catch (e5) {
128095
128099
  r = t2;
128096
128100
  }
@@ -128098,7 +128102,7 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128098
128102
  }
128099
128103
  async processClickhouseSettings({ connectionId: t2, externalClickhouseSettings: n7 }) {
128100
128104
  let r = structuredClone(n7 || {});
128101
- _optionalChain([r, "optionalAccess", (_104) => _104.max_rows_to_read]) && this.maxRowReadOnly && delete r.max_rows_to_read, _optionalChain([r, "optionalAccess", (_105) => _105.max_execution_time]) === void 0 && (this.queryTimeout || 0) > 0 && (r.max_execution_time = this.queryTimeout);
128105
+ _optionalChain([r, "optionalAccess", (_102) => _102.max_rows_to_read]) && this.maxRowReadOnly && delete r.max_rows_to_read, _optionalChain([r, "optionalAccess", (_103) => _103.max_execution_time]) === void 0 && (this.queryTimeout || 0) > 0 && (r.max_execution_time = this.queryTimeout);
128102
128106
  let s3 = { allow_experimental_analyzer: 1, date_time_output_format: "iso", wait_end_of_query: 0, cancel_http_readonly_queries_on_client_close: 1, output_format_json_quote_64bit_integers: 1 }, o = await ze2(this).getSettings({ connectionId: t2 }), l = (a3, u2) => {
128103
128107
  !o || !o.has(a3) || (s3[a3] = u2);
128104
128108
  };
@@ -128116,11 +128120,11 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128116
128120
  try {
128117
128121
  let i2 = "";
128118
128122
  try {
128119
- i2 = me2({ sql: t2.query, params: _nullishCoalesce(t2.query_params, () => ({})) });
128123
+ i2 = de2({ sql: t2.query, params: _nullishCoalesce(t2.query_params, () => ({})) });
128120
128124
  } catch (e6) {
128121
128125
  i2 = t2.query;
128122
128126
  }
128123
- s3 = new Z(r.message, i2), s3.cause = r;
128127
+ s3 = new re2(r.message, i2), s3.cause = r;
128124
128128
  } catch (e7) {
128125
128129
  }
128126
128130
  throw s3;
@@ -128131,8 +128135,8 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128131
128135
  throw new Error("ClickHouseClient query impossible codepath");
128132
128136
  }
128133
128137
  async queryChartConfig({ config: t2, metadata: n7, opts: r, querySettings: s3 }) {
128134
- t2 = _chunkXSPFZE62js.b.call(void 0, t2) ? Ue2(t2) : t2;
128135
- let i2 = await Promise.all(Be2(t2).map((a3) => w2(a3, n7, s3))), o = t2.displayType === "line", l = await Promise.all(i2.map(async (a3) => (await this.query({ query: a3.sql, query_params: a3.params, format: "JSON", abort_signal: _optionalChain([r, "optionalAccess", (_106) => _106.abort_signal]), connectionId: t2.connection, clickhouse_settings: _optionalChain([r, "optionalAccess", (_107) => _107.clickhouse_settings]) })).json()));
128138
+ t2 = _chunkXSPFZE62js.b.call(void 0, t2) ? Be2(t2) : t2;
128139
+ let i2 = await Promise.all(Pe2(t2).map((a3) => w2(a3, n7, s3))), o = t2.displayType === "line", l = await Promise.all(i2.map(async (a3) => (await this.query({ query: a3.sql, query_params: a3.params, format: "JSON", abort_signal: _optionalChain([r, "optionalAccess", (_104) => _104.abort_signal]), connectionId: t2.connection, clickhouse_settings: _optionalChain([r, "optionalAccess", (_105) => _105.clickhouse_settings]) })).json()));
128136
128140
  if (l.length === 1) return l[0];
128137
128141
  if (_chunkXSPFZE62js.b.call(void 0, t2) && l.length > 1) {
128138
128142
  let a3 = /* @__PURE__ */ new Map(), u2 = /* @__PURE__ */ new Map();
@@ -128141,13 +128145,13 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128141
128145
  let _2 = f.name;
128142
128146
  a3.has(_2) || a3.set(_2, f);
128143
128147
  }
128144
- let h3 = Ke2(_nullishCoalesce(g.meta, () => [])), S3 = _optionalChain([Ot2, "call", (_108) => _108(_nullishCoalesce(g.meta, () => [])), "optionalAccess", (_109) => _109[0], "optionalAccess", (_110) => _110.name]);
128148
+ let h3 = Ke2(_nullishCoalesce(g.meta, () => [])), S3 = _optionalChain([Ot2, "call", (_106) => _106(_nullishCoalesce(g.meta, () => [])), "optionalAccess", (_107) => _107[0], "optionalAccess", (_108) => _108.name]);
128145
128149
  for (let f of g.data) {
128146
- let _2 = S3 ? Object.fromEntries(Object.entries(f).filter(([A2]) => A2 !== S3)) : { ...f }, C2 = h3 != null ? f[h3.name] : o ? _objecthash2.default.call(void 0, _2) : "__FIXED_TIMESTAMP__";
128147
- if (u2.has(C2)) {
128148
- let A2 = u2.get(C2);
128149
- u2.set(C2, { ...A2, ...f });
128150
- } else u2.set(C2, f);
128150
+ let _2 = S3 ? Object.fromEntries(Object.entries(f).filter(([C2]) => C2 !== S3)) : { ...f }, A2 = h3 != null ? f[h3.name] : o ? _objecthash2.default.call(void 0, _2) : "__FIXED_TIMESTAMP__";
128151
+ if (u2.has(A2)) {
128152
+ let C2 = u2.get(A2);
128153
+ u2.set(A2, { ...C2, ...f });
128154
+ } else u2.set(A2, f);
128151
128155
  }
128152
128156
  }
128153
128157
  let m3 = t2.seriesReturnType === "ratio" && l.length === 2, p = { meta: Array.from(a3.values()), data: Array.from(u2.values()) };
@@ -128157,24 +128161,24 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128157
128161
  }
128158
128162
  async testChartConfigValidity({ config: t2, metadata: n7, opts: r, querySettings: s3 }) {
128159
128163
  try {
128160
- let i2 = await w2(t2, n7, s3), o = c3`EXPLAIN ESTIMATE ${i2}`, a3 = await (await this.query({ query: o.sql, query_params: o.params, format: "JSON", abort_signal: _optionalChain([r, "optionalAccess", (_111) => _111.abort_signal]), connectionId: t2.connection, clickhouse_settings: _optionalChain([r, "optionalAccess", (_112) => _112.clickhouse_settings]) })).json(), u2 = Number(_optionalChain([a3, "access", (_113) => _113.data, "access", (_114) => _114[0], "optionalAccess", (_115) => _115.rows]));
128164
+ let i2 = await w2(t2, n7, s3), o = c3`EXPLAIN ESTIMATE ${i2}`, a3 = await (await this.query({ query: o.sql, query_params: o.params, format: "JSON", abort_signal: _optionalChain([r, "optionalAccess", (_109) => _109.abort_signal]), connectionId: t2.connection, clickhouse_settings: _optionalChain([r, "optionalAccess", (_110) => _110.clickhouse_settings]) })).json(), u2 = Number(_optionalChain([a3, "access", (_111) => _111.data, "access", (_112) => _112[0], "optionalAccess", (_113) => _113.rows]));
128161
128165
  return { isValid: true, rowEstimate: Number.isNaN(u2) ? void 0 : u2 };
128162
128166
  } catch (i2) {
128163
- return { isValid: false, error: i2 instanceof Z ? i2.message : "Error while constructing materialized view query" };
128167
+ return { isValid: false, error: i2 instanceof re2 ? i2.message : "Error while constructing materialized view query" };
128164
128168
  }
128165
128169
  }
128166
128170
  }, _class3);
128167
128171
  var R3 = exports.G = ({ database: e2, table: t2 }) => c3`${{ Identifier: e2 }}.${{ Identifier: t2 }}`;
128168
- function me2({ sql: e2, params: t2 }) {
128172
+ function de2({ sql: e2, params: t2 }) {
128169
128173
  return Object.entries(t2).reduce((n7, [r, s3]) => n7.replace(new RegExp(`{${r}:\\w+}`, "g"), s3), e2);
128170
128174
  }
128171
128175
  function Jr(e2) {
128172
128176
  let t2 = {};
128173
128177
  if (e2 == null) return t2;
128174
128178
  try {
128175
- let n7 = me2(e2), [r] = _chunkPA2R4K2Ojs.C.call(void 0, n7), { sqlWithReplacements: s3, replacements: i2 } = _chunkPA2R4K2Ojs.i.call(void 0, r), l = new pe2.Parser().astify(s3, { database: "Postgresql", parseOptions: { includeLocations: true } });
128179
+ let n7 = de2(e2), [r] = _chunkTG7NNTT3js.C.call(void 0, n7), { sqlWithReplacements: s3, replacements: i2 } = _chunkTG7NNTT3js.i.call(void 0, r), l = new he2.Parser().astify(s3, { database: "Postgresql", parseOptions: { includeLocations: true } });
128176
128180
  l.columns != null && l.columns.forEach((a3) => {
128177
- a3.as != null && (a3.type === "expr" && a3.expr.type === "column_ref" ? t2[a3.as] = a3.expr.array_index && _optionalChain([a3, "access", (_116) => _116.expr, "access", (_117) => _117.array_index, "access", (_118) => _118[0], "optionalAccess", (_119) => _119.brackets]) ? `${a3.expr.column.expr.value}['${a3.expr.array_index[0].index.value}']` : a3.expr.column.expr.value : a3.expr.loc != null ? t2[a3.as] = s3.slice(a3.expr.loc.start.offset, a3.expr.loc.end.offset) : console.error("Unknown alias column type", a3));
128181
+ a3.as != null && (a3.type === "expr" && a3.expr.type === "column_ref" ? t2[a3.as] = a3.expr.array_index && _optionalChain([a3, "access", (_114) => _114.expr, "access", (_115) => _115.array_index, "access", (_116) => _116[0], "optionalAccess", (_117) => _117.brackets]) ? `${a3.expr.column.expr.value}['${a3.expr.array_index[0].index.value}']` : a3.expr.column.expr.value : a3.expr.loc != null ? t2[a3.as] = s3.slice(a3.expr.loc.start.offset, a3.expr.loc.end.offset) : console.error("Unknown alias column type", a3));
128178
128182
  });
128179
128183
  for (let [a3, u2] of Object.entries(t2)) for (let [m3, p] of i2) u2.includes(m3) && (t2[a3] = u2.replaceAll(m3, p));
128180
128184
  return t2;
@@ -128183,19 +128187,19 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128183
128187
  }
128184
128188
  return t2;
128185
128189
  }
128186
- function X3(e2, t2) {
128190
+ function te2(e2, t2) {
128187
128191
  return e2.filter((n7) => {
128188
128192
  let r = x3(n7.type);
128189
128193
  return r != null && t2.includes(r);
128190
128194
  });
128191
128195
  }
128192
128196
  function Ke2(e2) {
128193
- return _optionalChain([X3, "call", (_120) => _120(e2, ["date"]), "optionalAccess", (_121) => _121[0]]);
128197
+ return _optionalChain([te2, "call", (_118) => _118(e2, ["date"]), "optionalAccess", (_119) => _119[0]]);
128194
128198
  }
128195
128199
  function Ot2(e2) {
128196
- return X3(e2, ["number"]);
128200
+ return te2(e2, ["number"]);
128197
128201
  }
128198
- var Le2 = ({ select: e2, ...t2 }) => {
128202
+ var ve2 = ({ select: e2, ...t2 }) => {
128199
128203
  if (e2.aggFn === "quantile") {
128200
128204
  if (!("level" in e2) || e2.level === null) throw new Error("quantile must have a level");
128201
128205
  return kt2({ ...t2, level: e2.level });
@@ -128312,49 +128316,49 @@ var require_chunk_Z3GGA2U3 = __commonJS({
128312
128316
  FROM points
128313
128317
  WHERE length(point) > 1 AND total > 0
128314
128318
  ` }];
128315
- exports.a = Le2;
128319
+ exports.a = ve2;
128316
128320
  exports.b = ut2;
128317
- exports.c = le2;
128318
- exports.d = Y3;
128319
- exports.e = ue2;
128320
- exports.f = Ue2;
128321
- exports.g = Be2;
128321
+ exports.c = me2;
128322
+ exports.d = Z;
128323
+ exports.e = pe2;
128324
+ exports.f = Be2;
128325
+ exports.g = Pe2;
128322
128326
  exports.h = xr;
128323
- exports.i = U2;
128327
+ exports.i = H4;
128324
128328
  exports.j = pt2;
128325
128329
  exports.k = At2;
128326
128330
  exports.l = w2;
128327
- exports.m = B3;
128328
- exports.n = ce2;
128329
- exports.o = v2;
128331
+ exports.m = Q3;
128332
+ exports.n = ge2;
128333
+ exports.o = P2;
128330
128334
  exports.p = kr;
128331
- exports.q = Mr;
128335
+ exports.q = Dr;
128332
128336
  exports.r = ze2;
128333
- exports.s = ae2;
128337
+ exports.s = ue2;
128334
128338
  exports.t = Pr;
128335
128339
  exports.u = x3;
128336
128340
  exports.v = Hr;
128337
- exports.w = L3;
128338
- exports.x = Oe2;
128341
+ exports.w = B3;
128342
+ exports.x = qe2;
128339
128343
  exports.y = c3;
128340
128344
  exports.z = E2;
128341
128345
  exports.A = k3;
128342
- exports.B = Z;
128346
+ exports.B = re2;
128343
128347
  exports.C = Qr;
128344
128348
  exports.D = Rt2;
128345
128349
  exports.E = It2;
128346
128350
  exports.F = je2;
128347
128351
  exports.G = R3;
128348
- exports.H = me2;
128352
+ exports.H = de2;
128349
128353
  exports.I = Jr;
128350
- exports.J = X3;
128354
+ exports.J = te2;
128351
128355
  exports.K = Ke2;
128352
128356
  exports.L = Ot2;
128353
- exports.M = qe2;
128354
- exports.N = ie2;
128355
- exports.O = J;
128357
+ exports.M = ke3;
128358
+ exports.N = oe2;
128359
+ exports.O = V2;
128356
128360
  exports.P = st2;
128357
- exports.Q = z2;
128361
+ exports.Q = j2;
128358
128362
  exports.R = Ht2;
128359
128363
  }
128360
128364
  });
@@ -128364,33 +128368,33 @@ var require_clickhouse = __commonJS({
128364
128368
  "../common-utils/dist/clickhouse/index.js"(exports) {
128365
128369
  "use strict";
128366
128370
  Object.defineProperty(exports, "__esModule", { value: true });
128367
- var _chunkZ3GGA2U3js = require_chunk_Z3GGA2U3();
128368
- require_chunk_QZUFNMWN();
128369
- require_chunk_4NHZLI4N();
128370
- require_chunk_LDDGQDAH();
128371
- require_chunk_PA2R4K2O();
128371
+ var _chunkZEYGQWFCjs = require_chunk_ZEYGQWFC();
128372
+ require_chunk_KCHFIBHL();
128373
+ require_chunk_WX4KZTVE();
128374
+ require_chunk_AK5NJJI2();
128375
+ require_chunk_TG7NNTT3();
128372
128376
  require_chunk_XSPFZE62();
128373
- require_chunk_3BJ55V2F();
128374
- exports.BaseClickhouseClient = _chunkZ3GGA2U3js.F;
128375
- exports.ClickHouseQueryError = _chunkZ3GGA2U3js.B;
128376
- exports.JSDataType = _chunkZ3GGA2U3js.s;
128377
- exports.chSql = _chunkZ3GGA2U3js.y;
128378
- exports.chSqlToAliasMap = _chunkZ3GGA2U3js.I;
128379
- exports.computeRatio = _chunkZ3GGA2U3js.D;
128380
- exports.computeResultSetRatio = _chunkZ3GGA2U3js.E;
128381
- exports.concatChSql = _chunkZ3GGA2U3js.z;
128382
- exports.convertCHDataTypeToJSType = _chunkZ3GGA2U3js.u;
128383
- exports.convertCHTypeToLuceneSearchType = _chunkZ3GGA2U3js.x;
128384
- exports.extractColumnReferencesFromKey = _chunkZ3GGA2U3js.C;
128385
- exports.extractInnerCHArrayJSType = _chunkZ3GGA2U3js.w;
128386
- exports.filterColumnMetaByType = _chunkZ3GGA2U3js.J;
128387
- exports.getResponseHeaders = _chunkZ3GGA2U3js.t;
128388
- exports.inferNumericColumn = _chunkZ3GGA2U3js.L;
128389
- exports.inferTimestampColumn = _chunkZ3GGA2U3js.K;
128390
- exports.isJSDataTypeJSONStringifiable = _chunkZ3GGA2U3js.v;
128391
- exports.parameterizedQueryToSql = _chunkZ3GGA2U3js.H;
128392
- exports.tableExpr = _chunkZ3GGA2U3js.G;
128393
- exports.wrapChSqlIfNotEmpty = _chunkZ3GGA2U3js.A;
128377
+ require_chunk_JHY6DL4P();
128378
+ exports.BaseClickhouseClient = _chunkZEYGQWFCjs.F;
128379
+ exports.ClickHouseQueryError = _chunkZEYGQWFCjs.B;
128380
+ exports.JSDataType = _chunkZEYGQWFCjs.s;
128381
+ exports.chSql = _chunkZEYGQWFCjs.y;
128382
+ exports.chSqlToAliasMap = _chunkZEYGQWFCjs.I;
128383
+ exports.computeRatio = _chunkZEYGQWFCjs.D;
128384
+ exports.computeResultSetRatio = _chunkZEYGQWFCjs.E;
128385
+ exports.concatChSql = _chunkZEYGQWFCjs.z;
128386
+ exports.convertCHDataTypeToJSType = _chunkZEYGQWFCjs.u;
128387
+ exports.convertCHTypeToLuceneSearchType = _chunkZEYGQWFCjs.x;
128388
+ exports.extractColumnReferencesFromKey = _chunkZEYGQWFCjs.C;
128389
+ exports.extractInnerCHArrayJSType = _chunkZEYGQWFCjs.w;
128390
+ exports.filterColumnMetaByType = _chunkZEYGQWFCjs.J;
128391
+ exports.getResponseHeaders = _chunkZEYGQWFCjs.t;
128392
+ exports.inferNumericColumn = _chunkZEYGQWFCjs.L;
128393
+ exports.inferTimestampColumn = _chunkZEYGQWFCjs.K;
128394
+ exports.isJSDataTypeJSONStringifiable = _chunkZEYGQWFCjs.v;
128395
+ exports.parameterizedQueryToSql = _chunkZEYGQWFCjs.H;
128396
+ exports.tableExpr = _chunkZEYGQWFCjs.G;
128397
+ exports.wrapChSqlIfNotEmpty = _chunkZEYGQWFCjs.A;
128394
128398
  }
128395
128399
  });
128396
128400
 
@@ -128399,19 +128403,19 @@ var require_metadata = __commonJS({
128399
128403
  "../common-utils/dist/core/metadata.js"(exports) {
128400
128404
  "use strict";
128401
128405
  Object.defineProperty(exports, "__esModule", { value: true });
128402
- var _chunkZ3GGA2U3js = require_chunk_Z3GGA2U3();
128403
- require_chunk_QZUFNMWN();
128404
- require_chunk_4NHZLI4N();
128405
- require_chunk_LDDGQDAH();
128406
- require_chunk_PA2R4K2O();
128406
+ var _chunkZEYGQWFCjs = require_chunk_ZEYGQWFC();
128407
+ require_chunk_KCHFIBHL();
128408
+ require_chunk_WX4KZTVE();
128409
+ require_chunk_AK5NJJI2();
128410
+ require_chunk_TG7NNTT3();
128407
128411
  require_chunk_XSPFZE62();
128408
- require_chunk_3BJ55V2F();
128409
- exports.DEFAULT_METADATA_MAX_ROWS_TO_READ = _chunkZ3GGA2U3js.m;
128410
- exports.Metadata = _chunkZ3GGA2U3js.o;
128411
- exports.MetadataCache = _chunkZ3GGA2U3js.n;
128412
- exports.getMetadata = _chunkZ3GGA2U3js.r;
128413
- exports.tcFromChartConfig = _chunkZ3GGA2U3js.p;
128414
- exports.tcFromSource = _chunkZ3GGA2U3js.q;
128412
+ require_chunk_JHY6DL4P();
128413
+ exports.DEFAULT_METADATA_MAX_ROWS_TO_READ = _chunkZEYGQWFCjs.m;
128414
+ exports.Metadata = _chunkZEYGQWFCjs.o;
128415
+ exports.MetadataCache = _chunkZEYGQWFCjs.n;
128416
+ exports.getMetadata = _chunkZEYGQWFCjs.r;
128417
+ exports.tcFromChartConfig = _chunkZEYGQWFCjs.p;
128418
+ exports.tcFromSource = _chunkZEYGQWFCjs.q;
128415
128419
  }
128416
128420
  });
128417
128421
 
@@ -128719,44 +128723,44 @@ var require_utils3 = __commonJS({
128719
128723
  "../common-utils/dist/core/utils.js"(exports) {
128720
128724
  "use strict";
128721
128725
  Object.defineProperty(exports, "__esModule", { value: true });
128722
- var _chunkPA2R4K2Ojs = require_chunk_PA2R4K2O();
128726
+ var _chunkTG7NNTT3js = require_chunk_TG7NNTT3();
128723
128727
  require_chunk_XSPFZE62();
128724
- require_chunk_3BJ55V2F();
128725
- exports.DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS = _chunkPA2R4K2Ojs.a;
128726
- exports.Granularity = _chunkPA2R4K2Ojs.j;
128727
- exports._useTry = _chunkPA2R4K2Ojs.p;
128728
- exports.aliasMapToWithClauses = _chunkPA2R4K2Ojs.G;
128729
- exports.convertDateRangeToGranularityString = _chunkPA2R4K2Ojs.l;
128730
- exports.convertGranularityToSeconds = _chunkPA2R4K2Ojs.m;
128731
- exports.convertToDashboardDocument = _chunkPA2R4K2Ojs.t;
128732
- exports.convertToDashboardTemplate = _chunkPA2R4K2Ojs.s;
128733
- exports.extractSettingsClauseFromEnd = _chunkPA2R4K2Ojs.C;
128734
- exports.findJsonExpressions = _chunkPA2R4K2Ojs.h;
128735
- exports.formatDate = _chunkPA2R4K2Ojs.r;
128736
- exports.getAlignedDateRange = _chunkPA2R4K2Ojs.A;
128737
- exports.getDistributedTableArgs = _chunkPA2R4K2Ojs.H;
128738
- exports.getFirstOrderingItem = _chunkPA2R4K2Ojs.u;
128739
- exports.getFirstTimestampValueExpression = _chunkPA2R4K2Ojs.f;
128740
- exports.hashCode = _chunkPA2R4K2Ojs.k;
128741
- exports.isBrowser = _chunkPA2R4K2Ojs.b;
128742
- exports.isDateRangeEqual = _chunkPA2R4K2Ojs.B;
128743
- exports.isFirstOrderByAscending = _chunkPA2R4K2Ojs.x;
128744
- exports.isJsonExpression = _chunkPA2R4K2Ojs.g;
128745
- exports.isNode = _chunkPA2R4K2Ojs.c;
128746
- exports.isTimestampExpressionInFirstOrderBy = _chunkPA2R4K2Ojs.w;
128747
- exports.joinQuerySettings = _chunkPA2R4K2Ojs.E;
128748
- exports.objectHash = _chunkPA2R4K2Ojs.I;
128749
- exports.optimizeTimestampValueExpression = _chunkPA2R4K2Ojs.z;
128750
- exports.parseJSON = _chunkPA2R4K2Ojs.q;
128751
- exports.parseToNumber = _chunkPA2R4K2Ojs.D;
128752
- exports.parseToStartOfFunction = _chunkPA2R4K2Ojs.y;
128753
- exports.parseTokenizerFromTextIndex = _chunkPA2R4K2Ojs.F;
128754
- exports.removeTrailingDirection = _chunkPA2R4K2Ojs.v;
128755
- exports.replaceJsonExpressions = _chunkPA2R4K2Ojs.i;
128756
- exports.splitAndTrimCSV = _chunkPA2R4K2Ojs.d;
128757
- exports.splitAndTrimWithBracket = _chunkPA2R4K2Ojs.e;
128758
- exports.timeBucketByGranularity = _chunkPA2R4K2Ojs.o;
128759
- exports.toStartOfInterval = _chunkPA2R4K2Ojs.n;
128728
+ require_chunk_JHY6DL4P();
128729
+ exports.DEFAULT_AUTO_GRANULARITY_MAX_BUCKETS = _chunkTG7NNTT3js.a;
128730
+ exports.Granularity = _chunkTG7NNTT3js.j;
128731
+ exports._useTry = _chunkTG7NNTT3js.p;
128732
+ exports.aliasMapToWithClauses = _chunkTG7NNTT3js.G;
128733
+ exports.convertDateRangeToGranularityString = _chunkTG7NNTT3js.l;
128734
+ exports.convertGranularityToSeconds = _chunkTG7NNTT3js.m;
128735
+ exports.convertToDashboardDocument = _chunkTG7NNTT3js.t;
128736
+ exports.convertToDashboardTemplate = _chunkTG7NNTT3js.s;
128737
+ exports.extractSettingsClauseFromEnd = _chunkTG7NNTT3js.C;
128738
+ exports.findJsonExpressions = _chunkTG7NNTT3js.h;
128739
+ exports.formatDate = _chunkTG7NNTT3js.r;
128740
+ exports.getAlignedDateRange = _chunkTG7NNTT3js.A;
128741
+ exports.getDistributedTableArgs = _chunkTG7NNTT3js.H;
128742
+ exports.getFirstOrderingItem = _chunkTG7NNTT3js.u;
128743
+ exports.getFirstTimestampValueExpression = _chunkTG7NNTT3js.f;
128744
+ exports.hashCode = _chunkTG7NNTT3js.k;
128745
+ exports.isBrowser = _chunkTG7NNTT3js.b;
128746
+ exports.isDateRangeEqual = _chunkTG7NNTT3js.B;
128747
+ exports.isFirstOrderByAscending = _chunkTG7NNTT3js.x;
128748
+ exports.isJsonExpression = _chunkTG7NNTT3js.g;
128749
+ exports.isNode = _chunkTG7NNTT3js.c;
128750
+ exports.isTimestampExpressionInFirstOrderBy = _chunkTG7NNTT3js.w;
128751
+ exports.joinQuerySettings = _chunkTG7NNTT3js.E;
128752
+ exports.objectHash = _chunkTG7NNTT3js.I;
128753
+ exports.optimizeTimestampValueExpression = _chunkTG7NNTT3js.z;
128754
+ exports.parseJSON = _chunkTG7NNTT3js.q;
128755
+ exports.parseToNumber = _chunkTG7NNTT3js.D;
128756
+ exports.parseToStartOfFunction = _chunkTG7NNTT3js.y;
128757
+ exports.parseTokenizerFromTextIndex = _chunkTG7NNTT3js.F;
128758
+ exports.removeTrailingDirection = _chunkTG7NNTT3js.v;
128759
+ exports.replaceJsonExpressions = _chunkTG7NNTT3js.i;
128760
+ exports.splitAndTrimCSV = _chunkTG7NNTT3js.d;
128761
+ exports.splitAndTrimWithBracket = _chunkTG7NNTT3js.e;
128762
+ exports.timeBucketByGranularity = _chunkTG7NNTT3js.o;
128763
+ exports.toStartOfInterval = _chunkTG7NNTT3js.n;
128760
128764
  }
128761
128765
  });
128762
128766
 
@@ -128765,24 +128769,24 @@ var require_renderChartConfig = __commonJS({
128765
128769
  "../common-utils/dist/core/renderChartConfig.js"(exports) {
128766
128770
  "use strict";
128767
128771
  Object.defineProperty(exports, "__esModule", { value: true });
128768
- var _chunkZ3GGA2U3js = require_chunk_Z3GGA2U3();
128769
- require_chunk_QZUFNMWN();
128770
- require_chunk_4NHZLI4N();
128771
- require_chunk_LDDGQDAH();
128772
- require_chunk_PA2R4K2O();
128772
+ var _chunkZEYGQWFCjs = require_chunk_ZEYGQWFC();
128773
+ require_chunk_KCHFIBHL();
128774
+ require_chunk_WX4KZTVE();
128775
+ require_chunk_AK5NJJI2();
128776
+ require_chunk_TG7NNTT3();
128773
128777
  require_chunk_XSPFZE62();
128774
- require_chunk_3BJ55V2F();
128775
- exports.FIXED_TIME_BUCKET_EXPR_ALIAS = _chunkZ3GGA2U3js.b;
128776
- exports.inverseSqlAstFilter = _chunkZ3GGA2U3js.h;
128777
- exports.isMetricChartConfig = _chunkZ3GGA2U3js.e;
128778
- exports.isNonEmptyWhereExpr = _chunkZ3GGA2U3js.i;
128779
- exports.isUsingGranularity = _chunkZ3GGA2U3js.d;
128780
- exports.isUsingGroupBy = _chunkZ3GGA2U3js.c;
128781
- exports.renderChartConfig = _chunkZ3GGA2U3js.l;
128782
- exports.renderRawSqlChartConfig = _chunkZ3GGA2U3js.k;
128783
- exports.setChartSelectsAlias = _chunkZ3GGA2U3js.f;
128784
- exports.splitChartConfigs = _chunkZ3GGA2U3js.g;
128785
- exports.timeFilterExpr = _chunkZ3GGA2U3js.j;
128778
+ require_chunk_JHY6DL4P();
128779
+ exports.FIXED_TIME_BUCKET_EXPR_ALIAS = _chunkZEYGQWFCjs.b;
128780
+ exports.inverseSqlAstFilter = _chunkZEYGQWFCjs.h;
128781
+ exports.isMetricChartConfig = _chunkZEYGQWFCjs.e;
128782
+ exports.isNonEmptyWhereExpr = _chunkZEYGQWFCjs.i;
128783
+ exports.isUsingGranularity = _chunkZEYGQWFCjs.d;
128784
+ exports.isUsingGroupBy = _chunkZEYGQWFCjs.c;
128785
+ exports.renderChartConfig = _chunkZEYGQWFCjs.l;
128786
+ exports.renderRawSqlChartConfig = _chunkZEYGQWFCjs.k;
128787
+ exports.setChartSelectsAlias = _chunkZEYGQWFCjs.f;
128788
+ exports.splitChartConfigs = _chunkZEYGQWFCjs.g;
128789
+ exports.timeFilterExpr = _chunkZEYGQWFCjs.j;
128786
128790
  }
128787
128791
  });
128788
128792