react-semaphor 0.1.598 → 0.1.600

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 (90) hide show
  1. package/dist/analytics-protocol/index.js +336 -333
  2. package/dist/assistant-context/index.js +1 -1
  3. package/dist/assistant-protocol/index.js +5 -5
  4. package/dist/brand-studio/index.js +8 -8
  5. package/dist/briefings/index.js +5 -5
  6. package/dist/chunks/{add-to-dashboard-C86FsM8D.js → add-to-dashboard-ClhEIFst.js} +1 -1
  7. package/dist/chunks/{analytics-base-schemas-8wz9vqn_.js → analytics-base-schemas-DevrgqQb.js} +67 -60
  8. package/dist/chunks/{assistant-chat-DrI442Ld.js → assistant-chat-BULOkG9j.js} +88 -89
  9. package/dist/chunks/{bookmark-impact-C6uWtNWF.js → bookmark-impact-kdvXke8n.js} +3 -3
  10. package/dist/chunks/{bookmark-state-BfeKmj5s.js → bookmark-state-h1OLXVjE.js} +153 -153
  11. package/dist/chunks/{card-filter-builder-CSKCSpNo.js → card-filter-builder-CSCdSQQy.js} +1035 -1063
  12. package/dist/chunks/{comparison-window-caption-3bum5j00.js → comparison-window-caption-DJDwP9XO.js} +6 -6
  13. package/dist/chunks/{context-CVXTFljo.js → context-BJoEFgNl.js} +1 -1
  14. package/dist/chunks/{dashboard-briefing-launcher-C2AuKs10.js → dashboard-briefing-launcher-9YwUclHA.js} +255 -255
  15. package/dist/chunks/{dashboard-controls-BSbhyIkY.js → dashboard-controls-O6PNXMCp.js} +85 -85
  16. package/dist/chunks/{dashboard-json-Bd1rxD3y.js → dashboard-json-Bxf91TYq.js} +5 -5
  17. package/dist/chunks/{dashboard-PYd63LbL.js → dashboard-y9ON19ge.js} +1 -1
  18. package/dist/chunks/dates-DPTbpNxK.js +164 -0
  19. package/dist/chunks/{edit-dashboard-visual-D_0ZiWev.js → edit-dashboard-visual-CKwaW8H_.js} +5489 -5435
  20. package/dist/chunks/{filter-line-BdLyPYjH.js → filter-line-Dkg3yuOX.js} +6 -6
  21. package/dist/chunks/{filter-reach-copy-Dxn-mTuG.js → filter-reach-copy-ClzNcNhP.js} +1740 -1643
  22. package/dist/chunks/{filter-value-text-C6g-nDUW.js → filter-value-text-CXyuLW9Q.js} +4 -4
  23. package/dist/chunks/{index-BHSDE54O.js → index-CRo5--Y6.js} +7 -7
  24. package/dist/chunks/{layout-grid-CYR-LVpl.js → layout-grid-DSrBSfPM.js} +1 -1
  25. package/dist/chunks/{matrix-analytical-definition-C0IGLTZH.js → matrix-analytical-definition-i9PQY066.js} +443 -394
  26. package/dist/chunks/{matrix-member-presentation-D5BIYuy5.js → matrix-member-presentation-B_2beBc0.js} +1 -1
  27. package/dist/chunks/{matrix-operation-contract-RckfqkQm.js → matrix-operation-contract-DdK0J_KU.js} +36 -36
  28. package/dist/chunks/{metric-comparison-DsE8wdRh.js → metric-comparison-Bhz0V841.js} +2 -2
  29. package/dist/chunks/{paintbrush-xDDRjIyF.js → paintbrush-1UiU-uTz.js} +1 -1
  30. package/dist/chunks/{palette-CbOgFCy2.js → palette-DFIFf_-m.js} +1 -1
  31. package/dist/chunks/{pivot-result-contract-expectations-Cnq55Uno.js → pivot-result-contract-expectations-Dk7WFR_u.js} +8 -8
  32. package/dist/chunks/{pivot-result-identity-b4-ugQhm.js → pivot-result-identity-CzzrJpEm.js} +1 -1
  33. package/dist/chunks/{raw-temporal-value-B9W38mi3.js → raw-temporal-value-BLvdaMng.js} +2 -2
  34. package/dist/chunks/{report-preferences-dialog-DTu3a7ce.js → report-preferences-dialog-DiDsYpng.js} +14 -14
  35. package/dist/chunks/{report-runtime-context-BvJkcbar.js → report-runtime-context-CEGluufW.js} +2 -2
  36. package/dist/chunks/{resolve-dashboard-input-context-Bw-DesV2.js → resolve-dashboard-input-context-BAv33KGg.js} +11811 -11331
  37. package/dist/chunks/{save-BgvAsp6X.js → save-CWQ02kHo.js} +1 -1
  38. package/dist/chunks/{saved-dashboard-context-BFh0oOnF.js → saved-dashboard-context-CvzYqADe.js} +97 -97
  39. package/dist/chunks/{selection-filter-compiler-DHYsq3yM.js → selection-filter-compiler-SwrBvyyJ.js} +1 -1
  40. package/dist/chunks/{semaphor-ready-indicator-WvgHMnj8.js → semaphor-ready-indicator-1PRI9Yh2.js} +59336 -58569
  41. package/dist/chunks/{shelf-drop-preview-context-D6HgYFJp.js → shelf-drop-preview-context-BLk5Nc6K.js} +6 -6
  42. package/dist/chunks/{stored-dashboard-vlG0Knxi.js → stored-dashboard-xhYYKBsO.js} +1200 -1183
  43. package/dist/chunks/{style-sheet-parts-ClmvtkSC.js → style-sheet-parts-BX7d7-2-.js} +198 -198
  44. package/dist/chunks/{table-export-sheet-Bv6tVuMu.js → table-export-sheet-BWSVTclx.js} +1 -1
  45. package/dist/chunks/{token-types-eMdcuB6j.js → token-types-CnlEiAdS.js} +1 -1
  46. package/dist/chunks/{upload-ClUeK8F0.js → upload-DsqUSS8l.js} +1 -1
  47. package/dist/chunks/{validators-DwhBEvnh.js → validators-D2Hm57lJ.js} +23 -13
  48. package/dist/chunks/{variable-draft-CauoSBN0.js → variable-draft-DcKj8T1b.js} +4 -4
  49. package/dist/dashboard/index.js +2 -2
  50. package/dist/dashboard-authoring/index.js +2497 -2549
  51. package/dist/format-utils/index.js +14 -14
  52. package/dist/index.js +48 -48
  53. package/dist/report-runtime-context/index.js +2 -2
  54. package/dist/style.css +1 -1
  55. package/dist/surfboard/index.js +2 -2
  56. package/dist/types/components/surfboard/filter/types.d.ts +13 -1
  57. package/dist/types/components/visual/data-table/hooks/use-data-table-logic.d.ts +0 -2
  58. package/dist/types/components/visual/data-table/types/data-table.d.ts +14 -21
  59. package/dist/types/index.js +5 -5
  60. package/dist/types/lib/dashboard-view-state/card-view-state.d.ts +11 -1
  61. package/dist/types/lib/dashboard-view-state/drill-path.d.ts +7 -0
  62. package/dist/types/lib/dashboard-viewer/table-view.d.ts +20 -0
  63. package/dist/types/lib/matrix-table/matrix-runtime-types.d.ts +8 -0
  64. package/dist/types/lib/matrix-table/matrix-runtime.d.ts +1 -0
  65. package/dist/types/lib/query-context/resolve-runtime-card-filters.d.ts +2 -0
  66. package/dist/types/lib/stores/dashboard-store.d.ts +3 -1
  67. package/dist/types/shared/analytics-protocol/analytics-base-schemas.d.ts +64 -0
  68. package/dist/types/shared/analytics-protocol/catalog-source-address.d.ts +16 -0
  69. package/dist/types/shared/analytics-protocol/column-filter-id.d.ts +4 -0
  70. package/dist/types/shared/analytics-protocol/contracts.d.ts +26 -0
  71. package/dist/types/shared/analytics-protocol/index.d.ts +1 -0
  72. package/dist/types/shared/dashboard-authoring/card-query-request.d.ts +12 -1
  73. package/dist/types/shared/dashboard-authoring/card-settings/card-display-write.d.ts +12 -0
  74. package/dist/types/shared/dashboard-authoring/card-settings/card-kinds.d.ts +1 -1
  75. package/dist/types/shared/dashboard-authoring/card-settings/index.d.ts +1 -1
  76. package/dist/types/shared/dashboard-authoring/card-settings/inputs.d.ts +4 -0
  77. package/dist/types/shared/dashboard-authoring/card-settings/resolved.d.ts +2 -0
  78. package/dist/types/shared/dashboard-authoring/changes/dashboard-change.d.ts +18 -0
  79. package/dist/types/shared/dashboard-authoring/conditional-formatting/schema.d.ts +10 -10
  80. package/dist/types/shared/dashboard-authoring/dashboard-filter-mapping-contract.d.ts +2 -0
  81. package/dist/types/shared/dashboard-authoring/operations/operation-types.d.ts +8 -1
  82. package/dist/types/shared/dashboard-authoring/outline/outline-dashboard.d.ts +3 -1
  83. package/dist/types/shared/dashboard-authoring/outline/outline-filters.d.ts +29 -1
  84. package/dist/types/shared/usage-events/attribution.d.ts +2 -2
  85. package/dist/types/shared/usage-events/envelope.d.ts +2 -2
  86. package/dist/usage-events/index.js +1 -1
  87. package/package.json +1 -1
  88. package/dist/chunks/aggregate-measure-field-DtKcEjG5.js +0 -22
  89. package/dist/chunks/dates-DHMCf-F7.js +0 -115
  90. package/dist/chunks/list-filter-B67GsjTw.js +0 -15
@@ -1,26 +1,25 @@
1
- import { c as nt, B as U, X as ce, x as Ne, q as hn, a6 as gn, t as at, u as rt, v as st, w as ot, a7 as Ot, F as Oe, s as le, y as ge, z as xe, A as be, D as ve, E as re, e as it, f as lt, h as dt, L as xn, d as bn } from "./style-sheet-parts-ClmvtkSC.js";
2
- import { jsx as t, jsxs as l, Fragment as fe } from "react/jsx-runtime";
3
- import * as _e from "react";
1
+ import { c as nt, B as G, X as ce, x as Ne, q as hn, a3 as gn, t as at, u as rt, v as st, w as ot, a4 as Ft, F as _e, s as ie, y as ge, z as xe, A as be, D as ve, E as re, e as lt, f as it, h as dt, L as xn, d as bn } from "./style-sheet-parts-BX7d7-2-.js";
2
+ import { jsx as t, jsxs as i, Fragment as fe } from "react/jsx-runtime";
3
+ import * as Fe from "react";
4
4
  import bt, { useMemo as P, useState as Y, useRef as $e, useCallback as ne, useEffect as de, forwardRef as vn, Fragment as yn } from "react";
5
- import { b8 as ct, u as ut, am as se, c8 as _t, cF as X, cG as Nn, c4 as Te, cH as Ge, cI as Vt, cJ as Cn, b_ as Ve, cK as wn, an as Rt, bG as kn, bH as Sn, bJ as Dn, bZ as Tn, cL as In, o as Ln, cM as $n, cN as An, cO as vt, bY as Et, cP as Fn, cQ as zt, cR as Mt, cS as On, cT as _n, cU as Vn, cV as Rn, cW as En, cX as zn, cY as Mn, bz as qn, cZ as yt, c_ as qt, c$ as Nt, bC as jn, d0 as Gn, d1 as Un, d2 as Bn, d3 as ye, d4 as jt, d5 as Wn, d6 as Kn, d7 as Qn, d8 as Pn, d9 as Hn, da as Xe, db as he, dc as Ze, dd as et, de as tt, df as Yn, dg as Re, dh as Ee, di as ze, dj as Me, dk as Gt, dl as Ut, dm as Bt } from "./semaphor-ready-indicator-WvgHMnj8.js";
6
- import { D as Jn } from "./token-types-eMdcuB6j.js";
7
- import { gf as Wt, cr as Kt, cq as Qt, gg as Xn, gh as Zn, gi as ea, gj as ta, gk as na, gl as Ae, gm as Ct, gn as wt, go as Ke, gp as Qe, gq as aa, gr as ra, gs as kt, gt as sa, gu as oa, gv as Fe, gw as ia, gx as St, gy as Pt, gz as Ht, gA as Yt, gB as Jt, gC as la, gD as da, gE as Dt, gF as ca, gG as Tt, gH as ua, gI as ma, gJ as pa, gK as fa, gL as Pe, a as qe, gM as He, bn as ha, gN as ga, gO as xa, gP as ba, gQ as va } from "./resolve-dashboard-input-context-Bw-DesV2.js";
8
- import { c as q } from "./pickers-DkqmtnTL.js";
9
- import { r as Xt, l as ya, k as Zt, aF as en } from "./validators-DwhBEvnh.js";
10
- import "./matrix-operation-contract-RckfqkQm.js";
11
- import "./analytics-base-schemas-8wz9vqn_.js";
5
+ import { b8 as ct, u as ut, am as se, bL as Vt, bM as J, bN as Nn, bO as Te, bP as Ue, bQ as Rt, bR as Cn, bS as Ve, bT as wn, an as Et, bG as kn, bH as Sn, bJ as Dn, bU as Tn, bV as In, o as Ln, bW as $n, bX as An, bY as vt, bZ as zt, b_ as On, b$ as Mt, c0 as jt, c1 as _n, c2 as Fn, c3 as Vn, c4 as Rn, c5 as En, c6 as zn, c7 as Mn, bz as jn, c8 as yt, c9 as qt, ca as Nt, bC as qn, cb as Un, cc as Gn, cd as Bn, ce as ye, cf as Ut, cg as Wn, ch as Qn, ci as Kn, cj as Pn, ck as Hn, cl as Je, cm as he, cn as Ze, co as et, cp as tt, cq as Yn, cr as Re, cs as Ee, ct as ze, cu as Me, cv as Gt, cw as Bt, cx as Wt } from "./semaphor-ready-indicator-1PRI9Yh2.js";
6
+ import { D as Xn } from "./token-types-CnlEiAdS.js";
7
+ import { gt as Qt, cy as Kt, cx as Pt, gu as Jn, gv as Zn, gw as Ae, gx as Ct, gy as wt, gz as Qe, gA as Ke, gB as ea, gC as ta, gD as kt, gE as na, gF as aa, gG as Oe, gH as ra, gI as St, gJ as Ht, gK as Yt, gL as Xt, gM as Jt, gN as sa, gO as oa, gP as Dt, gQ as la, gR as Tt, gS as ia, gT as da, gU as ca, gV as ua, gW as Pe, a as je, gX as ma, gY as It, gZ as pa, g_ as He, bt as fa, g$ as ha, h0 as ga, h1 as xa, h2 as ba } from "./resolve-dashboard-input-context-BAv33KGg.js";
8
+ import { c as j } from "./pickers-DkqmtnTL.js";
9
+ import { r as Zt, l as va, k as en, aF as tn } from "./validators-D2Hm57lJ.js";
10
+ import "./matrix-operation-contract-DdK0J_KU.js";
11
+ import "./analytics-base-schemas-DevrgqQb.js";
12
12
  import "../value-format-preferences/index.js";
13
- import { U as Na } from "./upload-ClUeK8F0.js";
14
- import { r as tn } from "./metric-comparison-DsE8wdRh.js";
15
- import { r as Ca, j as wa } from "./raw-temporal-value-B9W38mi3.js";
16
- import { ad as nn } from "./filter-reach-copy-Dxn-mTuG.js";
13
+ import { U as ya } from "./upload-DsqUSS8l.js";
14
+ import { r as nn } from "./metric-comparison-Bhz0V841.js";
15
+ import { r as Na, j as Ca } from "./raw-temporal-value-BLvdaMng.js";
17
16
  /**
18
17
  * @license lucide-react v0.453.0 - ISC
19
18
  *
20
19
  * This source code is licensed under the ISC license.
21
20
  * See the LICENSE file in the root directory of this source tree.
22
21
  */
23
- const ka = nt("Boxes", [
22
+ const wa = nt("Boxes", [
24
23
  [
25
24
  "path",
26
25
  {
@@ -58,7 +57,7 @@ const ka = nt("Boxes", [
58
57
  * This source code is licensed under the ISC license.
59
58
  * See the LICENSE file in the root directory of this source tree.
60
59
  */
61
- const Tr = nt("FilterX", [
60
+ const kr = nt("FilterX", [
62
61
  ["path", { d: "M13.013 3H2l8 9.46V19l4 2v-8.54l.9-1.055", key: "1fi1da" }],
63
62
  ["path", { d: "m22 3-5 5", key: "12jva0" }],
64
63
  ["path", { d: "m17 3 5 5", key: "k36vhe" }]
@@ -69,13 +68,13 @@ const Tr = nt("FilterX", [
69
68
  * This source code is licensed under the ISC license.
70
69
  * See the LICENSE file in the root directory of this source tree.
71
70
  */
72
- const Sa = nt("Library", [
71
+ const ka = nt("Library", [
73
72
  ["path", { d: "m16 6 4 14", key: "ji33uf" }],
74
73
  ["path", { d: "M12 6v14", key: "1n7gus" }],
75
74
  ["path", { d: "M8 8v12", key: "1gg7y9" }],
76
75
  ["path", { d: "M4 4v16", key: "6qkkli" }]
77
76
  ]);
78
- function Da(e, n, a) {
77
+ function Sa(e, n, a) {
79
78
  switch (e) {
80
79
  case "none":
81
80
  return !1;
@@ -88,13 +87,13 @@ function Da(e, n, a) {
88
87
  return !0;
89
88
  }
90
89
  }
91
- function Ta({
90
+ function Da({
92
91
  mode: e,
93
92
  currentDomainId: n,
94
93
  scopedDomainIds: a,
95
94
  hasSelectedEntities: o
96
95
  }) {
97
- return e === "all" ? !1 : e === "none" ? !!n || o : n ? !Da(e, n, a) : o;
96
+ return e === "all" ? !1 : e === "none" ? !!n || o : n ? !Sa(e, n, a) : o;
98
97
  }
99
98
  function an(e) {
100
99
  const { tokenProps: n } = ct(), a = ut((s) => s.authToken) || e;
@@ -102,19 +101,19 @@ function an(e) {
102
101
  (s) => s.selectedConnectionId
103
102
  ), se(
104
103
  (s) => {
105
- var m, f;
106
- return (f = (m = s == null ? void 0 : s.card) == null ? void 0 : m.dataSource) == null ? void 0 : f.connectionId;
104
+ var c, g;
105
+ return (g = (c = s == null ? void 0 : s.card) == null ? void 0 : c.dataSource) == null ? void 0 : g.connectionId;
107
106
  }
108
107
  );
109
108
  const {
110
109
  refetch: o,
111
- isPending: u,
110
+ isPending: m,
112
111
  data: d,
113
- isLoading: c,
114
- isError: i
115
- } = _t({
112
+ isLoading: u,
113
+ isError: l
114
+ } = Vt({
116
115
  queryKey: ["semantic-domains"],
117
- queryFn: () => Wt(
116
+ queryFn: () => Qt(
118
117
  `${n.apiServiceUrl}/v1/domains`,
119
118
  (a == null ? void 0 : a.accessToken) || ""
120
119
  ),
@@ -122,133 +121,133 @@ function an(e) {
122
121
  // Only fetch if authToken is present
123
122
  });
124
123
  return {
125
- isPending: u,
126
- error: i,
124
+ isPending: m,
125
+ error: l,
127
126
  semanticDomainsData: d,
128
127
  semanticDomains: (d == null ? void 0 : d.domains) || [],
129
- isSemanticDomainsLoading: c,
130
- isSemanticDomainsError: i,
128
+ isSemanticDomainsLoading: u,
129
+ isSemanticDomainsError: l,
131
130
  refetchSemanticDomains: o
132
131
  };
133
132
  }
134
- function Ia(e, n) {
133
+ function Ta(e, n) {
135
134
  if (e.some(
136
- (d) => X(d, n)
135
+ (d) => J(d, n)
137
136
  ))
138
137
  return e.filter(
139
- (d) => !X(d, n)
138
+ (d) => !J(d, n)
140
139
  );
141
- const o = Qt(e);
140
+ const o = Pt(e);
142
141
  return e.some(
143
142
  (d) => !("domainId" in d)
144
143
  ) || [...o].some((d) => d !== n.domainId) ? [n] : [...e, n];
145
144
  }
146
- function La(e, n) {
147
- const a = Kt(n), o = Qt(e), u = e.some(
148
- (c) => !("domainId" in c)
145
+ function Ia(e, n) {
146
+ const a = Kt(n), o = Pt(e), m = e.some(
147
+ (u) => !("domainId" in u)
149
148
  );
150
- if (a && (u || [...o].some(
151
- (c) => c !== a
149
+ if (a && (m || [...o].some(
150
+ (u) => u !== a
152
151
  )))
153
152
  return n;
154
153
  const d = [...e];
155
- for (const c of n)
156
- d.some((i) => X(i, c)) || d.push(c);
154
+ for (const u of n)
155
+ d.some((l) => J(l, u)) || d.push(u);
157
156
  return d;
158
157
  }
159
- function $a({
158
+ function La({
160
159
  domainAccess: e,
161
160
  search: n,
162
161
  scopeDomainId: a,
163
162
  selectedEntities: o,
164
- onSelectionChange: u
163
+ onSelectionChange: m
165
164
  }) {
166
- const { semanticDomains: d, isSemanticDomainsLoading: c } = an(), i = P(() => Fa(d, e), [d, e]), s = P(() => a ? i.filter((f) => f.id === a) : i, [i, a]);
167
- if (c && s.length === 0)
165
+ const { semanticDomains: d, isSemanticDomainsLoading: u } = an(), l = P(() => Aa(d, e), [d, e]), s = P(() => a ? l.filter((g) => g.id === a) : l, [l, a]);
166
+ if (u && s.length === 0)
168
167
  return /* @__PURE__ */ t("div", { className: "px-3 py-4 text-[11px] text-muted-foreground", children: "Loading semantic domains…" });
169
168
  if (s.length === 0)
170
169
  return null;
171
- const m = !!a;
172
- return /* @__PURE__ */ l("div", { children: [
170
+ const c = !!a;
171
+ return /* @__PURE__ */ i("div", { children: [
173
172
  /* @__PURE__ */ t(rn, { label: "Semantic Domains" }),
174
- s.map((f) => /* @__PURE__ */ t(
175
- Aa,
173
+ s.map((g) => /* @__PURE__ */ t(
174
+ $a,
176
175
  {
177
- domain: f,
176
+ domain: g,
178
177
  search: n,
179
- forceExpanded: m,
178
+ forceExpanded: c,
180
179
  selectedEntities: o,
181
- onSelectionChange: u
180
+ onSelectionChange: m
182
181
  },
183
- f.id
182
+ g.id
184
183
  ))
185
184
  ] });
186
185
  }
187
- function Aa({
186
+ function $a({
188
187
  domain: e,
189
188
  search: n,
190
189
  forceExpanded: a,
191
190
  selectedEntities: o,
192
- onSelectionChange: u
191
+ onSelectionChange: m
193
192
  }) {
194
- const [d, c] = Y(!1), i = d || n.length > 0 || !!a, { datasets: s, isPending: m } = Nn(
195
- i ? e.id : void 0
196
- ), f = P(() => {
193
+ const [d, u] = Y(!1), l = d || n.length > 0 || !!a, { datasets: s, isPending: c } = Nn(
194
+ l ? e.id : void 0
195
+ ), g = P(() => {
197
196
  if (!n) return s;
198
197
  const C = n.trim().toLowerCase();
199
198
  return s.filter(
200
199
  (T) => `${T.label ?? ""} ${T.name ?? ""} ${T.description ?? ""}`.toLowerCase().includes(C)
201
200
  );
202
- }, [s, n]), k = n.length > 0 && f.length > 0, y = d || k || !!a, g = s.length, N = P(() => f.filter(
201
+ }, [s, n]), k = n.length > 0 && g.length > 0, y = d || k || !!a, h = s.length, N = P(() => g.filter(
203
202
  (C) => o.some(
204
- (T) => X(T, Le(C))
203
+ (T) => J(T, Le(C))
205
204
  )
206
- ).length, [f, o]), S = P(
207
- () => f.map(Le),
208
- [f]
205
+ ).length, [g, o]), S = P(
206
+ () => g.map(Le),
207
+ [g]
209
208
  ), V = S.length > 0 && S.every(
210
- (C) => o.some((T) => X(T, C))
211
- ), _ = () => {
209
+ (C) => o.some((T) => J(T, C))
210
+ ), F = () => {
212
211
  if (S.length !== 0) {
213
212
  if (V) {
214
- u(
213
+ m(
215
214
  o.filter(
216
215
  (C) => !S.some(
217
- (T) => X(C, T)
216
+ (T) => J(C, T)
218
217
  )
219
218
  )
220
219
  );
221
220
  return;
222
221
  }
223
- u(
224
- La(
222
+ m(
223
+ Ia(
225
224
  o,
226
225
  S
227
226
  )
228
227
  );
229
228
  }
230
- }, Q = (C) => {
229
+ }, K = (C) => {
231
230
  const T = Le(C);
232
- u(
233
- Ia(
231
+ m(
232
+ Ta(
234
233
  o,
235
234
  T
236
235
  )
237
236
  );
238
237
  };
239
- return n.length > 0 && !k && !m ? null : /* @__PURE__ */ l("div", { children: [
240
- /* @__PURE__ */ l("div", { className: "flex items-center rounded-[4px] px-3 py-1.5 transition-colors hover:bg-muted/50", children: [
241
- /* @__PURE__ */ l(
238
+ return n.length > 0 && !k && !c ? null : /* @__PURE__ */ i("div", { children: [
239
+ /* @__PURE__ */ i("div", { className: "flex items-center rounded-[4px] px-3 py-1.5 transition-colors hover:bg-muted/50", children: [
240
+ /* @__PURE__ */ i(
242
241
  "button",
243
242
  {
244
243
  type: "button",
245
- onClick: () => c((C) => !C),
244
+ onClick: () => u((C) => !C),
246
245
  className: "flex min-w-0 flex-1 items-center gap-1.5 text-left",
247
246
  children: [
248
247
  /* @__PURE__ */ t(
249
248
  Te,
250
249
  {
251
- className: q(
250
+ className: j(
252
251
  "h-3 w-3 shrink-0 text-muted-foreground transition-transform",
253
252
  y && "rotate-90"
254
253
  ),
@@ -256,42 +255,42 @@ function Aa({
256
255
  }
257
256
  ),
258
257
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || e.name }),
259
- g > 0 && /* @__PURE__ */ l("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: [
258
+ h > 0 && /* @__PURE__ */ i("span", { className: "shrink-0 text-[11px] text-muted-foreground", children: [
260
259
  "· ",
261
- g,
260
+ h,
262
261
  " dataset",
263
- g === 1 ? "" : "s",
262
+ h === 1 ? "" : "s",
264
263
  " · curated"
265
264
  ] })
266
265
  ]
267
266
  }
268
267
  ),
269
- y && !m && S.length > 0 && /* @__PURE__ */ t(
268
+ y && !c && S.length > 0 && /* @__PURE__ */ t(
270
269
  "button",
271
270
  {
272
271
  type: "button",
273
- onClick: _,
272
+ onClick: F,
274
273
  className: "ml-2 shrink-0 rounded-[3px] px-1.5 py-0.5 text-[10.5px] font-medium text-muted-foreground hover:bg-background hover:text-foreground",
275
274
  children: V ? "Clear" : "Select all"
276
275
  }
277
276
  ),
278
277
  /* @__PURE__ */ t("span", { className: "ml-auto font-mono text-[10px] tabular-nums text-muted-foreground", children: N > 0 ? N : "" })
279
278
  ] }),
280
- y && /* @__PURE__ */ t("ul", { className: "space-y-px pb-1", children: m && s.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "Loading datasets…" }) : f.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "No datasets in this domain." }) : f.map((C) => {
281
- const T = Le(C), G = o.some(
282
- (Z) => X(Z, T)
279
+ y && /* @__PURE__ */ t("ul", { className: "space-y-px pb-1", children: c && s.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "Loading datasets…" }) : g.length === 0 ? /* @__PURE__ */ t("li", { className: "px-9 py-1.5 text-[11px] text-muted-foreground", children: "No datasets in this domain." }) : g.map((C) => {
280
+ const T = Le(C), U = o.some(
281
+ (Z) => J(Z, T)
283
282
  );
284
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("label", { className: "flex cursor-pointer items-start gap-2 rounded-[4px] px-9 py-1.5 transition-colors hover:bg-muted/40", children: [
283
+ return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ i("label", { className: "flex cursor-pointer items-start gap-2 rounded-[4px] px-9 py-1.5 transition-colors hover:bg-muted/40", children: [
285
284
  /* @__PURE__ */ t(
286
- Ge,
285
+ Ue,
287
286
  {
288
- checked: G,
289
- onCheckedChange: () => Q(C),
287
+ checked: U,
288
+ onCheckedChange: () => K(C),
290
289
  className: "mt-[3px] h-3.5 w-3.5 shrink-0"
291
290
  }
292
291
  ),
293
- /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
294
- /* @__PURE__ */ l("div", { className: "flex items-baseline gap-1.5", children: [
292
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
293
+ /* @__PURE__ */ i("div", { className: "flex items-baseline gap-1.5", children: [
295
294
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground", children: C.label || C.name }),
296
295
  /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children: C.type === "virtual" ? "virtual" : "dataset" })
297
296
  ] }),
@@ -304,7 +303,7 @@ function Aa({
304
303
  function rn({ label: e }) {
305
304
  return /* @__PURE__ */ t("div", { className: "px-3 pb-1.5 pt-2.5", children: /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: e }) });
306
305
  }
307
- function Fa(e, n) {
306
+ function Aa(e, n) {
308
307
  if (!n || n.mode === "all") return e;
309
308
  const a = new Set(n.domainIds ?? []);
310
309
  return n.mode === "include" ? e.filter((o) => a.has(o.id)) : n.mode === "exclude" ? e.filter((o) => !a.has(o.id)) : [];
@@ -334,20 +333,20 @@ function Oa({
334
333
  selectedEntities: a,
335
334
  onSelectionChange: o
336
335
  }) {
337
- const { connections: u, isConnectionsLoading: d } = Vt(), c = P(() => n ? u.filter((s) => s.id === n) : u, [u, n]);
338
- if (d && c.length === 0)
336
+ const { connections: m, isConnectionsLoading: d } = Rt(), u = P(() => n ? m.filter((s) => s.id === n) : m, [m, n]);
337
+ if (d && u.length === 0)
339
338
  return /* @__PURE__ */ t("div", { className: "px-3 py-4 text-[11px] text-muted-foreground", children: "Loading connections…" });
340
- if (c.length === 0)
339
+ if (u.length === 0)
341
340
  return null;
342
- const i = !!n;
343
- return /* @__PURE__ */ l("div", { children: [
341
+ const l = !!n;
342
+ return /* @__PURE__ */ i("div", { children: [
344
343
  /* @__PURE__ */ t(rn, { label: "Direct Sources" }),
345
- c.map((s) => /* @__PURE__ */ t(
344
+ u.map((s) => /* @__PURE__ */ t(
346
345
  _a,
347
346
  {
348
347
  connection: s,
349
348
  search: e,
350
- forceExpanded: i,
349
+ forceExpanded: l,
351
350
  selectedEntities: a,
352
351
  onSelectionChange: o
353
352
  },
@@ -360,72 +359,72 @@ function _a({
360
359
  search: n,
361
360
  forceExpanded: a,
362
361
  selectedEntities: o,
363
- onSelectionChange: u
362
+ onSelectionChange: m
364
363
  }) {
365
364
  var N;
366
- const [d, c] = Y(!1), i = d || n.length > 0 || !!a, s = ((N = e.capabilities) == null ? void 0 : N.path) ?? [], m = s.includes("database"), f = s.includes("schema"), k = e.type === "upload", y = e.type === "url", g = P(
365
+ const [d, u] = Y(!1), l = d || n.length > 0 || !!a, s = ((N = e.capabilities) == null ? void 0 : N.path) ?? [], c = s.includes("database"), g = s.includes("schema"), k = e.type === "upload", y = e.type === "url", h = P(
367
366
  () => o.filter((S) => S.connectionId === e.id).length,
368
367
  [o, e.id]
369
368
  );
370
- return /* @__PURE__ */ l("div", { className: "border-b border-border/60 last:border-b-0", children: [
371
- /* @__PURE__ */ l(
369
+ return /* @__PURE__ */ i("div", { className: "border-b border-border/60 last:border-b-0", children: [
370
+ /* @__PURE__ */ i(
372
371
  "button",
373
372
  {
374
373
  type: "button",
375
- onClick: () => c((S) => !S),
374
+ onClick: () => u((S) => !S),
376
375
  className: "flex w-full items-center gap-2 px-4 py-1.5 text-left transition-colors hover:bg-muted/40",
377
376
  children: [
378
377
  /* @__PURE__ */ t(
379
378
  Te,
380
379
  {
381
- className: q(
380
+ className: j(
382
381
  "h-3 w-3 shrink-0 text-muted-foreground transition-transform",
383
- i && "rotate-90"
382
+ l && "rotate-90"
384
383
  ),
385
384
  strokeWidth: 1.75
386
385
  }
387
386
  ),
388
387
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground/90", children: e.name }),
389
- /* @__PURE__ */ l("span", { className: "truncate text-[11px] text-muted-foreground", children: [
388
+ /* @__PURE__ */ i("span", { className: "truncate text-[11px] text-muted-foreground", children: [
390
389
  "· ",
391
390
  e.type
392
391
  ] }),
393
- /* @__PURE__ */ t("span", { className: "ml-auto shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground", children: g > 0 ? g : "" })
392
+ /* @__PURE__ */ t("span", { className: "ml-auto shrink-0 font-mono text-[10px] tabular-nums text-muted-foreground", children: h > 0 ? h : "" })
394
393
  ]
395
394
  }
396
395
  ),
397
- i && /* @__PURE__ */ l(fe, { children: [
396
+ l && /* @__PURE__ */ i(fe, { children: [
398
397
  k ? /* @__PURE__ */ t(
399
- Va,
398
+ Fa,
400
399
  {
401
400
  connection: e,
402
401
  selectedEntities: o,
403
- onSelectionChange: u
402
+ onSelectionChange: m
404
403
  }
405
404
  ) : y ? /* @__PURE__ */ t(
406
- Ra,
405
+ Va,
407
406
  {
408
407
  connection: e,
409
408
  selectedEntities: o,
410
- onSelectionChange: u
409
+ onSelectionChange: m
411
410
  }
412
- ) : m ? /* @__PURE__ */ t(
413
- Ea,
411
+ ) : c ? /* @__PURE__ */ t(
412
+ Ra,
414
413
  {
415
414
  connection: e,
416
- requiresSchema: f,
415
+ requiresSchema: g,
417
416
  search: n,
418
417
  selectedEntities: o,
419
- onSelectionChange: u
418
+ onSelectionChange: m
420
419
  }
421
- ) : f ? /* @__PURE__ */ t(
420
+ ) : g ? /* @__PURE__ */ t(
422
421
  sn,
423
422
  {
424
423
  connection: e,
425
424
  databaseName: "",
426
425
  search: n,
427
426
  selectedEntities: o,
428
- onSelectionChange: u
427
+ onSelectionChange: m
429
428
  }
430
429
  ) : /* @__PURE__ */ t(
431
430
  mt,
@@ -435,52 +434,52 @@ function _a({
435
434
  schemaName: "",
436
435
  search: n,
437
436
  selectedEntities: o,
438
- onSelectionChange: u
437
+ onSelectionChange: m
439
438
  }
440
439
  ),
441
440
  !k && !y && /* @__PURE__ */ t(
442
- za,
441
+ Ea,
443
442
  {
444
443
  connection: e,
445
444
  search: n,
446
445
  selectedEntities: o,
447
- onSelectionChange: u
446
+ onSelectionChange: m
448
447
  }
449
448
  )
450
449
  ] })
451
450
  ] });
452
451
  }
453
- function Va({
452
+ function Fa({
454
453
  connection: e,
455
454
  selectedEntities: n,
456
455
  onSelectionChange: a
457
456
  }) {
458
- const o = `upload-source-${e.id}`, u = n.filter(
459
- (i) => i.connectionId === e.id && (i.type === "upload" || i.type === "file")
460
- ), d = (i) => {
461
- if (!(i != null && i.length)) return;
462
- const s = Array.from(i).map((m) => ({
457
+ const o = `upload-source-${e.id}`, m = n.filter(
458
+ (l) => l.connectionId === e.id && (l.type === "upload" || l.type === "file")
459
+ ), d = (l) => {
460
+ if (!(l != null && l.length)) return;
461
+ const s = Array.from(l).map((c) => ({
463
462
  id: `file-${Date.now()}-${Math.random()}`,
464
- name: m.name,
463
+ name: c.name,
465
464
  type: "upload",
466
465
  connectionId: e.id,
467
466
  connectionType: e.type,
468
- label: m.name,
467
+ label: c.name,
469
468
  description: `Uploaded ${(/* @__PURE__ */ new Date()).toLocaleString()}`,
470
- originalName: m.name,
471
- file: m
469
+ originalName: c.name,
470
+ file: c
472
471
  }));
473
472
  a([...n, ...s]);
474
- }, c = (i) => {
473
+ }, u = (l) => {
475
474
  a(
476
475
  n.filter(
477
- (s) => !("id" in s && s.id === i && s.connectionId === e.id && (s.type === "upload" || s.type === "file"))
476
+ (s) => !("id" in s && s.id === l && s.connectionId === e.id && (s.type === "upload" || s.type === "file"))
478
477
  )
479
478
  );
480
479
  };
481
- return /* @__PURE__ */ l("div", { className: "space-y-2 px-8 py-2", children: [
482
- /* @__PURE__ */ l("div", { className: "rounded-[6px] border border-dashed border-border bg-muted/20 p-4 text-center", children: [
483
- /* @__PURE__ */ t(Na, { className: "mx-auto mb-2 h-5 w-5 text-muted-foreground" }),
480
+ return /* @__PURE__ */ i("div", { className: "space-y-2 px-8 py-2", children: [
481
+ /* @__PURE__ */ i("div", { className: "rounded-[6px] border border-dashed border-border bg-muted/20 p-4 text-center", children: [
482
+ /* @__PURE__ */ t(ya, { className: "mx-auto mb-2 h-5 w-5 text-muted-foreground" }),
484
483
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Add CSV, JSON, or Excel files." }),
485
484
  /* @__PURE__ */ t(
486
485
  "input",
@@ -489,58 +488,58 @@ function Va({
489
488
  type: "file",
490
489
  multiple: !0,
491
490
  className: "hidden",
492
- onChange: (i) => d(i.target.files),
491
+ onChange: (l) => d(l.target.files),
493
492
  accept: ".csv,.json,.xlsx,.xls"
494
493
  }
495
494
  ),
496
495
  /* @__PURE__ */ t(
497
- U,
496
+ G,
498
497
  {
499
498
  type: "button",
500
499
  variant: "outline",
501
500
  size: "sm",
502
501
  className: "mt-2 h-7 text-[12px]",
503
502
  onClick: () => {
504
- var i;
505
- return (i = document.getElementById(o)) == null ? void 0 : i.click();
503
+ var l;
504
+ return (l = document.getElementById(o)) == null ? void 0 : l.click();
506
505
  },
507
506
  children: "Select files"
508
507
  }
509
508
  )
510
509
  ] }),
511
- u.length > 0 && /* @__PURE__ */ t("ul", { className: "space-y-1", children: u.map((i) => /* @__PURE__ */ l(
510
+ m.length > 0 && /* @__PURE__ */ t("ul", { className: "space-y-1", children: m.map((l) => /* @__PURE__ */ i(
512
511
  "li",
513
512
  {
514
513
  className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 py-1.5",
515
514
  children: [
516
515
  /* @__PURE__ */ t(Cn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
517
- /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[12px]", children: i.originalName || i.name }),
516
+ /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-[12px]", children: l.originalName || l.name }),
518
517
  /* @__PURE__ */ t(
519
518
  "button",
520
519
  {
521
520
  type: "button",
522
- "aria-label": `Remove ${i.originalName || i.name}`,
523
- onClick: () => c(i.id),
521
+ "aria-label": `Remove ${l.originalName || l.name}`,
522
+ onClick: () => u(l.id),
524
523
  className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-[3px] text-muted-foreground hover:bg-muted hover:text-foreground",
525
524
  children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
526
525
  }
527
526
  )
528
527
  ]
529
528
  },
530
- i.id
529
+ l.id
531
530
  )) })
532
531
  ] });
533
532
  }
534
- function Ra({
533
+ function Va({
535
534
  connection: e,
536
535
  selectedEntities: n,
537
536
  onSelectionChange: a
538
537
  }) {
539
- const [o, u] = Y(""), [d, c] = Y(""), [i, s] = Y("api"), m = n.filter(
538
+ const [o, m] = Y(""), [d, u] = Y(""), [l, s] = Y("api"), c = n.filter(
540
539
  (y) => y.connectionId === e.id && y.type === "url"
541
- ), f = () => {
542
- const y = o.trim(), g = d.trim();
543
- if (!y || !g) return;
540
+ ), g = () => {
541
+ const y = o.trim(), h = d.trim();
542
+ if (!y || !h) return;
544
543
  const N = {
545
544
  id: `url-${Date.now()}-${Math.random()}`,
546
545
  name: y,
@@ -548,26 +547,26 @@ function Ra({
548
547
  connectionId: e.id,
549
548
  connectionType: e.type,
550
549
  label: y,
551
- description: `URL source of type ${i}`,
550
+ description: `URL source of type ${l}`,
552
551
  originalName: y,
553
- url: g,
554
- sourceType: i
552
+ url: h,
553
+ sourceType: l
555
554
  };
556
- a([...n, N]), u(""), c(""), s("api");
555
+ a([...n, N]), m(""), u(""), s("api");
557
556
  }, k = (y) => {
558
557
  a(
559
558
  n.filter(
560
- (g) => !("id" in g && g.id === y && g.connectionId === e.id && g.type === "url")
559
+ (h) => !("id" in h && h.id === y && h.connectionId === e.id && h.type === "url")
561
560
  )
562
561
  );
563
562
  };
564
- return /* @__PURE__ */ l("div", { className: "space-y-2 px-8 py-2", children: [
565
- /* @__PURE__ */ l("div", { className: "space-y-2 rounded-[6px] border border-border bg-muted/20 p-3", children: [
563
+ return /* @__PURE__ */ i("div", { className: "space-y-2 px-8 py-2", children: [
564
+ /* @__PURE__ */ i("div", { className: "space-y-2 rounded-[6px] border border-border bg-muted/20 p-3", children: [
566
565
  /* @__PURE__ */ t(
567
566
  Ne,
568
567
  {
569
568
  value: o,
570
- onChange: (y) => u(y.target.value),
569
+ onChange: (y) => m(y.target.value),
571
570
  placeholder: "Source name",
572
571
  className: "h-7 text-[12px]"
573
572
  }
@@ -576,16 +575,16 @@ function Ra({
576
575
  Ne,
577
576
  {
578
577
  value: d,
579
- onChange: (y) => c(y.target.value),
578
+ onChange: (y) => u(y.target.value),
580
579
  placeholder: "https://api.example.com/data",
581
580
  className: "h-7 text-[12px]"
582
581
  }
583
582
  ),
584
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
585
- /* @__PURE__ */ l(
583
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
584
+ /* @__PURE__ */ i(
586
585
  "select",
587
586
  {
588
- value: i,
587
+ value: l,
589
588
  onChange: (y) => s(y.target.value),
590
589
  className: "h-7 flex-1 rounded-control border border-input bg-background px-2 text-[12px]",
591
590
  children: [
@@ -595,14 +594,14 @@ function Ra({
595
594
  ]
596
595
  }
597
596
  ),
598
- /* @__PURE__ */ l(
599
- U,
597
+ /* @__PURE__ */ i(
598
+ G,
600
599
  {
601
600
  type: "button",
602
601
  size: "sm",
603
602
  className: "h-7 text-[12px]",
604
603
  disabled: !o.trim() || !d.trim(),
605
- onClick: f,
604
+ onClick: g,
606
605
  children: [
607
606
  /* @__PURE__ */ t(Ve, { className: "mr-1 h-3 w-3" }),
608
607
  "Add"
@@ -611,13 +610,13 @@ function Ra({
611
610
  )
612
611
  ] })
613
612
  ] }),
614
- m.length > 0 && /* @__PURE__ */ t("ul", { className: "space-y-1", children: m.map((y) => /* @__PURE__ */ l(
613
+ c.length > 0 && /* @__PURE__ */ t("ul", { className: "space-y-1", children: c.map((y) => /* @__PURE__ */ i(
615
614
  "li",
616
615
  {
617
616
  className: "flex items-center gap-2 rounded-[5px] border border-border bg-background px-2 py-1.5",
618
617
  children: [
619
618
  /* @__PURE__ */ t(wn, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
620
- /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
619
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
621
620
  /* @__PURE__ */ t("p", { className: "truncate text-[12px]", children: y.name }),
622
621
  /* @__PURE__ */ t("p", { className: "truncate text-[11px] text-muted-foreground", children: y.url })
623
622
  ] }),
@@ -637,35 +636,35 @@ function Ra({
637
636
  )) })
638
637
  ] });
639
638
  }
640
- function Ea({
639
+ function Ra({
641
640
  connection: e,
642
641
  requiresSchema: n,
643
642
  search: a,
644
643
  selectedEntities: o,
645
- onSelectionChange: u
644
+ onSelectionChange: m
646
645
  }) {
647
- var i;
648
- const d = Ue("/v1/databases", { connection_id: e.id }, [
646
+ var l;
647
+ const d = Ge("/v1/databases", { connection_id: e.id }, [
649
648
  "databases",
650
649
  e.id
651
650
  ]);
652
651
  if (d.isLoading)
653
652
  return /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "Loading databases…" });
654
- const c = ((i = d.data) == null ? void 0 : i.databases) ?? [];
655
- return c.length === 0 ? /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "No databases." }) : /* @__PURE__ */ t("div", { children: c.map((s) => /* @__PURE__ */ t(
653
+ const u = ((l = d.data) == null ? void 0 : l.databases) ?? [];
654
+ return u.length === 0 ? /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "No databases." }) : /* @__PURE__ */ t("div", { children: u.map((s) => /* @__PURE__ */ t(
656
655
  on,
657
656
  {
658
657
  label: s.database_name,
659
658
  indentLevel: 1,
660
659
  search: a,
661
- renderChildren: (m) => m && (n ? /* @__PURE__ */ t(
660
+ renderChildren: (c) => c && (n ? /* @__PURE__ */ t(
662
661
  sn,
663
662
  {
664
663
  connection: e,
665
664
  databaseName: s.database_name,
666
665
  search: a,
667
666
  selectedEntities: o,
668
- onSelectionChange: u
667
+ onSelectionChange: m
669
668
  }
670
669
  ) : /* @__PURE__ */ t(
671
670
  mt,
@@ -675,7 +674,7 @@ function Ea({
675
674
  schemaName: "",
676
675
  search: a,
677
676
  selectedEntities: o,
678
- onSelectionChange: u
677
+ onSelectionChange: m
679
678
  }
680
679
  ))
681
680
  },
@@ -687,10 +686,10 @@ function sn({
687
686
  databaseName: n,
688
687
  search: a,
689
688
  selectedEntities: o,
690
- onSelectionChange: u
689
+ onSelectionChange: m
691
690
  }) {
692
- var i;
693
- const d = Ue(
691
+ var l;
692
+ const d = Ge(
694
693
  "/v1/schemas",
695
694
  {
696
695
  connection_id: e.id,
@@ -701,14 +700,14 @@ function sn({
701
700
  );
702
701
  if (d.isLoading)
703
702
  return /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "Loading schemas…" });
704
- const c = ((i = d.data) == null ? void 0 : i.schemas) ?? [];
705
- return c.length === 0 ? /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "No schemas." }) : /* @__PURE__ */ t("div", { children: c.map((s) => /* @__PURE__ */ t(
703
+ const u = ((l = d.data) == null ? void 0 : l.schemas) ?? [];
704
+ return u.length === 0 ? /* @__PURE__ */ t("div", { className: "px-8 py-1.5 text-[11px] text-muted-foreground", children: "No schemas." }) : /* @__PURE__ */ t("div", { children: u.map((s) => /* @__PURE__ */ t(
706
705
  on,
707
706
  {
708
707
  label: s.schema_name,
709
708
  indentLevel: n ? 2 : 1,
710
709
  search: a,
711
- renderChildren: (m) => m && /* @__PURE__ */ t(
710
+ renderChildren: (c) => c && /* @__PURE__ */ t(
712
711
  mt,
713
712
  {
714
713
  connection: e,
@@ -716,7 +715,7 @@ function sn({
716
715
  schemaName: s.schema_name,
717
716
  search: a,
718
717
  selectedEntities: o,
719
- onSelectionChange: u
718
+ onSelectionChange: m
720
719
  }
721
720
  )
722
721
  },
@@ -728,10 +727,10 @@ function mt({
728
727
  databaseName: n,
729
728
  schemaName: a,
730
729
  search: o,
731
- selectedEntities: u,
730
+ selectedEntities: m,
732
731
  onSelectionChange: d
733
732
  }) {
734
- const c = Ue(
733
+ const u = Ge(
735
734
  "/v1/tables",
736
735
  {
737
736
  connection_id: e.id,
@@ -739,60 +738,60 @@ function mt({
739
738
  schema_name: a || void 0
740
739
  },
741
740
  ["tables", e.id, n, a]
742
- ), i = P(() => {
741
+ ), l = P(() => {
743
742
  var S;
744
- const g = ((S = c.data) == null ? void 0 : S.tables) ?? [];
745
- if (!o) return g;
743
+ const h = ((S = u.data) == null ? void 0 : S.tables) ?? [];
744
+ if (!o) return h;
746
745
  const N = o.trim().toLowerCase();
747
- return g.filter((V) => V.table_name.toLowerCase().includes(N));
748
- }, [c.data, o]), s = (g, N) => ({
746
+ return h.filter((V) => V.table_name.toLowerCase().includes(N));
747
+ }, [u.data, o]), s = (h, N) => ({
749
748
  connectionId: e.id,
750
749
  connectionType: e.type,
751
750
  type: "table",
752
751
  dialect: e.dialect,
753
752
  database: n || void 0,
754
753
  schema: a || void 0,
755
- name: g,
754
+ name: h,
756
755
  dbObjectType: N == null ? void 0 : N.toLowerCase()
757
756
  });
758
- if (c.isLoading)
757
+ if (u.isLoading)
759
758
  return /* @__PURE__ */ t("div", { className: "px-10 py-1.5 text-[11px] text-muted-foreground", children: "Loading tables…" });
760
- if (i.length === 0)
759
+ if (l.length === 0)
761
760
  return o ? null : /* @__PURE__ */ t("div", { className: "px-10 py-1.5 text-[11px] text-muted-foreground", children: "No tables." });
762
- const m = i.map(
763
- (g) => s(g.table_name, g.table_type)
764
- ), f = m.length > 0 && m.every(
765
- (g) => u.some((N) => X(N, g))
766
- ), k = (g, N) => {
767
- const S = s(g, N), V = u.some(
768
- (_) => X(_, S)
761
+ const c = l.map(
762
+ (h) => s(h.table_name, h.table_type)
763
+ ), g = c.length > 0 && c.every(
764
+ (h) => m.some((N) => J(N, h))
765
+ ), k = (h, N) => {
766
+ const S = s(h, N), V = m.some(
767
+ (F) => J(F, S)
769
768
  );
770
769
  d(
771
- V ? u.filter((_) => !X(_, S)) : [...u, S]
770
+ V ? m.filter((F) => !J(F, S)) : [...m, S]
772
771
  );
773
772
  }, y = () => {
774
- if (m.length === 0) return;
775
- if (f) {
773
+ if (c.length === 0) return;
774
+ if (g) {
776
775
  d(
777
- u.filter(
778
- (N) => !m.some(
779
- (S) => X(N, S)
776
+ m.filter(
777
+ (N) => !c.some(
778
+ (S) => J(N, S)
780
779
  )
781
780
  )
782
781
  );
783
782
  return;
784
783
  }
785
- const g = [...u];
786
- for (const N of m)
787
- g.some((S) => X(S, N)) || g.push(N);
788
- d(g);
784
+ const h = [...m];
785
+ for (const N of c)
786
+ h.some((S) => J(S, N)) || h.push(N);
787
+ d(h);
789
788
  };
790
- return /* @__PURE__ */ l("ul", { children: [
791
- /* @__PURE__ */ l("li", { className: "flex items-center justify-between gap-2 py-1 pl-12 pr-4", children: [
792
- /* @__PURE__ */ l("span", { className: "text-[10.5px] font-medium uppercase tracking-[0.06em] text-muted-foreground", children: [
793
- i.length,
789
+ return /* @__PURE__ */ i("ul", { children: [
790
+ /* @__PURE__ */ i("li", { className: "flex items-center justify-between gap-2 py-1 pl-12 pr-4", children: [
791
+ /* @__PURE__ */ i("span", { className: "text-[10.5px] font-medium uppercase tracking-[0.06em] text-muted-foreground", children: [
792
+ l.length,
794
793
  " table",
795
- i.length === 1 ? "" : "s"
794
+ l.length === 1 ? "" : "s"
796
795
  ] }),
797
796
  /* @__PURE__ */ t(
798
797
  "button",
@@ -800,20 +799,20 @@ function mt({
800
799
  type: "button",
801
800
  onClick: y,
802
801
  className: "rounded-[3px] px-1.5 py-0.5 text-[10.5px] font-medium text-muted-foreground hover:bg-muted hover:text-foreground",
803
- children: f ? "Clear" : "Select all"
802
+ children: g ? "Clear" : "Select all"
804
803
  }
805
804
  )
806
805
  ] }),
807
- i.map((g) => {
808
- const N = s(g.table_name, g.table_type), S = u.some(
809
- (V) => X(V, N)
806
+ l.map((h) => {
807
+ const N = s(h.table_name, h.table_type), S = m.some(
808
+ (V) => J(V, N)
810
809
  );
811
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("label", { className: "flex cursor-pointer items-center gap-2.5 py-1.5 pl-12 pr-4 transition-colors hover:bg-muted/40", children: [
810
+ return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ i("label", { className: "flex cursor-pointer items-center gap-2.5 py-1.5 pl-12 pr-4 transition-colors hover:bg-muted/40", children: [
812
811
  /* @__PURE__ */ t(
813
- Ge,
812
+ Ue,
814
813
  {
815
814
  checked: S,
816
- onCheckedChange: () => k(g.table_name, g.table_type),
815
+ onCheckedChange: () => k(h.table_name, h.table_type),
817
816
  className: "h-3.5 w-3.5 shrink-0"
818
817
  }
819
818
  ),
@@ -824,93 +823,93 @@ function mt({
824
823
  strokeWidth: 1.75
825
824
  }
826
825
  ),
827
- /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-baseline gap-1.5", children: [
828
- /* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground/90", children: g.table_name }),
829
- /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children: g.table_type ?? "table" })
826
+ /* @__PURE__ */ i("div", { className: "flex min-w-0 flex-1 items-baseline gap-1.5", children: [
827
+ /* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground/90", children: h.table_name }),
828
+ /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children: h.table_type ?? "table" })
830
829
  ] })
831
- ] }) }, g.table_name);
830
+ ] }) }, h.table_name);
832
831
  })
833
832
  ] });
834
833
  }
835
- function za({
834
+ function Ea({
836
835
  connection: e,
837
836
  search: n,
838
837
  selectedEntities: a,
839
838
  onSelectionChange: o
840
839
  }) {
841
- const u = Ue("/v1/datamodels", { connection_id: e.id }, [
840
+ const m = Ge("/v1/datamodels", { connection_id: e.id }, [
842
841
  "datamodels",
843
842
  e.id
844
843
  ]), d = P(() => {
845
- var m;
846
- const i = ((m = u.data) == null ? void 0 : m.datamodels) ?? [];
847
- if (!n) return i;
844
+ var c;
845
+ const l = ((c = m.data) == null ? void 0 : c.datamodels) ?? [];
846
+ if (!n) return l;
848
847
  const s = n.trim().toLowerCase();
849
- return i.filter(
850
- (f) => `${f.label ?? ""} ${f.name ?? ""} ${f.description ?? ""}`.toLowerCase().includes(s)
848
+ return l.filter(
849
+ (g) => `${g.label ?? ""} ${g.name ?? ""} ${g.description ?? ""}`.toLowerCase().includes(s)
851
850
  );
852
- }, [u.data, n]);
853
- if (u.isLoading || d.length === 0) return null;
854
- const c = (i) => {
851
+ }, [m.data, n]);
852
+ if (m.isLoading || d.length === 0) return null;
853
+ const u = (l) => {
855
854
  const s = {
856
- id: i.id,
857
- name: i.name,
858
- label: i.label || "",
859
- description: i.description || "",
855
+ id: l.id,
856
+ name: l.name,
857
+ label: l.label || "",
858
+ description: l.description || "",
860
859
  connectionId: e.id,
861
860
  connectionType: e.type,
862
861
  type: "model",
863
- dialect: i.dialect ?? e.dialect,
864
- database: i.database || "",
865
- schema: i.schema || ""
866
- }, m = a.some(
867
- (f) => X(f, s)
862
+ dialect: l.dialect ?? e.dialect,
863
+ database: l.database || "",
864
+ schema: l.schema || ""
865
+ }, c = a.some(
866
+ (g) => J(g, s)
868
867
  );
869
868
  o(
870
- m ? a.filter((f) => !X(f, s)) : [...a, s]
869
+ c ? a.filter((g) => !J(g, s)) : [...a, s]
871
870
  );
872
871
  };
873
- return /* @__PURE__ */ l("div", { children: [
872
+ return /* @__PURE__ */ i("div", { children: [
874
873
  /* @__PURE__ */ t("div", { className: "px-8 pb-1 pt-2", children: /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Data models" }) }),
875
- /* @__PURE__ */ t("ul", { children: d.map((i) => {
874
+ /* @__PURE__ */ t("ul", { children: d.map((l) => {
876
875
  const s = {
877
- id: i.id,
878
- name: i.name,
879
- label: i.label || "",
880
- description: i.description || "",
876
+ id: l.id,
877
+ name: l.name,
878
+ label: l.label || "",
879
+ description: l.description || "",
881
880
  connectionId: e.id,
882
881
  connectionType: e.type,
883
882
  type: "model",
884
- dialect: i.dialect ?? e.dialect,
885
- database: i.database || "",
886
- schema: i.schema || ""
887
- }, m = a.some(
888
- (f) => X(f, s)
883
+ dialect: l.dialect ?? e.dialect,
884
+ database: l.database || "",
885
+ schema: l.schema || ""
886
+ }, c = a.some(
887
+ (g) => J(g, s)
889
888
  );
890
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ l("label", { className: "flex cursor-pointer items-start gap-2.5 py-1.5 pl-12 pr-4 transition-colors hover:bg-muted/40", children: [
889
+ return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ i("label", { className: "flex cursor-pointer items-start gap-2.5 py-1.5 pl-12 pr-4 transition-colors hover:bg-muted/40", children: [
891
890
  /* @__PURE__ */ t(
892
- Ge,
891
+ Ue,
893
892
  {
894
- checked: m,
895
- onCheckedChange: () => c(i),
893
+ checked: c,
894
+ onCheckedChange: () => u(l),
896
895
  className: "mt-[2px] h-3.5 w-3.5 shrink-0"
897
896
  }
898
897
  ),
899
898
  /* @__PURE__ */ t(
900
- ka,
899
+ wa,
901
900
  {
902
901
  className: "mt-[2px] h-3.5 w-3.5 shrink-0 text-muted-foreground",
903
902
  strokeWidth: 1.75
904
903
  }
905
904
  ),
906
- /* @__PURE__ */ l("div", { className: "min-w-0 flex-1", children: [
907
- /* @__PURE__ */ l("div", { className: "flex items-baseline gap-1.5", children: [
908
- /* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground/90", children: i.label || i.name }),
905
+ /* @__PURE__ */ i("div", { className: "min-w-0 flex-1", children: [
906
+ /* @__PURE__ */ i("div", { className: "flex items-baseline gap-1.5", children: [
907
+ /* @__PURE__ */ t("span", { className: "truncate text-[13px] text-foreground/90", children: l.label || l.name }),
909
908
  /* @__PURE__ */ t("span", { className: "shrink-0 font-mono text-[10px] uppercase tracking-[0.06em] text-muted-foreground/70", children: "model" })
910
909
  ] }),
911
- i.description && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 text-[11px] leading-[1.4] text-muted-foreground", children: i.description })
910
+ l.description && /* @__PURE__ */ t("p", { className: "mt-0.5 line-clamp-2 text-[11px] leading-[1.4] text-muted-foreground", children: l.description })
912
911
  ] })
913
- ] }) }, i.id);
912
+ ] }) }, l.id);
914
913
  }) })
915
914
  ] });
916
915
  }
@@ -920,14 +919,14 @@ function on({
920
919
  search: a,
921
920
  renderChildren: o
922
921
  }) {
923
- const [u, d] = Y(!1), c = u || a.length > 0;
924
- return /* @__PURE__ */ l("div", { children: [
925
- /* @__PURE__ */ l(
922
+ const [m, d] = Y(!1), u = m || a.length > 0;
923
+ return /* @__PURE__ */ i("div", { children: [
924
+ /* @__PURE__ */ i(
926
925
  "button",
927
926
  {
928
927
  type: "button",
929
928
  onClick: () => d((s) => !s),
930
- className: q(
929
+ className: j(
931
930
  "flex h-6 w-full items-center gap-1.5 pr-4 text-left transition-colors hover:bg-muted/40",
932
931
  n === 1 ? "pl-8" : "pl-10"
933
932
  ),
@@ -935,9 +934,9 @@ function on({
935
934
  /* @__PURE__ */ t(
936
935
  Te,
937
936
  {
938
- className: q(
937
+ className: j(
939
938
  "h-2.5 w-2.5 shrink-0 text-muted-foreground transition-transform",
940
- c && "rotate-90"
939
+ u && "rotate-90"
941
940
  ),
942
941
  strokeWidth: 1.75
943
942
  }
@@ -946,30 +945,30 @@ function on({
946
945
  ]
947
946
  }
948
947
  ),
949
- o(c)
948
+ o(u)
950
949
  ] });
951
950
  }
952
- function Ue(e, n, a, o = !0) {
953
- const { tokenProps: u } = ct(), d = ut((i) => i.authToken), c = P(
951
+ function Ge(e, n, a, o = !0) {
952
+ const { tokenProps: m } = ct(), d = ut((l) => l.authToken), u = P(
954
953
  () => Object.fromEntries(
955
- Object.entries(n).filter(([, i]) => i !== void 0)
954
+ Object.entries(n).filter(([, l]) => l !== void 0)
956
955
  ),
957
956
  [n]
958
957
  );
959
- return _t({
958
+ return Vt({
960
959
  queryKey: a,
961
- queryFn: () => Wt(
962
- `${u.apiServiceUrl}${e}`,
960
+ queryFn: () => Qt(
961
+ `${m.apiServiceUrl}${e}`,
963
962
  (d == null ? void 0 : d.accessToken) || "",
964
- c
963
+ u
965
964
  ),
966
- enabled: o && !!(d != null && d.accessToken) && Object.values(c).every((i) => i.length > 0)
965
+ enabled: o && !!(d != null && d.accessToken) && Object.values(u).every((l) => l.length > 0)
967
966
  });
968
967
  }
969
- function Ma(e) {
968
+ function za(e) {
970
969
  return e.type === "dataset" && e.label || e.name;
971
970
  }
972
- function qa(e, n) {
971
+ function Ma(e, n) {
973
972
  if (!(e.type !== "dataset" || !e.domainId || !n))
974
973
  return n.get(e.domainId);
975
974
  }
@@ -978,41 +977,41 @@ function ja({
978
977
  onDeselectEntity: n,
979
978
  semanticDomainLabels: a
980
979
  }) {
981
- return e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: e.map((o, u) => /* @__PURE__ */ t(
982
- Ga,
980
+ return e.length === 0 ? null : /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: e.map((o, m) => /* @__PURE__ */ t(
981
+ qa,
983
982
  {
984
983
  entity: o,
985
984
  semanticDomainLabels: a,
986
985
  onDeselect: n
987
986
  },
988
- `${o.type}-${o.name}-${u}`
987
+ `${o.type}-${o.name}-${m}`
989
988
  )) });
990
989
  }
991
- function Ga({
990
+ function qa({
992
991
  entity: e,
993
992
  semanticDomainLabels: n,
994
993
  onDeselect: a
995
994
  }) {
996
- const o = Ma(e), u = qa(e, n), d = u ? `${o} from ${u}` : o;
997
- return /* @__PURE__ */ l(
995
+ const o = za(e), m = Ma(e, n), d = m ? `${o} from ${m}` : o;
996
+ return /* @__PURE__ */ i(
998
997
  "span",
999
998
  {
1000
999
  className: "inline-flex items-center gap-1 rounded-control border border-input bg-muted/50 py-0.5 pl-1.5 pr-0.5 text-[11px] text-foreground/80",
1001
1000
  title: d,
1002
1001
  children: [
1003
- /* @__PURE__ */ l("span", { className: "max-w-[180px] truncate", children: [
1002
+ /* @__PURE__ */ i("span", { className: "max-w-[180px] truncate", children: [
1004
1003
  o,
1005
- u ? /* @__PURE__ */ l("span", { className: "text-muted-foreground", children: [
1004
+ m ? /* @__PURE__ */ i("span", { className: "text-muted-foreground", children: [
1006
1005
  " · ",
1007
- u
1006
+ m
1008
1007
  ] }) : null
1009
1008
  ] }),
1010
1009
  /* @__PURE__ */ t(
1011
1010
  "button",
1012
1011
  {
1013
1012
  type: "button",
1014
- onClick: (c) => {
1015
- c.stopPropagation(), a(e);
1013
+ onClick: (u) => {
1014
+ u.stopPropagation(), a(e);
1016
1015
  },
1017
1016
  "aria-label": `Remove ${d}`,
1018
1017
  className: "inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center rounded-control text-muted-foreground transition-colors hover:bg-muted hover:text-foreground",
@@ -1029,19 +1028,19 @@ function Ye(e) {
1029
1028
  (n) => n.type === "upload" || n.type === "file"
1030
1029
  ) ? "upload" : "database";
1031
1030
  }
1032
- function Ir({
1031
+ function Sr({
1033
1032
  open: e,
1034
1033
  onOpenChange: n,
1035
1034
  dataSource: a,
1036
1035
  incomingSelectedEntities: o,
1037
- onDataSourceChange: u
1036
+ onDataSourceChange: m
1038
1037
  }) {
1039
1038
  var Se, me;
1040
- const { tokenProps: d } = ct(), c = d.config, i = d.semanticDomainAccess || Jn, [s, m] = Y([]), [f, k] = Y(""), [y, g] = Y("all"), [N, S] = Y(
1039
+ const { tokenProps: d } = ct(), u = d.config, l = d.semanticDomainAccess || Xn, [s, c] = Y([]), [g, k] = Y(""), [y, h] = Y("all"), [N, S] = Y(
1041
1040
  void 0
1042
- ), V = $e(!1), { updateDataSource: _ } = Rt(), Q = u ?? _, C = i.mode, T = (c == null ? void 0 : c.showDirectSource) !== !1, G = C === "include" || C === "exclude" || !T, Z = C !== "all", p = T && !G, I = G ? "semanticDomain" : a.mode, $ = !T, D = C === "include" && (((Se = i.domainIds) == null ? void 0 : Se.length) || 0) === 1 ? (me = i.domainIds) == null ? void 0 : me[0] : void 0, v = ne(
1041
+ ), V = $e(!1), { updateDataSource: F } = Et(), K = m ?? F, C = l.mode, T = (u == null ? void 0 : u.showDirectSource) !== !1, U = C === "include" || C === "exclude" || !T, Z = C !== "all", p = T && !U, I = U ? "semanticDomain" : a.mode, $ = !T, D = C === "include" && (((Se = l.domainIds) == null ? void 0 : Se.length) || 0) === 1 ? (me = l.domainIds) == null ? void 0 : me[0] : void 0, v = ne(
1043
1042
  (A) => {
1044
- V.current = !0, Q({
1043
+ V.current = !0, K({
1045
1044
  ...a,
1046
1045
  connectionId: (a == null ? void 0 : a.connectionId) || "",
1047
1046
  connectionType: (a == null ? void 0 : a.connectionType) || "",
@@ -1050,63 +1049,63 @@ function Ir({
1050
1049
  ...A !== "semanticDomain" && { semanticDomainId: void 0 }
1051
1050
  });
1052
1051
  },
1053
- [a, Q]
1054
- ), h = ne(
1052
+ [a, K]
1053
+ ), f = ne(
1055
1054
  (A) => {
1056
- Q({
1055
+ K({
1057
1056
  ...a,
1058
1057
  ...A
1059
1058
  });
1060
1059
  },
1061
- [a, Q]
1060
+ [a, K]
1062
1061
  );
1063
1062
  de(() => {
1064
1063
  var b;
1065
- if (G && a.mode !== "semanticDomain") {
1064
+ if (U && a.mode !== "semanticDomain") {
1066
1065
  v("semanticDomain");
1067
1066
  return;
1068
1067
  }
1069
1068
  if (!Z || I !== "semanticDomain") return;
1070
- const A = i.domainIds ?? [], ae = (((b = a.selectedEntities) == null ? void 0 : b.length) ?? 0) > 0, r = ((s == null ? void 0 : s.length) ?? 0) > 0;
1071
- Ta({
1069
+ const A = l.domainIds ?? [], ae = (((b = a.selectedEntities) == null ? void 0 : b.length) ?? 0) > 0, r = ((s == null ? void 0 : s.length) ?? 0) > 0;
1070
+ Da({
1072
1071
  mode: C,
1073
1072
  currentDomainId: a.semanticDomainId,
1074
1073
  scopedDomainIds: A,
1075
1074
  hasSelectedEntities: ae
1076
- }) && (h({
1075
+ }) && (f({
1077
1076
  semanticDomainId: void 0,
1078
1077
  selectedEntities: []
1079
- }), r && m([]));
1078
+ }), r && c([]));
1080
1079
  }, [
1081
- G,
1080
+ U,
1082
1081
  Z,
1083
1082
  I,
1084
1083
  a.mode,
1085
1084
  a.semanticDomainId,
1086
1085
  a.selectedEntities,
1087
1086
  s,
1088
- i.domainIds,
1087
+ l.domainIds,
1089
1088
  C,
1090
- h,
1089
+ f,
1091
1090
  v
1092
1091
  ]), de(() => {
1093
- D && !a.semanticDomainId && h({ semanticDomainId: D });
1094
- }, [D, a.semanticDomainId, h]), de(() => {
1092
+ D && !a.semanticDomainId && f({ semanticDomainId: D });
1093
+ }, [D, a.semanticDomainId, f]), de(() => {
1095
1094
  if (!e) {
1096
- V.current = !1, k(""), S(void 0), g(G ? "semantic" : "all");
1095
+ V.current = !1, k(""), S(void 0), h(U ? "semantic" : "all");
1097
1096
  return;
1098
1097
  }
1099
- V.current || (m([...o || []]), S(
1098
+ V.current || (c([...o || []]), S(
1100
1099
  Ye(o)
1101
1100
  ));
1102
- }, [e, o, G]);
1101
+ }, [e, o, U]);
1103
1102
  const E = (A) => {
1104
- V.current = !0, m(
1105
- s.filter((ae) => !X(ae, A))
1103
+ V.current = !0, c(
1104
+ s.filter((ae) => !J(ae, A))
1106
1105
  );
1107
1106
  }, w = ne(
1108
1107
  (A, ae) => {
1109
- V.current = !0, m(A), S(
1108
+ V.current = !0, c(A), S(
1110
1109
  ae ?? Ye(A)
1111
1110
  );
1112
1111
  },
@@ -1116,7 +1115,7 @@ function Ir({
1116
1115
  const A = Ye(s) ?? N ?? I;
1117
1116
  if (A === "semanticDomain") {
1118
1117
  const x = Kt(s) || a.semanticDomainId, b = ((ae = s == null ? void 0 : s[0]) == null ? void 0 : ae.connectionId) || a.connectionId, L = ((r = s == null ? void 0 : s[0]) == null ? void 0 : r.connectionType) || a.connectionType;
1119
- Q({
1118
+ K({
1120
1119
  ...a,
1121
1120
  mode: "semanticDomain",
1122
1121
  semanticDomainId: x,
@@ -1126,7 +1125,7 @@ function Ir({
1126
1125
  });
1127
1126
  } else if (A === "upload" || A === "url") {
1128
1127
  const x = s == null ? void 0 : s[0];
1129
- Q({
1128
+ K({
1130
1129
  ...a,
1131
1130
  mode: A,
1132
1131
  semanticDomainId: void 0,
@@ -1136,7 +1135,7 @@ function Ir({
1136
1135
  });
1137
1136
  } else {
1138
1137
  const x = s == null ? void 0 : s[0];
1139
- Q({
1138
+ K({
1140
1139
  ...a,
1141
1140
  mode: "database",
1142
1141
  semanticDomainId: void 0,
@@ -1146,26 +1145,26 @@ function Ir({
1146
1145
  });
1147
1146
  }
1148
1147
  n(!1);
1149
- }, { semanticDomains: O } = an(), { connections: z } = Vt(), B = P(
1148
+ }, { semanticDomains: _ } = an(), { connections: z } = Rt(), B = P(
1150
1149
  () => new Map(
1151
- O.map((A) => [
1150
+ _.map((A) => [
1152
1151
  A.id,
1153
1152
  A.label || A.name
1154
1153
  ])
1155
1154
  ),
1156
- [O]
1157
- ), j = (A) => {
1158
- g(A), A === "semantic" || A.startsWith("domain:") ? a.mode !== "semanticDomain" && v("semanticDomain") : (A === "direct" || A.startsWith("conn:")) && a.mode === "semanticDomain" && v("database");
1159
- }, ee = y.startsWith("domain:"), te = y.startsWith("conn:"), Be = ee ? y.slice(7) : void 0, We = te ? y.slice(5) : void 0, oe = !p || y === "all" || y === "semantic" || ee, Ie = T && !G && (y === "all" || y === "direct" || te), ue = ((o == null ? void 0 : o.length) ?? 0) > 0, Ce = s.length === 0 && !ue, we = s.length === 0 && ue ? "Clear" : "Add", ke = $ ? "Select dataset" : "Add data";
1160
- return /* @__PURE__ */ t(kn, { open: e, onOpenChange: n, children: /* @__PURE__ */ l(
1155
+ [_]
1156
+ ), q = (A) => {
1157
+ h(A), A === "semantic" || A.startsWith("domain:") ? a.mode !== "semanticDomain" && v("semanticDomain") : (A === "direct" || A.startsWith("conn:")) && a.mode === "semanticDomain" && v("database");
1158
+ }, ee = y.startsWith("domain:"), te = y.startsWith("conn:"), Be = ee ? y.slice(7) : void 0, We = te ? y.slice(5) : void 0, oe = !p || y === "all" || y === "semantic" || ee, Ie = T && !U && (y === "all" || y === "direct" || te), ue = ((o == null ? void 0 : o.length) ?? 0) > 0, Ce = s.length === 0 && !ue, we = s.length === 0 && ue ? "Clear" : "Add", ke = $ ? "Select dataset" : "Add data";
1159
+ return /* @__PURE__ */ t(kn, { open: e, onOpenChange: n, children: /* @__PURE__ */ i(
1161
1160
  Sn,
1162
1161
  {
1163
1162
  showCloseButton: !1,
1164
1163
  className: "flex h-[560px] w-[620px] max-w-[620px] flex-col gap-0 overflow-hidden rounded-[6px] border border-border bg-popover p-0",
1165
1164
  children: [
1166
1165
  /* @__PURE__ */ t(gn, { children: /* @__PURE__ */ t(Dn, { children: ke }) }),
1167
- /* @__PURE__ */ l("div", { className: "flex items-start justify-between border-b border-border px-4 py-2.5", children: [
1168
- /* @__PURE__ */ l("div", { children: [
1166
+ /* @__PURE__ */ i("div", { className: "flex items-start justify-between border-b border-border px-4 py-2.5", children: [
1167
+ /* @__PURE__ */ i("div", { children: [
1169
1168
  /* @__PURE__ */ t("p", { className: "text-[14px] font-semibold text-foreground", children: ke }),
1170
1169
  /* @__PURE__ */ t("p", { className: "text-[11px] text-muted-foreground", children: $ ? "Choose a curated dataset to analyze" : "Search your semantic domains and connections" })
1171
1170
  ] }),
@@ -1180,20 +1179,20 @@ function Ir({
1180
1179
  }
1181
1180
  )
1182
1181
  ] }),
1183
- /* @__PURE__ */ l("div", { className: "border-b border-border px-4 py-2.5", children: [
1184
- /* @__PURE__ */ l("div", { className: "flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 focus-within:border-ring", children: [
1182
+ /* @__PURE__ */ i("div", { className: "border-b border-border px-4 py-2.5", children: [
1183
+ /* @__PURE__ */ i("div", { className: "flex h-7 items-center gap-1.5 rounded-control border border-input bg-background px-2 focus-within:border-ring", children: [
1185
1184
  /* @__PURE__ */ t(Tn, { className: "h-3 w-3 shrink-0 text-muted-foreground" }),
1186
1185
  /* @__PURE__ */ t(
1187
1186
  "input",
1188
1187
  {
1189
1188
  type: "text",
1190
- value: f,
1189
+ value: g,
1191
1190
  onChange: (A) => k(A.target.value),
1192
1191
  placeholder: "Search datasets, tables, views, models",
1193
1192
  className: "h-full w-full bg-transparent text-[12px] text-foreground placeholder:text-muted-foreground/60 focus:outline-none"
1194
1193
  }
1195
1194
  ),
1196
- f && /* @__PURE__ */ t(
1195
+ g && /* @__PURE__ */ t(
1197
1196
  "button",
1198
1197
  {
1199
1198
  type: "button",
@@ -1207,22 +1206,22 @@ function Ir({
1207
1206
  p && // Horizontal scroll strip — chips stay on a single row
1208
1207
  // regardless of how many sources exist. Mock canon: the
1209
1208
  // chip rail never grows the picker's header height.
1210
- /* @__PURE__ */ t("div", { className: "-mx-4 mt-2 overflow-x-auto px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ l("div", { className: "flex w-max items-center gap-1", children: [
1209
+ /* @__PURE__ */ t("div", { className: "-mx-4 mt-2 overflow-x-auto px-4 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ i("div", { className: "flex w-max items-center gap-1", children: [
1211
1210
  /* @__PURE__ */ t(
1212
1211
  De,
1213
1212
  {
1214
1213
  label: "All",
1215
1214
  active: y === "all",
1216
- onClick: () => j("all")
1215
+ onClick: () => q("all")
1217
1216
  }
1218
1217
  ),
1219
- (O.length > 0 || z.length > 0) && /* @__PURE__ */ l(fe, { children: [
1218
+ (_.length > 0 || z.length > 0) && /* @__PURE__ */ i(fe, { children: [
1220
1219
  /* @__PURE__ */ t(
1221
1220
  De,
1222
1221
  {
1223
1222
  label: "Semantic",
1224
1223
  active: y === "semantic",
1225
- onClick: () => j("semantic")
1224
+ onClick: () => q("semantic")
1226
1225
  }
1227
1226
  ),
1228
1227
  /* @__PURE__ */ t(
@@ -1230,17 +1229,17 @@ function Ir({
1230
1229
  {
1231
1230
  label: "Direct",
1232
1231
  active: y === "direct",
1233
- onClick: () => j("direct")
1232
+ onClick: () => q("direct")
1234
1233
  }
1235
1234
  ),
1236
1235
  /* @__PURE__ */ t("span", { className: "shrink-0 px-0.5 text-muted-foreground/50", children: "·" })
1237
1236
  ] }),
1238
- O.map((A) => /* @__PURE__ */ t(
1237
+ _.map((A) => /* @__PURE__ */ t(
1239
1238
  De,
1240
1239
  {
1241
1240
  label: A.label || A.name,
1242
1241
  active: y === `domain:${A.id}`,
1243
- onClick: () => j(`domain:${A.id}`)
1242
+ onClick: () => q(`domain:${A.id}`)
1244
1243
  },
1245
1244
  `domain:${A.id}`
1246
1245
  )),
@@ -1249,18 +1248,18 @@ function Ir({
1249
1248
  {
1250
1249
  label: A.name,
1251
1250
  active: y === `conn:${A.id}`,
1252
- onClick: () => j(`conn:${A.id}`)
1251
+ onClick: () => q(`conn:${A.id}`)
1253
1252
  },
1254
1253
  `conn:${A.id}`
1255
1254
  ))
1256
1255
  ] }) })
1257
1256
  ] }),
1258
- /* @__PURE__ */ l("div", { className: "flex-1 overflow-y-auto py-1", children: [
1257
+ /* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto py-1", children: [
1259
1258
  oe && /* @__PURE__ */ t(
1260
- $a,
1259
+ La,
1261
1260
  {
1262
- domainAccess: i,
1263
- search: f,
1261
+ domainAccess: l,
1262
+ search: g,
1264
1263
  scopeDomainId: Be,
1265
1264
  selectedEntities: s,
1266
1265
  onSelectionChange: (A) => w(A, "semanticDomain")
@@ -1269,23 +1268,23 @@ function Ir({
1269
1268
  Ie && /* @__PURE__ */ t(
1270
1269
  Oa,
1271
1270
  {
1272
- search: f,
1271
+ search: g,
1273
1272
  scopeConnectionId: We,
1274
1273
  selectedEntities: s,
1275
1274
  onSelectionChange: (A) => w(A)
1276
1275
  }
1277
1276
  )
1278
1277
  ] }),
1279
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-0.5 border-t border-border px-4 py-2.5", children: [
1280
- /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-3", children: [
1281
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
1278
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-0.5 border-t border-border px-4 py-2.5", children: [
1279
+ /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-3", children: [
1280
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: [
1282
1281
  /* @__PURE__ */ t("span", { children: "Selected" }),
1283
- /* @__PURE__ */ l("span", { className: "font-mono tabular-nums text-muted-foreground/70", children: [
1282
+ /* @__PURE__ */ i("span", { className: "font-mono tabular-nums text-muted-foreground/70", children: [
1284
1283
  "· ",
1285
1284
  s.length
1286
1285
  ] })
1287
1286
  ] }),
1288
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
1287
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
1289
1288
  /* @__PURE__ */ t(
1290
1289
  "button",
1291
1290
  {
@@ -1295,19 +1294,19 @@ function Ir({
1295
1294
  children: "Cancel"
1296
1295
  }
1297
1296
  ),
1298
- /* @__PURE__ */ l(
1297
+ /* @__PURE__ */ i(
1299
1298
  "button",
1300
1299
  {
1301
1300
  type: "button",
1302
1301
  onClick: H,
1303
1302
  disabled: Ce,
1304
- className: q(
1303
+ className: j(
1305
1304
  "inline-flex h-7 items-center gap-1.5 rounded-control bg-primary px-2.5 text-[12px] font-medium text-primary-foreground transition-colors hover:bg-primary/90",
1306
1305
  Ce && "cursor-not-allowed opacity-50 hover:bg-primary"
1307
1306
  ),
1308
1307
  children: [
1309
1308
  /* @__PURE__ */ t("span", { children: we }),
1310
- s.length > 0 && /* @__PURE__ */ l("span", { className: "font-mono tabular-nums text-primary-foreground/70", children: [
1309
+ s.length > 0 && /* @__PURE__ */ i("span", { className: "font-mono tabular-nums text-primary-foreground/70", children: [
1311
1310
  "· ",
1312
1311
  s.length
1313
1312
  ] })
@@ -1340,7 +1339,7 @@ function De({
1340
1339
  type: "button",
1341
1340
  onClick: a,
1342
1341
  "aria-pressed": n,
1343
- className: q(
1342
+ className: j(
1344
1343
  "inline-flex h-6 shrink-0 items-center whitespace-nowrap rounded-control px-2 text-[11px] font-medium transition-colors",
1345
1344
  n ? "bg-primary text-primary-foreground hover:bg-primary/90" : "text-muted-foreground hover:bg-muted hover:text-foreground"
1346
1345
  ),
@@ -1348,58 +1347,58 @@ function De({
1348
1347
  }
1349
1348
  );
1350
1349
  }
1351
- function Lr() {
1352
- const e = se((c) => c.card.dataSource), {
1350
+ function Dr() {
1351
+ const e = se((u) => u.card.dataSource), {
1353
1352
  setSelectedConnectionId: n,
1354
1353
  setSelectedDatabaseName: a,
1355
1354
  setSelectedSchemaName: o,
1356
- setSelectedTableName: u,
1355
+ setSelectedTableName: m,
1357
1356
  setSelectedDatamodelId: d
1358
- } = Rt();
1357
+ } = Et();
1359
1358
  de(() => {
1360
- var g;
1359
+ var h;
1361
1360
  if (!e) return;
1362
- const { tableName: c, schemaName: i, databaseName: s, connectionId: m } = In(e), f = (g = e.selectedEntities) == null ? void 0 : g[0], y = (f == null ? void 0 : f.type) === "model" && "id" in f ? f.id : "";
1363
- n(m || ""), a(s || ""), o(i || ""), u(c || ""), d(y);
1361
+ const { tableName: u, schemaName: l, databaseName: s, connectionId: c } = In(e), g = (h = e.selectedEntities) == null ? void 0 : h[0], y = (g == null ? void 0 : g.type) === "model" && "id" in g ? g.id : "";
1362
+ n(c || ""), a(s || ""), o(l || ""), m(u || ""), d(y);
1364
1363
  }, [
1365
1364
  e,
1366
1365
  n,
1367
1366
  a,
1368
1367
  o,
1369
- u,
1368
+ m,
1370
1369
  d
1371
1370
  ]);
1372
1371
  }
1373
- function $r({
1372
+ function Tr({
1374
1373
  type: e,
1375
1374
  isLinked: n,
1376
1375
  className: a,
1377
1376
  showLabel: o = !1,
1378
- showLocal: u = !1
1377
+ showLocal: m = !1
1379
1378
  }) {
1380
- const d = ut((S) => S.selectedFrameId), c = Ln((S) => S.selectedVisual), i = se((S) => S.frame);
1379
+ const d = ut((S) => S.selectedFrameId), u = Ln((S) => S.selectedVisual), l = se((S) => S.frame);
1381
1380
  let s;
1382
1381
  if (e)
1383
1382
  s = e;
1384
1383
  else if (n !== void 0)
1385
1384
  s = n ? "linked" : "library";
1386
- else if (!!!(i != null && i.visualId || c != null && c.id) && d)
1385
+ else if (!!!(l != null && l.visualId || u != null && u.id) && d)
1387
1386
  s = "local";
1388
- else if (c && !d)
1387
+ else if (u && !d)
1389
1388
  s = "library";
1390
- else if (i != null && i.visualId && d)
1389
+ else if (l != null && l.visualId && d)
1391
1390
  s = "linked";
1392
- else if (c != null && c.id && d)
1391
+ else if (u != null && u.id && d)
1393
1392
  s = "library";
1394
1393
  else
1395
1394
  return null;
1396
- if (s === "local" && !u)
1395
+ if (s === "local" && !m)
1397
1396
  return null;
1398
- const m = {
1397
+ const c = {
1399
1398
  local: "border-slate-200/70 bg-slate-50/80 text-slate-700 shadow-sm hover:bg-slate-100/80 dark:border-slate-700 dark:bg-slate-900/70 dark:text-slate-200 dark:hover:bg-slate-800/80",
1400
1399
  linked: "border-purple-200/70 bg-gradient-to-r from-purple-50/50 to-purple-100/30 text-purple-900 shadow-sm hover:from-purple-100/60 hover:to-purple-100/50 hover:shadow-md dark:border-purple-800/50 dark:from-purple-950/40 dark:to-purple-900/30 dark:text-purple-100 dark:hover:from-purple-950/60 dark:hover:to-purple-900/50",
1401
1400
  library: "border-blue-200/70 bg-gradient-to-r from-blue-50/50 to-blue-100/30 text-blue-900 shadow-sm hover:from-blue-100/60 hover:to-blue-100/50 hover:shadow-md dark:border-blue-800/50 dark:from-blue-950/40 dark:to-blue-900/30 dark:text-blue-100 dark:hover:from-blue-950/60 dark:hover:to-blue-900/50"
1402
- }, f = {
1401
+ }, g = {
1403
1402
  local: "Local to this dashboard: Changes made here only affect this dashboard copy.",
1404
1403
  linked: "Linked to library: Changes made here update the library visual and all linked instances.",
1405
1404
  library: "Library visual: Share and reuse this visual across multiple dashboards."
@@ -1411,39 +1410,39 @@ function $r({
1411
1410
  local: "fill-slate-50 dark:fill-slate-900",
1412
1411
  linked: "fill-purple-50 dark:fill-purple-950",
1413
1412
  library: "fill-blue-50 dark:fill-blue-950"
1414
- }, g = {
1413
+ }, h = {
1415
1414
  local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
1416
1415
  linked: /* @__PURE__ */ t(An, { className: "h-3.5 w-3.5" }),
1417
- library: /* @__PURE__ */ t(Sa, { className: "h-3.5 w-3.5" })
1416
+ library: /* @__PURE__ */ t(ka, { className: "h-3.5 w-3.5" })
1418
1417
  }, N = {
1419
1418
  local: "Local",
1420
1419
  linked: "Linked",
1421
1420
  library: "Library"
1422
1421
  };
1423
- return /* @__PURE__ */ t(at, { children: /* @__PURE__ */ l(rt, { delayDuration: 300, children: [
1424
- /* @__PURE__ */ t(st, { asChild: !0, children: /* @__PURE__ */ l(
1422
+ return /* @__PURE__ */ t(at, { children: /* @__PURE__ */ i(rt, { delayDuration: 300, children: [
1423
+ /* @__PURE__ */ t(st, { asChild: !0, children: /* @__PURE__ */ i(
1425
1424
  $n,
1426
1425
  {
1427
1426
  variant: "outline",
1428
- className: q(
1427
+ className: j(
1429
1428
  "cursor-help select-none transition-all",
1430
- m[s],
1429
+ c[s],
1431
1430
  a
1432
1431
  ),
1433
1432
  children: [
1434
- g[s],
1433
+ h[s],
1435
1434
  o && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: N[s] })
1436
1435
  ]
1437
1436
  }
1438
1437
  ) }),
1439
- /* @__PURE__ */ l(
1438
+ /* @__PURE__ */ i(
1440
1439
  ot,
1441
1440
  {
1442
1441
  side: "bottom",
1443
- className: q("max-w-xs", k[s]),
1442
+ className: j("max-w-xs", k[s]),
1444
1443
  children: [
1445
- /* @__PURE__ */ t(Ot, { className: y[s] }),
1446
- /* @__PURE__ */ t("p", { children: f[s] })
1444
+ /* @__PURE__ */ t(Ft, { className: y[s] }),
1445
+ /* @__PURE__ */ t("p", { children: g[s] })
1447
1446
  ]
1448
1447
  }
1449
1448
  )
@@ -1455,72 +1454,47 @@ const Ua = vn(
1455
1454
  children: n,
1456
1455
  className: a,
1457
1456
  tooltip: o,
1458
- onClick: u,
1457
+ onClick: m,
1459
1458
  openDelay: d = 300,
1460
- buttonProps: c,
1461
- disabled: i,
1459
+ buttonProps: u,
1460
+ disabled: l,
1462
1461
  ...s
1463
- }, m) => /* @__PURE__ */ t(at, { children: /* @__PURE__ */ l(rt, { delayDuration: d, children: [
1462
+ }, c) => /* @__PURE__ */ t(at, { children: /* @__PURE__ */ i(rt, { delayDuration: d, children: [
1464
1463
  /* @__PURE__ */ t(st, { asChild: !0, children: /* @__PURE__ */ t(
1465
- U,
1464
+ G,
1466
1465
  {
1467
- disabled: i,
1468
- ref: m,
1466
+ disabled: l,
1467
+ ref: c,
1469
1468
  size: "sm",
1470
1469
  variant: "ghost",
1471
- onClick: u,
1470
+ onClick: m,
1472
1471
  ...s,
1473
- ...c,
1474
- className: q(`${Xn}`, a),
1472
+ ...u,
1473
+ className: j(`${Jn}`, a),
1475
1474
  children: n
1476
1475
  }
1477
1476
  ) }),
1478
- o && /* @__PURE__ */ l(
1477
+ o && /* @__PURE__ */ i(
1479
1478
  ot,
1480
1479
  {
1481
1480
  side: e,
1482
1481
  sideOffset: 10,
1483
- className: q(
1482
+ className: j(
1484
1483
  "border-foreground/20 bg-foreground text-background"
1485
1484
  ),
1486
1485
  children: [
1487
1486
  o,
1488
- /* @__PURE__ */ t(Ot, { className: "fill-foreground" })
1487
+ /* @__PURE__ */ t(Ft, { className: "fill-foreground" })
1489
1488
  ]
1490
1489
  }
1491
1490
  )
1492
1491
  ] }) })
1493
1492
  );
1494
1493
  Ua.displayName = "IconButton";
1495
- function Ba(e, n) {
1496
- var s, m;
1497
- const a = e.qualifiedFieldName || e.name, o = e.qualifiedFieldName ? e.qualifiedFieldName.split(".").slice(0, -1).join(".") : e.qualifiedEntityName || e.entityName, u = n.connectionId || ((s = n.dataSource) == null ? void 0 : s.connectionId) || "", d = Zn(e), c = ea(
1498
- n.dataSource,
1499
- {
1500
- connectionId: u,
1501
- connectionType: (m = n.dataSource) == null ? void 0 : m.connectionType
1502
- },
1503
- e
1504
- ), i = ta(n.dataSource, c, e) || "";
1505
- return {
1506
- column: a,
1507
- title: nn(e),
1508
- dataType: e.dataType,
1509
- ...e.nativeDataType ? { nativeDataType: e.nativeDataType } : {},
1510
- table: e.entityName || "",
1511
- database: i,
1512
- qualifiedTableName: o,
1513
- connectionId: u,
1514
- operation: "in",
1515
- sql: "",
1516
- fieldMeta: d,
1517
- semanticContext: c
1518
- };
1519
- }
1520
1494
  function ln(e) {
1521
1495
  const { control: n, onChange: a } = e;
1522
- return /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
1523
- /* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1496
+ return /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
1497
+ /* @__PURE__ */ t(ie, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1524
1498
  /* @__PURE__ */ t(
1525
1499
  Ne,
1526
1500
  {
@@ -1532,18 +1506,18 @@ function ln(e) {
1532
1506
  )
1533
1507
  ] });
1534
1508
  }
1535
- function Wa(e) {
1509
+ function Ga(e) {
1536
1510
  const { currentStep: n, labels: a } = e;
1537
- return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b border-border/60 bg-background/95 px-1 pb-2.5 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: a.map((o, u) => {
1538
- const d = u + 1, c = d === n, i = d < n;
1539
- return /* @__PURE__ */ l(yn, { children: [
1540
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
1511
+ return /* @__PURE__ */ t("div", { className: "sticky top-0 z-10 -mx-1 border-b border-border/60 bg-background/95 px-1 pb-2.5 pt-1 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: /* @__PURE__ */ t("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: a.map((o, m) => {
1512
+ const d = m + 1, u = d === n, l = d < n;
1513
+ return /* @__PURE__ */ i(yn, { children: [
1514
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
1541
1515
  /* @__PURE__ */ t(
1542
1516
  "span",
1543
1517
  {
1544
- className: q(
1518
+ className: j(
1545
1519
  "flex h-5 w-5 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",
1546
- c ? "border-foreground bg-foreground text-background" : i ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
1520
+ u ? "border-foreground bg-foreground text-background" : l ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
1547
1521
  ),
1548
1522
  children: d
1549
1523
  }
@@ -1551,15 +1525,15 @@ function Wa(e) {
1551
1525
  /* @__PURE__ */ t(
1552
1526
  "span",
1553
1527
  {
1554
- className: q(
1528
+ className: j(
1555
1529
  "text-[12px]",
1556
- c ? "font-medium text-foreground" : "text-muted-foreground"
1530
+ u ? "font-medium text-foreground" : "text-muted-foreground"
1557
1531
  ),
1558
1532
  children: o
1559
1533
  }
1560
1534
  )
1561
1535
  ] }),
1562
- u < a.length - 1 ? /* @__PURE__ */ t(
1536
+ m < a.length - 1 ? /* @__PURE__ */ t(
1563
1537
  "span",
1564
1538
  {
1565
1539
  className: "h-px w-4 bg-border/60 sm:w-6",
@@ -1569,81 +1543,81 @@ function Wa(e) {
1569
1543
  ] }, o);
1570
1544
  }) }) });
1571
1545
  }
1572
- function je(e) {
1546
+ function qe(e) {
1573
1547
  const { secondary: n, tertiary: a, primary: o } = e;
1574
- return /* @__PURE__ */ l("div", { className: "sticky bottom-0 z-10 -mx-1 flex justify-end gap-2 border-t bg-background/95 px-1 pb-1 pt-3 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: [
1548
+ return /* @__PURE__ */ i("div", { className: "sticky bottom-0 z-10 -mx-1 flex justify-end gap-2 border-t bg-background/95 px-1 pb-1 pt-3 backdrop-blur supports-[backdrop-filter]:bg-background/85", children: [
1575
1549
  n,
1576
1550
  a,
1577
1551
  o
1578
1552
  ] });
1579
1553
  }
1580
- function Ka(e) {
1554
+ function Ba(e) {
1581
1555
  const { control: n, scope: a, detail: o } = e;
1582
- return /* @__PURE__ */ l("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
1556
+ return /* @__PURE__ */ i("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
1583
1557
  /* @__PURE__ */ t(zn, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
1584
- /* @__PURE__ */ l("div", { className: "min-w-0 space-y-0.5", children: [
1558
+ /* @__PURE__ */ i("div", { className: "min-w-0 space-y-0.5", children: [
1585
1559
  /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: n.label }),
1586
- /* @__PURE__ */ l("div", { className: "text-[12px] text-muted-foreground", children: [
1587
- Pt(n.type).label,
1560
+ /* @__PURE__ */ i("div", { className: "text-[12px] text-muted-foreground", children: [
1561
+ Ht(n.type).label,
1588
1562
  " ·",
1589
1563
  " ",
1590
- Yt(n),
1564
+ Xt(n),
1591
1565
  " ·",
1592
1566
  " ",
1593
- Ht(a, n.placement)
1567
+ Yt(a, n.placement)
1594
1568
  ] }),
1595
1569
  o ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: o }) : null
1596
1570
  ] })
1597
1571
  ] });
1598
1572
  }
1599
- function It(e) {
1573
+ function Lt(e) {
1600
1574
  const {
1601
1575
  control: n,
1602
1576
  defaultValue: a,
1603
1577
  availableFieldChoices: o,
1604
- availableMetricChoices: u,
1578
+ availableMetricChoices: m,
1605
1579
  previewControlDefinitions: d,
1606
- previewControlValues: c,
1607
- onControlChange: i,
1580
+ previewControlValues: u,
1581
+ onControlChange: l,
1608
1582
  onLabelChange: s,
1609
- onDefaultValueChange: m,
1610
- onBack: f,
1583
+ onDefaultValueChange: c,
1584
+ onBack: g,
1611
1585
  onNext: k,
1612
1586
  nextDisabled: y
1613
1587
  } = e;
1614
- return /* @__PURE__ */ l("div", { className: "space-y-3", children: [
1588
+ return /* @__PURE__ */ i("div", { className: "space-y-3", children: [
1615
1589
  /* @__PURE__ */ t(ln, { control: n, onChange: s }),
1616
1590
  /* @__PURE__ */ t(
1617
- zt,
1591
+ Mt,
1618
1592
  {
1619
1593
  control: n,
1620
1594
  availableFieldChoices: o,
1621
- availableMetricChoices: u,
1595
+ availableMetricChoices: m,
1622
1596
  previewControlDefinitions: d,
1623
- previewControlValues: c,
1597
+ previewControlValues: u,
1624
1598
  controlLifecycle: "create",
1625
- onChange: i
1599
+ onChange: l
1626
1600
  }
1627
1601
  ),
1628
1602
  /* @__PURE__ */ t(
1629
- Mt,
1603
+ jt,
1630
1604
  {
1631
1605
  control: n,
1632
1606
  value: a,
1633
- onChange: m,
1607
+ onChange: c,
1634
1608
  allowNoDefault: !0,
1635
1609
  allowCardDefault: !0,
1636
1610
  hint: "This is the value viewers will see first.",
1637
1611
  previewControlDefinitions: d,
1638
- previewControlValues: c
1612
+ previewControlValues: u
1639
1613
  }
1640
1614
  ),
1641
1615
  /* @__PURE__ */ t(
1642
- je,
1616
+ qe,
1643
1617
  {
1644
- secondary: /* @__PURE__ */ t(U, { type: "button", variant: "outline", size: "xs", onClick: f, children: "Back" }),
1618
+ secondary: /* @__PURE__ */ t(G, { type: "button", variant: "outline", size: "xs", onClick: g, children: "Back" }),
1645
1619
  primary: /* @__PURE__ */ t(
1646
- U,
1620
+ G,
1647
1621
  {
1648
1622
  type: "button",
1649
1623
  size: "xs",
@@ -1656,22 +1630,22 @@ function It(e) {
1656
1630
  )
1657
1631
  ] });
1658
1632
  }
1659
- const Qa = /* @__PURE__ */ new Set([
1633
+ const Wa = /* @__PURE__ */ new Set([
1660
1634
  "grain_selector",
1661
1635
  "aggregation_selector",
1662
1636
  "field_selector",
1663
1637
  "metric_selector"
1664
1638
  ]);
1665
- function Lt(e) {
1666
- const { text: n, ariaLabel: a } = e, [o, u] = Y(!1);
1667
- return /* @__PURE__ */ l(
1639
+ function $t(e) {
1640
+ const { text: n, ariaLabel: a } = e, [o, m] = Y(!1);
1641
+ return /* @__PURE__ */ i(
1668
1642
  "button",
1669
1643
  {
1670
1644
  type: "button",
1671
1645
  "aria-label": a,
1672
1646
  onClick: async () => {
1673
1647
  try {
1674
- await navigator.clipboard.writeText(n), u(!0), setTimeout(() => u(!1), 1200);
1648
+ await navigator.clipboard.writeText(n), m(!0), setTimeout(() => m(!1), 1200);
1675
1649
  } catch (d) {
1676
1650
  console.error("Failed to copy", d);
1677
1651
  }
@@ -1684,51 +1658,51 @@ function Lt(e) {
1684
1658
  }
1685
1659
  );
1686
1660
  }
1687
- function $t(e) {
1661
+ function At(e) {
1688
1662
  const {
1689
1663
  control: n,
1690
1664
  scope: a,
1691
1665
  createdReference: o,
1692
- explorerContent: u,
1666
+ explorerContent: m,
1693
1667
  sqlDescription: d,
1694
- summaryDetail: c,
1695
- onBack: i,
1668
+ summaryDetail: u,
1669
+ onBack: l,
1696
1670
  onCancel: s,
1697
- onDone: m
1698
- } = e, f = Qa.has(n.type), k = o.match(/\[\[param\.(.+?)\]\]/), y = k ? `{{ param('${k[1]}') }}` : "";
1699
- return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
1671
+ onDone: c
1672
+ } = e, g = Wa.has(n.type), k = o.match(/\[\[param\.(.+?)\]\]/), y = k ? `{{ param('${k[1]}') }}` : "";
1673
+ return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
1700
1674
  /* @__PURE__ */ t(
1701
- Ka,
1675
+ Ba,
1702
1676
  {
1703
1677
  control: n,
1704
1678
  scope: a,
1705
- detail: c
1679
+ detail: u
1706
1680
  }
1707
1681
  ),
1708
- /* @__PURE__ */ l("div", { className: "space-y-2", children: [
1682
+ /* @__PURE__ */ i("div", { className: "space-y-2", children: [
1709
1683
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-foreground", children: "How cards use this control" }),
1710
- /* @__PURE__ */ l("div", { className: "divide-y divide-border/60 overflow-hidden rounded-control border border-border/60", children: [
1711
- f ? /* @__PURE__ */ l("div", { className: "space-y-1 px-3 py-2.5", children: [
1684
+ /* @__PURE__ */ i("div", { className: "divide-y divide-border/60 overflow-hidden rounded-control border border-border/60", children: [
1685
+ g ? /* @__PURE__ */ i("div", { className: "space-y-1 px-3 py-2.5", children: [
1712
1686
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Explorer cards" }),
1713
- /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: u })
1687
+ /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: m })
1714
1688
  ] }) : null,
1715
- /* @__PURE__ */ l("div", { className: "space-y-1.5 px-3 py-2.5", children: [
1689
+ /* @__PURE__ */ i("div", { className: "space-y-1.5 px-3 py-2.5", children: [
1716
1690
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
1717
1691
  /* @__PURE__ */ t(
1718
- Lt,
1692
+ $t,
1719
1693
  {
1720
1694
  text: o,
1721
1695
  ariaLabel: "Copy SQL control reference"
1722
1696
  }
1723
1697
  ),
1724
1698
  y ? /* @__PURE__ */ t(
1725
- Lt,
1699
+ $t,
1726
1700
  {
1727
1701
  text: y,
1728
1702
  ariaLabel: "Copy Jinja control reference"
1729
1703
  }
1730
1704
  ) : null,
1731
- /* @__PURE__ */ l("p", { className: "text-[12px] text-muted-foreground", children: [
1705
+ /* @__PURE__ */ i("p", { className: "text-[12px] text-muted-foreground", children: [
1732
1706
  d,
1733
1707
  " ",
1734
1708
  /* @__PURE__ */ t(
@@ -1747,16 +1721,16 @@ function $t(e) {
1747
1721
  ] })
1748
1722
  ] }),
1749
1723
  /* @__PURE__ */ t(
1750
- je,
1724
+ qe,
1751
1725
  {
1752
- secondary: /* @__PURE__ */ t(U, { type: "button", variant: "outline", size: "xs", onClick: i, children: "Back" }),
1753
- tertiary: /* @__PURE__ */ t(U, { type: "button", variant: "outline", size: "xs", onClick: s, children: "Cancel" }),
1754
- primary: /* @__PURE__ */ t(U, { type: "button", size: "xs", onClick: m, children: "Done" })
1726
+ secondary: /* @__PURE__ */ t(G, { type: "button", variant: "outline", size: "xs", onClick: l, children: "Back" }),
1727
+ tertiary: /* @__PURE__ */ t(G, { type: "button", variant: "outline", size: "xs", onClick: s, children: "Cancel" }),
1728
+ primary: /* @__PURE__ */ t(G, { type: "button", size: "xs", onClick: c, children: "Done" })
1755
1729
  }
1756
1730
  )
1757
1731
  ] });
1758
1732
  }
1759
- function Pa(e) {
1733
+ function Qa(e) {
1760
1734
  const n = Ae(
1761
1735
  e.scope,
1762
1736
  e.existingControls,
@@ -1780,81 +1754,81 @@ function Pa(e) {
1780
1754
  return {
1781
1755
  step: 2,
1782
1756
  control: a,
1783
- defaultValue: Fe(a, void 0)
1757
+ defaultValue: Oe(a, void 0)
1784
1758
  };
1785
1759
  }
1786
- function Ar({
1760
+ function Ir({
1787
1761
  scope: e,
1788
1762
  controls: n,
1789
1763
  reservedControlIds: a,
1790
1764
  defaultValues: o,
1791
- onChange: u,
1765
+ onChange: m,
1792
1766
  emptyMessage: d,
1793
- initialCreateFlow: c = !1,
1794
- usageByControlId: i,
1767
+ initialCreateFlow: u = !1,
1768
+ usageByControlId: l,
1795
1769
  availableFieldChoices: s,
1796
- availableMetricChoices: m,
1797
- structuralParticipants: f,
1770
+ availableMetricChoices: c,
1771
+ structuralParticipants: g,
1798
1772
  structuralParticipantIdsByControlId: k,
1799
1773
  card: y,
1800
- allowedControlTypes: g,
1774
+ allowedControlTypes: h,
1801
1775
  onCreateFlowActiveChange: N,
1802
1776
  onCreateFlowComplete: S
1803
1777
  }) {
1804
1778
  const V = P(
1805
1779
  () => new Set(a || []),
1806
1780
  [a]
1807
- ), _ = la(e), Q = na(e), [C, T] = Y(
1781
+ ), F = sa(e), K = Zn(e), [C, T] = Y(
1808
1782
  null
1809
- ), [G, Z] = Y(
1783
+ ), [U, Z] = Y(
1810
1784
  null
1811
1785
  ), [p, I] = Y(
1812
- () => c ? {
1786
+ () => u ? {
1813
1787
  step: 1,
1814
1788
  control: Ae(e, n, Array.from(V))
1815
1789
  } : null
1816
- ), $ = $e({}), D = $e(void 0), v = $e(c), h = P(() => {
1790
+ ), $ = $e({}), D = $e(void 0), v = $e(u), f = P(() => {
1817
1791
  const r = Ct({ scope: e, card: y });
1818
- if (!g)
1792
+ if (!h)
1819
1793
  return r;
1820
- const x = new Set(g);
1794
+ const x = new Set(h);
1821
1795
  return r.filter((b) => x.has(b.value));
1822
- }, [g, y, e]), E = ne(
1796
+ }, [h, y, e]), E = ne(
1823
1797
  (r) => {
1824
1798
  const x = Ct({
1825
1799
  scope: e,
1826
1800
  card: y,
1827
- includeType: g ? void 0 : r
1801
+ includeType: h ? void 0 : r
1828
1802
  });
1829
- if (!g)
1803
+ if (!h)
1830
1804
  return x;
1831
- const b = new Set(g);
1805
+ const b = new Set(h);
1832
1806
  return x.filter((L) => b.has(L.value));
1833
1807
  },
1834
- [g, y, e]
1808
+ [h, y, e]
1835
1809
  ), w = ne(
1836
1810
  (r) => e === "dashboard" && (r === "field_selector" || r === "metric_selector"),
1837
1811
  [e]
1838
1812
  ), H = P(
1839
1813
  () => p ? wt(
1840
- f || [],
1814
+ g || [],
1841
1815
  p.control.type
1842
1816
  ) : [],
1843
- [p, f]
1844
- ), O = P(() => {
1817
+ [p, g]
1818
+ ), _ = P(() => {
1845
1819
  if (!p)
1846
1820
  return {
1847
1821
  fields: s || [],
1848
- metrics: m || []
1822
+ metrics: c || []
1849
1823
  };
1850
1824
  if (!w(p.control.type))
1851
1825
  return {
1852
1826
  fields: s || [],
1853
- metrics: m || []
1827
+ metrics: c || []
1854
1828
  };
1855
- const r = p.selectedCardIds || [], x = Ke({
1829
+ const r = p.selectedCardIds || [], x = Qe({
1856
1830
  controlType: p.control.type,
1857
- participants: f || [],
1831
+ participants: g || [],
1858
1832
  selectedCardIds: r
1859
1833
  });
1860
1834
  return {
@@ -1869,35 +1843,35 @@ function Ar({
1869
1843
  };
1870
1844
  }, [
1871
1845
  s,
1872
- m,
1846
+ c,
1873
1847
  p,
1874
1848
  w,
1875
- f
1849
+ g
1876
1850
  ]);
1877
1851
  de(() => {
1878
1852
  N == null || N(!!p);
1879
1853
  }, [p, N]), de(() => {
1880
- const r = c && !v.current;
1881
- v.current = c, r && (I({
1854
+ const r = u && !v.current;
1855
+ v.current = u, r && (I({
1882
1856
  step: 1,
1883
1857
  control: Ae(e, n, Array.from(V))
1884
1858
  }), Z(null), T(null));
1885
- }, [n, c, V, e]);
1859
+ }, [n, u, V, e]);
1886
1860
  const z = (r) => {
1887
1861
  if (!w(r.type))
1888
1862
  return {
1889
1863
  fields: s || [],
1890
- metrics: m || []
1864
+ metrics: c || []
1891
1865
  };
1892
1866
  const x = (k == null ? void 0 : k[r.id]) || [];
1893
1867
  if (x.length === 0)
1894
1868
  return {
1895
1869
  fields: s || [],
1896
- metrics: m || []
1870
+ metrics: c || []
1897
1871
  };
1898
- const b = Ke({
1872
+ const b = Qe({
1899
1873
  controlType: r.type,
1900
- participants: f || [],
1874
+ participants: g || [],
1901
1875
  selectedCardIds: x
1902
1876
  });
1903
1877
  return {
@@ -1916,11 +1890,11 @@ function Ar({
1916
1890
  nextControl: r.control,
1917
1891
  cardBindingsById: void 0
1918
1892
  };
1919
- const x = (k == null ? void 0 : k[r.control.id]) || [], b = Ke({
1893
+ const x = (k == null ? void 0 : k[r.control.id]) || [], b = Qe({
1920
1894
  controlType: r.control.type,
1921
- participants: f || [],
1895
+ participants: g || [],
1922
1896
  selectedCardIds: r.nextSelectedCardIds
1923
- }), L = pa({
1897
+ }), L = ca({
1924
1898
  control: r.control,
1925
1899
  choices: b.choices
1926
1900
  }), R = Object.fromEntries(
@@ -1930,7 +1904,7 @@ function Ar({
1930
1904
  R,
1931
1905
  Tt({
1932
1906
  control: L,
1933
- participants: f || [],
1907
+ participants: g || [],
1934
1908
  selectedCardIds: r.nextSelectedCardIds,
1935
1909
  matrixTargetIds: r.matrixTargetIds
1936
1910
  })
@@ -1938,68 +1912,68 @@ function Ar({
1938
1912
  nextControl: L,
1939
1913
  cardBindingsById: R
1940
1914
  };
1941
- }, j = ne(
1915
+ }, q = ne(
1942
1916
  (r, x = o, b = { type: "update" }) => {
1943
- const L = r.map((R) => (Qe({
1917
+ const L = r.map((R) => (Ke({
1944
1918
  control: R,
1945
1919
  defaultValues: x
1946
- }), aa(
1920
+ }), ea(
1947
1921
  R
1948
1922
  )));
1949
- u(L, x, b);
1923
+ m(L, x, b);
1950
1924
  },
1951
- [o, u]
1925
+ [o, m]
1952
1926
  ), ee = (r, x) => {
1953
1927
  const b = n.find(
1954
- (K) => K.id === r
1928
+ (Q) => Q.id === r
1955
1929
  );
1956
- let L = n.map((K) => K.id !== r ? K : x(K));
1930
+ let L = n.map((Q) => Q.id !== r ? Q : x(Q));
1957
1931
  const R = L.find(
1958
- (K) => K.id === r
1932
+ (Q) => Q.id === r
1959
1933
  );
1960
- let M, F;
1961
- if (R && (!b || ua({ control: b }, { control: R })) && e === "dashboard" && (R.type === "field_selector" || R.type === "metric_selector")) {
1962
- const K = (k == null ? void 0 : k[R.id]) || [], pe = B({
1934
+ let M, O;
1935
+ if (R && (!b || ia({ control: b }, { control: R })) && e === "dashboard" && (R.type === "field_selector" || R.type === "metric_selector")) {
1936
+ const Q = (k == null ? void 0 : k[R.id]) || [], pe = B({
1963
1937
  control: R,
1964
- nextSelectedCardIds: K
1938
+ nextSelectedCardIds: Q
1965
1939
  });
1966
1940
  L = L.map(
1967
- (ie) => ie.id === r ? pe.nextControl : ie
1968
- ), M = pe.cardBindingsById, F = [R.id];
1969
- } else if (b && (!R || !ma(R.type)) && e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector")) {
1970
- const K = (k == null ? void 0 : k[b.id]) || [];
1941
+ (le) => le.id === r ? pe.nextControl : le
1942
+ ), M = pe.cardBindingsById, O = [R.id];
1943
+ } else if (b && (!R || !da(R.type)) && e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector")) {
1944
+ const Q = (k == null ? void 0 : k[b.id]) || [];
1971
1945
  M = Object.fromEntries(
1972
- K.map((pe) => [pe, void 0])
1973
- ), F = [b.id];
1946
+ Q.map((pe) => [pe, void 0])
1947
+ ), O = [b.id];
1974
1948
  }
1975
1949
  const W = L.find(
1976
- (K) => K.id === r
1950
+ (Q) => Q.id === r
1977
1951
  );
1978
- let J = o;
1952
+ let X = o;
1979
1953
  if (b && W) {
1980
- const K = Qe({
1954
+ const Q = Ke({
1981
1955
  control: b,
1982
1956
  defaultValues: o
1983
1957
  });
1984
- b.source.kind === "manual" && W.source.kind === "sql_query" && ($.current[r] = K);
1985
- const pe = K === void 0 && b.source.kind === "sql_query" && W.source.kind === "manual" ? $.current[r] : K, ie = Dt({
1958
+ b.source.kind === "manual" && W.source.kind === "sql_query" && ($.current[r] = Q);
1959
+ const pe = Q === void 0 && b.source.kind === "sql_query" && W.source.kind === "manual" ? $.current[r] : Q, le = Dt({
1986
1960
  previousControl: b,
1987
1961
  nextControl: W,
1988
1962
  currentDefaultValue: pe
1989
1963
  });
1990
- W.source.kind === "manual" && ($.current[r] = ie), o && (J = { ...o }, ie === void 0 ? delete J[r] : J[r] = ie), L = L.map(
1991
- (xt) => xt.id === r ? { ...W, defaultValue: ie } : xt
1964
+ W.source.kind === "manual" && ($.current[r] = le), o && (X = { ...o }, le === void 0 ? delete X[r] : X[r] = le), L = L.map(
1965
+ (xt) => xt.id === r ? { ...W, defaultValue: le } : xt
1992
1966
  );
1993
1967
  }
1994
- j(L, J, {
1968
+ q(L, X, {
1995
1969
  type: "update",
1996
1970
  cardBindingsById: M,
1997
- affectedBindingControlIds: F
1971
+ affectedBindingControlIds: O
1998
1972
  });
1999
1973
  }, te = (r, x) => {
2000
1974
  if (!x.trim())
2001
1975
  return;
2002
- const b = fa(x);
1976
+ const b = ua(x);
2003
1977
  if (b === r || V.has(b) || n.some(
2004
1978
  (M) => M.id === b && M.id !== r
2005
1979
  ))
@@ -2008,7 +1982,7 @@ function Ar({
2008
1982
  (M) => M.id === r ? { ...M, id: b } : M
2009
1983
  );
2010
1984
  if (!o) {
2011
- j(L, void 0, {
1985
+ q(L, void 0, {
2012
1986
  type: "rename",
2013
1987
  oldId: r,
2014
1988
  newId: b
@@ -2016,7 +1990,7 @@ function Ar({
2016
1990
  return;
2017
1991
  }
2018
1992
  const R = { ...o };
2019
- Object.prototype.hasOwnProperty.call(R, r) && (R[b] = R[r], delete R[r]), j(L, R, {
1993
+ Object.prototype.hasOwnProperty.call(R, r) && (R[b] = R[r], delete R[r]), q(L, R, {
2020
1994
  type: "rename",
2021
1995
  oldId: r,
2022
1996
  newId: b
@@ -2024,11 +1998,11 @@ function Ar({
2024
1998
  }, Be = (r) => {
2025
1999
  const x = n.filter((L) => L.id !== r);
2026
2000
  if (!o) {
2027
- j(x, void 0, { type: "remove", controlId: r });
2001
+ q(x, void 0, { type: "remove", controlId: r });
2028
2002
  return;
2029
2003
  }
2030
2004
  const b = { ...o };
2031
- delete b[r], j(x, b, { type: "remove", controlId: r });
2005
+ delete b[r], q(x, b, { type: "remove", controlId: r });
2032
2006
  }, We = ne(() => {
2033
2007
  D.current = void 0, I({
2034
2008
  step: 1,
@@ -2062,8 +2036,8 @@ function Ar({
2062
2036
  if (!p)
2063
2037
  return !1;
2064
2038
  if (p.step === 2 && w(p.control.type))
2065
- return (p.selectedCardIds || []).length > 0 && ra({
2066
- participants: f || [],
2039
+ return (p.selectedCardIds || []).length > 0 && ta({
2040
+ participants: g || [],
2067
2041
  selectedCardIds: p.selectedCardIds || [],
2068
2042
  control: p.control,
2069
2043
  selected: p.matrixTargetIds
@@ -2071,7 +2045,7 @@ function Ar({
2071
2045
  if (p.step !== 2 && p.step !== 3 || !p.control.label.trim())
2072
2046
  return !1;
2073
2047
  const x = p.control.source.kind === "sql_query" ? p.control : kt(p.control);
2074
- if (x.source.kind === "manual" && (sa(x) && x.source.options.length === 0 || x.source.options.some(
2048
+ if (x.source.kind === "manual" && (na(x) && x.source.options.length === 0 || x.source.options.some(
2075
2049
  (L) => L.label.trim().length === 0 || L.value.trim().length === 0
2076
2050
  )))
2077
2051
  return !1;
@@ -2079,14 +2053,14 @@ function Ar({
2079
2053
  const { connectionId: b, sql: L, valueColumn: R } = x.source;
2080
2054
  return b.trim().length > 0 && L.trim().length > 0 && R.trim().length > 0;
2081
2055
  }
2082
- return oa(
2083
- Fe(x, p.defaultValue)
2056
+ return aa(
2057
+ Oe(x, p.defaultValue)
2084
2058
  );
2085
2059
  })(), Ce = () => {
2086
2060
  var M;
2087
2061
  if (!p)
2088
2062
  return;
2089
- const r = kt(p.control), x = ca({
2063
+ const r = kt(p.control), x = la({
2090
2064
  label: r.label,
2091
2065
  fallbackId: r.id,
2092
2066
  existingControls: n,
@@ -2096,10 +2070,10 @@ function Ar({
2096
2070
  id: x
2097
2071
  }, L = e === "dashboard" && (b.type === "field_selector" || b.type === "metric_selector") && ((M = p.selectedCardIds) != null && M.length) ? Tt({
2098
2072
  control: b,
2099
- participants: f || [],
2073
+ participants: g || [],
2100
2074
  selectedCardIds: p.selectedCardIds,
2101
2075
  matrixTargetIds: p.matrixTargetIds
2102
- }) : void 0, R = Fe(
2076
+ }) : void 0, R = Oe(
2103
2077
  b,
2104
2078
  p.defaultValue
2105
2079
  );
@@ -2119,13 +2093,13 @@ function Ar({
2119
2093
  I(null);
2120
2094
  return;
2121
2095
  }
2122
- const r = p.control, x = p.createdControlId, b = Fe(
2096
+ const r = p.control, x = p.createdControlId, b = Oe(
2123
2097
  r,
2124
2098
  p.defaultValue
2125
2099
  );
2126
2100
  if (o) {
2127
2101
  const L = { ...o };
2128
- b === void 0 ? delete L[x] : L[x] = b, j(
2102
+ b === void 0 ? delete L[x] : L[x] = b, q(
2129
2103
  [
2130
2104
  ...n,
2131
2105
  {
@@ -2140,7 +2114,7 @@ function Ar({
2140
2114
  }
2141
2115
  );
2142
2116
  } else
2143
- j(
2117
+ q(
2144
2118
  [
2145
2119
  ...n,
2146
2120
  {
@@ -2155,7 +2129,7 @@ function Ar({
2155
2129
  }
2156
2130
  );
2157
2131
  Z(x), I(null), S == null || S();
2158
- }, [n, p, o, j, S]), gt = p ? w(p.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Se = p != null && p.createdControlId ? `[[param.${p.createdControlId}]]` : p ? `[[param.${ia(p.control.label) || p.control.id}]]` : "", me = St({
2132
+ }, [n, p, o, q, S]), gt = p ? w(p.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Se = p != null && p.createdControlId ? `[[param.${p.createdControlId}]]` : p ? `[[param.${ra(p.control.label) || p.control.id}]]` : "", me = St({
2159
2133
  controls: n,
2160
2134
  defaultValues: o
2161
2135
  }), A = p ? [...n, p.control] : n, ae = p ? St({
@@ -2168,10 +2142,10 @@ function Ar({
2168
2142
  }
2169
2143
  ]
2170
2144
  }) : me;
2171
- return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
2172
- p ? /* @__PURE__ */ l("div", { className: "space-y-4 pb-1", children: [
2145
+ return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
2146
+ p ? /* @__PURE__ */ i("div", { className: "space-y-4 pb-1", children: [
2173
2147
  /* @__PURE__ */ t(
2174
- Wa,
2148
+ Ga,
2175
2149
  {
2176
2150
  currentStep: p.step,
2177
2151
  labels: gt
@@ -2188,17 +2162,17 @@ function Ar({
2188
2162
  // keeping the shared definitions for existing controls.
2189
2163
  "date",
2190
2164
  "text"
2191
- ]), b = h.filter(
2165
+ ]), b = f.filter(
2192
2166
  (M) => !r.has(M.value) && !x.has(M.value)
2193
- ), L = h.filter(
2167
+ ), L = f.filter(
2194
2168
  (M) => r.has(M.value)
2195
- ), R = (M) => /* @__PURE__ */ l(
2169
+ ), R = (M) => /* @__PURE__ */ i(
2196
2170
  "button",
2197
2171
  {
2198
2172
  type: "button",
2199
2173
  className: "rounded-control border border-border/60 bg-background px-3 py-2.5 text-left transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:outline-none",
2200
2174
  onClick: () => I(
2201
- Pa({
2175
+ Qa({
2202
2176
  scope: e,
2203
2177
  existingControls: n,
2204
2178
  reservedIds: Array.from(V),
@@ -2212,21 +2186,21 @@ function Ar({
2212
2186
  },
2213
2187
  M.value
2214
2188
  );
2215
- return /* @__PURE__ */ l("div", { className: "space-y-4", children: [
2189
+ return /* @__PURE__ */ i("div", { className: "space-y-4", children: [
2216
2190
  e === "card" && (y == null ? void 0 : y.sql) == null ? /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Explorer cards support displayed metric, group by field, aggregation, and time grain controls here." }) : null,
2217
- b.length > 0 && /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
2191
+ b.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
2218
2192
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input controls" }),
2219
2193
  /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: b.map(R) })
2220
2194
  ] }),
2221
- L.length > 0 && /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
2195
+ L.length > 0 && /* @__PURE__ */ i("div", { className: "space-y-1.5", children: [
2222
2196
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Data-driven controls" }),
2223
2197
  /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: L.map(R) })
2224
2198
  ] }),
2225
2199
  /* @__PURE__ */ t(
2226
- je,
2200
+ qe,
2227
2201
  {
2228
2202
  secondary: /* @__PURE__ */ t(
2229
- U,
2203
+ G,
2230
2204
  {
2231
2205
  type: "button",
2232
2206
  variant: "outline",
@@ -2239,8 +2213,8 @@ function Ar({
2239
2213
  )
2240
2214
  ] });
2241
2215
  })(),
2242
- p.step === 2 && w(p.control.type) && /* @__PURE__ */ l("div", { className: "space-y-3", children: [
2243
- /* @__PURE__ */ l("div", { className: "space-y-3", children: [
2216
+ p.step === 2 && w(p.control.type) && /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2217
+ /* @__PURE__ */ i("div", { className: "space-y-3", children: [
2244
2218
  /* @__PURE__ */ t(
2245
2219
  ln,
2246
2220
  {
@@ -2255,13 +2229,13 @@ function Ar({
2255
2229
  ] }),
2256
2230
  H.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-control border border-border/60 bg-muted/30 px-3 py-2.5 text-[12px] text-muted-foreground", children: "No eligible cards are available yet. Add compatible metrics or group-by fields to cards first." }) : /* @__PURE__ */ t("div", { className: "space-y-1 rounded-control border border-border/60 bg-background p-2", children: H.map((r) => {
2257
2231
  const x = (p.selectedCardIds || []).includes(r.cardId);
2258
- return /* @__PURE__ */ l(
2232
+ return /* @__PURE__ */ i(
2259
2233
  "label",
2260
2234
  {
2261
2235
  className: "flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",
2262
2236
  children: [
2263
2237
  /* @__PURE__ */ t(
2264
- Ge,
2238
+ Ue,
2265
2239
  {
2266
2240
  checked: x,
2267
2241
  onCheckedChange: (b) => I(
@@ -2277,7 +2251,7 @@ function Ar({
2277
2251
  )
2278
2252
  }
2279
2253
  ),
2280
- /* @__PURE__ */ l("div", { className: "min-w-0", children: [
2254
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
2281
2255
  /* @__PURE__ */ t("div", { className: "font-medium text-foreground", children: r.title }),
2282
2256
  /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: p.control.type === "field_selector" ? `${r.fieldChoices.length} compatible group-by fields` : `${r.metricChoices.length} compatible metrics` })
2283
2257
  ] })
@@ -2297,10 +2271,10 @@ function Ar({
2297
2271
  }
2298
2272
  ),
2299
2273
  /* @__PURE__ */ t(
2300
- je,
2274
+ qe,
2301
2275
  {
2302
2276
  secondary: /* @__PURE__ */ t(
2303
- U,
2277
+ G,
2304
2278
  {
2305
2279
  type: "button",
2306
2280
  variant: "outline",
@@ -2316,7 +2290,7 @@ function Ar({
2316
2290
  }
2317
2291
  ),
2318
2292
  primary: /* @__PURE__ */ t(
2319
- U,
2293
+ G,
2320
2294
  {
2321
2295
  type: "button",
2322
2296
  size: "xs",
@@ -2334,12 +2308,12 @@ function Ar({
2334
2308
  )
2335
2309
  ] }),
2336
2310
  p.step === 2 && !w(p.control.type) && /* @__PURE__ */ t(
2337
- It,
2311
+ Lt,
2338
2312
  {
2339
2313
  control: p.control,
2340
2314
  defaultValue: p.defaultValue,
2341
- availableFieldChoices: O.fields,
2342
- availableMetricChoices: O.metrics,
2315
+ availableFieldChoices: _.fields,
2316
+ availableMetricChoices: _.metrics,
2343
2317
  previewControlDefinitions: A,
2344
2318
  previewControlValues: ae,
2345
2319
  onControlChange: (r) => oe(() => r),
@@ -2359,12 +2333,12 @@ function Ar({
2359
2333
  }
2360
2334
  ),
2361
2335
  p.step === 3 && w(p.control.type) && /* @__PURE__ */ t(
2362
- It,
2336
+ Lt,
2363
2337
  {
2364
2338
  control: p.control,
2365
2339
  defaultValue: p.defaultValue,
2366
- availableFieldChoices: O.fields,
2367
- availableMetricChoices: O.metrics,
2340
+ availableFieldChoices: _.fields,
2341
+ availableMetricChoices: _.metrics,
2368
2342
  previewControlDefinitions: A,
2369
2343
  previewControlValues: ae,
2370
2344
  onControlChange: (r) => oe(() => r),
@@ -2384,12 +2358,12 @@ function Ar({
2384
2358
  }
2385
2359
  ),
2386
2360
  p.step === 3 && !w(p.control.type) && /* @__PURE__ */ t(
2387
- $t,
2361
+ At,
2388
2362
  {
2389
2363
  control: p.control,
2390
2364
  scope: e,
2391
2365
  createdReference: Se,
2392
- explorerContent: /* @__PURE__ */ l(fe, { children: [
2366
+ explorerContent: /* @__PURE__ */ i(fe, { children: [
2393
2367
  "Open the card and use",
2394
2368
  " ",
2395
2369
  /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
@@ -2408,12 +2382,12 @@ function Ar({
2408
2382
  }
2409
2383
  ),
2410
2384
  p.step === 4 && w(p.control.type) && /* @__PURE__ */ t(
2411
- $t,
2385
+ At,
2412
2386
  {
2413
2387
  control: p.control,
2414
2388
  scope: e,
2415
2389
  createdReference: Se,
2416
- summaryDetail: /* @__PURE__ */ l(fe, { children: [
2390
+ summaryDetail: /* @__PURE__ */ i(fe, { children: [
2417
2391
  "Used by ",
2418
2392
  (p.selectedCardIds || []).length,
2419
2393
  " selected card",
@@ -2434,34 +2408,34 @@ function Ar({
2434
2408
  ] }) : null,
2435
2409
  !p && n.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: d }) : null,
2436
2410
  !p && n.map((r) => {
2437
- const x = z(r), b = i == null ? void 0 : i[r.id], L = Qe({
2411
+ const x = z(r), b = l == null ? void 0 : l[r.id], L = Ke({
2438
2412
  control: r,
2439
2413
  defaultValues: o
2440
- }), R = G === r.id, M = "inline-flex shrink-0 items-center rounded-[4px] border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground";
2441
- return /* @__PURE__ */ l(
2414
+ }), R = U === r.id, M = "inline-flex shrink-0 items-center rounded-[4px] border border-border/60 bg-muted/40 px-1.5 py-0.5 text-[11px] font-medium text-muted-foreground";
2415
+ return /* @__PURE__ */ i(
2442
2416
  "div",
2443
2417
  {
2444
2418
  className: "rounded-control border border-border/60",
2445
2419
  children: [
2446
- /* @__PURE__ */ l("div", { className: "flex items-center gap-2 px-3 py-2.5", children: [
2447
- /* @__PURE__ */ l(
2420
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 px-3 py-2.5", children: [
2421
+ /* @__PURE__ */ i(
2448
2422
  "button",
2449
2423
  {
2450
2424
  type: "button",
2451
2425
  className: "flex min-w-0 flex-1 items-start gap-2 rounded-control text-left focus:outline-none focus-visible:bg-muted/40",
2452
2426
  onClick: () => Z(
2453
- (F) => F === r.id ? null : r.id
2427
+ (O) => O === r.id ? null : r.id
2454
2428
  ),
2455
2429
  children: [
2456
- R ? /* @__PURE__ */ t(Oe, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Te, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2457
- /* @__PURE__ */ l("div", { className: "min-w-0", children: [
2458
- /* @__PURE__ */ l("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2430
+ R ? /* @__PURE__ */ t(_e, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Te, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
2431
+ /* @__PURE__ */ i("div", { className: "min-w-0", children: [
2432
+ /* @__PURE__ */ i("div", { className: "flex flex-wrap items-center gap-1.5", children: [
2459
2433
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: r.label || "Untitled control" }),
2460
- /* @__PURE__ */ t("span", { className: M, children: Pt(r.type).label }),
2461
- /* @__PURE__ */ t("span", { className: M, children: Ht(e, r.placement) })
2434
+ /* @__PURE__ */ t("span", { className: M, children: Ht(r.type).label }),
2435
+ /* @__PURE__ */ t("span", { className: M, children: Yt(e, r.placement) })
2462
2436
  ] }),
2463
- /* @__PURE__ */ l("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
2464
- Yt(r),
2437
+ /* @__PURE__ */ i("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
2438
+ Xt(r),
2465
2439
  b != null && b.status ? ` · ${b.status}` : ""
2466
2440
  ] })
2467
2441
  ] })
@@ -2469,7 +2443,7 @@ function Ar({
2469
2443
  }
2470
2444
  ),
2471
2445
  /* @__PURE__ */ t(
2472
- U,
2446
+ G,
2473
2447
  {
2474
2448
  type: "button",
2475
2449
  size: "xs",
@@ -2477,98 +2451,98 @@ function Ar({
2477
2451
  className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
2478
2452
  onClick: () => Be(r.id),
2479
2453
  "aria-label": `Remove ${r.label}`,
2480
- children: /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" })
2454
+ children: /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" })
2481
2455
  }
2482
2456
  )
2483
2457
  ] }),
2484
- R && /* @__PURE__ */ l("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
2485
- /* @__PURE__ */ l("div", { className: "grid gap-3 md:grid-cols-3", children: [
2486
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
2487
- /* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
2458
+ R && /* @__PURE__ */ i("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
2459
+ /* @__PURE__ */ i("div", { className: "grid gap-3 md:grid-cols-3", children: [
2460
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
2461
+ /* @__PURE__ */ t(ie, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
2488
2462
  /* @__PURE__ */ t(
2489
2463
  Ne,
2490
2464
  {
2491
2465
  size: "xs",
2492
2466
  value: r.label,
2493
2467
  placeholder: "Control label",
2494
- onChange: (F) => ee(r.id, (W) => ({
2468
+ onChange: (O) => ee(r.id, (W) => ({
2495
2469
  ...W,
2496
- label: F.target.value
2470
+ label: O.target.value
2497
2471
  }))
2498
2472
  }
2499
2473
  )
2500
2474
  ] }),
2501
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
2502
- /* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
2503
- /* @__PURE__ */ l(
2475
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
2476
+ /* @__PURE__ */ t(ie, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
2477
+ /* @__PURE__ */ i(
2504
2478
  ge,
2505
2479
  {
2506
2480
  value: r.type,
2507
- onValueChange: (F) => {
2481
+ onValueChange: (O) => {
2508
2482
  const W = Jt({
2509
2483
  controls: n,
2510
2484
  controlId: r.id,
2511
- nextType: F,
2485
+ nextType: O,
2512
2486
  defaultValues: o
2513
2487
  });
2514
- j(W.controls, W.defaultValues);
2488
+ q(W.controls, W.defaultValues);
2515
2489
  },
2516
2490
  children: [
2517
2491
  /* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(be, {}) }),
2518
2492
  /* @__PURE__ */ t(ve, { children: E(r.type).map(
2519
- (F) => /* @__PURE__ */ t(
2493
+ (O) => /* @__PURE__ */ t(
2520
2494
  re,
2521
2495
  {
2522
- value: F.value,
2523
- children: F.label
2496
+ value: O.value,
2497
+ children: O.label
2524
2498
  },
2525
- F.value
2499
+ O.value
2526
2500
  )
2527
2501
  ) })
2528
2502
  ]
2529
2503
  }
2530
2504
  )
2531
2505
  ] }),
2532
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
2533
- /* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
2534
- /* @__PURE__ */ l(
2506
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
2507
+ /* @__PURE__ */ t(ie, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
2508
+ /* @__PURE__ */ i(
2535
2509
  ge,
2536
2510
  {
2537
- value: r.placement || Q,
2538
- onValueChange: (F) => ee(r.id, (W) => ({
2511
+ value: r.placement || K,
2512
+ onValueChange: (O) => ee(r.id, (W) => ({
2539
2513
  ...W,
2540
- placement: F
2514
+ placement: O
2541
2515
  })),
2542
2516
  children: [
2543
2517
  /* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(be, {}) }),
2544
- /* @__PURE__ */ t(ve, { children: _.map((F) => /* @__PURE__ */ t(re, { value: F.value, children: F.label }, F.value)) })
2518
+ /* @__PURE__ */ t(ve, { children: F.map((O) => /* @__PURE__ */ t(re, { value: O.value, children: O.label }, O.value)) })
2545
2519
  ]
2546
2520
  }
2547
2521
  )
2548
2522
  ] })
2549
2523
  ] }),
2550
- w(r.type) ? /* @__PURE__ */ l(fe, { children: [
2524
+ w(r.type) ? /* @__PURE__ */ i(fe, { children: [
2551
2525
  /* @__PURE__ */ t(
2552
- Fn,
2526
+ On,
2553
2527
  {
2554
2528
  type: r.type,
2555
2529
  participants: wt(
2556
- f || [],
2530
+ g || [],
2557
2531
  r.type
2558
- ).map((F) => ({
2559
- cardId: F.cardId,
2560
- title: F.title,
2561
- choiceCount: r.type === "field_selector" ? F.fieldChoices.length : F.metricChoices.length
2532
+ ).map((O) => ({
2533
+ cardId: O.cardId,
2534
+ title: O.title,
2535
+ choiceCount: r.type === "field_selector" ? O.fieldChoices.length : O.metricChoices.length
2562
2536
  })),
2563
2537
  selectedCardIds: (k == null ? void 0 : k[r.id]) || [],
2564
- onChange: (F) => {
2538
+ onChange: (O) => {
2565
2539
  const W = B({
2566
2540
  control: r,
2567
- nextSelectedCardIds: F
2568
- }), J = n.map(
2569
- (K) => K.id === r.id ? W.nextControl : K
2541
+ nextSelectedCardIds: O
2542
+ }), X = n.map(
2543
+ (Q) => Q.id === r.id ? W.nextControl : Q
2570
2544
  );
2571
- j(J, o, {
2545
+ q(X, o, {
2572
2546
  type: "update",
2573
2547
  cardBindingsById: W.cardBindingsById
2574
2548
  });
@@ -2578,26 +2552,26 @@ function Ar({
2578
2552
  /* @__PURE__ */ t(
2579
2553
  vt,
2580
2554
  {
2581
- participants: f || [],
2555
+ participants: g || [],
2582
2556
  selectedCardIds: (k == null ? void 0 : k[r.id]) || [],
2583
2557
  control: r,
2584
- onChange: (F, W) => {
2585
- const J = B({
2558
+ onChange: (O, W) => {
2559
+ const X = B({
2586
2560
  control: r,
2587
2561
  nextSelectedCardIds: (k == null ? void 0 : k[r.id]) || [],
2588
- matrixTargetIds: { [F]: W }
2562
+ matrixTargetIds: { [O]: W }
2589
2563
  });
2590
- j(
2591
- n.map((K) => K.id === r.id ? J.nextControl : K),
2564
+ q(
2565
+ n.map((Q) => Q.id === r.id ? X.nextControl : Q),
2592
2566
  o,
2593
- { type: "update", cardBindingsById: J.cardBindingsById }
2567
+ { type: "update", cardBindingsById: X.cardBindingsById }
2594
2568
  );
2595
2569
  }
2596
2570
  }
2597
2571
  )
2598
2572
  ] }) : null,
2599
2573
  /* @__PURE__ */ t(
2600
- zt,
2574
+ Mt,
2601
2575
  {
2602
2576
  control: r,
2603
2577
  availableFieldChoices: x.fields,
@@ -2605,11 +2579,11 @@ function Ar({
2605
2579
  previewControlDefinitions: n,
2606
2580
  previewControlValues: me,
2607
2581
  controlLifecycle: "edit",
2608
- onChange: (F) => ee(r.id, () => F)
2582
+ onChange: (O) => ee(r.id, () => O)
2609
2583
  }
2610
2584
  ),
2611
2585
  r.initialValueStrategy === "saved_default" && /* @__PURE__ */ t(
2612
- Mt,
2586
+ jt,
2613
2587
  {
2614
2588
  control: r,
2615
2589
  value: L,
@@ -2617,70 +2591,70 @@ function Ar({
2617
2591
  allowCardDefault: !0,
2618
2592
  previewControlDefinitions: n,
2619
2593
  previewControlValues: me,
2620
- onChange: (F) => {
2594
+ onChange: (O) => {
2621
2595
  const W = n.map(
2622
- (J) => J.id === r.id ? { ...J, defaultValue: F } : J
2596
+ (X) => X.id === r.id ? { ...X, defaultValue: O } : X
2623
2597
  );
2624
- if (r.source.kind === "manual" && ($.current[r.id] = F), o) {
2625
- const J = { ...o };
2626
- F === void 0 ? delete J[r.id] : J[r.id] = F, j(W, J);
2598
+ if (r.source.kind === "manual" && ($.current[r.id] = O), o) {
2599
+ const X = { ...o };
2600
+ O === void 0 ? delete X[r.id] : X[r.id] = O, q(W, X);
2627
2601
  return;
2628
2602
  }
2629
- j(W, void 0);
2603
+ q(W, void 0);
2630
2604
  }
2631
2605
  }
2632
2606
  ),
2633
- /* @__PURE__ */ l(
2634
- On,
2607
+ /* @__PURE__ */ i(
2608
+ _n,
2635
2609
  {
2636
2610
  open: C === r.id,
2637
- onOpenChange: (F) => T(F ? r.id : null),
2611
+ onOpenChange: (O) => T(O ? r.id : null),
2638
2612
  children: [
2639
- /* @__PURE__ */ t(_n, { asChild: !0, children: /* @__PURE__ */ l(
2640
- U,
2613
+ /* @__PURE__ */ t(Fn, { asChild: !0, children: /* @__PURE__ */ i(
2614
+ G,
2641
2615
  {
2642
2616
  type: "button",
2643
2617
  variant: "ghost",
2644
2618
  size: "xs",
2645
2619
  className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
2646
2620
  children: [
2647
- C === r.id ? /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" }),
2621
+ C === r.id ? /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Te, { className: "h-3.5 w-3.5" }),
2648
2622
  "Advanced"
2649
2623
  ]
2650
2624
  }
2651
2625
  ) }),
2652
- /* @__PURE__ */ l(Vn, { className: "space-y-3 pt-2", children: [
2653
- /* @__PURE__ */ l("div", { className: "grid gap-3 md:grid-cols-2", children: [
2654
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
2655
- /* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
2626
+ /* @__PURE__ */ i(Vn, { className: "space-y-3 pt-2", children: [
2627
+ /* @__PURE__ */ i("div", { className: "grid gap-3 md:grid-cols-2", children: [
2628
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
2629
+ /* @__PURE__ */ t(ie, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
2656
2630
  /* @__PURE__ */ t(
2657
2631
  Rn,
2658
2632
  {
2659
2633
  controlId: r.id,
2660
- onCommit: (F) => te(r.id, F)
2634
+ onCommit: (O) => te(r.id, O)
2661
2635
  },
2662
2636
  r.id
2663
2637
  )
2664
2638
  ] }),
2665
- /* @__PURE__ */ l("div", { className: "flex flex-col gap-1.5", children: [
2666
- /* @__PURE__ */ t(le, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
2667
- /* @__PURE__ */ l(
2639
+ /* @__PURE__ */ i("div", { className: "flex flex-col gap-1.5", children: [
2640
+ /* @__PURE__ */ t(ie, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
2641
+ /* @__PURE__ */ i(
2668
2642
  ge,
2669
2643
  {
2670
2644
  value: r.initialValueStrategy,
2671
- onValueChange: (F) => ee(r.id, (W) => ({
2645
+ onValueChange: (O) => ee(r.id, (W) => ({
2672
2646
  ...W,
2673
- initialValueStrategy: F
2647
+ initialValueStrategy: O
2674
2648
  })),
2675
2649
  children: [
2676
2650
  /* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(be, {}) }),
2677
- /* @__PURE__ */ t(ve, { children: da.map((F) => /* @__PURE__ */ t(
2651
+ /* @__PURE__ */ t(ve, { children: oa.map((O) => /* @__PURE__ */ t(
2678
2652
  re,
2679
2653
  {
2680
- value: F.value,
2681
- children: F.label
2654
+ value: O.value,
2655
+ children: O.label
2682
2656
  },
2683
- F.value
2657
+ O.value
2684
2658
  )) })
2685
2659
  ]
2686
2660
  }
@@ -2691,7 +2665,7 @@ function Ar({
2691
2665
  En,
2692
2666
  {
2693
2667
  control: r,
2694
- onChange: (F) => ee(r.id, () => F)
2668
+ onChange: (O) => ee(r.id, () => O)
2695
2669
  }
2696
2670
  )
2697
2671
  ] })
@@ -2704,8 +2678,8 @@ function Ar({
2704
2678
  r.id
2705
2679
  );
2706
2680
  }),
2707
- !p && /* @__PURE__ */ l(
2708
- U,
2681
+ !p && /* @__PURE__ */ i(
2682
+ G,
2709
2683
  {
2710
2684
  type: "button",
2711
2685
  variant: "outline",
@@ -2719,26 +2693,26 @@ function Ar({
2719
2693
  )
2720
2694
  ] });
2721
2695
  }
2722
- function Fr(e) {
2696
+ function Lr(e) {
2723
2697
  const {
2724
2698
  open: n,
2725
2699
  onOpenChange: a,
2726
2700
  initialCreateFlowActive: o = !1,
2727
- dismissMode: u = "passive"
2728
- } = e, d = n !== void 0, [c, i] = Y(!1), [s, m] = Y(
2701
+ dismissMode: m = "passive"
2702
+ } = e, d = n !== void 0, [u, l] = Y(!1), [s, c] = Y(
2729
2703
  o
2730
- ), f = d ? n : c, k = ne(
2704
+ ), g = d ? n : u, k = ne(
2731
2705
  (N) => {
2732
- !N && s && u === "passive" || (d || i(N), N || m(!1), a == null || a(N));
2706
+ !N && s && m === "passive" || (d || l(N), N || c(!1), a == null || a(N));
2733
2707
  },
2734
- [d, s, u, a]
2708
+ [d, s, m, a]
2735
2709
  ), y = ne(() => {
2736
- d || i(!1), m(!1), a == null || a(!1);
2710
+ d || l(!1), c(!1), a == null || a(!1);
2737
2711
  }, [d, a]);
2738
2712
  de(() => {
2739
- f || m(!1);
2740
- }, [f]);
2741
- const g = ne(
2713
+ g || c(!1);
2714
+ }, [g]);
2715
+ const h = ne(
2742
2716
  (N) => {
2743
2717
  s && N.preventDefault();
2744
2718
  },
@@ -2748,9 +2722,9 @@ function Fr(e) {
2748
2722
  forceClose: y,
2749
2723
  handleOpenChange: k,
2750
2724
  isCreateFlowActive: s,
2751
- preventPassiveDismissDuringCreate: g,
2752
- resolvedOpen: f,
2753
- setIsCreateFlowActive: m
2725
+ preventPassiveDismissDuringCreate: h,
2726
+ resolvedOpen: g,
2727
+ setIsCreateFlowActive: c
2754
2728
  };
2755
2729
  }
2756
2730
  function dn(e) {
@@ -2765,23 +2739,23 @@ function pt(e, n) {
2765
2739
  const a = dn(e);
2766
2740
  return n.relativeMeta ? { ...a, value: n.value, relativeMeta: n.relativeMeta } : { ...a, value: n.value };
2767
2741
  }
2768
- function Ha(e, n) {
2742
+ function Ka(e, n) {
2769
2743
  const a = n === "in" || n === "not in" || n === "between" || n === "not between" ? [] : n === "isNull" || n === "isNotNull" ? null : "";
2770
2744
  return pt({ ...e, operator: n }, { value: a });
2771
2745
  }
2772
- function Ya(e, n) {
2773
- const a = qe(n.dataType) === "date";
2746
+ function Pa(e, n) {
2747
+ const a = je(n.dataType) === "date";
2774
2748
  return pt(
2775
2749
  { ...e, field: n, operator: a ? "between" : "=" },
2776
2750
  { value: "" }
2777
2751
  );
2778
2752
  }
2779
- function Ja({
2753
+ function Ha({
2780
2754
  initialFilters: e,
2781
2755
  availableFields: n,
2782
2756
  onChange: a
2783
2757
  } = {}) {
2784
- const [o, u] = Y(
2758
+ const [o, m] = Y(
2785
2759
  e || {
2786
2760
  id: `group-${Date.now()}`,
2787
2761
  logicalOperator: "AND",
@@ -2790,10 +2764,10 @@ function Ja({
2790
2764
  groups: []
2791
2765
  }
2792
2766
  ), d = (I) => {
2793
- u(I), a == null || a(I);
2767
+ m(I), a == null || a(I);
2794
2768
  };
2795
2769
  se((I) => I.card.dataSource);
2796
- const { filterableFields: c, isLoading: i } = Mn(), s = n || c || [], m = {
2770
+ const { filterableFields: u, isLoading: l } = Mn(), s = n || u || [], c = {
2797
2771
  id: "default",
2798
2772
  qualifiedFieldName: "default",
2799
2773
  name: "default",
@@ -2802,10 +2776,10 @@ function Ja({
2802
2776
  entityId: "default",
2803
2777
  entityName: "Default",
2804
2778
  entityType: "table"
2805
- }, f = (I) => {
2779
+ }, g = (I) => {
2806
2780
  const $ = (D) => {
2807
2781
  if (D.id === I) {
2808
- const v = s[0] || m, h = qe(v.dataType) === "date";
2782
+ const v = s[0] || c, f = je(v.dataType) === "date";
2809
2783
  return {
2810
2784
  ...D,
2811
2785
  conditions: [
@@ -2813,8 +2787,8 @@ function Ja({
2813
2787
  {
2814
2788
  id: `condition-${Date.now()}`,
2815
2789
  field: v,
2816
- operator: h ? "between" : "=",
2817
- value: h ? [] : ""
2790
+ operator: f ? "between" : "=",
2791
+ value: f ? [] : ""
2818
2792
  }
2819
2793
  ]
2820
2794
  };
@@ -2828,7 +2802,7 @@ function Ja({
2828
2802
  }, k = (I) => {
2829
2803
  const $ = (D) => {
2830
2804
  if (D.id === I) {
2831
- const v = s[0] || m, h = qe(v.dataType) === "date";
2805
+ const v = s[0] || c, f = je(v.dataType) === "date";
2832
2806
  return {
2833
2807
  ...D,
2834
2808
  groups: [
@@ -2841,8 +2815,8 @@ function Ja({
2841
2815
  {
2842
2816
  id: `condition-${Date.now()}`,
2843
2817
  field: v,
2844
- operator: h ? "between" : "=",
2845
- value: h ? [] : ""
2818
+ operator: f ? "between" : "=",
2819
+ value: f ? [] : ""
2846
2820
  }
2847
2821
  ],
2848
2822
  groups: []
@@ -2859,36 +2833,36 @@ function Ja({
2859
2833
  }, y = (I, $) => {
2860
2834
  const D = (v) => v.id === I ? {
2861
2835
  ...v,
2862
- conditions: v.conditions.filter((h) => h.id !== $)
2836
+ conditions: v.conditions.filter((f) => f.id !== $)
2863
2837
  } : {
2864
2838
  ...v,
2865
2839
  groups: v.groups.map(D)
2866
2840
  };
2867
2841
  d(D(o));
2868
- }, g = (I, $) => {
2842
+ }, h = (I, $) => {
2869
2843
  const D = (v) => v.id === I ? {
2870
2844
  ...v,
2871
- groups: v.groups.filter((h) => h.id !== $)
2845
+ groups: v.groups.filter((f) => f.id !== $)
2872
2846
  } : {
2873
2847
  ...v,
2874
2848
  groups: v.groups.map(D)
2875
2849
  };
2876
2850
  d(D(o));
2877
2851
  }, N = (I, $, D) => {
2878
- const v = (h) => h.id === I ? {
2879
- ...h,
2880
- conditions: h.conditions.map(
2852
+ const v = (f) => f.id === I ? {
2853
+ ...f,
2854
+ conditions: f.conditions.map(
2881
2855
  (E) => E.id === $ ? D(E) : E
2882
2856
  )
2883
2857
  } : {
2884
- ...h,
2885
- groups: h.groups.map(v)
2858
+ ...f,
2859
+ groups: f.groups.map(v)
2886
2860
  };
2887
2861
  d(v(o));
2888
2862
  }, S = (I, $, D) => N(I, $, (v) => ({
2889
2863
  ..."value" in D || "operator" in D || "field" in D ? dn(v) : v,
2890
2864
  ...D
2891
- })), V = (I, $, D) => N(I, $, () => D), _ = qn(), Q = (I, $) => {
2865
+ })), V = (I, $, D) => N(I, $, () => D), F = jn(), K = (I, $) => {
2892
2866
  const D = (v) => v.id === I ? {
2893
2867
  ...v,
2894
2868
  logicalOperator: $
@@ -2907,94 +2881,94 @@ function Ja({
2907
2881
  };
2908
2882
  d(D(o));
2909
2883
  }, T = (I, $, D) => {
2910
- const v = (h) => h.id === I ? {
2911
- ...h,
2912
- conditions: yt(h.conditions, $, D)
2884
+ const v = (f) => f.id === I ? {
2885
+ ...f,
2886
+ conditions: yt(f.conditions, $, D)
2913
2887
  } : {
2914
- ...h,
2915
- groups: h.groups.map(v)
2888
+ ...f,
2889
+ groups: f.groups.map(v)
2916
2890
  };
2917
2891
  d(v(o));
2918
- }, G = (I, $, D) => {
2919
- const v = (h) => h.id === I ? {
2920
- ...h,
2921
- groups: yt(h.groups, $, D)
2892
+ }, U = (I, $, D) => {
2893
+ const v = (f) => f.id === I ? {
2894
+ ...f,
2895
+ groups: yt(f.groups, $, D)
2922
2896
  } : {
2923
- ...h,
2924
- groups: h.groups.map(v)
2897
+ ...f,
2898
+ groups: f.groups.map(v)
2925
2899
  };
2926
2900
  d(v(o));
2927
2901
  }, Z = (I) => {
2928
2902
  if (!I || I.conditions.length === 0 && I.groups.length === 0)
2929
2903
  return "-- No filters defined";
2930
2904
  const $ = (v) => {
2931
- let h = "";
2932
- typeof v.field == "object" ? h = v.field.entityName ? `${v.field.entityName}.${v.field.name}` : v.field.name : h = String(v.field);
2905
+ let f = "";
2906
+ typeof v.field == "object" ? f = v.field.entityName ? `${v.field.entityName}.${v.field.name}` : v.field.name : f = String(v.field);
2933
2907
  const E = v.operator;
2934
2908
  let w = v.value;
2935
2909
  if (v.latestValue && E === "=")
2936
- return `${h} = ${qt} /* the latest value each time the card runs */`;
2937
- const H = Xt(v.relativeMeta);
2938
- if (H && ya(E) && Zt(E, H)) {
2939
- const O = Ca(E, H), { label: z, range: B } = Nt(H, {
2940
- tz: (_ == null ? void 0 : _.tz) ?? "UTC",
2941
- weekStart: (_ == null ? void 0 : _.weekStart) ?? 1,
2942
- anchor: (_ == null ? void 0 : _.anchor) ?? "now"
2943
- }), j = O ? wa(O) : z;
2910
+ return `${f} = ${qt} /* the latest value each time the card runs */`;
2911
+ const H = Zt(v.relativeMeta);
2912
+ if (H && va(E) && en(E, H)) {
2913
+ const _ = Na(E, H), { label: z, range: B } = Nt(H, {
2914
+ tz: (F == null ? void 0 : F.tz) ?? "UTC",
2915
+ weekStart: (F == null ? void 0 : F.weekStart) ?? 1,
2916
+ anchor: (F == null ? void 0 : F.anchor) ?? "now"
2917
+ }), q = _ ? Ca(_) : z;
2944
2918
  if (B) {
2945
- const [ee] = en(E, [B.start, B.end]);
2946
- return `${h} ${E} '${ee.toISOString()}' /* ${j}: the date updates each time the card runs */`;
2919
+ const [ee] = tn(E, [B.start, B.end]);
2920
+ return `${f} ${E} '${ee.toISOString()}' /* ${q}: the date updates each time the card runs */`;
2947
2921
  }
2948
- return `${h} ${E} ${j} /* the date follows your calendar each time the card runs */`;
2922
+ return `${f} ${E} ${q} /* the date follows your calendar each time the card runs */`;
2949
2923
  }
2950
2924
  if (H && (E === "between" || E === "not between")) {
2951
- const O = E === "between" ? "BETWEEN" : "NOT BETWEEN", { label: z, range: B } = Nt(H, {
2952
- tz: (_ == null ? void 0 : _.tz) ?? "UTC",
2953
- weekStart: (_ == null ? void 0 : _.weekStart) ?? 1,
2954
- anchor: (_ == null ? void 0 : _.anchor) ?? "now"
2925
+ const _ = E === "between" ? "BETWEEN" : "NOT BETWEEN", { label: z, range: B } = Nt(H, {
2926
+ tz: (F == null ? void 0 : F.tz) ?? "UTC",
2927
+ weekStart: (F == null ? void 0 : F.weekStart) ?? 1,
2928
+ anchor: (F == null ? void 0 : F.anchor) ?? "now"
2955
2929
  });
2956
- return B ? `${h} ${O} '${B.start.toISOString()}' AND '${B.end.toISOString()}' /* ${z}: dates update each time the card runs */` : tn(H).dataAnchored ? `${h} ${O} ${z} /* dates count back from the latest data each time the card runs */` : `${h} ${O} ${z} /* dates follow your calendar each time the card runs */`;
2930
+ return B ? `${f} ${_} '${B.start.toISOString()}' AND '${B.end.toISOString()}' /* ${z}: dates update each time the card runs */` : nn(H).dataAnchored ? `${f} ${_} ${z} /* dates count back from the latest data each time the card runs */` : `${f} ${_} ${z} /* dates follow your calendar each time the card runs */`;
2957
2931
  }
2958
2932
  if (v.field.dataType === "string" && !["in", "not in"].includes(v.operator))
2959
2933
  typeof w == "string" ? w = `'${w}'` : Array.isArray(w) && (w = `'${w.join(", ")}'`);
2960
2934
  else if (v.field.dataType === "date" || v.field.dataType === "datetime" || v.field.dataType === "timestamp")
2961
2935
  if (v.operator === "between" && Array.isArray(w) && w.length === 2) {
2962
- const O = w[0] ? `'${w[0]}'` : "NULL", z = w[1] ? `'${w[1]}'` : "NULL";
2963
- return `${h} BETWEEN ${O} AND ${z}`;
2936
+ const _ = w[0] ? `'${w[0]}'` : "NULL", z = w[1] ? `'${w[1]}'` : "NULL";
2937
+ return `${f} BETWEEN ${_} AND ${z}`;
2964
2938
  } else if ((v.operator === "in" || v.operator === "not in") && Array.isArray(w)) {
2965
- const O = w.map((z) => z ? `'${z}'` : "NULL").join(", ");
2966
- return `${h} ${E} (${O})`;
2939
+ const _ = w.map((z) => z ? `'${z}'` : "NULL").join(", ");
2940
+ return `${f} ${E} (${_})`;
2967
2941
  } else typeof w == "string" || w instanceof Date ? w = `'${w}'` : Array.isArray(w) && w.length > 0 && (w = `'${w[0]}'`);
2968
2942
  else if (["in", "not in"].includes(v.operator)) {
2969
- let O = [];
2970
- Array.isArray(w) ? O = w.map(
2943
+ let _ = [];
2944
+ Array.isArray(w) ? _ = w.map(
2971
2945
  (z) => typeof z == "string" ? `'${z}'` : String(z)
2972
- ) : typeof w == "string" ? O = w.split(",").map((z) => {
2946
+ ) : typeof w == "string" ? _ = w.split(",").map((z) => {
2973
2947
  const B = z.trim();
2974
2948
  return v.field.dataType === "string" ? `'${B}'` : B;
2975
- }) : typeof w == "number" && (O = [String(w)]), w = `(${O.join(", ")})`;
2949
+ }) : typeof w == "number" && (_ = [String(w)]), w = `(${_.join(", ")})`;
2976
2950
  }
2977
2951
  switch (E) {
2978
2952
  case "contains":
2979
- return typeof w == "string" ? `${h} LIKE '%${w.replace(/'/g, "")}'` : `${h} LIKE '%${String(w)}'`;
2953
+ return typeof w == "string" ? `${f} LIKE '%${w.replace(/'/g, "")}'` : `${f} LIKE '%${String(w)}'`;
2980
2954
  case "startsWith":
2981
- return typeof w == "string" ? `${h} LIKE '${w.replace(/'/g, "")}%'` : `${h} LIKE '${String(w)}%'`;
2955
+ return typeof w == "string" ? `${f} LIKE '${w.replace(/'/g, "")}%'` : `${f} LIKE '${String(w)}%'`;
2982
2956
  case "endsWith":
2983
- return typeof w == "string" ? `${h} LIKE '%${w.replace(/'/g, "")}'` : `${h} LIKE '%${String(w)}'`;
2957
+ return typeof w == "string" ? `${f} LIKE '%${w.replace(/'/g, "")}'` : `${f} LIKE '%${String(w)}'`;
2984
2958
  case "isNull":
2985
- return `${h} IS NULL`;
2959
+ return `${f} IS NULL`;
2986
2960
  case "isNotNull":
2987
- return `${h} IS NOT NULL`;
2961
+ return `${f} IS NOT NULL`;
2988
2962
  default:
2989
- return `${h} ${E} ${w}`;
2963
+ return `${f} ${E} ${w}`;
2990
2964
  }
2991
2965
  }, D = (v) => {
2992
- const h = v.conditions.map($), E = v.groups.map(
2966
+ const f = v.conditions.map($), E = v.groups.map(
2993
2967
  (z) => D(z)
2994
- ), w = [...h, ...E].filter(Boolean);
2968
+ ), w = [...f, ...E].filter(Boolean);
2995
2969
  if (w.length === 0) return "";
2996
- const H = w.join(` ${v.logicalOperator} `), O = w.length > 1 ? `(${H})` : H;
2997
- return v.negate ? `NOT ${O}` : O;
2970
+ const H = w.join(` ${v.logicalOperator} `), _ = w.length > 1 ? `(${H})` : H;
2971
+ return v.negate ? `NOT ${_}` : _;
2998
2972
  };
2999
2973
  return D(I);
3000
2974
  }, p = o.conditions.length > 0 || o.groups.length > 0;
@@ -3002,31 +2976,31 @@ function Ja({
3002
2976
  currentFilters: o,
3003
2977
  setCurrentFilters: d,
3004
2978
  availableFields: s,
3005
- isLoading: i,
3006
- addCondition: f,
2979
+ isLoading: l,
2980
+ addCondition: g,
3007
2981
  addGroup: k,
3008
2982
  removeCondition: y,
3009
- removeGroup: g,
2983
+ removeGroup: h,
3010
2984
  updateConditionFields: S,
3011
2985
  replaceCondition: V,
3012
- updateGroupOperator: Q,
2986
+ updateGroupOperator: K,
3013
2987
  updateGroupNegate: C,
3014
2988
  reorderConditions: T,
3015
- reorderGroups: G,
2989
+ reorderGroups: U,
3016
2990
  generateSQLPreview: Z,
3017
2991
  hasAnyFilters: p
3018
2992
  };
3019
2993
  }
3020
- function Xa({
2994
+ function Ya({
3021
2995
  children: e,
3022
2996
  className: n,
3023
2997
  delayDuration: a
3024
2998
  }) {
3025
- return /* @__PURE__ */ t(at, { children: /* @__PURE__ */ l(rt, { delayDuration: a, children: [
2999
+ return /* @__PURE__ */ t(at, { children: /* @__PURE__ */ i(rt, { delayDuration: a, children: [
3026
3000
  /* @__PURE__ */ t(st, { asChild: !0, children: /* @__PURE__ */ t(
3027
3001
  "div",
3028
3002
  {
3029
- className: q(
3003
+ className: j(
3030
3004
  "w-[200px] overflow-hidden text-ellipsis whitespace-nowrap text-sm",
3031
3005
  n
3032
3006
  ),
@@ -3036,34 +3010,34 @@ function Xa({
3036
3010
  /* @__PURE__ */ t(ot, { children: e })
3037
3011
  ] }) });
3038
3012
  }
3039
- function Za({
3013
+ function Xa({
3040
3014
  value: e,
3041
3015
  onValueChange: n,
3042
3016
  availableFields: a,
3043
3017
  placeholder: o = "Select field",
3044
- className: u
3018
+ className: m
3045
3019
  }) {
3046
- const [d, c] = bt.useState(!1), i = bt.useMemo(
3020
+ const [d, u] = bt.useState(!1), l = bt.useMemo(
3047
3021
  () => new Set(e ? [e.id] : []),
3048
3022
  [e]
3049
- ), s = e ? nn(e) : null;
3050
- return /* @__PURE__ */ l(it, { modal: !0, open: d, onOpenChange: c, children: [
3051
- /* @__PURE__ */ t(lt, { asChild: !0, children: /* @__PURE__ */ l(
3052
- U,
3023
+ ), s = e ? ma(e) : null;
3024
+ return /* @__PURE__ */ i(lt, { modal: !0, open: d, onOpenChange: u, children: [
3025
+ /* @__PURE__ */ t(it, { asChild: !0, children: /* @__PURE__ */ i(
3026
+ G,
3053
3027
  {
3054
3028
  variant: "outline",
3055
3029
  size: "xs",
3056
3030
  role: "combobox",
3057
3031
  "aria-expanded": d,
3058
3032
  title: e ? `${e.entityName}.${e.name}` : void 0,
3059
- className: q(
3033
+ className: j(
3060
3034
  "min-w-0 justify-between gap-1.5 font-normal",
3061
3035
  !e && "text-muted-foreground",
3062
- u
3036
+ m
3063
3037
  ),
3064
3038
  children: [
3065
- s ? /* @__PURE__ */ t(Xa, { className: "w-auto min-w-0 flex-1 text-left text-[12px]", children: s }) : /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-left", children: o }),
3066
- /* @__PURE__ */ t(jn, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
3039
+ s ? /* @__PURE__ */ t(Ya, { className: "w-auto min-w-0 flex-1 text-left text-[12px]", children: s }) : /* @__PURE__ */ t("span", { className: "min-w-0 flex-1 truncate text-left", children: o }),
3040
+ /* @__PURE__ */ t(qn, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
3067
3041
  ]
3068
3042
  }
3069
3043
  ) }),
@@ -3072,17 +3046,17 @@ function Za({
3072
3046
  {
3073
3047
  className: "flex w-80 flex-col rounded-control p-1.5",
3074
3048
  align: "start",
3075
- onOpenAutoFocus: (m) => {
3076
- var f, k;
3077
- m.preventDefault(), (k = (f = m.currentTarget) == null ? void 0 : f.querySelector('input[type="text"]')) == null || k.focus();
3049
+ onOpenAutoFocus: (c) => {
3050
+ var g, k;
3051
+ c.preventDefault(), (k = (g = c.currentTarget) == null ? void 0 : g.querySelector('input[type="text"]')) == null || k.focus();
3078
3052
  },
3079
3053
  children: /* @__PURE__ */ t(
3080
- Gn,
3054
+ Un,
3081
3055
  {
3082
3056
  fields: a,
3083
- selectedIds: i,
3084
- onSelect: (m) => {
3085
- n(m), c(!1);
3057
+ selectedIds: l,
3058
+ onSelect: (c) => {
3059
+ n(c), u(!1);
3086
3060
  },
3087
3061
  density: "compact",
3088
3062
  listLabel: "Fields",
@@ -3094,62 +3068,61 @@ function Za({
3094
3068
  ] });
3095
3069
  }
3096
3070
  function cn(e, n) {
3097
- var m;
3098
- const a = se((f) => f.card.dataSource), o = se(
3099
- (f) => f.card.connectionId
3100
- ), u = se(
3101
- (f) => f.selectedConnectionId
3102
- ), d = n ? n.dataSource : a, c = n ? n.connectionId || ((m = n.dataSource) == null ? void 0 : m.connectionId) : u || (a == null ? void 0 : a.connectionId) || o, i = P(
3071
+ const a = se((c) => c.card.dataSource), o = se(
3072
+ (c) => c.card.connectionId
3073
+ ), m = se(
3074
+ (c) => c.selectedConnectionId
3075
+ ), { dataSource: d, connectionId: u } = n ? It(n) : It({ dataSource: a, connectionId: o }, m), l = P(
3103
3076
  () => ({
3104
3077
  id: `card-filter-option:${e.id}`,
3105
- ...Ba(e, { dataSource: d, connectionId: c })
3078
+ ...pa(e, { dataSource: d, connectionId: u })
3106
3079
  }),
3107
- [c, d, e]
3080
+ [u, d, e]
3108
3081
  ), s = P(
3109
- () => Un({ filter: i }),
3110
- [i]
3082
+ () => Gn({ filter: l }),
3083
+ [l]
3111
3084
  );
3112
- return Bn(i, {
3085
+ return Bn(l, {
3113
3086
  inputContext: s,
3114
3087
  currentSelectionPolicy: "exclude"
3115
3088
  });
3116
3089
  }
3117
- function er({
3090
+ function Ja({
3118
3091
  field: e,
3119
3092
  source: n,
3120
3093
  selected: a,
3121
3094
  onChange: o,
3122
- placeholder: u = "Select values…",
3095
+ placeholder: m = "Select values…",
3123
3096
  className: d
3124
3097
  }) {
3125
- const [c, i] = _e.useState(!1), s = cn(e, n), m = _e.useMemo(
3126
- () => new Set(a.map((g) => ye(g))),
3098
+ const [u, l] = Fe.useState(!1), s = cn(e, n), c = Fe.useMemo(
3099
+ () => new Set(a.map((h) => ye(h))),
3127
3100
  [a]
3128
- ), f = (g) => {
3101
+ ), g = (h) => {
3129
3102
  var N, S;
3130
- return ((S = (N = s.allRecords.find((V) => ye(V.value) === ye(g))) == null ? void 0 : N.label) == null ? void 0 : S.toString()) ?? g;
3131
- }, k = (g) => {
3132
- o(a.filter((N) => N !== g));
3133
- }, y = (g) => {
3134
- i(g), !g && s.query && s.setQuery("");
3103
+ return ((S = (N = s.allRecords.find((V) => ye(V.value) === ye(h))) == null ? void 0 : N.label) == null ? void 0 : S.toString()) ?? h;
3104
+ }, k = (h) => {
3105
+ o(a.filter((N) => N !== h));
3106
+ }, y = (h) => {
3107
+ l(h), !h && s.query && s.setQuery("");
3135
3108
  };
3136
- return /* @__PURE__ */ t("div", { className: q("w-full", d), children: /* @__PURE__ */ l(it, { open: c, onOpenChange: y, modal: !0, children: [
3137
- /* @__PURE__ */ t(lt, { asChild: !0, children: /* @__PURE__ */ l(
3138
- U,
3109
+ return /* @__PURE__ */ t("div", { className: j("w-full", d), children: /* @__PURE__ */ i(lt, { open: u, onOpenChange: y, modal: !0, children: [
3110
+ /* @__PURE__ */ t(it, { asChild: !0, children: /* @__PURE__ */ i(
3111
+ G,
3139
3112
  {
3140
3113
  variant: "outline",
3141
3114
  size: "xs",
3142
3115
  role: "combobox",
3143
- "aria-expanded": c,
3116
+ "aria-expanded": u,
3144
3117
  className: "h-auto min-h-7 w-full justify-between gap-1.5 px-2 py-0.5 font-normal",
3145
3118
  children: [
3146
- /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1", children: a.length > 0 ? a.map((g) => {
3147
- const N = f(g);
3119
+ /* @__PURE__ */ t("div", { className: "flex min-w-0 flex-1 flex-wrap gap-1", children: a.length > 0 ? a.map((h) => {
3120
+ const N = g(h);
3148
3121
  return (
3149
3122
  // Selected values render as small square chips (4px
3150
3123
  // radius), not pills. Pill badges are reserved for
3151
3124
  // avatars and status dots.
3152
- /* @__PURE__ */ l(
3125
+ /* @__PURE__ */ i(
3153
3126
  "span",
3154
3127
  {
3155
3128
  className: "inline-flex max-w-full items-center gap-1 rounded-[4px] border border-border/70 bg-muted/40 px-1.5 py-0.5 text-[11px] leading-[14px] text-foreground",
@@ -3163,24 +3136,24 @@ function er({
3163
3136
  "aria-label": `Remove ${N}`,
3164
3137
  className: "shrink-0 rounded-[2px] text-muted-foreground outline-none hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring",
3165
3138
  onKeyDown: (S) => {
3166
- S.key === "Enter" && k(g);
3139
+ S.key === "Enter" && k(h);
3167
3140
  },
3168
3141
  onMouseDown: (S) => {
3169
3142
  S.preventDefault(), S.stopPropagation();
3170
3143
  },
3171
3144
  onClick: (S) => {
3172
- S.stopPropagation(), k(g);
3145
+ S.stopPropagation(), k(h);
3173
3146
  },
3174
3147
  children: /* @__PURE__ */ t(ce, { className: "h-3 w-3" })
3175
3148
  }
3176
3149
  )
3177
3150
  ]
3178
3151
  },
3179
- g
3152
+ h
3180
3153
  )
3181
3154
  );
3182
- }) : /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: u }) }),
3183
- /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
3155
+ }) : /* @__PURE__ */ t("span", { className: "truncate text-muted-foreground", children: m }) }),
3156
+ /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
3184
3157
  ]
3185
3158
  }
3186
3159
  ) }),
@@ -3189,17 +3162,17 @@ function er({
3189
3162
  {
3190
3163
  className: "w-[var(--radix-popover-trigger-width)] min-w-[240px] rounded-control p-1.5",
3191
3164
  align: "start",
3192
- onOpenAutoFocus: (g) => {
3165
+ onOpenAutoFocus: (h) => {
3193
3166
  var N, S;
3194
- g.preventDefault(), (S = (N = g.currentTarget) == null ? void 0 : N.querySelector('input[type="text"]')) == null || S.focus();
3167
+ h.preventDefault(), (S = (N = h.currentTarget) == null ? void 0 : N.querySelector('input[type="text"]')) == null || S.focus();
3195
3168
  },
3196
3169
  children: /* @__PURE__ */ t(
3197
- jt,
3170
+ Ut,
3198
3171
  {
3199
3172
  records: s.displayRecords,
3200
- selectedIdentities: m,
3201
- onToggle: (g) => {
3202
- const N = String(g.value);
3173
+ selectedIdentities: c,
3174
+ onToggle: (h) => {
3175
+ const N = String(h.value);
3203
3176
  a.includes(N) ? k(N) : o([...a, N]);
3204
3177
  },
3205
3178
  browse: s,
@@ -3212,32 +3185,32 @@ function er({
3212
3185
  )
3213
3186
  ] }) });
3214
3187
  }
3215
- function tr({
3188
+ function Za({
3216
3189
  field: e,
3217
3190
  source: n,
3218
3191
  value: a,
3219
3192
  onChange: o,
3220
- placeholder: u = "Select value…",
3193
+ placeholder: m = "Select value…",
3221
3194
  className: d
3222
3195
  }) {
3223
- var y, g;
3224
- const [c, i] = _e.useState(!1), s = cn(e, n), m = _e.useMemo(
3196
+ var y, h;
3197
+ const [u, l] = Fe.useState(!1), s = cn(e, n), c = Fe.useMemo(
3225
3198
  () => new Set(a ? [ye(a)] : []),
3226
3199
  [a]
3227
- ), f = a ? ((g = (y = s.allRecords.find(
3200
+ ), g = a ? ((h = (y = s.allRecords.find(
3228
3201
  (N) => ye(N.value) === ye(a)
3229
- )) == null ? void 0 : y.label) == null ? void 0 : g.toString()) ?? a : "", k = (N) => {
3230
- i(N), !N && s.query && s.setQuery("");
3202
+ )) == null ? void 0 : y.label) == null ? void 0 : h.toString()) ?? a : "", k = (N) => {
3203
+ l(N), !N && s.query && s.setQuery("");
3231
3204
  };
3232
- return /* @__PURE__ */ l(it, { open: c, onOpenChange: k, modal: !0, children: [
3233
- /* @__PURE__ */ t(lt, { asChild: !0, children: /* @__PURE__ */ l(
3234
- U,
3205
+ return /* @__PURE__ */ i(lt, { open: u, onOpenChange: k, modal: !0, children: [
3206
+ /* @__PURE__ */ t(it, { asChild: !0, children: /* @__PURE__ */ i(
3207
+ G,
3235
3208
  {
3236
3209
  variant: "outline",
3237
3210
  size: "xs",
3238
3211
  role: "combobox",
3239
- "aria-expanded": c,
3240
- className: q(
3212
+ "aria-expanded": u,
3213
+ className: j(
3241
3214
  "min-w-0 flex-1 justify-between gap-1.5 px-2 font-normal",
3242
3215
  d
3243
3216
  ),
@@ -3245,11 +3218,11 @@ function tr({
3245
3218
  /* @__PURE__ */ t(
3246
3219
  "span",
3247
3220
  {
3248
- className: q("truncate", !a && "text-muted-foreground"),
3249
- children: a ? f : u
3221
+ className: j("truncate", !a && "text-muted-foreground"),
3222
+ children: a ? g : m
3250
3223
  }
3251
3224
  ),
3252
- /* @__PURE__ */ t(Oe, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
3225
+ /* @__PURE__ */ t(_e, { className: "h-3.5 w-3.5 shrink-0 opacity-50" })
3253
3226
  ]
3254
3227
  }
3255
3228
  ) }),
@@ -3263,10 +3236,10 @@ function tr({
3263
3236
  N.preventDefault(), (V = (S = N.currentTarget) == null ? void 0 : S.querySelector('input[type="text"]')) == null || V.focus();
3264
3237
  },
3265
3238
  children: /* @__PURE__ */ t(
3266
- jt,
3239
+ Ut,
3267
3240
  {
3268
3241
  records: s.displayRecords,
3269
- selectedIdentities: m,
3242
+ selectedIdentities: c,
3270
3243
  onToggle: (N) => {
3271
3244
  o(String(N.value)), k(!1);
3272
3245
  },
@@ -3281,46 +3254,46 @@ function tr({
3281
3254
  )
3282
3255
  ] });
3283
3256
  }
3284
- function nr({
3257
+ function er({
3285
3258
  value: e,
3286
3259
  operator: n,
3287
3260
  relativeMeta: a,
3288
3261
  latestValue: o,
3289
- field: u,
3262
+ field: m,
3290
3263
  onChange: d,
3291
- className: c
3264
+ className: u
3292
3265
  }) {
3293
- const i = Wn(), s = Kn(), m = n === "between" || n === "not between", f = Zt(n), k = f ? a : void 0, y = P(() => {
3294
- if (!m || !a) return;
3266
+ const l = Wn(), s = Qn(), c = n === "between" || n === "not between", g = en(n), k = g ? a : void 0, y = P(() => {
3267
+ if (!c || !a) return;
3295
3268
  const C = s(a);
3296
3269
  return {
3297
3270
  ...C,
3298
- tooltip: C.dates ? void 0 : tn(a).dataAnchored ? Qn : Pn
3271
+ tooltip: C.dates ? void 0 : nn(a).dataAnchored ? Kn : Pn
3299
3272
  };
3300
- }, [m, a, s]), g = P(() => {
3301
- if (m) {
3273
+ }, [c, a, s]), h = P(() => {
3274
+ if (c) {
3302
3275
  if (y) {
3303
3276
  const { range: C } = y;
3304
3277
  return C ? { from: C.start, to: C.end } : void 0;
3305
3278
  }
3306
3279
  if (e && Array.isArray(e) && e.length === 2) {
3307
- const C = He(e[0], i, "start"), T = He(e[1], i, "end");
3280
+ const C = He(e[0], l, "start"), T = He(e[1], l, "end");
3308
3281
  if (C && T)
3309
3282
  return { from: C, to: T };
3310
3283
  }
3311
3284
  }
3312
- }, [e, m, y, i]), N = P(() => {
3313
- if (!e || m || o) return;
3285
+ }, [e, c, y, l]), N = P(() => {
3286
+ if (!e || c || o) return;
3314
3287
  const C = Array.isArray(e) ? e[0] : e;
3315
- return He(C, i, "start");
3316
- }, [e, m, o, i]), S = (C) => n === "<=" || n === ">" ? xa(C, i) : ba(C, i);
3288
+ return He(C, l, "start");
3289
+ }, [e, c, o, l]), S = (C) => n === "<=" || n === ">" ? ga(C, l) : xa(C, l);
3317
3290
  return /* @__PURE__ */ t(
3318
3291
  Hn,
3319
3292
  {
3320
- value: m ? g : void 0,
3321
- selectionMode: m ? "range" : "single",
3322
- singleValue: m ? void 0 : N,
3323
- singleValueLabel: !m && o ? qt : void 0,
3293
+ value: c ? h : void 0,
3294
+ selectionMode: c ? "range" : "single",
3295
+ singleValue: c ? void 0 : N,
3296
+ singleValueLabel: !c && o ? qt : void 0,
3324
3297
  onChange: (C) => {
3325
3298
  if (C != null && C.from && C.to) {
3326
3299
  d({ value: [C.from.toISOString(), C.to.toISOString()] });
@@ -3333,47 +3306,47 @@ function nr({
3333
3306
  d({ value: "" });
3334
3307
  return;
3335
3308
  }
3336
- const T = S(C), G = ga(T, n, {
3337
- timezone: i
3309
+ const T = S(C), U = ha(T, n, {
3310
+ timezone: l
3338
3311
  });
3339
- d({ value: typeof G == "string" ? G : G.toISOString() });
3312
+ d({ value: typeof U == "string" ? U : U.toISOString() });
3340
3313
  },
3341
- onRelativeSelect: f ? (C, T) => {
3314
+ onRelativeSelect: g ? (C, T) => {
3342
3315
  if (!C.from || !C.to) {
3343
- d({ value: m ? [] : "" });
3316
+ d({ value: c ? [] : "" });
3344
3317
  return;
3345
3318
  }
3346
- const G = en(n, [
3319
+ const U = tn(n, [
3347
3320
  C.from.toISOString(),
3348
3321
  C.to.toISOString()
3349
3322
  ]);
3350
3323
  d({
3351
- value: G.length === 1 ? G[0] : G,
3324
+ value: U.length === 1 ? U[0] : U,
3352
3325
  relativeMeta: T
3353
3326
  });
3354
3327
  } : void 0,
3355
3328
  relativeValue: k,
3356
- comparisonValue: !m && f ? n : void 0,
3357
- relativePoints: !m && f ? { operator: n } : "none",
3329
+ comparisonValue: !c && g ? n : void 0,
3330
+ relativePoints: !c && g ? { operator: n } : "none",
3358
3331
  relativeSummary: y,
3359
- supplementalFooter: f ? /* @__PURE__ */ t("p", { className: "border-t border-border px-3 py-2 text-[11px] text-muted-foreground", children: "Presets and Relative update each time the card runs. Static dates stay fixed." }) : void 0,
3360
- timezone: i,
3361
- enableTimePrecision: ha(u),
3332
+ supplementalFooter: g ? /* @__PURE__ */ t("p", { className: "border-t border-border px-3 py-2 text-[11px] text-muted-foreground", children: "Presets and Relative update each time the card runs. Static dates stay fixed." }) : void 0,
3333
+ timezone: l,
3334
+ enableTimePrecision: fa(m),
3362
3335
  staticTimeInputs: !1,
3363
- showRelativeTab: f,
3364
- className: q("min-w-0", c),
3336
+ showRelativeTab: g,
3337
+ className: j("min-w-0", u),
3365
3338
  buttonClassName: "h-7 text-[12px] [&>span]:text-[12px]",
3366
3339
  placeholder: "Select date…"
3367
3340
  }
3368
3341
  );
3369
3342
  }
3370
- const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3343
+ const tr = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3371
3344
  "contains",
3372
3345
  "startsWith",
3373
3346
  "endsWith",
3374
3347
  "like",
3375
3348
  "not like"
3376
- ], rr = [
3349
+ ], nr = [
3377
3350
  "=",
3378
3351
  "!=",
3379
3352
  ">",
@@ -3385,7 +3358,7 @@ const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3385
3358
  "not in",
3386
3359
  "isNull",
3387
3360
  "isNotNull"
3388
- ], sr = [
3361
+ ], ar = [
3389
3362
  "=",
3390
3363
  "!=",
3391
3364
  ...ft,
@@ -3393,7 +3366,7 @@ const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3393
3366
  "not in",
3394
3367
  "isNull",
3395
3368
  "isNotNull"
3396
- ], or = [
3369
+ ], rr = [
3397
3370
  "=",
3398
3371
  "!=",
3399
3372
  ">",
@@ -3404,7 +3377,7 @@ const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3404
3377
  "not in",
3405
3378
  "isNull",
3406
3379
  "isNotNull"
3407
- ], ir = ["=", "!=", "isNull", "isNotNull"], lr = [
3380
+ ], sr = ["=", "!=", "isNull", "isNotNull"], or = [
3408
3381
  "between",
3409
3382
  // Default operator for dates
3410
3383
  "=",
@@ -3415,7 +3388,7 @@ const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3415
3388
  ">=",
3416
3389
  "isNull",
3417
3390
  "isNotNull"
3418
- ], dr = {
3391
+ ], lr = {
3419
3392
  "=": "Equals",
3420
3393
  "!=": "Not equals",
3421
3394
  ">": "Greater than",
@@ -3434,30 +3407,30 @@ const ar = (e) => e.conditions.length > 0 || e.groups.length > 0, ft = [
3434
3407
  isNotNull: "Is not null",
3435
3408
  "not between": "Not between"
3436
3409
  };
3437
- function Je(e) {
3438
- return dr[e] || va(e);
3410
+ function Xe(e) {
3411
+ return lr[e] || ba(e);
3439
3412
  }
3440
- function cr(e) {
3413
+ function ir(e) {
3441
3414
  switch (e) {
3442
3415
  case "string":
3443
- return sr;
3416
+ return ar;
3444
3417
  case "number":
3445
- return or;
3418
+ return rr;
3446
3419
  case "boolean":
3447
- return ir;
3420
+ return sr;
3448
3421
  case "date":
3449
- return lr;
3422
+ return or;
3450
3423
  default:
3451
- return rr;
3424
+ return nr;
3452
3425
  }
3453
3426
  }
3454
- const un = "w-[68px] shrink-0", At = "group-data-[inline]/filters:w-auto group-data-[inline]/filters:min-w-0 group-data-[inline]/filters:flex-1 group-data-[inline]/filters:shrink", ht = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
3427
+ const un = "w-[68px] shrink-0", Ot = "group-data-[inline]/filters:w-auto group-data-[inline]/filters:min-w-0 group-data-[inline]/filters:flex-1 group-data-[inline]/filters:shrink", ht = "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground";
3455
3428
  function mn({
3456
3429
  value: e,
3457
3430
  onValueChange: n,
3458
3431
  "aria-label": a
3459
3432
  }) {
3460
- return /* @__PURE__ */ l(
3433
+ return /* @__PURE__ */ i(
3461
3434
  ge,
3462
3435
  {
3463
3436
  value: e,
@@ -3468,11 +3441,11 @@ function mn({
3468
3441
  {
3469
3442
  size: "xs",
3470
3443
  "aria-label": a,
3471
- className: q(un, "font-medium"),
3444
+ className: j(un, "font-medium"),
3472
3445
  children: /* @__PURE__ */ t(be, {})
3473
3446
  }
3474
3447
  ),
3475
- /* @__PURE__ */ l(ve, { className: "min-w-[var(--radix-select-trigger-width)]", children: [
3448
+ /* @__PURE__ */ i(ve, { className: "min-w-[var(--radix-select-trigger-width)]", children: [
3476
3449
  /* @__PURE__ */ t(re, { value: "AND", className: "text-[12px] font-medium", children: "AND" }),
3477
3450
  /* @__PURE__ */ t(re, { value: "OR", className: "text-[12px] font-medium", children: "OR" })
3478
3451
  ] })
@@ -3485,30 +3458,30 @@ function pn({
3485
3458
  index: n,
3486
3459
  groupId: a,
3487
3460
  groupLogicalOperator: o,
3488
- onRemoveCondition: u,
3461
+ onRemoveCondition: m,
3489
3462
  onUpdateGroupOperator: d,
3490
- availableFields: c,
3491
- source: i,
3463
+ availableFields: u,
3464
+ source: l,
3492
3465
  updateConditionFields: s,
3493
- replaceCondition: m
3466
+ replaceCondition: c
3494
3467
  }) {
3495
3468
  const {
3496
- attributes: f,
3469
+ attributes: g,
3497
3470
  listeners: k,
3498
3471
  setNodeRef: y,
3499
- transform: g,
3472
+ transform: h,
3500
3473
  transition: N,
3501
3474
  isDragging: S
3502
3475
  } = Gt({ id: e.id }), V = {
3503
- transform: Ut.Transform.toString(g),
3476
+ transform: Bt.Transform.toString(h),
3504
3477
  transition: N
3505
- }, _ = qe(e.field.dataType), Q = e.operator === "isNull" || e.operator === "isNotNull", C = e.operator === "in" || e.operator === "not in";
3506
- return /* @__PURE__ */ l(
3478
+ }, F = je(e.field.dataType), K = e.operator === "isNull" || e.operator === "isNotNull", C = e.operator === "in" || e.operator === "not in";
3479
+ return /* @__PURE__ */ i(
3507
3480
  "div",
3508
3481
  {
3509
3482
  ref: y,
3510
3483
  style: V,
3511
- className: q(
3484
+ className: j(
3512
3485
  "flex items-center gap-2 rounded-control px-1.5 py-1 transition-colors hover:bg-muted/40",
3513
3486
  S && "z-50 opacity-50"
3514
3487
  ),
@@ -3517,11 +3490,11 @@ function pn({
3517
3490
  "button",
3518
3491
  {
3519
3492
  type: "button",
3520
- ...f,
3493
+ ...g,
3521
3494
  ...k,
3522
3495
  "aria-label": "Drag to reorder condition",
3523
3496
  className: "flex h-7 w-5 shrink-0 cursor-grab items-center justify-center rounded-control text-muted-foreground/60 hover:text-foreground focus-visible:outline-none active:cursor-grabbing",
3524
- children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
3497
+ children: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" })
3525
3498
  }
3526
3499
  ),
3527
3500
  n > 0 ? /* @__PURE__ */ t(
@@ -3531,31 +3504,31 @@ function pn({
3531
3504
  onValueChange: (T) => d(a, T),
3532
3505
  "aria-label": "Logical operator"
3533
3506
  }
3534
- ) : /* @__PURE__ */ t("span", { className: q(un, "text-center", ht), children: "Where" }),
3507
+ ) : /* @__PURE__ */ t("span", { className: j(un, "text-center", ht), children: "Where" }),
3535
3508
  /* @__PURE__ */ t(
3536
- Za,
3509
+ Xa,
3537
3510
  {
3538
3511
  value: e.field,
3539
3512
  onValueChange: (T) => {
3540
- m(
3513
+ c(
3541
3514
  a,
3542
3515
  e.id,
3543
- Ya(e, T)
3516
+ Pa(e, T)
3544
3517
  );
3545
3518
  },
3546
- availableFields: c,
3519
+ availableFields: u,
3547
3520
  placeholder: "Select field",
3548
- className: q("w-60 shrink-0", At)
3521
+ className: j("w-60 shrink-0", Ot)
3549
3522
  }
3550
3523
  ),
3551
- /* @__PURE__ */ l(
3524
+ /* @__PURE__ */ i(
3552
3525
  ge,
3553
3526
  {
3554
3527
  value: e.operator,
3555
- onValueChange: (T) => m(
3528
+ onValueChange: (T) => c(
3556
3529
  a,
3557
3530
  e.id,
3558
- Ha(e, T)
3531
+ Ka(e, T)
3559
3532
  ),
3560
3533
  children: [
3561
3534
  /* @__PURE__ */ t(
@@ -3563,19 +3536,19 @@ function pn({
3563
3536
  {
3564
3537
  size: "xs",
3565
3538
  "aria-label": "Operator",
3566
- className: q("w-40 shrink-0", At),
3567
- children: /* @__PURE__ */ t(be, { children: e.operator ? Je(e.operator) : "" })
3539
+ className: j("w-40 shrink-0", Ot),
3540
+ children: /* @__PURE__ */ t(be, { children: e.operator ? Xe(e.operator) : "" })
3568
3541
  }
3569
3542
  ),
3570
- /* @__PURE__ */ t(ve, { children: cr(_).map((T) => /* @__PURE__ */ t(re, { value: T, children: Je(T) }, T)) })
3543
+ /* @__PURE__ */ t(ve, { children: ir(F).map((T) => /* @__PURE__ */ t(re, { value: T, children: Xe(T) }, T)) })
3571
3544
  ]
3572
3545
  }
3573
3546
  ),
3574
- Q ? /* @__PURE__ */ t("div", { className: "min-w-0 flex-1" }) : _ === "string" ? C ? /* @__PURE__ */ t(
3575
- er,
3547
+ K ? /* @__PURE__ */ t("div", { className: "min-w-0 flex-1" }) : F === "string" ? C ? /* @__PURE__ */ t(
3548
+ Ja,
3576
3549
  {
3577
3550
  field: e.field,
3578
- source: i,
3551
+ source: l,
3579
3552
  selected: Array.isArray(e.value) && e.value.every((T) => typeof T == "string") ? e.value : [],
3580
3553
  onChange: (T) => s(a, e.id, {
3581
3554
  value: T
@@ -3592,19 +3565,19 @@ function pn({
3592
3565
  value: T.target.value
3593
3566
  }),
3594
3567
  className: "min-w-0 flex-1",
3595
- placeholder: `${Je(e.operator)}…`
3568
+ placeholder: `${Xe(e.operator)}…`
3596
3569
  }
3597
3570
  ) : /* @__PURE__ */ t(
3598
- tr,
3571
+ Za,
3599
3572
  {
3600
3573
  field: e.field,
3601
- source: i,
3574
+ source: l,
3602
3575
  value: typeof e.value == "string" ? e.value : "",
3603
3576
  onChange: (T) => s(a, e.id, { value: T }),
3604
3577
  placeholder: "Select value…",
3605
3578
  className: "min-w-0 flex-1"
3606
3579
  }
3607
- ) : _ === "boolean" ? /* @__PURE__ */ l(
3580
+ ) : F === "boolean" ? /* @__PURE__ */ i(
3608
3581
  ge,
3609
3582
  {
3610
3583
  value: typeof e.value == "boolean" ? String(e.value) : "",
@@ -3613,26 +3586,26 @@ function pn({
3613
3586
  }),
3614
3587
  children: [
3615
3588
  /* @__PURE__ */ t(xe, { size: "xs", className: "min-w-0 flex-1", children: /* @__PURE__ */ t(be, { placeholder: "Select value…" }) }),
3616
- /* @__PURE__ */ l(ve, { children: [
3589
+ /* @__PURE__ */ i(ve, { children: [
3617
3590
  /* @__PURE__ */ t(re, { value: "true", children: "True" }),
3618
3591
  /* @__PURE__ */ t(re, { value: "false", children: "False" })
3619
3592
  ] })
3620
3593
  ]
3621
3594
  }
3622
- ) : _ === "date" ? (
3595
+ ) : F === "date" ? (
3623
3596
  // Date fields use CardDateFilter which:
3624
3597
  // - Formats dates as ISO strings for backend compatibility
3625
3598
  // - Handles different operators (=, !=, >, <, between, in, etc.)
3626
3599
  // - Saves relative choices ("This month") with the range
3627
3600
  /* @__PURE__ */ t(
3628
- nr,
3601
+ er,
3629
3602
  {
3630
3603
  value: e.value,
3631
3604
  operator: e.operator,
3632
- relativeMeta: Xt(e.relativeMeta),
3605
+ relativeMeta: Zt(e.relativeMeta),
3633
3606
  latestValue: e.latestValue === !0,
3634
3607
  field: e.field,
3635
- onChange: (T) => m(
3608
+ onChange: (T) => c(
3636
3609
  a,
3637
3610
  e.id,
3638
3611
  pt(e, T)
@@ -3653,13 +3626,13 @@ function pn({
3653
3626
  }
3654
3627
  ),
3655
3628
  /* @__PURE__ */ t(
3656
- U,
3629
+ G,
3657
3630
  {
3658
3631
  variant: "ghost",
3659
3632
  size: "xs",
3660
3633
  "aria-label": "Remove condition",
3661
3634
  className: "h-7 w-7 shrink-0 p-0 text-muted-foreground hover:text-foreground",
3662
- onClick: () => u(a, e.id),
3635
+ onClick: () => m(a, e.id),
3663
3636
  children: /* @__PURE__ */ t(ce, { className: "h-3.5 w-3.5" })
3664
3637
  }
3665
3638
  )
@@ -3667,19 +3640,19 @@ function pn({
3667
3640
  }
3668
3641
  );
3669
3642
  }
3670
- const Ft = "group-data-[inline]/filters:h-auto group-data-[inline]/filters:gap-1 group-data-[inline]/filters:border-0 group-data-[inline]/filters:bg-transparent group-data-[inline]/filters:px-0 group-data-[inline]/filters:py-0.5 group-data-[inline]/filters:text-[11px] group-data-[inline]/filters:font-medium group-data-[inline]/filters:text-muted-foreground group-data-[inline]/filters:shadow-none group-data-[inline]/filters:underline-offset-2 group-data-[inline]/filters:hover:bg-transparent group-data-[inline]/filters:hover:text-foreground group-data-[inline]/filters:hover:underline";
3643
+ const _t = "group-data-[inline]/filters:h-auto group-data-[inline]/filters:gap-1 group-data-[inline]/filters:border-0 group-data-[inline]/filters:bg-transparent group-data-[inline]/filters:px-0 group-data-[inline]/filters:py-0.5 group-data-[inline]/filters:text-[11px] group-data-[inline]/filters:font-medium group-data-[inline]/filters:text-muted-foreground group-data-[inline]/filters:shadow-none group-data-[inline]/filters:underline-offset-2 group-data-[inline]/filters:hover:bg-transparent group-data-[inline]/filters:hover:text-foreground group-data-[inline]/filters:hover:underline";
3671
3644
  function fn({
3672
3645
  onAddCondition: e,
3673
3646
  onAddGroup: n
3674
3647
  }) {
3675
- return /* @__PURE__ */ l("div", { className: "mt-2 flex items-center gap-1.5 group-data-[inline]/filters:mt-1 group-data-[inline]/filters:gap-3", children: [
3676
- /* @__PURE__ */ l(
3677
- U,
3648
+ return /* @__PURE__ */ i("div", { className: "mt-2 flex items-center gap-1.5 group-data-[inline]/filters:mt-1 group-data-[inline]/filters:gap-3", children: [
3649
+ /* @__PURE__ */ i(
3650
+ G,
3678
3651
  {
3679
3652
  type: "button",
3680
3653
  size: "xs",
3681
3654
  variant: "outline",
3682
- className: q("gap-1.5", Ft),
3655
+ className: j("gap-1.5", _t),
3683
3656
  onClick: e,
3684
3657
  children: [
3685
3658
  /* @__PURE__ */ t(Ve, { className: "h-3 w-3" }),
@@ -3687,13 +3660,13 @@ function fn({
3687
3660
  ]
3688
3661
  }
3689
3662
  ),
3690
- n && /* @__PURE__ */ l(
3691
- U,
3663
+ n && /* @__PURE__ */ i(
3664
+ G,
3692
3665
  {
3693
3666
  type: "button",
3694
3667
  size: "xs",
3695
3668
  variant: "ghost",
3696
- className: q("gap-1.5 text-muted-foreground hover:text-foreground", Ft),
3669
+ className: j("gap-1.5 text-muted-foreground hover:text-foreground", _t),
3697
3670
  onClick: n,
3698
3671
  children: [
3699
3672
  /* @__PURE__ */ t(Ve, { className: "h-3 w-3" }),
@@ -3703,83 +3676,83 @@ function fn({
3703
3676
  )
3704
3677
  ] });
3705
3678
  }
3706
- function ur({
3679
+ function dr({
3707
3680
  group: e,
3708
3681
  depth: n,
3709
3682
  parentGroupId: a,
3710
3683
  onUpdateGroupOperator: o,
3711
- onUpdateGroupNegate: u,
3684
+ onUpdateGroupNegate: m,
3712
3685
  onRemoveGroup: d,
3713
- onRemoveCondition: c,
3714
- onReorderConditions: i,
3686
+ onRemoveCondition: u,
3687
+ onReorderConditions: l,
3715
3688
  onReorderGroups: s,
3716
- onAddCondition: m,
3717
- onAddGroup: f,
3689
+ onAddCondition: c,
3690
+ onAddGroup: g,
3718
3691
  availableFields: k,
3719
3692
  source: y,
3720
- renderFilterGroup: g,
3693
+ renderFilterGroup: h,
3721
3694
  updateConditionFields: N,
3722
3695
  replaceCondition: S
3723
3696
  }) {
3724
3697
  const {
3725
3698
  attributes: V,
3726
- listeners: _,
3727
- setNodeRef: Q,
3699
+ listeners: F,
3700
+ setNodeRef: K,
3728
3701
  transform: C,
3729
3702
  transition: T,
3730
- isDragging: G
3703
+ isDragging: U
3731
3704
  } = Gt({ id: e.id }), Z = {
3732
- transform: Ut.Transform.toString(C),
3705
+ transform: Bt.Transform.toString(C),
3733
3706
  transition: T
3734
3707
  }, p = ($) => {
3735
3708
  const { active: D, over: v } = $;
3736
3709
  if (v && D.id !== v.id) {
3737
- const h = e.conditions.findIndex(
3710
+ const f = e.conditions.findIndex(
3738
3711
  (w) => w.id === D.id
3739
3712
  ), E = e.conditions.findIndex(
3740
3713
  (w) => w.id === v.id
3741
3714
  );
3742
- h !== -1 && E !== -1 && i(e.id, h, E);
3715
+ f !== -1 && E !== -1 && l(e.id, f, E);
3743
3716
  }
3744
3717
  }, I = ($) => {
3745
3718
  const { active: D, over: v } = $;
3746
3719
  if (v && D.id !== v.id && a) {
3747
- const h = e.groups.findIndex((w) => w.id === D.id), E = e.groups.findIndex((w) => w.id === v.id);
3748
- h !== -1 && E !== -1 && s(a, h, E);
3720
+ const f = e.groups.findIndex((w) => w.id === D.id), E = e.groups.findIndex((w) => w.id === v.id);
3721
+ f !== -1 && E !== -1 && s(a, f, E);
3749
3722
  }
3750
3723
  };
3751
- return /* @__PURE__ */ l(
3724
+ return /* @__PURE__ */ i(
3752
3725
  "div",
3753
3726
  {
3754
- ref: Q,
3727
+ ref: K,
3755
3728
  style: Z,
3756
- className: q(
3729
+ className: j(
3757
3730
  n > 0 && "mt-2 overflow-hidden rounded-[6px] border border-border/60",
3758
- G && "z-50 opacity-50"
3731
+ U && "z-50 opacity-50"
3759
3732
  ),
3760
3733
  children: [
3761
- n > 0 && /* @__PURE__ */ l("div", { className: "flex items-center justify-between gap-2 border-b border-border/60 bg-muted/40 px-2 py-1", children: [
3762
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
3734
+ n > 0 && /* @__PURE__ */ i("div", { className: "flex items-center justify-between gap-2 border-b border-border/60 bg-muted/40 px-2 py-1", children: [
3735
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
3763
3736
  /* @__PURE__ */ t(
3764
3737
  "button",
3765
3738
  {
3766
3739
  type: "button",
3767
3740
  ...V,
3768
- ..._,
3741
+ ...F,
3769
3742
  "aria-label": "Drag to reorder group",
3770
3743
  className: "flex h-7 w-5 shrink-0 cursor-grab items-center justify-center rounded-control text-muted-foreground/60 hover:text-foreground focus-visible:outline-none active:cursor-grabbing",
3771
- children: /* @__PURE__ */ t(Bt, { className: "h-3.5 w-3.5" })
3744
+ children: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" })
3772
3745
  }
3773
3746
  ),
3774
3747
  /* @__PURE__ */ t(
3775
- U,
3748
+ G,
3776
3749
  {
3777
3750
  type: "button",
3778
3751
  variant: e.negate ? "default" : "outline",
3779
3752
  size: "xs",
3780
3753
  "aria-pressed": e.negate,
3781
3754
  className: "px-2",
3782
- onClick: () => u(e.id, !e.negate),
3755
+ onClick: () => m(e.id, !e.negate),
3783
3756
  children: "NOT"
3784
3757
  }
3785
3758
  ),
@@ -3794,7 +3767,7 @@ function ur({
3794
3767
  /* @__PURE__ */ t("span", { className: ht, children: "Group" })
3795
3768
  ] }),
3796
3769
  /* @__PURE__ */ t(
3797
- U,
3770
+ G,
3798
3771
  {
3799
3772
  type: "button",
3800
3773
  variant: "ghost",
@@ -3802,15 +3775,15 @@ function ur({
3802
3775
  "aria-label": "Remove group",
3803
3776
  className: "h-7 w-7 p-0 text-muted-foreground hover:text-foreground",
3804
3777
  onClick: () => a && d(a, e.id),
3805
- children: /* @__PURE__ */ t(Et, { className: "h-3.5 w-3.5" })
3778
+ children: /* @__PURE__ */ t(zt, { className: "h-3.5 w-3.5" })
3806
3779
  }
3807
3780
  )
3808
3781
  ] }),
3809
- /* @__PURE__ */ l("div", { className: q(n > 0 && "p-2"), children: [
3782
+ /* @__PURE__ */ i("div", { className: j(n > 0 && "p-2"), children: [
3810
3783
  /* @__PURE__ */ t(
3811
3784
  Re,
3812
3785
  {
3813
- sensors: Xe(
3786
+ sensors: Je(
3814
3787
  he(tt),
3815
3788
  he(et, {
3816
3789
  coordinateGetter: Ze
@@ -3830,7 +3803,7 @@ function ur({
3830
3803
  index: D,
3831
3804
  groupId: e.id,
3832
3805
  groupLogicalOperator: e.logicalOperator,
3833
- onRemoveCondition: c,
3806
+ onRemoveCondition: u,
3834
3807
  onUpdateGroupOperator: o,
3835
3808
  availableFields: k,
3836
3809
  source: y,
@@ -3846,7 +3819,7 @@ function ur({
3846
3819
  /* @__PURE__ */ t(
3847
3820
  Re,
3848
3821
  {
3849
- sensors: Xe(
3822
+ sensors: Je(
3850
3823
  he(tt),
3851
3824
  he(et, {
3852
3825
  coordinateGetter: Ze
@@ -3860,7 +3833,7 @@ function ur({
3860
3833
  items: e.groups.map(($) => $.id),
3861
3834
  strategy: Me,
3862
3835
  children: e.groups.map(
3863
- ($) => g($, n + 1, e.id)
3836
+ ($) => h($, n + 1, e.id)
3864
3837
  )
3865
3838
  }
3866
3839
  )
@@ -3870,8 +3843,8 @@ function ur({
3870
3843
  /* @__PURE__ */ t(
3871
3844
  fn,
3872
3845
  {
3873
- onAddCondition: () => m(e.id),
3874
- onAddGroup: () => f(e.id)
3846
+ onAddCondition: () => c(e.id),
3847
+ onAddGroup: () => g(e.id)
3875
3848
  }
3876
3849
  )
3877
3850
  ] })
@@ -3879,82 +3852,82 @@ function ur({
3879
3852
  }
3880
3853
  );
3881
3854
  }
3882
- function Or({
3855
+ function $r({
3883
3856
  filters: e,
3884
3857
  availableFields: n,
3885
3858
  source: a,
3886
3859
  onSave: o,
3887
- onClearAll: u,
3860
+ onClearAll: m,
3888
3861
  onCancel: d,
3889
- onChange: c
3862
+ onChange: u
3890
3863
  }) {
3891
- const i = c !== void 0, {
3864
+ const l = u !== void 0, {
3892
3865
  currentFilters: s,
3893
- availableFields: m,
3894
- isLoading: f,
3866
+ availableFields: c,
3867
+ isLoading: g,
3895
3868
  addCondition: k,
3896
3869
  addGroup: y,
3897
- removeCondition: g,
3870
+ removeCondition: h,
3898
3871
  removeGroup: N,
3899
3872
  updateConditionFields: S,
3900
3873
  replaceCondition: V,
3901
- updateGroupOperator: _,
3902
- updateGroupNegate: Q,
3874
+ updateGroupOperator: F,
3875
+ updateGroupNegate: K,
3903
3876
  reorderConditions: C,
3904
3877
  reorderGroups: T,
3905
- generateSQLPreview: G,
3878
+ generateSQLPreview: U,
3906
3879
  hasAnyFilters: Z
3907
- } = Ja({
3880
+ } = Ha({
3908
3881
  initialFilters: e,
3909
3882
  availableFields: n,
3910
- ...c ? {
3911
- onChange: (h) => c(ar(h) ? h : null)
3883
+ ...u ? {
3884
+ onChange: (f) => u(tr(f) ? f : null)
3912
3885
  } : {}
3913
- }), p = Xe(
3886
+ }), p = Je(
3914
3887
  he(tt),
3915
3888
  he(et, {
3916
3889
  coordinateGetter: Ze
3917
3890
  })
3918
- ), [I, $] = Y(!1), D = (h, E = 0, w) => {
3891
+ ), [I, $] = Y(!1), D = (f, E = 0, w) => {
3919
3892
  if (E === 0) {
3920
- const H = h.conditions.length === 0 && h.groups.length === 0;
3921
- return /* @__PURE__ */ l("div", { children: [
3893
+ const H = f.conditions.length === 0 && f.groups.length === 0;
3894
+ return /* @__PURE__ */ i("div", { children: [
3922
3895
  /* @__PURE__ */ t(
3923
3896
  Re,
3924
3897
  {
3925
3898
  sensors: p,
3926
3899
  collisionDetection: Ee,
3927
- onDragEnd: (O) => {
3928
- const { active: z, over: B } = O;
3900
+ onDragEnd: (_) => {
3901
+ const { active: z, over: B } = _;
3929
3902
  if (B && z.id !== B.id) {
3930
- const j = h.conditions.findIndex(
3903
+ const q = f.conditions.findIndex(
3931
3904
  (te) => te.id === z.id
3932
- ), ee = h.conditions.findIndex(
3905
+ ), ee = f.conditions.findIndex(
3933
3906
  (te) => te.id === B.id
3934
3907
  );
3935
- j !== -1 && ee !== -1 && C(h.id, j, ee);
3908
+ q !== -1 && ee !== -1 && C(f.id, q, ee);
3936
3909
  }
3937
3910
  },
3938
3911
  children: /* @__PURE__ */ t(
3939
3912
  ze,
3940
3913
  {
3941
- items: h.conditions.map((O) => O.id),
3914
+ items: f.conditions.map((_) => _.id),
3942
3915
  strategy: Me,
3943
- children: /* @__PURE__ */ t("div", { className: "space-y-0.5", children: h.conditions.map((O, z) => /* @__PURE__ */ t(
3916
+ children: /* @__PURE__ */ t("div", { className: "space-y-0.5", children: f.conditions.map((_, z) => /* @__PURE__ */ t(
3944
3917
  pn,
3945
3918
  {
3946
- condition: O,
3919
+ condition: _,
3947
3920
  index: z,
3948
- groupId: h.id,
3949
- groupLogicalOperator: h.logicalOperator,
3950
- onRemoveCondition: g,
3951
- onUpdateGroupOperator: _,
3952
- availableFields: m,
3921
+ groupId: f.id,
3922
+ groupLogicalOperator: f.logicalOperator,
3923
+ onRemoveCondition: h,
3924
+ onUpdateGroupOperator: F,
3925
+ availableFields: c,
3953
3926
  source: a,
3954
3927
  updateConditionFields: S,
3955
3928
  replaceCondition: V
3956
3929
  },
3957
- O.id
3930
+ _.id
3958
3931
  )) })
3959
3932
  }
3960
3933
  )
@@ -3965,84 +3938,84 @@ function Or({
3965
3938
  {
3966
3939
  sensors: p,
3967
3940
  collisionDetection: Ee,
3968
- onDragEnd: (O) => {
3969
- const { active: z, over: B } = O;
3941
+ onDragEnd: (_) => {
3942
+ const { active: z, over: B } = _;
3970
3943
  if (B && z.id !== B.id) {
3971
- const j = h.groups.findIndex(
3944
+ const q = f.groups.findIndex(
3972
3945
  (te) => te.id === z.id
3973
- ), ee = h.groups.findIndex(
3946
+ ), ee = f.groups.findIndex(
3974
3947
  (te) => te.id === B.id
3975
3948
  );
3976
- j !== -1 && ee !== -1 && T(h.id, j, ee);
3949
+ q !== -1 && ee !== -1 && T(f.id, q, ee);
3977
3950
  }
3978
3951
  },
3979
3952
  children: /* @__PURE__ */ t(
3980
3953
  ze,
3981
3954
  {
3982
- items: h.groups.map((O) => O.id),
3955
+ items: f.groups.map((_) => _.id),
3983
3956
  strategy: Me,
3984
- children: h.groups.map(
3985
- (O) => D(O, E + 1, h.id)
3957
+ children: f.groups.map(
3958
+ (_) => D(_, E + 1, f.id)
3986
3959
  )
3987
3960
  }
3988
3961
  )
3989
3962
  }
3990
3963
  ),
3991
- H && !i && /* @__PURE__ */ t("p", { className: "rounded-control border border-dashed border-border/60 px-3 py-2 text-center text-[11.5px] text-muted-foreground", children: "No filters yet. Add a condition to limit the rows this card shows." }),
3964
+ H && !l && /* @__PURE__ */ t("p", { className: "rounded-control border border-dashed border-border/60 px-3 py-2 text-center text-[11.5px] text-muted-foreground", children: "No filters yet. Add a condition to limit the rows this card shows." }),
3992
3965
  /* @__PURE__ */ t(
3993
3966
  fn,
3994
3967
  {
3995
- onAddCondition: () => k(h.id),
3968
+ onAddCondition: () => k(f.id),
3996
3969
  onAddGroup: (
3997
3970
  // In place, grouping is offered once there are two conditions to group,
3998
3971
  // not as a mode to switch on first.
3999
- (i ? h.conditions.length + h.groups.length >= 2 : I) ? () => y(h.id) : void 0
3972
+ (l ? f.conditions.length + f.groups.length >= 2 : I) ? () => y(f.id) : void 0
4000
3973
  )
4001
3974
  }
4002
3975
  )
4003
- ] }, h.id);
3976
+ ] }, f.id);
4004
3977
  }
4005
3978
  return /* @__PURE__ */ t(
4006
- ur,
3979
+ dr,
4007
3980
  {
4008
- group: h,
3981
+ group: f,
4009
3982
  depth: E,
4010
3983
  parentGroupId: w,
4011
- onUpdateGroupOperator: _,
4012
- onUpdateGroupNegate: Q,
3984
+ onUpdateGroupOperator: F,
3985
+ onUpdateGroupNegate: K,
4013
3986
  onRemoveGroup: N,
4014
- onRemoveCondition: g,
3987
+ onRemoveCondition: h,
4015
3988
  onReorderConditions: C,
4016
3989
  onReorderGroups: T,
4017
3990
  onAddCondition: k,
4018
3991
  onAddGroup: y,
4019
- availableFields: m,
3992
+ availableFields: c,
4020
3993
  source: a,
4021
3994
  renderFilterGroup: D,
4022
3995
  updateConditionFields: S,
4023
3996
  replaceCondition: V
4024
3997
  },
4025
- h.id
3998
+ f.id
4026
3999
  );
4027
4000
  }, v = Yn(e);
4028
- return /* @__PURE__ */ l("div", { className: q("group/filters", i ? "flex flex-col" : "flex min-h-0 flex-1 flex-col"), "data-inline": i || void 0, children: [
4029
- /* @__PURE__ */ l("div", { className: i ? "" : "min-h-0 flex-1 overflow-y-auto px-3 py-3", children: [
4030
- f ? /* @__PURE__ */ l("div", { className: "flex items-center justify-center gap-2 py-6 text-[12px] text-muted-foreground", children: [
4001
+ return /* @__PURE__ */ i("div", { className: j("group/filters", l ? "flex flex-col" : "flex min-h-0 flex-1 flex-col"), "data-inline": l || void 0, children: [
4002
+ /* @__PURE__ */ i("div", { className: l ? "" : "min-h-0 flex-1 overflow-y-auto px-3 py-3", children: [
4003
+ g ? /* @__PURE__ */ i("div", { className: "flex items-center justify-center gap-2 py-6 text-[12px] text-muted-foreground", children: [
4031
4004
  /* @__PURE__ */ t(xn, { className: "h-3.5 w-3.5 animate-spin" }),
4032
4005
  "Loading columns…"
4033
4006
  ] }) : D(s),
4034
- !i && /* @__PURE__ */ l("div", { className: "mt-3 flex items-center gap-2 border-t border-border/60 pt-3", children: [
4007
+ !l && /* @__PURE__ */ i("div", { className: "mt-3 flex items-center gap-2 border-t border-border/60 pt-3", children: [
4035
4008
  /* @__PURE__ */ t(
4036
4009
  bn,
4037
4010
  {
4038
4011
  size: "xs",
4039
4012
  id: "advanced-mode",
4040
4013
  checked: I,
4041
- onCheckedChange: (h) => $(h)
4014
+ onCheckedChange: (f) => $(f)
4042
4015
  }
4043
4016
  ),
4044
4017
  /* @__PURE__ */ t(
4045
- le,
4018
+ ie,
4046
4019
  {
4047
4020
  htmlFor: "advanced-mode",
4048
4021
  className: "text-[12px] font-normal leading-none text-foreground",
@@ -4051,26 +4024,26 @@ function Or({
4051
4024
  ),
4052
4025
  /* @__PURE__ */ t("span", { className: "text-[11px] text-muted-foreground", children: "Nest conditions in groups" })
4053
4026
  ] }),
4054
- Z && !i && /* @__PURE__ */ l("div", { className: "mt-3 border-t border-border/60 pt-3", children: [
4055
- /* @__PURE__ */ t("div", { className: q("mb-1.5", ht), children: "Where clause" }),
4056
- /* @__PURE__ */ t("pre", { className: "overflow-x-auto whitespace-pre-wrap break-words rounded-[6px] border border-border bg-muted/40 px-3 py-2 font-mono text-[12px] leading-[1.55] text-foreground", children: G(s) })
4027
+ Z && !l && /* @__PURE__ */ i("div", { className: "mt-3 border-t border-border/60 pt-3", children: [
4028
+ /* @__PURE__ */ t("div", { className: j("mb-1.5", ht), children: "Where clause" }),
4029
+ /* @__PURE__ */ t("pre", { className: "overflow-x-auto whitespace-pre-wrap break-words rounded-[6px] border border-border bg-muted/40 px-3 py-2 font-mono text-[12px] leading-[1.55] text-foreground", children: U(s) })
4057
4030
  ] })
4058
4031
  ] }),
4059
- i ? null : /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border px-3 py-2.5", children: [
4032
+ l ? null : /* @__PURE__ */ i("div", { className: "flex shrink-0 items-center justify-between gap-2 border-t border-border px-3 py-2.5", children: [
4060
4033
  /* @__PURE__ */ t("div", { children: v > 0 && /* @__PURE__ */ t(
4061
- U,
4034
+ G,
4062
4035
  {
4063
4036
  size: "xs",
4064
4037
  variant: "ghost",
4065
4038
  className: "text-muted-foreground hover:text-foreground",
4066
- onClick: () => u == null ? void 0 : u(),
4039
+ onClick: () => m == null ? void 0 : m(),
4067
4040
  children: "Clear all"
4068
4041
  }
4069
4042
  ) }),
4070
- /* @__PURE__ */ l("div", { className: "flex items-center gap-1.5", children: [
4071
- /* @__PURE__ */ t(U, { size: "xs", variant: "ghost", onClick: () => d == null ? void 0 : d(), children: "Cancel" }),
4043
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-1.5", children: [
4044
+ /* @__PURE__ */ t(G, { size: "xs", variant: "ghost", onClick: () => d == null ? void 0 : d(), children: "Cancel" }),
4072
4045
  /* @__PURE__ */ t(
4073
- U,
4046
+ G,
4074
4047
  {
4075
4048
  size: "xs",
4076
4049
  onClick: () => o == null ? void 0 : o(Z ? s : null),
@@ -4082,16 +4055,15 @@ function Or({
4082
4055
  ] });
4083
4056
  }
4084
4057
  export {
4085
- Ir as A,
4086
- Ar as C,
4087
- Tr as F,
4058
+ Sr as A,
4059
+ Ir as C,
4060
+ kr as F,
4088
4061
  Ua as I,
4089
- Sa as L,
4090
- $r as V,
4091
- Lr as a,
4092
- Or as b,
4062
+ ka as L,
4063
+ Tr as V,
4064
+ Dr as a,
4065
+ $r as b,
4093
4066
  an as c,
4094
- Ba as d,
4095
- qa as g,
4096
- Fr as u
4067
+ Ma as g,
4068
+ Lr as u
4097
4069
  };