react-semaphor 0.1.293 → 0.1.295

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 (40) hide show
  1. package/dist/chunks/{braces-BwW2HFlB.js → braces-BdoTYzuj.js} +1 -1
  2. package/dist/chunks/{braces-C7GP95Fp.js → braces-DWldEFn5.js} +1 -1
  3. package/dist/chunks/{dashboard-controls-DgUc38Tn.js → dashboard-controls-B3lrnI_r.js} +9 -9
  4. package/dist/chunks/{dashboard-controls-jrkoCSY_.js → dashboard-controls-D7U6E1sB.js} +504 -472
  5. package/dist/chunks/dashboard-filter-controls-button-D0AsV28-.js +11 -0
  6. package/dist/chunks/dashboard-filter-controls-button-XwenlcXw.js +1152 -0
  7. package/dist/chunks/{dashboard-json-COjT-zjQ.js → dashboard-json-CU55qPXj.js} +1 -1
  8. package/dist/chunks/{dashboard-json-C0NiRL-A.js → dashboard-json-V6m6lJ_c.js} +1 -1
  9. package/dist/chunks/{dashboard-summary-settings-dialog-CGuFl7Xe.js → dashboard-summary-settings-dialog-0CIiWsKc.js} +1 -1
  10. package/dist/chunks/{dashboard-summary-settings-dialog-CXqaN_zj.js → dashboard-summary-settings-dialog-DRLPzp1P.js} +1 -1
  11. package/dist/chunks/{edit-dashboard-visual-ppdXk86H.js → edit-dashboard-visual-8ha6EM_g.js} +2205 -2147
  12. package/dist/chunks/edit-dashboard-visual-sSLAkmgf.js +183 -0
  13. package/dist/chunks/{index-9z-jMqN8.js → index-14M0TnH6.js} +35272 -33064
  14. package/dist/chunks/index-Ze8VskG1.js +1435 -0
  15. package/dist/chunks/{resource-management-panel-CP8cegZP.js → resource-management-panel-BL5-5ouC.js} +64 -64
  16. package/dist/chunks/{resource-management-panel-os6AuEKT.js → resource-management-panel-CcDAn86l.js} +1 -1
  17. package/dist/chunks/use-create-flow-overlay-state-BbQVNDCj.js +21 -0
  18. package/dist/chunks/{use-create-flow-overlay-state-wpuqRZX5.js → use-create-flow-overlay-state-D3PxfjYv.js} +430 -425
  19. package/dist/chunks/use-visual-utils-CdIOq4nt.js +337 -0
  20. package/dist/chunks/use-visual-utils-kh8p2QFm.js +1 -0
  21. package/dist/dashboard/index.cjs +1 -1
  22. package/dist/dashboard/index.js +1 -1
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +258 -253
  25. package/dist/style.css +1 -1
  26. package/dist/surfboard/index.cjs +1 -1
  27. package/dist/surfboard/index.js +2 -2
  28. package/dist/types/dashboard.d.ts +65 -0
  29. package/dist/types/main.d.ts +79 -4
  30. package/dist/types/shared.d.ts +40 -0
  31. package/dist/types/surfboard.d.ts +65 -0
  32. package/dist/types/types.d.ts +65 -0
  33. package/package.json +1 -1
  34. package/dist/chunks/dashboard-filter-controls-button-B19UWmsK.js +0 -11
  35. package/dist/chunks/dashboard-filter-controls-button-DGH4DxJ8.js +0 -1109
  36. package/dist/chunks/edit-dashboard-visual-CDOz4LWO.js +0 -183
  37. package/dist/chunks/index-K25f5Rqr.js +0 -1435
  38. package/dist/chunks/use-create-flow-overlay-state-CecnMS_v.js +0 -21
  39. package/dist/chunks/use-visual-utils-BTfG-ppd.js +0 -1
  40. package/dist/chunks/use-visual-utils-BhRKGJql.js +0 -334
@@ -1,14 +1,14 @@
1
- import { c as le, V as L, bN as Ke, bO as pt, bP as mt, bQ as ft, bR as ht, bS as bt, u as De, ag as gt, bT as yt, bU as xt, bV as vt, ad as Ct, b as re, bW as kt, bX as Nt, B as q, t as St, J as ne, O as Ye, K as Xe, bY as Ge, x as He, N as Ne, bZ as Pe, X as Je, y as O, b_ as Dt, b$ as wt, c0 as te, c1 as Fe, c2 as Ae, c3 as fe, c4 as he, c5 as Tt, c6 as ze, c7 as Vt, c8 as It, c9 as ae, ca as qt, cb as Oe, cc as Et, a7 as Me, cd as Be, ce as We, cf as Ze, cg as et, ch as _t, L as Y, I as tt, z as be, A as ge, E as ye, F as xe, G as ve, ci as at, cj as Lt, ck as Ft, cl as rt, cm as st, cn as At, co as zt, cp as Ot, cq as Mt, cr as Bt, cs as Qt, ct as jt, cu as Qe, cv as Rt, cw as je, cx as Ut, cy as Ce, cz as $t } from "./index-9z-jMqN8.js";
2
- import { jsx as t, jsxs as d, Fragment as U } from "react/jsx-runtime";
3
- import { useMemo as A, useState as M, useRef as ke, useCallback as z, useEffect as Se, Fragment as Kt } from "react";
4
- import { u as we } from "./use-visual-utils-BhRKGJql.js";
1
+ import { c as ie, W as _, bO as Ke, bP as pt, bQ as mt, bR as ft, bS as ht, bT as bt, u as le, ai as gt, bU as yt, bV as xt, bW as vt, af as Ct, b as ne, bX as kt, bY as Nt, B as V, t as St, J as de, Q as Pe, M as Ye, bZ as Xe, x as Ge, b_ as Dt, O as Se, b$ as He, X as Je, y as O, c0 as wt, c1 as Tt, c2 as It, c3 as re, c4 as Le, c5 as Ae, c6 as he, c7 as be, c8 as Vt, c9 as ze, ca as Et, cb as qt, cc as se, cd as Ft, ce as Oe, cf as _t, a9 as Me, cg as Be, ch as We, ci as Ze, cj as et, ck as Lt, L as X, I as tt, z as ge, A as ye, E as xe, F as ve, G as Ce, cl as at, cm as At, cn as zt, co as rt, cp as st, cq as Ot, cr as Mt, cs as Bt, ct as Qt, cu as Rt, cv as jt, cw as Ut, cx as Qe, cy as $t, cz as Re, cA as Kt, cB as ke, cC as Pt } from "./index-14M0TnH6.js";
2
+ import { jsx as t, jsxs as d, Fragment as $ } from "react/jsx-runtime";
3
+ import { useMemo as A, useState as M, useRef as Ne, useCallback as z, useEffect as De, Fragment as Yt } from "react";
4
+ import { u as we } from "./use-visual-utils-CdIOq4nt.js";
5
5
  /**
6
6
  * @license lucide-react v0.453.0 - ISC
7
7
  *
8
8
  * This source code is licensed under the ISC license.
9
9
  * See the LICENSE file in the root directory of this source tree.
10
10
  */
11
- const ra = le("CircleX", [
11
+ const la = ie("CircleX", [
12
12
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
13
13
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
14
14
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -19,7 +19,7 @@ const ra = le("CircleX", [
19
19
  * This source code is licensed under the ISC license.
20
20
  * See the LICENSE file in the root directory of this source tree.
21
21
  */
22
- const Yt = le("Library", [
22
+ const Xt = ie("Library", [
23
23
  ["path", { d: "m16 6 4 14", key: "ji33uf" }],
24
24
  ["path", { d: "M12 6v14", key: "1n7gus" }],
25
25
  ["path", { d: "M8 8v12", key: "1gg7y9" }],
@@ -31,7 +31,7 @@ const Yt = le("Library", [
31
31
  * This source code is licensed under the ISC license.
32
32
  * See the LICENSE file in the root directory of this source tree.
33
33
  */
34
- const Xt = le("Link2", [
34
+ const Gt = ie("Link2", [
35
35
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
36
36
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
37
37
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
@@ -42,7 +42,7 @@ const Xt = le("Link2", [
42
42
  * This source code is licensed under the ISC license.
43
43
  * See the LICENSE file in the root directory of this source tree.
44
44
  */
45
- const lt = le("Save", [
45
+ const lt = ie("Save", [
46
46
  [
47
47
  "path",
48
48
  {
@@ -55,18 +55,18 @@ const lt = le("Save", [
55
55
  ]);
56
56
  function nt() {
57
57
  var h, C;
58
- const s = L((x) => x.card), r = L((x) => x.frame), o = A(
58
+ const s = _((y) => y.card), r = _((y) => y.frame), o = A(
59
59
  () => Ke(r, s),
60
60
  [r, s]
61
61
  ), { manifest: i } = pt(
62
62
  ((h = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : h.url) || ""
63
63
  ), f = A(
64
64
  () => {
65
- var x;
66
- return (x = i == null ? void 0 : i.visuals) == null ? void 0 : x.find(
65
+ var y;
66
+ return (y = i == null ? void 0 : i.visuals) == null ? void 0 : y.find(
67
67
  (m) => {
68
- var g;
69
- return m.name === ((g = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : g.componentName);
68
+ var v;
69
+ return m.name === ((v = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : v.componentName);
70
70
  }
71
71
  );
72
72
  },
@@ -78,36 +78,36 @@ function nt() {
78
78
  isMultiInputVisual: u === "multiple"
79
79
  }),
80
80
  [r, o, u]
81
- ), v = A(() => {
82
- const x = b.findIndex(
81
+ ), x = A(() => {
82
+ const y = b.findIndex(
83
83
  (m) => (m == null ? void 0 : m.id) === s.id
84
84
  );
85
- return x < 0 ? -1 : ht(s, x);
85
+ return y < 0 ? -1 : ht(s, y);
86
86
  }, [b, s]);
87
- return A(() => !o || u !== "multiple" || v < 0 ? s.type : bt(
87
+ return A(() => !o || u !== "multiple" || x < 0 ? s.type : bt(
88
88
  s,
89
- v,
89
+ x,
90
90
  f == null ? void 0 : f.slots
91
- ) ?? s.type, [o, u, v, s, f == null ? void 0 : f.slots]);
91
+ ) ?? s.type, [o, u, x, s, f == null ? void 0 : f.slots]);
92
92
  }
93
- function sa({
93
+ function na({
94
94
  type: s,
95
95
  isLinked: r,
96
96
  className: o,
97
97
  showLabel: i = !1,
98
98
  showLocal: f = !1
99
99
  }) {
100
- const u = De((I) => I.selectedFrameId), b = gt((I) => I.selectedVisual), v = L((I) => I.frame);
100
+ const u = le((N) => N.selectedFrameId), b = gt((N) => N.selectedVisual), x = _((N) => N.frame);
101
101
  let h;
102
102
  if (s)
103
103
  h = s;
104
104
  else if (r !== void 0)
105
105
  h = r ? "linked" : "library";
106
- else if (!!!(v != null && v.visualId || b != null && b.id) && u)
106
+ else if (!!!(x != null && x.visualId || b != null && b.id) && u)
107
107
  h = "local";
108
108
  else if (b && !u)
109
109
  h = "library";
110
- else if (v != null && v.visualId && u)
110
+ else if (x != null && x.visualId && u)
111
111
  h = "linked";
112
112
  else if (b != null && b.id && u)
113
113
  h = "library";
@@ -119,7 +119,7 @@ function sa({
119
119
  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",
120
120
  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",
121
121
  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"
122
- }, x = {
122
+ }, y = {
123
123
  local: "Local to this dashboard: Changes made here only affect this dashboard copy.",
124
124
  linked: "Linked to library: Changes made here update the library visual and all linked instances.",
125
125
  library: "Library visual: Share and reuse this visual across multiple dashboards."
@@ -127,15 +127,15 @@ function sa({
127
127
  local: "border-slate-200 bg-slate-50 text-slate-900 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100",
128
128
  linked: "border-purple-200 bg-purple-50 text-purple-900 dark:border-purple-800 dark:bg-purple-950 dark:text-purple-100",
129
129
  library: "border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-800 dark:bg-blue-950 dark:text-blue-100"
130
- }, g = {
130
+ }, v = {
131
131
  local: "fill-slate-50 dark:fill-slate-900",
132
132
  linked: "fill-purple-50 dark:fill-purple-950",
133
133
  library: "fill-blue-50 dark:fill-blue-950"
134
- }, N = {
134
+ }, E = {
135
135
  local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
136
- linked: /* @__PURE__ */ t(Xt, { className: "h-3.5 w-3.5" }),
137
- library: /* @__PURE__ */ t(Yt, { className: "h-3.5 w-3.5" })
138
- }, V = {
136
+ linked: /* @__PURE__ */ t(Gt, { className: "h-3.5 w-3.5" }),
137
+ library: /* @__PURE__ */ t(Xt, { className: "h-3.5 w-3.5" })
138
+ }, k = {
139
139
  local: "Local",
140
140
  linked: "Linked",
141
141
  library: "Library"
@@ -145,14 +145,14 @@ function sa({
145
145
  Ct,
146
146
  {
147
147
  variant: "outline",
148
- className: re(
148
+ className: ne(
149
149
  "cursor-help select-none transition-all",
150
150
  C[h],
151
151
  o
152
152
  ),
153
153
  children: [
154
- N[h],
155
- i && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: V[h] })
154
+ E[h],
155
+ i && /* @__PURE__ */ t("span", { className: "ml-1 text-xs font-medium leading-none", children: k[h] })
156
156
  ]
157
157
  }
158
158
  ) }),
@@ -160,16 +160,16 @@ function sa({
160
160
  kt,
161
161
  {
162
162
  side: "bottom",
163
- className: re("max-w-xs", m[h]),
163
+ className: ne("max-w-xs", m[h]),
164
164
  children: [
165
- /* @__PURE__ */ t(Nt, { className: g[h] }),
166
- /* @__PURE__ */ t("p", { children: x[h] })
165
+ /* @__PURE__ */ t(Nt, { className: v[h] }),
166
+ /* @__PURE__ */ t("p", { children: y[h] })
167
167
  ]
168
168
  }
169
169
  )
170
170
  ] }) });
171
171
  }
172
- function Gt(s, r) {
172
+ function Ht(s, r) {
173
173
  return {
174
174
  ...s,
175
175
  sql: "",
@@ -186,20 +186,20 @@ function Gt(s, r) {
186
186
  };
187
187
  }
188
188
  function Te(s) {
189
- const r = Dt(s);
189
+ const r = Tt(s);
190
190
  return r ? (O.error(r), !1) : !0;
191
191
  }
192
- function la({
192
+ function oa({
193
193
  className: s,
194
194
  variant: r = "outline"
195
195
  }) {
196
- const o = L((u) => u.onSave), { getUpdatedFrame: i } = we();
196
+ const o = _((u) => u.onSave), { getUpdatedFrame: i } = we();
197
197
  function f() {
198
198
  const u = i();
199
199
  Te(u) && (o == null || o(u));
200
200
  }
201
201
  return /* @__PURE__ */ d(
202
- q,
202
+ V,
203
203
  {
204
204
  onClick: f,
205
205
  className: s,
@@ -212,36 +212,36 @@ function la({
212
212
  }
213
213
  );
214
214
  }
215
- function na({
215
+ function ia({
216
216
  className: s,
217
217
  variant: r = "default"
218
218
  }) {
219
- const o = ne(), [i, f] = M(!1), u = De(
220
- (g) => g.actions.setIsDashboardPanelOpen
221
- ), { setIsVisualEditing: b } = Ye(), { getUpdatedFrame: v } = we(), h = Xe(), C = L((g) => g.frame), x = Ge();
219
+ const o = de(), [i, f] = M(!1), u = le(
220
+ (v) => v.actions.setIsDashboardPanelOpen
221
+ ), { setIsVisualEditing: b } = Pe(), { getUpdatedFrame: x } = we(), h = Ye(), C = _((v) => v.frame), y = Xe();
222
222
  return /* @__PURE__ */ t(
223
- q,
223
+ V,
224
224
  {
225
225
  onClick: () => {
226
- const g = v();
227
- if (!Te(g))
226
+ const v = x();
227
+ if (!Te(v))
228
228
  return;
229
- const N = (C == null ? void 0 : C.visualId) || (h == null ? void 0 : h.id);
230
- if (!N) {
229
+ const E = (C == null ? void 0 : C.visualId) || (h == null ? void 0 : h.id);
230
+ if (!E) {
231
231
  O.error("No visual to save");
232
232
  return;
233
233
  }
234
- f(!0), x.mutate(
234
+ f(!0), y.mutate(
235
235
  {
236
- visualId: N,
236
+ visualId: E,
237
237
  data: {
238
- frameObject: g
238
+ frameObject: v
239
239
  }
240
240
  },
241
241
  {
242
242
  onSuccess: () => {
243
243
  f(!1), u(!0), O.success("Visual updated successfully"), o.invalidateQueries({
244
- queryKey: ["resource-by-id", "visual", N],
244
+ queryKey: ["resource-by-id", "visual", E],
245
245
  exact: !0
246
246
  });
247
247
  },
@@ -254,56 +254,61 @@ function na({
254
254
  className: s,
255
255
  size: "xs",
256
256
  variant: r,
257
- children: i ? /* @__PURE__ */ d(U, { children: [
258
- /* @__PURE__ */ t(He, { className: "h-3.5 w-3.5 animate-spin" }),
257
+ children: i ? /* @__PURE__ */ d($, { children: [
258
+ /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
259
259
  "Saving"
260
- ] }) : /* @__PURE__ */ d(U, { children: [
260
+ ] }) : /* @__PURE__ */ d($, { children: [
261
261
  /* @__PURE__ */ t(lt, { className: "h-3.5 w-3.5" }),
262
262
  "Save to Library"
263
263
  ] })
264
264
  }
265
265
  );
266
266
  }
267
- function oa({
267
+ function da({
268
268
  className: s
269
269
  }) {
270
- const r = ne(), [o, i] = M(!1), f = Xe(), u = L((g) => g.frame), b = De((g) => g.selectedSheetId), { updateFrame: v, setIsVisualEditing: h } = Ye(), { getUpdatedFrame: C } = we(), x = Ge();
270
+ const r = de(), [o, i] = M(!1), f = Ye(), u = _((k) => k.frame), b = le((k) => k.selectedSheetId), x = le((k) => k.dashboard), { updateFrame: h, setIsVisualEditing: C } = Pe(), { getUpdatedFrame: y } = we(), m = Xe(), v = Dt();
271
271
  return /* @__PURE__ */ t(
272
- q,
272
+ V,
273
273
  {
274
274
  onClick: async () => {
275
275
  if (!b) {
276
276
  O.error("No sheet selected");
277
277
  return;
278
278
  }
279
- const g = (u == null ? void 0 : u.visualId) || (f == null ? void 0 : f.id);
280
- if (!g) {
279
+ const k = (u == null ? void 0 : u.visualId) || (f == null ? void 0 : f.id);
280
+ if (!k) {
281
281
  O.error("No visual to update");
282
282
  return;
283
283
  }
284
284
  i(!0);
285
285
  try {
286
- const N = C();
286
+ const N = y();
287
287
  if (!Te(N)) {
288
288
  i(!1);
289
289
  return;
290
290
  }
291
- await x.mutateAsync({
292
- visualId: g,
291
+ const B = {
292
+ ...N,
293
+ visualId: k
294
+ // Keep the link to library visual
295
+ }, G = wt(x, B.id), K = await v(B, {
296
+ previousFrame: G
297
+ });
298
+ await m.mutateAsync({
299
+ visualId: k,
293
300
  data: {
294
301
  frameObject: N
295
302
  }
296
- });
297
- const V = {
298
- ...N,
299
- visualId: g
300
- // Keep the link to library visual
301
- };
302
- v(b, V), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", g] }), O.success("Saved to library and applied locally"), setTimeout(() => {
303
- h(!1);
303
+ }), h(b, B, {
304
+ semanticExecutionPayload: K
305
+ }), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", k] }), O.success("Saved to library and applied locally"), setTimeout(() => {
306
+ C(!1);
304
307
  }, 300);
305
308
  } catch (N) {
306
- console.error("Failed to save and apply:", N), O.error("Failed to save and apply changes");
309
+ console.error("Failed to save and apply:", N), O.error(
310
+ N instanceof Error ? N.message : "Failed to save and apply changes"
311
+ );
307
312
  } finally {
308
313
  i(!1);
309
314
  }
@@ -312,29 +317,29 @@ function oa({
312
317
  size: "xs",
313
318
  variant: "default",
314
319
  disabled: o,
315
- children: o ? /* @__PURE__ */ d(U, { children: [
316
- /* @__PURE__ */ t(He, { className: "h-3.5 w-3.5 animate-spin" }),
320
+ children: o ? /* @__PURE__ */ d($, { children: [
321
+ /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
317
322
  "Saving..."
318
- ] }) : /* @__PURE__ */ d(U, { children: [
323
+ ] }) : /* @__PURE__ */ d($, { children: [
319
324
  /* @__PURE__ */ t(lt, { className: "h-3.5 w-3.5" }),
320
325
  "Save & Apply"
321
326
  ] })
322
327
  }
323
328
  );
324
329
  }
325
- function ia({ className: s }) {
326
- const { setTempQueryData: r, setSqlGen: o } = Ne(), i = ne(), f = L((m) => m.tempQueryData), u = L((m) => m.onClose), b = L((m) => m.card), v = nt(), h = A(() => v !== b.type ? { ...b, type: v } : b, [b, v]), { queryKey: C } = Pe(h);
327
- function x() {
330
+ function ca({ className: s }) {
331
+ const { setTempQueryData: r, setSqlGen: o } = Se(), i = de(), f = _((m) => m.tempQueryData), u = _((m) => m.onClose), b = _((m) => m.card), x = nt(), h = A(() => x !== b.type ? { ...b, type: x } : b, [b, x]), { queryKey: C } = He(h);
332
+ function y() {
328
333
  if (f) {
329
- const { queryKey: m, queryData: g } = f;
330
- m && g && i.setQueryData(m, g);
334
+ const { queryKey: m, queryData: v } = f;
335
+ m && v && i.setQueryData(m, v);
331
336
  }
332
337
  o({}), u == null || u();
333
338
  }
334
339
  return /* @__PURE__ */ d(
335
- q,
340
+ V,
336
341
  {
337
- onClick: x,
342
+ onClick: y,
338
343
  className: s,
339
344
  size: "xs",
340
345
  variant: "outline",
@@ -345,43 +350,43 @@ function ia({ className: s }) {
345
350
  }
346
351
  );
347
352
  }
348
- function da({
353
+ function ua({
349
354
  label: s = "Clear",
350
355
  variant: r = "secondary",
351
356
  className: o
352
357
  } = {}) {
353
- const { setTempQueryData: i } = Ne(), f = ne(), u = L((a) => a.tempQueryData), b = L((a) => a.card), v = nt(), h = A(() => v !== b.type ? { ...b, type: v } : b, [b, v]), { queryKey: C } = Pe(h), {
354
- setCardSql: x,
358
+ const { setTempQueryData: i } = Se(), f = de(), u = _((a) => a.tempQueryData), b = _((a) => a.card), x = nt(), h = A(() => x !== b.type ? { ...b, type: x } : b, [b, x]), { queryKey: C } = He(h), {
359
+ setCardSql: y,
355
360
  setSqlGen: m,
356
- setCardPython: g,
357
- setCardCustomCfg: N,
358
- setCardPreferences: V,
359
- clearQueryConfig: I,
360
- setCardConfig: oe,
361
- setCardType: ie,
362
- setFrame: Z,
363
- setCard: X,
364
- setActiveTabCardId: de
365
- } = Ne();
366
- function $() {
367
- var E, H, j, ee;
361
+ setCardPython: v,
362
+ setCardCustomCfg: E,
363
+ setCardPreferences: k,
364
+ clearQueryConfig: N,
365
+ setCardConfig: B,
366
+ setCardType: G,
367
+ setFrame: K,
368
+ setCard: H,
369
+ setActiveTabCardId: ce
370
+ } = Se();
371
+ function P() {
372
+ var q, W, j, ae;
368
373
  const a = f.getQueryData(C);
369
374
  u != null && u.queryData || i({
370
375
  queryKey: C,
371
376
  queryData: a
372
- }), f.setQueryData(C, null), f.removeQueries({ queryKey: C, exact: !0 }), x(""), m({}), I(), oe(void 0), g(""), N(""), V({});
373
- const S = L.getState().frame, B = L.getState().card, T = Ke(S, B), G = ((E = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : E.visualType) === "multiple" || !!((H = T == null ? void 0 : T.customCardPreferences) != null && H.dataInputCardIds) || (((j = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : j.minInputs) || 0) > 1 || (((ee = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : ee.maxInputs) || 0) > 1, Q = Gt(B, G);
374
- Z({
375
- ...S,
376
- cards: S.cards.map(
377
- (P) => P.id === Q.id ? Q : P
377
+ }), f.setQueryData(C, null), f.removeQueries({ queryKey: C, exact: !0 }), y(""), m({}), N(), B(void 0), v(""), E(""), k({});
378
+ const D = _.getState().frame, Q = _.getState().card, I = Ke(D, Q), J = ((q = I == null ? void 0 : I.customCardPreferences) == null ? void 0 : q.visualType) === "multiple" || !!((W = I == null ? void 0 : I.customCardPreferences) != null && W.dataInputCardIds) || (((j = I == null ? void 0 : I.customCardPreferences) == null ? void 0 : j.minInputs) || 0) > 1 || (((ae = I == null ? void 0 : I.customCardPreferences) == null ? void 0 : ae.maxInputs) || 0) > 1, R = Ht(Q, J);
379
+ K({
380
+ ...D,
381
+ cards: D.cards.map(
382
+ (Z) => Z.id === R.id ? R : Z
378
383
  )
379
- }), de(Q.id), X(Q), G || ie("bar");
384
+ }), ce(R.id), H(R), J || G("bar");
380
385
  }
381
386
  return /* @__PURE__ */ d(
382
- q,
387
+ V,
383
388
  {
384
- onClick: $,
389
+ onClick: P,
385
390
  className: o,
386
391
  size: "xs",
387
392
  variant: r,
@@ -395,7 +400,7 @@ function da({
395
400
  function ot(s) {
396
401
  const { control: r, onChange: o } = s;
397
402
  return /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
398
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
403
+ /* @__PURE__ */ t(X, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
399
404
  /* @__PURE__ */ t(
400
405
  tt,
401
406
  {
@@ -407,18 +412,18 @@ function ot(s) {
407
412
  )
408
413
  ] });
409
414
  }
410
- function Ht(s) {
415
+ function Jt(s) {
411
416
  const { currentStep: r, labels: o } = s;
412
417
  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: o.map((i, f) => {
413
- const u = f + 1, b = u === r, v = u < r;
414
- return /* @__PURE__ */ d(Kt, { children: [
418
+ const u = f + 1, b = u === r, x = u < r;
419
+ return /* @__PURE__ */ d(Yt, { children: [
415
420
  /* @__PURE__ */ d("div", { className: "flex items-center gap-1.5", children: [
416
421
  /* @__PURE__ */ t(
417
422
  "span",
418
423
  {
419
- className: re(
424
+ className: ne(
420
425
  "flex h-5 w-5 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",
421
- b ? "border-foreground bg-foreground text-background" : v ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
426
+ b ? "border-foreground bg-foreground text-background" : x ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
422
427
  ),
423
428
  children: u
424
429
  }
@@ -426,7 +431,7 @@ function Ht(s) {
426
431
  /* @__PURE__ */ t(
427
432
  "span",
428
433
  {
429
- className: re(
434
+ className: ne(
430
435
  "text-[12px]",
431
436
  b ? "font-medium text-foreground" : "text-muted-foreground"
432
437
  ),
@@ -444,7 +449,7 @@ function Ht(s) {
444
449
  ] }, i);
445
450
  }) }) });
446
451
  }
447
- function se(s) {
452
+ function oe(s) {
448
453
  const { secondary: r, tertiary: o, primary: i } = s;
449
454
  return /* @__PURE__ */ d("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: [
450
455
  r,
@@ -452,10 +457,10 @@ function se(s) {
452
457
  i
453
458
  ] });
454
459
  }
455
- function Pt(s) {
460
+ function Wt(s) {
456
461
  const { control: r, scope: o, detail: i } = s;
457
462
  return /* @__PURE__ */ d("div", { className: "flex items-start gap-2.5 rounded-[6px] border border-border/60 bg-muted/30 px-3 py-2.5", children: [
458
- /* @__PURE__ */ t($t, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
463
+ /* @__PURE__ */ t(Pt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
459
464
  /* @__PURE__ */ d("div", { className: "min-w-0 space-y-0.5", children: [
460
465
  /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
461
466
  /* @__PURE__ */ d("div", { className: "text-[12px] text-muted-foreground", children: [
@@ -471,7 +476,7 @@ function Pt(s) {
471
476
  ] })
472
477
  ] });
473
478
  }
474
- function Re(s) {
479
+ function je(s) {
475
480
  const {
476
481
  control: r,
477
482
  defaultValue: o,
@@ -479,12 +484,12 @@ function Re(s) {
479
484
  availableMetricChoices: f,
480
485
  previewControlDefinitions: u,
481
486
  previewControlValues: b,
482
- onControlChange: v,
487
+ onControlChange: x,
483
488
  onLabelChange: h,
484
489
  onDefaultValueChange: C,
485
- onBack: x,
490
+ onBack: y,
486
491
  onNext: m,
487
- nextDisabled: g
492
+ nextDisabled: v
488
493
  } = s;
489
494
  return /* @__PURE__ */ d("div", { className: "space-y-3", children: [
490
495
  /* @__PURE__ */ t(ot, { control: r, onChange: h }),
@@ -497,7 +502,7 @@ function Re(s) {
497
502
  previewControlDefinitions: u,
498
503
  previewControlValues: b,
499
504
  controlLifecycle: "create",
500
- onChange: v
505
+ onChange: x
501
506
  }
502
507
  ),
503
508
  /* @__PURE__ */ t(
@@ -514,25 +519,25 @@ function Re(s) {
514
519
  }
515
520
  ),
516
521
  /* @__PURE__ */ t(
517
- se,
522
+ oe,
518
523
  {
519
524
  secondary: /* @__PURE__ */ t(
520
- q,
525
+ V,
521
526
  {
522
527
  type: "button",
523
528
  variant: "outline",
524
529
  size: "xs",
525
- onClick: x,
530
+ onClick: y,
526
531
  children: "Back"
527
532
  }
528
533
  ),
529
534
  primary: /* @__PURE__ */ t(
530
- q,
535
+ V,
531
536
  {
532
537
  type: "button",
533
538
  size: "xs",
534
539
  onClick: m,
535
- disabled: g,
540
+ disabled: v,
536
541
  children: "Next"
537
542
  }
538
543
  )
@@ -540,7 +545,7 @@ function Re(s) {
540
545
  )
541
546
  ] });
542
547
  }
543
- const Jt = /* @__PURE__ */ new Set([
548
+ const Zt = /* @__PURE__ */ new Set([
544
549
  "grain_selector",
545
550
  "aggregation_selector",
546
551
  "field_selector",
@@ -576,13 +581,13 @@ function $e(s) {
576
581
  explorerContent: f,
577
582
  sqlDescription: u,
578
583
  summaryDetail: b,
579
- onBack: v,
584
+ onBack: x,
580
585
  onCancel: h,
581
586
  onDone: C
582
- } = s, x = Jt.has(r.type), m = i.match(/\[\[param\.(.+?)\]\]/), g = m ? `{{ param('${m[1]}') }}` : "";
587
+ } = s, y = Zt.has(r.type), m = i.match(/\[\[param\.(.+?)\]\]/), v = m ? `{{ param('${m[1]}') }}` : "";
583
588
  return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
584
589
  /* @__PURE__ */ t(
585
- Pt,
590
+ Wt,
586
591
  {
587
592
  control: r,
588
593
  scope: o,
@@ -592,7 +597,7 @@ function $e(s) {
592
597
  /* @__PURE__ */ d("div", { className: "space-y-2", children: [
593
598
  /* @__PURE__ */ t("p", { className: "text-[13px] font-medium text-foreground", children: "How cards use this control" }),
594
599
  /* @__PURE__ */ d("div", { className: "divide-y divide-border/60 overflow-hidden rounded-[6px] border border-border/60", children: [
595
- x ? /* @__PURE__ */ d("div", { className: "space-y-1 px-3 py-2.5", children: [
600
+ y ? /* @__PURE__ */ d("div", { className: "space-y-1 px-3 py-2.5", children: [
596
601
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Explorer cards" }),
597
602
  /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: f })
598
603
  ] }) : null,
@@ -605,10 +610,10 @@ function $e(s) {
605
610
  ariaLabel: "Copy SQL control reference"
606
611
  }
607
612
  ),
608
- g ? /* @__PURE__ */ t(
613
+ v ? /* @__PURE__ */ t(
609
614
  Ue,
610
615
  {
611
- text: g,
616
+ text: v,
612
617
  ariaLabel: "Copy Jinja control reference"
613
618
  }
614
619
  ) : null,
@@ -631,20 +636,20 @@ function $e(s) {
631
636
  ] })
632
637
  ] }),
633
638
  /* @__PURE__ */ t(
634
- se,
639
+ oe,
635
640
  {
636
641
  secondary: /* @__PURE__ */ t(
637
- q,
642
+ V,
638
643
  {
639
644
  type: "button",
640
645
  variant: "outline",
641
646
  size: "xs",
642
- onClick: v,
647
+ onClick: x,
643
648
  children: "Back"
644
649
  }
645
650
  ),
646
651
  tertiary: /* @__PURE__ */ t(
647
- q,
652
+ V,
648
653
  {
649
654
  type: "button",
650
655
  variant: "outline",
@@ -653,39 +658,39 @@ function $e(s) {
653
658
  children: "Cancel"
654
659
  }
655
660
  ),
656
- primary: /* @__PURE__ */ t(q, { type: "button", size: "xs", onClick: C, children: "Done" })
661
+ primary: /* @__PURE__ */ t(V, { type: "button", size: "xs", onClick: C, children: "Done" })
657
662
  }
658
663
  )
659
664
  ] });
660
665
  }
661
- function Wt(s) {
662
- const r = te(
666
+ function ea(s) {
667
+ const r = re(
663
668
  s.scope,
664
669
  s.existingControls,
665
670
  s.reservedIds
666
671
  ), o = s.type === r.type ? {
667
672
  ...r,
668
- label: Ce[s.type]
673
+ label: ke[s.type]
669
674
  } : {
670
675
  ...at({
671
676
  controls: [
672
677
  {
673
678
  ...r,
674
- label: Ce[s.type]
679
+ label: ke[s.type]
675
680
  }
676
681
  ],
677
682
  controlId: r.id,
678
683
  nextType: s.type
679
684
  }).controls[0],
680
- label: Ce[s.type]
685
+ label: ke[s.type]
681
686
  };
682
687
  return {
683
688
  step: 2,
684
689
  control: o,
685
- defaultValue: ae(o, void 0)
690
+ defaultValue: se(o, void 0)
686
691
  };
687
692
  }
688
- function ca({
693
+ function pa({
689
694
  scope: s,
690
695
  controls: r,
691
696
  reservedControlIds: o,
@@ -693,53 +698,53 @@ function ca({
693
698
  onChange: f,
694
699
  emptyMessage: u,
695
700
  initialCreateFlow: b = !1,
696
- usageByControlId: v,
701
+ usageByControlId: x,
697
702
  availableFieldChoices: h,
698
703
  availableMetricChoices: C,
699
- structuralParticipants: x,
704
+ structuralParticipants: y,
700
705
  structuralParticipantIdsByControlId: m,
701
- card: g,
702
- onCreateFlowActiveChange: N,
703
- onCreateFlowComplete: V
706
+ card: v,
707
+ onCreateFlowActiveChange: E,
708
+ onCreateFlowComplete: k
704
709
  }) {
705
- const I = A(
710
+ const N = A(
706
711
  () => new Set(o || []),
707
712
  [o]
708
- ), oe = Lt(s), ie = wt(s), [Z, X] = M(
713
+ ), B = At(s), G = It(s), [K, H] = M(
709
714
  null
710
- ), [de, $] = M(
715
+ ), [ce, P] = M(
711
716
  null
712
- ), [a, S] = M(
717
+ ), [a, D] = M(
713
718
  () => b ? {
714
719
  step: 1,
715
- control: te(s, r, Array.from(I))
720
+ control: re(s, r, Array.from(N))
716
721
  } : null
717
- ), B = ke({}), T = ke(void 0), G = ke(b), Q = A(
718
- () => Fe({ scope: s, card: g }),
719
- [g, s]
720
- ), E = z(
722
+ ), Q = Ne({}), I = Ne(void 0), J = Ne(b), R = A(
723
+ () => Le({ scope: s, card: v }),
724
+ [v, s]
725
+ ), q = z(
721
726
  (e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
722
727
  [s]
723
- ), H = A(
728
+ ), W = A(
724
729
  () => a ? Ae(
725
- x || [],
730
+ y || [],
726
731
  a.control.type
727
732
  ) : [],
728
- [a, x]
733
+ [a, y]
729
734
  ), j = A(() => {
730
735
  if (!a)
731
736
  return {
732
737
  fields: h || [],
733
738
  metrics: C || []
734
739
  };
735
- if (!E(a.control.type))
740
+ if (!q(a.control.type))
736
741
  return {
737
742
  fields: h || [],
738
743
  metrics: C || []
739
744
  };
740
- const e = a.selectedCardIds || [], n = fe({
745
+ const e = a.selectedCardIds || [], n = he({
741
746
  controlType: a.control.type,
742
- participants: x || [],
747
+ participants: y || [],
743
748
  selectedCardIds: e
744
749
  });
745
750
  return {
@@ -756,20 +761,20 @@ function ca({
756
761
  h,
757
762
  C,
758
763
  a,
759
- E,
760
- x
764
+ q,
765
+ y
761
766
  ]);
762
- Se(() => {
763
- N == null || N(!!a);
764
- }, [a, N]), Se(() => {
765
- const e = b && !G.current;
766
- G.current = b, e && (S({
767
+ De(() => {
768
+ E == null || E(!!a);
769
+ }, [a, E]), De(() => {
770
+ const e = b && !J.current;
771
+ J.current = b, e && (D({
767
772
  step: 1,
768
- control: te(s, r, Array.from(I))
769
- }), $(null), X(null));
770
- }, [r, b, I, s]);
771
- const ee = (e) => {
772
- if (!E(e.type))
773
+ control: re(s, r, Array.from(N))
774
+ }), P(null), H(null));
775
+ }, [r, b, N, s]);
776
+ const ae = (e) => {
777
+ if (!q(e.type))
773
778
  return {
774
779
  fields: h || [],
775
780
  metrics: C || []
@@ -780,9 +785,9 @@ function ca({
780
785
  fields: h || [],
781
786
  metrics: C || []
782
787
  };
783
- const l = fe({
788
+ const l = he({
784
789
  controlType: e.type,
785
- participants: x || [],
790
+ participants: y || [],
786
791
  selectedCardIds: n
787
792
  });
788
793
  return {
@@ -795,107 +800,107 @@ function ca({
795
800
  target: l.metricTargetMap[c.value]
796
801
  })) : []
797
802
  };
798
- }, P = (e) => {
799
- if (!E(e.control.type))
803
+ }, Z = (e) => {
804
+ if (!q(e.control.type))
800
805
  return {
801
806
  nextControl: e.control,
802
807
  cardBindingsById: void 0
803
808
  };
804
- const n = (m == null ? void 0 : m[e.control.id]) || [], l = fe({
809
+ const n = (m == null ? void 0 : m[e.control.id]) || [], l = he({
805
810
  controlType: e.control.type,
806
- participants: x || [],
811
+ participants: y || [],
807
812
  selectedCardIds: e.nextSelectedCardIds
808
- }), c = Ut({
813
+ }), c = Kt({
809
814
  control: e.control,
810
815
  choices: l.choices
811
- }), y = Object.fromEntries(
812
- n.filter((D) => !e.nextSelectedCardIds.includes(D)).map((D) => [D, void 0])
816
+ }), g = Object.fromEntries(
817
+ n.filter((w) => !e.nextSelectedCardIds.includes(w)).map((w) => [w, void 0])
813
818
  );
814
819
  return e.nextSelectedCardIds.length > 0 && c.source.kind === "manual" && c.source.options.length > 0 && Object.assign(
815
- y,
816
- je({
820
+ g,
821
+ Re({
817
822
  control: c,
818
- participants: x || [],
823
+ participants: y || [],
819
824
  selectedCardIds: e.nextSelectedCardIds
820
825
  })
821
826
  ), {
822
827
  nextControl: c,
823
- cardBindingsById: y
828
+ cardBindingsById: g
824
829
  };
825
- }, F = z((e, n = i, l = { type: "update" }) => {
826
- const c = e.map((y) => (he({
827
- control: y,
830
+ }, L = z((e, n = i, l = { type: "update" }) => {
831
+ const c = e.map((g) => (be({
832
+ control: g,
828
833
  defaultValues: n
829
- }), Tt(
830
- y
834
+ }), Vt(
835
+ g
831
836
  )));
832
837
  f(c, n, l);
833
- }, [i, f]), J = (e, n) => {
838
+ }, [i, f]), ee = (e, n) => {
834
839
  const l = r.find(
835
- (w) => w.id === e
840
+ (T) => T.id === e
836
841
  );
837
- let c = r.map((w) => w.id !== e ? w : n(w));
838
- const y = c.find(
839
- (w) => w.id === e
842
+ let c = r.map((T) => T.id !== e ? T : n(T));
843
+ const g = c.find(
844
+ (T) => T.id === e
840
845
  );
841
- let D, p;
842
- if (y && s === "dashboard" && (y.type === "field_selector" || y.type === "metric_selector")) {
843
- const w = (m == null ? void 0 : m[y.id]) || [], K = P({
844
- control: y,
845
- nextSelectedCardIds: w
846
+ let w, p;
847
+ if (g && s === "dashboard" && (g.type === "field_selector" || g.type === "metric_selector")) {
848
+ const T = (m == null ? void 0 : m[g.id]) || [], Y = Z({
849
+ control: g,
850
+ nextSelectedCardIds: T
846
851
  });
847
852
  c = c.map(
848
- (R) => R.id === e ? K.nextControl : R
849
- ), D = K.cardBindingsById, p = [y.id];
853
+ (U) => U.id === e ? Y.nextControl : U
854
+ ), w = Y.cardBindingsById, p = [g.id];
850
855
  } else if (l && s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector")) {
851
- const w = (m == null ? void 0 : m[l.id]) || [];
852
- D = Object.fromEntries(
853
- w.map((K) => [K, void 0])
856
+ const T = (m == null ? void 0 : m[l.id]) || [];
857
+ w = Object.fromEntries(
858
+ T.map((Y) => [Y, void 0])
854
859
  ), p = [l.id];
855
860
  }
856
- const k = c.find(
857
- (w) => w.id === e
861
+ const S = c.find(
862
+ (T) => T.id === e
858
863
  );
859
- let _ = i;
860
- if (l && k) {
861
- const w = he({
864
+ let F = i;
865
+ if (l && S) {
866
+ const T = be({
862
867
  control: l,
863
868
  defaultValues: i
864
869
  });
865
- l.source.kind === "manual" && k.source.kind === "sql_query" && (B.current[e] = w);
866
- const K = w === void 0 && l.source.kind === "sql_query" && k.source.kind === "manual" ? B.current[e] : w, R = Qe({
870
+ l.source.kind === "manual" && S.source.kind === "sql_query" && (Q.current[e] = T);
871
+ const Y = T === void 0 && l.source.kind === "sql_query" && S.source.kind === "manual" ? Q.current[e] : T, U = Qe({
867
872
  previousControl: l,
868
- nextControl: k,
869
- currentDefaultValue: K
873
+ nextControl: S,
874
+ currentDefaultValue: Y
870
875
  });
871
- k.source.kind === "manual" && (B.current[e] = R), i && (_ = { ...i }, R === void 0 ? delete _[e] : _[e] = R), c = c.map(
872
- (Le) => Le.id === e ? { ...k, defaultValue: R } : Le
876
+ S.source.kind === "manual" && (Q.current[e] = U), i && (F = { ...i }, U === void 0 ? delete F[e] : F[e] = U), c = c.map(
877
+ (_e) => _e.id === e ? { ...S, defaultValue: U } : _e
873
878
  );
874
879
  }
875
- F(c, _, {
880
+ L(c, F, {
876
881
  type: "update",
877
- cardBindingsById: D,
882
+ cardBindingsById: w,
878
883
  affectedBindingControlIds: p
879
884
  });
880
885
  }, it = (e, n) => {
881
886
  const l = n.trim();
882
- if (l.length === 0 || l === e || I.has(l) || r.some(
883
- (D) => D.id === l && D.id !== e
887
+ if (l.length === 0 || l === e || N.has(l) || r.some(
888
+ (w) => w.id === l && w.id !== e
884
889
  ))
885
890
  return;
886
891
  const c = r.map(
887
- (D) => D.id === e ? { ...D, id: l } : D
892
+ (w) => w.id === e ? { ...w, id: l } : w
888
893
  );
889
894
  if (!i) {
890
- F(c, void 0, {
895
+ L(c, void 0, {
891
896
  type: "rename",
892
897
  oldId: e,
893
898
  newId: l
894
899
  });
895
900
  return;
896
901
  }
897
- const y = { ...i };
898
- Object.prototype.hasOwnProperty.call(y, e) && (y[l] = y[e], delete y[e]), F(c, y, {
902
+ const g = { ...i };
903
+ Object.prototype.hasOwnProperty.call(g, e) && (g[l] = g[e], delete g[e]), L(c, g, {
899
904
  type: "rename",
900
905
  oldId: e,
901
906
  newId: l
@@ -903,101 +908,101 @@ function ca({
903
908
  }, dt = (e) => {
904
909
  const n = r.filter((c) => c.id !== e);
905
910
  if (!i) {
906
- F(n, void 0, { type: "remove", controlId: e });
911
+ L(n, void 0, { type: "remove", controlId: e });
907
912
  return;
908
913
  }
909
914
  const l = { ...i };
910
- delete l[e], F(n, l, { type: "remove", controlId: e });
915
+ delete l[e], L(n, l, { type: "remove", controlId: e });
911
916
  }, ct = z(() => {
912
- T.current = void 0, S({
917
+ I.current = void 0, D({
913
918
  step: 1,
914
- control: te(s, r, Array.from(I))
915
- }), $(null), X(null);
916
- }, [r, I, s]), W = (e) => {
917
- S(
919
+ control: re(s, r, Array.from(N))
920
+ }), P(null), H(null);
921
+ }, [r, N, s]), te = (e) => {
922
+ D(
918
923
  (n) => n && (() => {
919
924
  const l = e(n.control);
920
- n.control.source.kind === "manual" && l.source.kind === "sql_query" && (T.current = n.defaultValue);
921
- const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? T.current : n.defaultValue, y = Qe({
925
+ n.control.source.kind === "manual" && l.source.kind === "sql_query" && (I.current = n.defaultValue);
926
+ const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? I.current : n.defaultValue, g = Qe({
922
927
  previousControl: n.control,
923
928
  nextControl: l,
924
929
  currentDefaultValue: c
925
930
  });
926
- return l.source.kind === "manual" && (T.current = y), {
931
+ return l.source.kind === "manual" && (I.current = g), {
927
932
  ...n,
928
933
  control: l,
929
- defaultValue: y
934
+ defaultValue: g
930
935
  };
931
936
  })()
932
937
  );
933
- }, Ve = (e) => {
934
- S(
935
- (n) => n && (n.control.source.kind === "manual" && (T.current = e), {
938
+ }, Ie = (e) => {
939
+ D(
940
+ (n) => n && (n.control.source.kind === "manual" && (I.current = e), {
936
941
  ...n,
937
942
  defaultValue: e
938
943
  })
939
944
  );
940
- }, ce = (() => {
945
+ }, ue = (() => {
941
946
  if (!a)
942
947
  return !1;
943
- if (a.step === 2 && E(a.control.type))
948
+ if (a.step === 2 && q(a.control.type))
944
949
  return (a.selectedCardIds || []).length > 0;
945
950
  if (a.step !== 2 && a.step !== 3 || !a.control.label.trim())
946
951
  return !1;
947
952
  const n = a.control.source.kind === "sql_query" ? a.control : ze(a.control);
948
- if (n.source.kind === "manual" && (Vt(n) && n.source.options.length === 0 || n.source.options.some(
953
+ if (n.source.kind === "manual" && (Et(n) && n.source.options.length === 0 || n.source.options.some(
949
954
  (c) => c.label.trim().length === 0 || c.value.trim().length === 0
950
955
  )))
951
956
  return !1;
952
957
  if (n.source.kind === "sql_query") {
953
- const { connectionId: l, sql: c, valueColumn: y } = n.source;
954
- return l.trim().length > 0 && c.trim().length > 0 && y.trim().length > 0;
958
+ const { connectionId: l, sql: c, valueColumn: g } = n.source;
959
+ return l.trim().length > 0 && c.trim().length > 0 && g.trim().length > 0;
955
960
  }
956
- return It(
957
- ae(n, a.defaultValue)
961
+ return qt(
962
+ se(n, a.defaultValue)
958
963
  );
959
- })(), Ie = () => {
960
- var D;
964
+ })(), Ve = () => {
965
+ var w;
961
966
  if (!a)
962
967
  return;
963
- const e = ze(a.control), n = Rt({
968
+ const e = ze(a.control), n = $t({
964
969
  label: e.label,
965
970
  fallbackId: e.id,
966
971
  existingControls: r,
967
- reservedIds: Array.from(I)
972
+ reservedIds: Array.from(N)
968
973
  }), l = {
969
974
  ...e,
970
975
  id: n
971
- }, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((D = a.selectedCardIds) != null && D.length) ? je({
976
+ }, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((w = a.selectedCardIds) != null && w.length) ? Re({
972
977
  control: l,
973
- participants: x || [],
978
+ participants: y || [],
974
979
  selectedCardIds: a.selectedCardIds
975
- }) : void 0, y = ae(
980
+ }) : void 0, g = se(
976
981
  l,
977
982
  a.defaultValue
978
983
  );
979
- S({
984
+ D({
980
985
  step: s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") ? 4 : 3,
981
986
  control: l,
982
- defaultValue: y,
987
+ defaultValue: g,
983
988
  createdControlId: n,
984
989
  selectedCardIds: a.selectedCardIds,
985
990
  cardBindingsById: c
986
991
  });
987
- }, ue = z(() => {
988
- S(null);
989
- }, []), qe = z(() => {
992
+ }, pe = z(() => {
993
+ D(null);
994
+ }, []), Ee = z(() => {
990
995
  if (!(a != null && a.createdControlId)) {
991
- S(null);
996
+ D(null);
992
997
  return;
993
998
  }
994
- const e = a.control, n = a.createdControlId, l = ae(
999
+ const e = a.control, n = a.createdControlId, l = se(
995
1000
  e,
996
1001
  a.defaultValue
997
1002
  );
998
1003
  if (i) {
999
1004
  const c = { ...i };
1000
- l === void 0 ? delete c[n] : c[n] = l, F(
1005
+ l === void 0 ? delete c[n] : c[n] = l, L(
1001
1006
  [
1002
1007
  ...r,
1003
1008
  {
@@ -1012,7 +1017,7 @@ function ca({
1012
1017
  }
1013
1018
  );
1014
1019
  } else
1015
- F(
1020
+ L(
1016
1021
  [
1017
1022
  ...r,
1018
1023
  {
@@ -1026,12 +1031,12 @@ function ca({
1026
1031
  cardBindingsById: a.cardBindingsById
1027
1032
  }
1028
1033
  );
1029
- $(n), S(null), V == null || V();
1030
- }, [r, a, i, F, V]), ut = a ? E(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ee = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${qt(a.control.label) || a.control.id}]]` : "", pe = Oe({
1034
+ P(n), D(null), k == null || k();
1035
+ }, [r, a, i, L, k]), ut = a ? q(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], qe = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Ft(a.control.label) || a.control.id}]]` : "", me = Oe({
1031
1036
  controls: r,
1032
1037
  defaultValues: i
1033
- }), me = a ? [...r, a.control] : r, _e = a ? Oe({
1034
- controls: me,
1038
+ }), fe = a ? [...r, a.control] : r, Fe = a ? Oe({
1039
+ controls: fe,
1035
1040
  defaultValues: i,
1036
1041
  overrides: [
1037
1042
  {
@@ -1039,11 +1044,11 @@ function ca({
1039
1044
  value: a.defaultValue
1040
1045
  }
1041
1046
  ]
1042
- }) : pe;
1047
+ }) : me;
1043
1048
  return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
1044
1049
  a ? /* @__PURE__ */ d("div", { className: "space-y-4 pb-1", children: [
1045
1050
  /* @__PURE__ */ t(
1046
- Ht,
1051
+ Jt,
1047
1052
  {
1048
1053
  currentStep: a.step,
1049
1054
  labels: ut
@@ -1055,32 +1060,32 @@ function ca({
1055
1060
  "aggregation_selector",
1056
1061
  "field_selector",
1057
1062
  "metric_selector"
1058
- ]), n = Q.filter(
1059
- (y) => !e.has(y.value)
1060
- ), l = Q.filter(
1061
- (y) => e.has(y.value)
1062
- ), c = (y) => /* @__PURE__ */ d(
1063
+ ]), n = R.filter(
1064
+ (g) => !e.has(g.value)
1065
+ ), l = R.filter(
1066
+ (g) => e.has(g.value)
1067
+ ), c = (g) => /* @__PURE__ */ d(
1063
1068
  "button",
1064
1069
  {
1065
1070
  type: "button",
1066
1071
  className: "rounded-[6px] 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",
1067
- onClick: () => S(
1068
- Wt({
1072
+ onClick: () => D(
1073
+ ea({
1069
1074
  scope: s,
1070
1075
  existingControls: r,
1071
- reservedIds: Array.from(I),
1072
- type: y.value
1076
+ reservedIds: Array.from(N),
1077
+ type: g.value
1073
1078
  })
1074
1079
  ),
1075
1080
  children: [
1076
- /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: y.label }),
1077
- /* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: y.description })
1081
+ /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: g.label }),
1082
+ /* @__PURE__ */ t("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: g.description })
1078
1083
  ]
1079
1084
  },
1080
- y.value
1085
+ g.value
1081
1086
  );
1082
1087
  return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
1083
- s === "card" && (g == null ? void 0 : g.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,
1088
+ s === "card" && (v == null ? void 0 : v.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,
1084
1089
  n.length > 0 && /* @__PURE__ */ d("div", { className: "space-y-1.5", children: [
1085
1090
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input controls" }),
1086
1091
  /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: n.map(c) })
@@ -1090,15 +1095,15 @@ function ca({
1090
1095
  /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: l.map(c) })
1091
1096
  ] }),
1092
1097
  /* @__PURE__ */ t(
1093
- se,
1098
+ oe,
1094
1099
  {
1095
1100
  secondary: /* @__PURE__ */ t(
1096
- q,
1101
+ V,
1097
1102
  {
1098
1103
  type: "button",
1099
1104
  variant: "outline",
1100
1105
  size: "xs",
1101
- onClick: ue,
1106
+ onClick: pe,
1102
1107
  children: "Back to controls"
1103
1108
  }
1104
1109
  )
@@ -1106,13 +1111,13 @@ function ca({
1106
1111
  )
1107
1112
  ] });
1108
1113
  })(),
1109
- a.step === 2 && E(a.control.type) && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1114
+ a.step === 2 && q(a.control.type) && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1110
1115
  /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1111
1116
  /* @__PURE__ */ t(
1112
1117
  ot,
1113
1118
  {
1114
1119
  control: a.control,
1115
- onChange: (e) => W((n) => ({
1120
+ onChange: (e) => te((n) => ({
1116
1121
  ...n,
1117
1122
  label: e
1118
1123
  }))
@@ -1120,7 +1125,7 @@ function ca({
1120
1125
  ),
1121
1126
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
1122
1127
  ] }),
1123
- H.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-[6px] 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-[6px] border border-border/60 bg-background p-2", children: H.map((e) => {
1128
+ W.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-[6px] 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-[6px] border border-border/60 bg-background p-2", children: W.map((e) => {
1124
1129
  const n = (a.selectedCardIds || []).includes(e.cardId);
1125
1130
  return /* @__PURE__ */ d(
1126
1131
  "label",
@@ -1128,17 +1133,17 @@ function ca({
1128
1133
  className: "flex items-start gap-2 rounded-[4px] px-1.5 py-1 text-[13px] hover:bg-muted/40",
1129
1134
  children: [
1130
1135
  /* @__PURE__ */ t(
1131
- Et,
1136
+ _t,
1132
1137
  {
1133
1138
  checked: n,
1134
- onCheckedChange: (l) => S(
1139
+ onCheckedChange: (l) => D(
1135
1140
  (c) => c && {
1136
1141
  ...c,
1137
1142
  selectedCardIds: l === !0 ? [
1138
1143
  ...c.selectedCardIds || [],
1139
1144
  e.cardId
1140
1145
  ] : (c.selectedCardIds || []).filter(
1141
- (y) => y !== e.cardId
1146
+ (g) => g !== e.cardId
1142
1147
  )
1143
1148
  }
1144
1149
  )
@@ -1154,15 +1159,15 @@ function ca({
1154
1159
  );
1155
1160
  }) }),
1156
1161
  /* @__PURE__ */ t(
1157
- se,
1162
+ oe,
1158
1163
  {
1159
1164
  secondary: /* @__PURE__ */ t(
1160
- q,
1165
+ V,
1161
1166
  {
1162
1167
  type: "button",
1163
1168
  variant: "outline",
1164
1169
  size: "xs",
1165
- onClick: () => S(
1170
+ onClick: () => D(
1166
1171
  (e) => e && {
1167
1172
  ...e,
1168
1173
  step: 1,
@@ -1173,80 +1178,80 @@ function ca({
1173
1178
  }
1174
1179
  ),
1175
1180
  primary: /* @__PURE__ */ t(
1176
- q,
1181
+ V,
1177
1182
  {
1178
1183
  type: "button",
1179
1184
  size: "xs",
1180
- onClick: () => S(
1185
+ onClick: () => D(
1181
1186
  (e) => e && {
1182
1187
  ...e,
1183
1188
  step: 3
1184
1189
  }
1185
1190
  ),
1186
- disabled: !ce,
1191
+ disabled: !ue,
1187
1192
  children: "Next"
1188
1193
  }
1189
1194
  )
1190
1195
  }
1191
1196
  )
1192
1197
  ] }),
1193
- a.step === 2 && !E(a.control.type) && /* @__PURE__ */ t(
1194
- Re,
1198
+ a.step === 2 && !q(a.control.type) && /* @__PURE__ */ t(
1199
+ je,
1195
1200
  {
1196
1201
  control: a.control,
1197
1202
  defaultValue: a.defaultValue,
1198
1203
  availableFieldChoices: j.fields,
1199
1204
  availableMetricChoices: j.metrics,
1200
- previewControlDefinitions: me,
1201
- previewControlValues: _e,
1202
- onControlChange: (e) => W(() => e),
1203
- onLabelChange: (e) => W((n) => ({
1205
+ previewControlDefinitions: fe,
1206
+ previewControlValues: Fe,
1207
+ onControlChange: (e) => te(() => e),
1208
+ onLabelChange: (e) => te((n) => ({
1204
1209
  ...n,
1205
1210
  label: e
1206
1211
  })),
1207
- onDefaultValueChange: Ve,
1208
- onBack: () => S(
1212
+ onDefaultValueChange: Ie,
1213
+ onBack: () => D(
1209
1214
  (e) => e && {
1210
1215
  ...e,
1211
1216
  step: 1
1212
1217
  }
1213
1218
  ),
1214
- onNext: Ie,
1215
- nextDisabled: !ce
1219
+ onNext: Ve,
1220
+ nextDisabled: !ue
1216
1221
  }
1217
1222
  ),
1218
- a.step === 3 && E(a.control.type) && /* @__PURE__ */ t(
1219
- Re,
1223
+ a.step === 3 && q(a.control.type) && /* @__PURE__ */ t(
1224
+ je,
1220
1225
  {
1221
1226
  control: a.control,
1222
1227
  defaultValue: a.defaultValue,
1223
1228
  availableFieldChoices: j.fields,
1224
1229
  availableMetricChoices: j.metrics,
1225
- previewControlDefinitions: me,
1226
- previewControlValues: _e,
1227
- onControlChange: (e) => W(() => e),
1228
- onLabelChange: (e) => W((n) => ({
1230
+ previewControlDefinitions: fe,
1231
+ previewControlValues: Fe,
1232
+ onControlChange: (e) => te(() => e),
1233
+ onLabelChange: (e) => te((n) => ({
1229
1234
  ...n,
1230
1235
  label: e
1231
1236
  })),
1232
- onDefaultValueChange: Ve,
1233
- onBack: () => S(
1237
+ onDefaultValueChange: Ie,
1238
+ onBack: () => D(
1234
1239
  (e) => e && {
1235
1240
  ...e,
1236
1241
  step: 2
1237
1242
  }
1238
1243
  ),
1239
- onNext: Ie,
1240
- nextDisabled: !ce
1244
+ onNext: Ve,
1245
+ nextDisabled: !ue
1241
1246
  }
1242
1247
  ),
1243
- a.step === 3 && !E(a.control.type) && /* @__PURE__ */ t(
1248
+ a.step === 3 && !q(a.control.type) && /* @__PURE__ */ t(
1244
1249
  $e,
1245
1250
  {
1246
1251
  control: a.control,
1247
1252
  scope: s,
1248
- createdReference: Ee,
1249
- explorerContent: /* @__PURE__ */ d(U, { children: [
1253
+ createdReference: qe,
1254
+ explorerContent: /* @__PURE__ */ d($, { children: [
1250
1255
  "Open the card and use",
1251
1256
  " ",
1252
1257
  /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
@@ -1254,48 +1259,48 @@ function ca({
1254
1259
  "to choose what this control changes."
1255
1260
  ] }),
1256
1261
  sqlDescription: "Reference this control directly in the SQL editor.",
1257
- onBack: () => S(
1262
+ onBack: () => D(
1258
1263
  (e) => e && {
1259
1264
  ...e,
1260
1265
  step: 2
1261
1266
  }
1262
1267
  ),
1263
- onCancel: ue,
1264
- onDone: qe
1268
+ onCancel: pe,
1269
+ onDone: Ee
1265
1270
  }
1266
1271
  ),
1267
- a.step === 4 && E(a.control.type) && /* @__PURE__ */ t(
1272
+ a.step === 4 && q(a.control.type) && /* @__PURE__ */ t(
1268
1273
  $e,
1269
1274
  {
1270
1275
  control: a.control,
1271
1276
  scope: s,
1272
- createdReference: Ee,
1273
- summaryDetail: /* @__PURE__ */ d(U, { children: [
1277
+ createdReference: qe,
1278
+ summaryDetail: /* @__PURE__ */ d($, { children: [
1274
1279
  "Used by ",
1275
1280
  (a.selectedCardIds || []).length,
1276
1281
  " ",
1277
1282
  "selected card",
1278
1283
  (a.selectedCardIds || []).length === 1 ? "" : "s"
1279
1284
  ] }),
1280
- explorerContent: /* @__PURE__ */ t(U, { children: "Selected cards have been set up to respond to this control automatically." }),
1285
+ explorerContent: /* @__PURE__ */ t($, { children: "Selected cards have been set up to respond to this control automatically." }),
1281
1286
  sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
1282
- onBack: () => S(
1287
+ onBack: () => D(
1283
1288
  (e) => e && {
1284
1289
  ...e,
1285
1290
  step: 3
1286
1291
  }
1287
1292
  ),
1288
- onCancel: ue,
1289
- onDone: qe
1293
+ onCancel: pe,
1294
+ onDone: Ee
1290
1295
  }
1291
1296
  )
1292
1297
  ] }) : null,
1293
1298
  !a && r.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: u }) : null,
1294
1299
  !a && r.map((e) => {
1295
- const n = ee(e), l = v == null ? void 0 : v[e.id], c = he({
1300
+ const n = ae(e), l = x == null ? void 0 : x[e.id], c = be({
1296
1301
  control: e,
1297
1302
  defaultValues: i
1298
- }), y = de === e.id, D = "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";
1303
+ }), g = ce === e.id, w = "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";
1299
1304
  return /* @__PURE__ */ d("div", { className: "rounded-[6px] border border-border/60", children: [
1300
1305
  /* @__PURE__ */ d("div", { className: "flex items-center gap-2 px-3 py-2.5", children: [
1301
1306
  /* @__PURE__ */ d(
@@ -1303,16 +1308,16 @@ function ca({
1303
1308
  {
1304
1309
  type: "button",
1305
1310
  className: "flex min-w-0 flex-1 items-start gap-2 rounded-[4px] text-left focus:outline-none focus-visible:bg-muted/40",
1306
- onClick: () => $(
1311
+ onClick: () => P(
1307
1312
  (p) => p === e.id ? null : e.id
1308
1313
  ),
1309
1314
  children: [
1310
- y ? /* @__PURE__ */ t(Me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Be, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1315
+ g ? /* @__PURE__ */ t(Me, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Be, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1311
1316
  /* @__PURE__ */ d("div", { className: "min-w-0", children: [
1312
1317
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1313
1318
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
1314
- /* @__PURE__ */ t("span", { className: D, children: We(e.type).label }),
1315
- /* @__PURE__ */ t("span", { className: D, children: Ze(s, e.placement) })
1319
+ /* @__PURE__ */ t("span", { className: w, children: We(e.type).label }),
1320
+ /* @__PURE__ */ t("span", { className: w, children: Ze(s, e.placement) })
1316
1321
  ] }),
1317
1322
  /* @__PURE__ */ d("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
1318
1323
  et(e),
@@ -1323,7 +1328,7 @@ function ca({
1323
1328
  }
1324
1329
  ),
1325
1330
  /* @__PURE__ */ t(
1326
- q,
1331
+ V,
1327
1332
  {
1328
1333
  type: "button",
1329
1334
  size: "xs",
@@ -1331,77 +1336,77 @@ function ca({
1331
1336
  className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
1332
1337
  onClick: () => dt(e.id),
1333
1338
  "aria-label": `Remove ${e.label}`,
1334
- children: /* @__PURE__ */ t(_t, { className: "h-3.5 w-3.5" })
1339
+ children: /* @__PURE__ */ t(Lt, { className: "h-3.5 w-3.5" })
1335
1340
  }
1336
1341
  )
1337
1342
  ] }),
1338
- y && /* @__PURE__ */ d("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
1343
+ g && /* @__PURE__ */ d("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
1339
1344
  /* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-3", children: [
1340
1345
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1341
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1346
+ /* @__PURE__ */ t(X, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1342
1347
  /* @__PURE__ */ t(
1343
1348
  tt,
1344
1349
  {
1345
1350
  size: "xs",
1346
1351
  value: e.label,
1347
1352
  placeholder: "Control label",
1348
- onChange: (p) => J(e.id, (k) => ({
1349
- ...k,
1353
+ onChange: (p) => ee(e.id, (S) => ({
1354
+ ...S,
1350
1355
  label: p.target.value
1351
1356
  }))
1352
1357
  }
1353
1358
  )
1354
1359
  ] }),
1355
1360
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1356
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1361
+ /* @__PURE__ */ t(X, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1357
1362
  /* @__PURE__ */ d(
1358
- be,
1363
+ ge,
1359
1364
  {
1360
1365
  value: e.type,
1361
1366
  onValueChange: (p) => {
1362
- const k = at({
1367
+ const S = at({
1363
1368
  controls: r,
1364
1369
  controlId: e.id,
1365
1370
  nextType: p,
1366
1371
  defaultValues: i
1367
1372
  });
1368
- F(k.controls, k.defaultValues);
1373
+ L(S.controls, S.defaultValues);
1369
1374
  },
1370
1375
  children: [
1371
- /* @__PURE__ */ t(ge, { size: "xs", children: /* @__PURE__ */ t(ye, {}) }),
1372
- /* @__PURE__ */ t(xe, { children: Fe({
1376
+ /* @__PURE__ */ t(ye, { size: "xs", children: /* @__PURE__ */ t(xe, {}) }),
1377
+ /* @__PURE__ */ t(ve, { children: Le({
1373
1378
  scope: s,
1374
- card: g,
1379
+ card: v,
1375
1380
  includeType: e.type
1376
- }).map((p) => /* @__PURE__ */ t(ve, { value: p.value, children: p.label }, p.value)) })
1381
+ }).map((p) => /* @__PURE__ */ t(Ce, { value: p.value, children: p.label }, p.value)) })
1377
1382
  ]
1378
1383
  }
1379
1384
  )
1380
1385
  ] }),
1381
1386
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1382
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1387
+ /* @__PURE__ */ t(X, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1383
1388
  /* @__PURE__ */ d(
1384
- be,
1389
+ ge,
1385
1390
  {
1386
- value: e.placement || ie,
1387
- onValueChange: (p) => J(e.id, (k) => ({
1388
- ...k,
1391
+ value: e.placement || G,
1392
+ onValueChange: (p) => ee(e.id, (S) => ({
1393
+ ...S,
1389
1394
  placement: p
1390
1395
  })),
1391
1396
  children: [
1392
- /* @__PURE__ */ t(ge, { size: "xs", children: /* @__PURE__ */ t(ye, {}) }),
1393
- /* @__PURE__ */ t(xe, { children: oe.map((p) => /* @__PURE__ */ t(ve, { value: p.value, children: p.label }, p.value)) })
1397
+ /* @__PURE__ */ t(ye, { size: "xs", children: /* @__PURE__ */ t(xe, {}) }),
1398
+ /* @__PURE__ */ t(ve, { children: B.map((p) => /* @__PURE__ */ t(Ce, { value: p.value, children: p.label }, p.value)) })
1394
1399
  ]
1395
1400
  }
1396
1401
  )
1397
1402
  ] })
1398
1403
  ] }),
1399
- E(e.type) ? /* @__PURE__ */ t(
1400
- Ft,
1404
+ q(e.type) ? /* @__PURE__ */ t(
1405
+ zt,
1401
1406
  {
1402
1407
  type: e.type,
1403
1408
  participants: Ae(
1404
- x || [],
1409
+ y || [],
1405
1410
  e.type
1406
1411
  ).map((p) => ({
1407
1412
  cardId: p.cardId,
@@ -1410,15 +1415,15 @@ function ca({
1410
1415
  })),
1411
1416
  selectedCardIds: (m == null ? void 0 : m[e.id]) || [],
1412
1417
  onChange: (p) => {
1413
- const k = P({
1418
+ const S = Z({
1414
1419
  control: e,
1415
1420
  nextSelectedCardIds: p
1416
- }), _ = r.map(
1417
- (w) => w.id === e.id ? k.nextControl : w
1421
+ }), F = r.map(
1422
+ (T) => T.id === e.id ? S.nextControl : T
1418
1423
  );
1419
- F(_, i, {
1424
+ L(F, i, {
1420
1425
  type: "update",
1421
- cardBindingsById: k.cardBindingsById
1426
+ cardBindingsById: S.cardBindingsById
1422
1427
  });
1423
1428
  }
1424
1429
  }
@@ -1430,9 +1435,9 @@ function ca({
1430
1435
  availableFieldChoices: n.fields,
1431
1436
  availableMetricChoices: n.metrics,
1432
1437
  previewControlDefinitions: r,
1433
- previewControlValues: pe,
1438
+ previewControlValues: me,
1434
1439
  controlLifecycle: "edit",
1435
- onChange: (p) => J(e.id, () => p)
1440
+ onChange: (p) => ee(e.id, () => p)
1436
1441
  }
1437
1442
  ),
1438
1443
  e.initialValueStrategy === "saved_default" && /* @__PURE__ */ t(
@@ -1443,45 +1448,45 @@ function ca({
1443
1448
  allowNoDefault: !0,
1444
1449
  allowCardDefault: !0,
1445
1450
  previewControlDefinitions: r,
1446
- previewControlValues: pe,
1451
+ previewControlValues: me,
1447
1452
  onChange: (p) => {
1448
- const k = r.map(
1449
- (_) => _.id === e.id ? { ..._, defaultValue: p } : _
1453
+ const S = r.map(
1454
+ (F) => F.id === e.id ? { ...F, defaultValue: p } : F
1450
1455
  );
1451
- if (e.source.kind === "manual" && (B.current[e.id] = p), i) {
1452
- const _ = { ...i };
1453
- p === void 0 ? delete _[e.id] : _[e.id] = p, F(k, _);
1456
+ if (e.source.kind === "manual" && (Q.current[e.id] = p), i) {
1457
+ const F = { ...i };
1458
+ p === void 0 ? delete F[e.id] : F[e.id] = p, L(S, F);
1454
1459
  return;
1455
1460
  }
1456
- F(k, void 0);
1461
+ L(S, void 0);
1457
1462
  }
1458
1463
  }
1459
1464
  ),
1460
1465
  /* @__PURE__ */ d(
1461
- At,
1466
+ Ot,
1462
1467
  {
1463
- open: Z === e.id,
1464
- onOpenChange: (p) => X(p ? e.id : null),
1468
+ open: K === e.id,
1469
+ onOpenChange: (p) => H(p ? e.id : null),
1465
1470
  children: [
1466
- /* @__PURE__ */ t(zt, { asChild: !0, children: /* @__PURE__ */ d(
1467
- q,
1471
+ /* @__PURE__ */ t(Mt, { asChild: !0, children: /* @__PURE__ */ d(
1472
+ V,
1468
1473
  {
1469
1474
  type: "button",
1470
1475
  variant: "ghost",
1471
1476
  size: "xs",
1472
1477
  className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
1473
1478
  children: [
1474
- Z === e.id ? /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }),
1479
+ K === e.id ? /* @__PURE__ */ t(Me, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }),
1475
1480
  "Advanced"
1476
1481
  ]
1477
1482
  }
1478
1483
  ) }),
1479
- /* @__PURE__ */ d(Ot, { className: "space-y-3 pt-2", children: [
1484
+ /* @__PURE__ */ d(Bt, { className: "space-y-3 pt-2", children: [
1480
1485
  /* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
1481
1486
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1482
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Control ID" }),
1487
+ /* @__PURE__ */ t(X, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Control ID" }),
1483
1488
  /* @__PURE__ */ t(
1484
- Mt,
1489
+ Qt,
1485
1490
  {
1486
1491
  controlId: e.id,
1487
1492
  onCommit: (p) => it(e.id, p)
@@ -1490,19 +1495,19 @@ function ca({
1490
1495
  )
1491
1496
  ] }),
1492
1497
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1493
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1498
+ /* @__PURE__ */ t(X, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1494
1499
  /* @__PURE__ */ d(
1495
- be,
1500
+ ge,
1496
1501
  {
1497
1502
  value: e.initialValueStrategy,
1498
- onValueChange: (p) => J(e.id, (k) => ({
1499
- ...k,
1503
+ onValueChange: (p) => ee(e.id, (S) => ({
1504
+ ...S,
1500
1505
  initialValueStrategy: p
1501
1506
  })),
1502
1507
  children: [
1503
- /* @__PURE__ */ t(ge, { size: "xs", children: /* @__PURE__ */ t(ye, {}) }),
1504
- /* @__PURE__ */ t(xe, { children: Bt.map((p) => /* @__PURE__ */ t(
1505
- ve,
1508
+ /* @__PURE__ */ t(ye, { size: "xs", children: /* @__PURE__ */ t(xe, {}) }),
1509
+ /* @__PURE__ */ t(ve, { children: Rt.map((p) => /* @__PURE__ */ t(
1510
+ Ce,
1506
1511
  {
1507
1512
  value: p.value,
1508
1513
  children: p.label
@@ -1515,10 +1520,10 @@ function ca({
1515
1520
  ] })
1516
1521
  ] }),
1517
1522
  /* @__PURE__ */ t(
1518
- Qt,
1523
+ jt,
1519
1524
  {
1520
1525
  control: e,
1521
- onChange: (p) => J(e.id, () => p)
1526
+ onChange: (p) => ee(e.id, () => p)
1522
1527
  }
1523
1528
  )
1524
1529
  ] })
@@ -1529,66 +1534,66 @@ function ca({
1529
1534
  ] }, e.id);
1530
1535
  }),
1531
1536
  !a && /* @__PURE__ */ d(
1532
- q,
1537
+ V,
1533
1538
  {
1534
1539
  type: "button",
1535
1540
  variant: "outline",
1536
1541
  size: "xs",
1537
1542
  onClick: ct,
1538
1543
  children: [
1539
- /* @__PURE__ */ t(jt, { className: "h-3.5 w-3.5" }),
1544
+ /* @__PURE__ */ t(Ut, { className: "h-3.5 w-3.5" }),
1540
1545
  "Add control"
1541
1546
  ]
1542
1547
  }
1543
1548
  )
1544
1549
  ] });
1545
1550
  }
1546
- function ua(s) {
1551
+ function ma(s) {
1547
1552
  const {
1548
1553
  open: r,
1549
1554
  onOpenChange: o,
1550
1555
  initialCreateFlowActive: i = !1,
1551
1556
  dismissMode: f = "passive"
1552
- } = s, u = r !== void 0, [b, v] = M(!1), [h, C] = M(
1557
+ } = s, u = r !== void 0, [b, x] = M(!1), [h, C] = M(
1553
1558
  i
1554
- ), x = u ? r : b, m = z(
1555
- (V) => {
1556
- !V && h && f === "passive" || (u || v(V), V || C(!1), o == null || o(V));
1559
+ ), y = u ? r : b, m = z(
1560
+ (k) => {
1561
+ !k && h && f === "passive" || (u || x(k), k || C(!1), o == null || o(k));
1557
1562
  },
1558
1563
  [u, h, f, o]
1559
- ), g = z(() => {
1560
- u || v(!1), C(!1), o == null || o(!1);
1564
+ ), v = z(() => {
1565
+ u || x(!1), C(!1), o == null || o(!1);
1561
1566
  }, [u, o]);
1562
- Se(() => {
1563
- x || C(!1);
1564
- }, [x]);
1565
- const N = z(
1566
- (V) => {
1567
- h && V.preventDefault();
1567
+ De(() => {
1568
+ y || C(!1);
1569
+ }, [y]);
1570
+ const E = z(
1571
+ (k) => {
1572
+ h && k.preventDefault();
1568
1573
  },
1569
1574
  [h]
1570
1575
  );
1571
1576
  return {
1572
- forceClose: g,
1577
+ forceClose: v,
1573
1578
  handleOpenChange: m,
1574
1579
  isCreateFlowActive: h,
1575
- preventPassiveDismissDuringCreate: N,
1576
- resolvedOpen: x,
1580
+ preventPassiveDismissDuringCreate: E,
1581
+ resolvedOpen: y,
1577
1582
  setIsCreateFlowActive: C
1578
1583
  };
1579
1584
  }
1580
1585
  export {
1581
- ra as C,
1582
- la as E,
1583
- Yt as L,
1586
+ la as C,
1587
+ oa as E,
1588
+ Xt as L,
1584
1589
  lt as S,
1585
- sa as V,
1586
- na as a,
1587
- oa as b,
1588
- Xt as c,
1589
- ia as d,
1590
- ca as e,
1590
+ na as V,
1591
+ ia as a,
1592
+ da as b,
1593
+ Gt as c,
1594
+ ca as d,
1595
+ pa as e,
1591
1596
  nt as f,
1592
- da as g,
1593
- ua as u
1597
+ ua as g,
1598
+ ma as u
1594
1599
  };