react-semaphor 0.1.315 → 0.1.316

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 (46) hide show
  1. package/dist/brand-studio/index.js +65 -65
  2. package/dist/briefings/index.cjs +1 -0
  3. package/dist/briefings/index.js +848 -0
  4. package/dist/chunks/{braces-CWi8x9ww.js → braces-CDPz6CF2.js} +1 -1
  5. package/dist/chunks/{calendar-preferences-dialog-B3JYKgek.js → calendar-preferences-dialog-9NlFzHX8.js} +3 -3
  6. package/dist/chunks/{calendar-preferences-dialog-aODuCeYE.js → calendar-preferences-dialog-BDdxi7Xm.js} +1 -1
  7. package/dist/chunks/{chevrons-up-down-B2viXO2I.js → chevrons-up-down-BsdQRmJL.js} +1 -1
  8. package/dist/chunks/dashboard-briefing-launcher-5fM_KJoT.js +7321 -0
  9. package/dist/chunks/dashboard-briefing-launcher-CVxLt10p.js +96 -0
  10. package/dist/chunks/dashboard-controls-9YV-D1tD.js +2009 -0
  11. package/dist/chunks/dashboard-controls-UR_m0wD1.js +57 -0
  12. package/dist/chunks/{dashboard-json-zKDTezgS.js → dashboard-json-CKPID8Am.js} +2 -2
  13. package/dist/chunks/{dashboard-json-Duea3KSa.js → dashboard-json-ws4tortP.js} +1 -1
  14. package/dist/chunks/edit-dashboard-visual-CmxnZI8I.js +178 -0
  15. package/dist/chunks/{edit-dashboard-visual-MZCJaPiq.js → edit-dashboard-visual-ifKJLMTS.js} +807 -822
  16. package/dist/chunks/index-Xdag_85e.js +1298 -0
  17. package/dist/chunks/{index-CjRLHvSp.js → index-gcA9Rs35.js} +41203 -46487
  18. package/dist/chunks/{palette-CIuwlEiG.js → palette-BlxLchHy.js} +1 -1
  19. package/dist/chunks/{resource-management-panel-CM3Zsk9H.js → resource-management-panel-BduJanWW.js} +1 -1
  20. package/dist/chunks/{resource-management-panel-S0LXyguo.js → resource-management-panel-paSAzVj2.js} +81 -81
  21. package/dist/chunks/{save-_ALpoMy6.js → save-DVRQBMeb.js} +1 -1
  22. package/dist/chunks/{switch-B6fh8nb-.js → switch-sauemjyY.js} +199 -199
  23. package/dist/chunks/{use-create-flow-overlay-state-Cp7PYD-t.js → use-create-flow-overlay-state-DKV6tIc5.js} +254 -225
  24. package/dist/chunks/use-create-flow-overlay-state-DWnzVVlP.js +26 -0
  25. package/dist/chunks/{use-visual-utils-DDd0pAJ_.js → use-visual-utils-C8PDxg2w.js} +1 -1
  26. package/dist/chunks/{use-visual-utils-D9DsvP1v.js → use-visual-utils-Cs0-baCK.js} +48 -48
  27. package/dist/dashboard/index.cjs +1 -1
  28. package/dist/dashboard/index.js +1 -1
  29. package/dist/index.cjs +1 -1
  30. package/dist/index.js +232 -485
  31. package/dist/style.css +1 -1
  32. package/dist/surfboard/index.cjs +1 -1
  33. package/dist/surfboard/index.js +2 -2
  34. package/dist/types/briefings.d.ts +240 -0
  35. package/dist/types/dashboard.d.ts +1 -0
  36. package/dist/types/main.d.ts +619 -1017
  37. package/dist/types/surfboard.d.ts +1 -0
  38. package/dist/types/types.d.ts +411 -261
  39. package/package.json +7 -2
  40. package/dist/chunks/dashboard-controls-CSunAZVx.js +0 -57
  41. package/dist/chunks/dashboard-controls-jvJF-AJC.js +0 -2021
  42. package/dist/chunks/dashboard-filter-controls-launcher-B0i9xSZZ.js +0 -11
  43. package/dist/chunks/dashboard-filter-controls-launcher-DG6yRPmx.js +0 -1540
  44. package/dist/chunks/edit-dashboard-visual-QjRIAadP.js +0 -183
  45. package/dist/chunks/index-B7C8qBWC.js +0 -1330
  46. package/dist/chunks/use-create-flow-overlay-state-CqTBDwBF.js +0 -16
@@ -1,16 +1,16 @@
1
- import { c as De, i as L, g as le, u as ne, s as ft, t as ht, v as bt, a as oe, w as gt, a8 as yt, B as V, e as xt, X as Ke, h as Ye, f as Ge, a9 as vt, aa as Ct, ab as re, ac as Ae, ad as ze, ae as be, af as ge, ag as kt, ah as Oe, ai as Nt, aj as St, ak as se, al as Dt, am as Me, G as Be, an as Xe, ao as He, ap as Je, L as Y, x as We, y as ye, z as xe, A as ve, D as Ce, E as ke, aq as Ze, ar as wt, as as It, at as Qe, au as Tt, av as je, aw as Et, ax as Ne } from "./switch-B6fh8nb-.js";
2
- import { useEffect as ie, useMemo as z, useState as j, useRef as Se, useCallback as M, Fragment as Vt } from "react";
3
- import { a$ as qt, b0 as et, b1 as _t, b2 as Ft, b3 as Lt, b4 as At, b5 as zt, V as Ot, P as Mt, q as ce, b6 as tt, s as at, b7 as rt, b8 as Bt, o as Q, b9 as Qt, ba as jt, bb as Re, bc as Rt, bd as Ut, be as st, bf as lt, bg as Pt, bh as $t, bi as Kt, bj as Yt, bk as Gt, bl as Xt, bm as Ht, bn as Jt } from "./index-CjRLHvSp.js";
4
- import { jsx as t, jsxs as d, Fragment as $ } from "react/jsx-runtime";
5
- import { u as we } from "./use-visual-utils-D9DsvP1v.js";
6
- import { S as nt } from "./save-_ALpoMy6.js";
1
+ import { c as te, G as L, H as ne, u as oe, Y as ft, Z as ht, _ as bt, a as ie, a0 as gt, a9 as yt, B as V, e as xt, X as Pe, E as Ye, f as Ke, aa as vt, ab as Ct, ac as se, ad as Ae, ae as ze, af as ge, ag as ye, ah as kt, ai as Me, aj as Nt, ak as St, al as le, am as Dt, an as Oe, g as Be, ao as Xe, ap as Ge, aq as Ze, L as Y, a1 as Je, a2 as xe, a3 as ve, a4 as Ce, a5 as ke, a6 as Ne, ar as We, as as wt, at as It, au as Re, av as Tt, aw as Qe, ax as Et, ay as Se } from "./switch-sauemjyY.js";
2
+ import { useEffect as de, useMemo as z, useState as Q, useRef as De, useCallback as O, Fragment as Vt } from "react";
3
+ import { aS as _t, aT as et, aU as qt, aV as Ft, aW as Lt, aX as At, aY as zt, x as Mt, aZ as Ot, ac as ue, a_ as tt, ae as at, a$ as rt, b0 as Bt, o as R, b1 as Rt, b2 as Qt, b3 as je, av as jt, b4 as Ut, b5 as st, b6 as lt, b7 as $t, b8 as Ht, b9 as Pt, ba as Yt, bb as Kt, al as Xt, bc as Gt, bd as Zt } from "./index-gcA9Rs35.js";
4
+ import { jsx as t, jsxs as d, Fragment as H } from "react/jsx-runtime";
5
+ import { u as we } from "./use-visual-utils-Cs0-baCK.js";
6
+ import { S as nt } from "./save-DVRQBMeb.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
9
9
  *
10
10
  * This source code is licensed under the ISC license.
11
11
  * See the LICENSE file in the root directory of this source tree.
12
12
  */
13
- const ua = De("CircleX", [
13
+ const ua = te("CircleX", [
14
14
  ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
15
15
  ["path", { d: "m15 9-6 6", key: "1uzhvr" }],
16
16
  ["path", { d: "m9 9 6 6", key: "z0biqf" }]
@@ -21,7 +21,7 @@ const ua = De("CircleX", [
21
21
  * This source code is licensed under the ISC license.
22
22
  * See the LICENSE file in the root directory of this source tree.
23
23
  */
24
- const Wt = De("Library", [
24
+ const Jt = te("Library", [
25
25
  ["path", { d: "m16 6 4 14", key: "ji33uf" }],
26
26
  ["path", { d: "M12 6v14", key: "1n7gus" }],
27
27
  ["path", { d: "M8 8v12", key: "1gg7y9" }],
@@ -33,23 +33,50 @@ const Wt = De("Library", [
33
33
  * This source code is licensed under the ISC license.
34
34
  * See the LICENSE file in the root directory of this source tree.
35
35
  */
36
- const Zt = De("Link2", [
36
+ const Wt = te("Link2", [
37
37
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
38
38
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
39
39
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
40
40
  ]);
41
- function pa() {
41
+ /**
42
+ * @license lucide-react v0.453.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */
47
+ const pa = te("Rows3", [
48
+ ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
49
+ ["path", { d: "M21 9H3", key: "1338ky" }],
50
+ ["path", { d: "M21 15H3", key: "9uk58r" }]
51
+ ]);
52
+ /**
53
+ * @license lucide-react v0.453.0 - ISC
54
+ *
55
+ * This source code is licensed under the ISC license.
56
+ * See the LICENSE file in the root directory of this source tree.
57
+ */
58
+ const ma = te("SendHorizontal", [
59
+ [
60
+ "path",
61
+ {
62
+ d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z",
63
+ key: "117uat"
64
+ }
65
+ ],
66
+ ["path", { d: "M6 12h16", key: "s4cdu5" }]
67
+ ]);
68
+ function fa() {
42
69
  const s = L((h) => h.card.dataSource), {
43
70
  setSelectedConnectionId: r,
44
71
  setSelectedDatabaseName: o,
45
72
  setSelectedSchemaName: i,
46
73
  setSelectedTableName: p,
47
74
  setSelectedDatamodelId: u
48
- } = le();
49
- ie(() => {
75
+ } = ne();
76
+ de(() => {
50
77
  var S;
51
78
  if (!s) return;
52
- const { tableName: h, schemaName: y, databaseName: b, connectionId: v } = qt(s), g = (S = s.selectedEntities) == null ? void 0 : S[0], x = (g == null ? void 0 : g.type) === "model" && "id" in g ? g.id : "";
79
+ const { tableName: h, schemaName: y, databaseName: b, connectionId: v } = _t(s), g = (S = s.selectedEntities) == null ? void 0 : S[0], x = (g == null ? void 0 : g.type) === "model" && "id" in g ? g.id : "";
53
80
  r(v || ""), o(b || ""), i(y || ""), p(h || ""), u(x);
54
81
  }, [
55
82
  s,
@@ -65,7 +92,7 @@ function ot() {
65
92
  const s = L((g) => g.card), r = L((g) => g.frame), o = z(
66
93
  () => et(r, s),
67
94
  [r, s]
68
- ), { manifest: i } = _t(
95
+ ), { manifest: i } = qt(
69
96
  ((b = o == null ? void 0 : o.customCardPreferences) == null ? void 0 : b.url) || ""
70
97
  ), p = z(
71
98
  () => {
@@ -97,14 +124,14 @@ function ot() {
97
124
  p == null ? void 0 : p.slots
98
125
  ) ?? s.type, [o, u, y, s, p == null ? void 0 : p.slots]);
99
126
  }
100
- function ma({
127
+ function ha({
101
128
  type: s,
102
129
  isLinked: r,
103
130
  className: o,
104
131
  showLabel: i = !1,
105
132
  showLocal: p = !1
106
133
  }) {
107
- const u = ne((D) => D.selectedFrameId), h = Ot((D) => D.selectedVisual), y = L((D) => D.frame);
134
+ const u = oe((D) => D.selectedFrameId), h = Mt((D) => D.selectedVisual), y = L((D) => D.frame);
108
135
  let b;
109
136
  if (s)
110
137
  b = s;
@@ -140,8 +167,8 @@ function ma({
140
167
  library: "fill-blue-50 dark:fill-blue-950"
141
168
  }, S = {
142
169
  local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
143
- linked: /* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" }),
144
- library: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" })
170
+ linked: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
171
+ library: /* @__PURE__ */ t(Jt, { className: "h-3.5 w-3.5" })
145
172
  }, N = {
146
173
  local: "Local",
147
174
  linked: "Linked",
@@ -149,10 +176,10 @@ function ma({
149
176
  };
150
177
  return /* @__PURE__ */ t(ft, { children: /* @__PURE__ */ d(ht, { delayDuration: 300, children: [
151
178
  /* @__PURE__ */ t(bt, { asChild: !0, children: /* @__PURE__ */ d(
152
- Mt,
179
+ Ot,
153
180
  {
154
181
  variant: "outline",
155
- className: oe(
182
+ className: ie(
156
183
  "cursor-help select-none transition-all",
157
184
  v[b],
158
185
  o
@@ -167,7 +194,7 @@ function ma({
167
194
  gt,
168
195
  {
169
196
  side: "bottom",
170
- className: oe("max-w-xs", m[b]),
197
+ className: ie("max-w-xs", m[b]),
171
198
  children: [
172
199
  /* @__PURE__ */ t(yt, { className: x[b] }),
173
200
  /* @__PURE__ */ t("p", { children: g[b] })
@@ -194,9 +221,9 @@ function ea(s, r) {
194
221
  }
195
222
  function Ie(s) {
196
223
  const r = vt(s);
197
- return r ? (Q.error(r), !1) : !0;
224
+ return r ? (R.error(r), !1) : !0;
198
225
  }
199
- function fa({
226
+ function ba({
200
227
  className: s,
201
228
  variant: r = "outline"
202
229
  }) {
@@ -219,11 +246,11 @@ function fa({
219
246
  }
220
247
  );
221
248
  }
222
- function ha({
249
+ function ga({
223
250
  className: s,
224
251
  variant: r = "default"
225
252
  }) {
226
- const o = ce(), [i, p] = j(!1), u = ne(
253
+ const o = ue(), [i, p] = Q(!1), u = oe(
227
254
  (x) => x.actions.setIsDashboardPanelOpen
228
255
  ), { setIsVisualEditing: h } = Ye(), { getUpdatedFrame: y } = we(), b = at(), v = L((x) => x.frame), g = rt();
229
256
  return /* @__PURE__ */ t(
@@ -235,7 +262,7 @@ function ha({
235
262
  return;
236
263
  const S = (v == null ? void 0 : v.visualId) || (b == null ? void 0 : b.id);
237
264
  if (!S) {
238
- Q.error("No visual to save");
265
+ R.error("No visual to save");
239
266
  return;
240
267
  }
241
268
  p(!0), g.mutate(
@@ -247,13 +274,13 @@ function ha({
247
274
  },
248
275
  {
249
276
  onSuccess: () => {
250
- p(!1), u(!0), Q.success("Visual updated successfully"), o.invalidateQueries({
277
+ p(!1), u(!0), R.success("Visual updated successfully"), o.invalidateQueries({
251
278
  queryKey: ["resource-by-id", "visual", S],
252
279
  exact: !0
253
280
  });
254
281
  },
255
282
  onError: () => {
256
- p(!1), Q.error("Failed to update visual");
283
+ p(!1), R.error("Failed to update visual");
257
284
  }
258
285
  }
259
286
  );
@@ -261,31 +288,31 @@ function ha({
261
288
  className: s,
262
289
  size: "xs",
263
290
  variant: r,
264
- children: i ? /* @__PURE__ */ d($, { children: [
265
- /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
291
+ children: i ? /* @__PURE__ */ d(H, { children: [
292
+ /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5 animate-spin" }),
266
293
  "Saving"
267
- ] }) : /* @__PURE__ */ d($, { children: [
294
+ ] }) : /* @__PURE__ */ d(H, { children: [
268
295
  /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
269
296
  "Save to Library"
270
297
  ] })
271
298
  }
272
299
  );
273
300
  }
274
- function ba({
301
+ function ya({
275
302
  className: s
276
303
  }) {
277
- const r = ce(), [o, i] = j(!1), p = at(), u = L((N) => N.frame), h = ne((N) => N.selectedSheetId), y = ne((N) => N.dashboard), { updateFrame: b, setIsVisualEditing: v } = Ye(), { getUpdatedFrame: g } = we(), m = rt(), x = Bt();
304
+ const r = ue(), [o, i] = Q(!1), p = at(), u = L((N) => N.frame), h = oe((N) => N.selectedSheetId), y = oe((N) => N.dashboard), { updateFrame: b, setIsVisualEditing: v } = Ye(), { getUpdatedFrame: g } = we(), m = rt(), x = Bt();
278
305
  return /* @__PURE__ */ t(
279
306
  V,
280
307
  {
281
308
  onClick: async () => {
282
309
  if (!h) {
283
- Q.error("No sheet selected");
310
+ R.error("No sheet selected");
284
311
  return;
285
312
  }
286
313
  const N = (u == null ? void 0 : u.visualId) || (p == null ? void 0 : p.id);
287
314
  if (!N) {
288
- Q.error("No visual to update");
315
+ R.error("No visual to update");
289
316
  return;
290
317
  }
291
318
  i(!0);
@@ -295,25 +322,25 @@ function ba({
295
322
  i(!1);
296
323
  return;
297
324
  }
298
- const _ = {
325
+ const q = {
299
326
  ...D,
300
327
  visualId: N
301
328
  // Keep the link to library visual
302
- }, G = Qt(y, _.id), X = await x(_, {
303
- previousFrame: G
329
+ }, K = Rt(y, q.id), X = await x(q, {
330
+ previousFrame: K
304
331
  });
305
332
  await m.mutateAsync({
306
333
  visualId: N,
307
334
  data: {
308
335
  frameObject: D
309
336
  }
310
- }), b(h, _, {
337
+ }), b(h, q, {
311
338
  semanticExecutionPayload: X
312
- }), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", N] }), Q.success("Saved to library and applied locally"), setTimeout(() => {
339
+ }), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", N] }), R.success("Saved to library and applied locally"), setTimeout(() => {
313
340
  v(!1);
314
341
  }, 300);
315
342
  } catch (D) {
316
- console.error("Failed to save and apply:", D), Q.error(
343
+ console.error("Failed to save and apply:", D), R.error(
317
344
  D instanceof Error ? D.message : "Failed to save and apply changes"
318
345
  );
319
346
  } finally {
@@ -324,18 +351,18 @@ function ba({
324
351
  size: "xs",
325
352
  variant: "default",
326
353
  disabled: o,
327
- children: o ? /* @__PURE__ */ d($, { children: [
328
- /* @__PURE__ */ t(Ge, { className: "h-3.5 w-3.5 animate-spin" }),
354
+ children: o ? /* @__PURE__ */ d(H, { children: [
355
+ /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5 animate-spin" }),
329
356
  "Saving..."
330
- ] }) : /* @__PURE__ */ d($, { children: [
357
+ ] }) : /* @__PURE__ */ d(H, { children: [
331
358
  /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
332
359
  "Save & Apply"
333
360
  ] })
334
361
  }
335
362
  );
336
363
  }
337
- function ga({ className: s }) {
338
- const { setTempQueryData: r, setSqlGen: o } = le(), i = ce(), p = L((m) => m.tempQueryData), u = L((m) => m.onClose), h = L((m) => m.card), y = ot(), b = z(() => y !== h.type ? { ...h, type: y } : h, [h, y]), { queryKey: v } = tt(b);
364
+ function xa({ className: s }) {
365
+ const { setTempQueryData: r, setSqlGen: o } = ne(), i = ue(), p = L((m) => m.tempQueryData), u = L((m) => m.onClose), h = L((m) => m.card), y = ot(), b = z(() => y !== h.type ? { ...h, type: y } : h, [h, y]), { queryKey: v } = tt(b);
339
366
  function g() {
340
367
  if (p) {
341
368
  const { queryKey: m, queryData: x } = p;
@@ -351,54 +378,54 @@ function ga({ className: s }) {
351
378
  size: "xs",
352
379
  variant: "outline",
353
380
  children: [
354
- /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" }),
381
+ /* @__PURE__ */ t(Pe, { className: "h-3.5 w-3.5" }),
355
382
  "Close"
356
383
  ]
357
384
  }
358
385
  );
359
386
  }
360
- function ya({
387
+ function va({
361
388
  label: s = "Clear",
362
389
  variant: r = "secondary",
363
390
  className: o
364
391
  } = {}) {
365
- const { setTempQueryData: i } = le(), p = ce(), u = L((O) => O.tempQueryData), h = L((O) => O.card), y = ot(), b = z(() => y !== h.type ? { ...h, type: y } : h, [h, y]), { queryKey: v } = tt(b), {
392
+ const { setTempQueryData: i } = ne(), p = ue(), u = L((M) => M.tempQueryData), h = L((M) => M.card), y = ot(), b = z(() => y !== h.type ? { ...h, type: y } : h, [h, y]), { queryKey: v } = tt(b), {
366
393
  setCardSql: g,
367
394
  setSqlGen: m,
368
395
  setCardPython: x,
369
396
  setCardCustomCfg: S,
370
397
  setCardPreferences: N,
371
398
  clearQueryConfig: D,
372
- setCardConfig: _,
373
- setCardType: G,
399
+ setCardConfig: q,
400
+ setCardType: K,
374
401
  setFrame: X,
375
- setCard: te,
376
- setActiveTabCardId: H
377
- } = le();
378
- function ue() {
379
- var J, ae, q, W;
380
- const O = p.getQueryData(v);
402
+ setCard: ae,
403
+ setActiveTabCardId: G
404
+ } = ne();
405
+ function pe() {
406
+ var Z, re, _, J;
407
+ const M = p.getQueryData(v);
381
408
  u != null && u.queryData || i({
382
409
  queryKey: v,
383
- queryData: O
384
- }), p.setQueryData(v, null), p.removeQueries({ queryKey: v, exact: !0 }), g(""), m({}), D(), _(void 0), x(""), S(""), N({});
385
- const a = L.getState().frame, T = L.getState().card, E = et(a, T), B = ((J = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((ae = E == null ? void 0 : E.customCardPreferences) != null && ae.dataInputCardIds) || (((q = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : q.minInputs) || 0) > 1 || (((W = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : W.maxInputs) || 0) > 1, R = ea(T, B);
410
+ queryData: M
411
+ }), p.setQueryData(v, null), p.removeQueries({ queryKey: v, exact: !0 }), g(""), m({}), D(), q(void 0), x(""), S(""), N({});
412
+ const a = L.getState().frame, T = L.getState().card, E = et(a, T), B = ((Z = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : Z.visualType) === "multiple" || !!((re = E == null ? void 0 : E.customCardPreferences) != null && re.dataInputCardIds) || (((_ = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : _.minInputs) || 0) > 1 || (((J = E == null ? void 0 : E.customCardPreferences) == null ? void 0 : J.maxInputs) || 0) > 1, j = ea(T, B);
386
413
  X({
387
414
  ...a,
388
415
  cards: a.cards.map(
389
- (U) => U.id === R.id ? R : U
416
+ (U) => U.id === j.id ? j : U
390
417
  )
391
- }), H(R.id), te(R), B || G("bar");
418
+ }), G(j.id), ae(j), B || K("bar");
392
419
  }
393
420
  return /* @__PURE__ */ d(
394
421
  V,
395
422
  {
396
- onClick: ue,
423
+ onClick: pe,
397
424
  className: o,
398
425
  size: "xs",
399
426
  variant: r,
400
427
  children: [
401
- /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5" }),
428
+ /* @__PURE__ */ t(Pe, { className: "h-3.5 w-3.5" }),
402
429
  s
403
430
  ]
404
431
  }
@@ -409,7 +436,7 @@ function it(s) {
409
436
  return /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
410
437
  /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
411
438
  /* @__PURE__ */ t(
412
- We,
439
+ Je,
413
440
  {
414
441
  size: "xs",
415
442
  value: r.label,
@@ -428,7 +455,7 @@ function ta(s) {
428
455
  /* @__PURE__ */ t(
429
456
  "span",
430
457
  {
431
- className: oe(
458
+ className: ie(
432
459
  "flex h-5 w-5 items-center justify-center rounded-full border text-[10px] font-medium tabular-nums",
433
460
  h ? "border-foreground bg-foreground text-background" : y ? "border-foreground/30 bg-foreground/10 text-foreground" : "border-border/60 bg-background text-muted-foreground"
434
461
  ),
@@ -438,7 +465,7 @@ function ta(s) {
438
465
  /* @__PURE__ */ t(
439
466
  "span",
440
467
  {
441
- className: oe(
468
+ className: ie(
442
469
  "text-[12px]",
443
470
  h ? "font-medium text-foreground" : "text-muted-foreground"
444
471
  ),
@@ -456,7 +483,7 @@ function ta(s) {
456
483
  ] }, i);
457
484
  }) }) });
458
485
  }
459
- function de(s) {
486
+ function ce(s) {
460
487
  const { secondary: r, tertiary: o, primary: i } = s;
461
488
  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: [
462
489
  r,
@@ -467,17 +494,17 @@ function de(s) {
467
494
  function aa(s) {
468
495
  const { control: r, scope: o, detail: i } = s;
469
496
  return /* @__PURE__ */ d("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
470
- /* @__PURE__ */ t(Jt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
497
+ /* @__PURE__ */ t(Zt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
471
498
  /* @__PURE__ */ d("div", { className: "min-w-0 space-y-0.5", children: [
472
499
  /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
473
500
  /* @__PURE__ */ d("div", { className: "text-[12px] text-muted-foreground", children: [
474
501
  Xe(r.type).label,
475
502
  " ·",
476
503
  " ",
477
- Je(r),
504
+ Ze(r),
478
505
  " ·",
479
506
  " ",
480
- He(o, r.placement)
507
+ Ge(o, r.placement)
481
508
  ] }),
482
509
  i ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: i }) : null
483
510
  ] })
@@ -526,7 +553,7 @@ function Ue(s) {
526
553
  }
527
554
  ),
528
555
  /* @__PURE__ */ t(
529
- de,
556
+ ce,
530
557
  {
531
558
  secondary: /* @__PURE__ */ t(V, { type: "button", variant: "outline", size: "xs", onClick: g, children: "Back" }),
532
559
  primary: /* @__PURE__ */ t(
@@ -549,8 +576,8 @@ const ra = /* @__PURE__ */ new Set([
549
576
  "field_selector",
550
577
  "metric_selector"
551
578
  ]);
552
- function Pe(s) {
553
- const { text: r, ariaLabel: o } = s, [i, p] = j(!1);
579
+ function $e(s) {
580
+ const { text: r, ariaLabel: o } = s, [i, p] = Q(!1);
554
581
  return /* @__PURE__ */ d(
555
582
  "button",
556
583
  {
@@ -571,7 +598,7 @@ function Pe(s) {
571
598
  }
572
599
  );
573
600
  }
574
- function $e(s) {
601
+ function He(s) {
575
602
  const {
576
603
  control: r,
577
604
  scope: o,
@@ -602,14 +629,14 @@ function $e(s) {
602
629
  /* @__PURE__ */ d("div", { className: "space-y-1.5 px-3 py-2.5", children: [
603
630
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
604
631
  /* @__PURE__ */ t(
605
- Pe,
632
+ $e,
606
633
  {
607
634
  text: i,
608
635
  ariaLabel: "Copy SQL control reference"
609
636
  }
610
637
  ),
611
638
  x ? /* @__PURE__ */ t(
612
- Pe,
639
+ $e,
613
640
  {
614
641
  text: x,
615
642
  ariaLabel: "Copy Jinja control reference"
@@ -634,7 +661,7 @@ function $e(s) {
634
661
  ] })
635
662
  ] }),
636
663
  /* @__PURE__ */ t(
637
- de,
664
+ ce,
638
665
  {
639
666
  secondary: /* @__PURE__ */ t(V, { type: "button", variant: "outline", size: "xs", onClick: y, children: "Back" }),
640
667
  tertiary: /* @__PURE__ */ t(V, { type: "button", variant: "outline", size: "xs", onClick: b, children: "Cancel" }),
@@ -644,33 +671,33 @@ function $e(s) {
644
671
  ] });
645
672
  }
646
673
  function sa(s) {
647
- const r = re(
674
+ const r = se(
648
675
  s.scope,
649
676
  s.existingControls,
650
677
  s.reservedIds
651
678
  ), o = s.type === r.type ? {
652
679
  ...r,
653
- label: Ne[s.type]
680
+ label: Se[s.type]
654
681
  } : {
655
- ...Ze({
682
+ ...We({
656
683
  controls: [
657
684
  {
658
685
  ...r,
659
- label: Ne[s.type]
686
+ label: Se[s.type]
660
687
  }
661
688
  ],
662
689
  controlId: r.id,
663
690
  nextType: s.type
664
691
  }).controls[0],
665
- label: Ne[s.type]
692
+ label: Se[s.type]
666
693
  };
667
694
  return {
668
695
  step: 2,
669
696
  control: o,
670
- defaultValue: se(o, void 0)
697
+ defaultValue: le(o, void 0)
671
698
  };
672
699
  }
673
- function xa({
700
+ function Ca({
674
701
  scope: s,
675
702
  controls: r,
676
703
  reservedControlIds: o,
@@ -688,25 +715,25 @@ function xa({
688
715
  onCreateFlowActiveChange: N,
689
716
  onCreateFlowComplete: D
690
717
  }) {
691
- const _ = z(
718
+ const q = z(
692
719
  () => new Set(o || []),
693
720
  [o]
694
- ), G = wt(s), X = Ct(s), [te, H] = j(
721
+ ), K = wt(s), X = Ct(s), [ae, G] = Q(
695
722
  null
696
- ), [ue, O] = j(
723
+ ), [pe, M] = Q(
697
724
  null
698
- ), [a, T] = j(
725
+ ), [a, T] = Q(
699
726
  () => h ? {
700
727
  step: 1,
701
- control: re(s, r, Array.from(_))
728
+ control: se(s, r, Array.from(q))
702
729
  } : null
703
- ), E = Se({}), B = Se(void 0), R = Se(h), J = z(() => {
730
+ ), E = De({}), B = De(void 0), j = De(h), Z = z(() => {
704
731
  const e = Ae({ scope: s, card: x });
705
732
  if (!S)
706
733
  return e;
707
734
  const n = new Set(S);
708
735
  return e.filter((l) => n.has(l.value));
709
- }, [S, x, s]), ae = M(
736
+ }, [S, x, s]), re = O(
710
737
  (e) => {
711
738
  const n = Ae({
712
739
  scope: s,
@@ -719,10 +746,10 @@ function xa({
719
746
  return n.filter((c) => l.has(c.value));
720
747
  },
721
748
  [S, x, s]
722
- ), q = M(
749
+ ), _ = O(
723
750
  (e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
724
751
  [s]
725
- ), W = z(
752
+ ), J = z(
726
753
  () => a ? ze(
727
754
  g || [],
728
755
  a.control.type
@@ -734,12 +761,12 @@ function xa({
734
761
  fields: b || [],
735
762
  metrics: v || []
736
763
  };
737
- if (!q(a.control.type))
764
+ if (!_(a.control.type))
738
765
  return {
739
766
  fields: b || [],
740
767
  metrics: v || []
741
768
  };
742
- const e = a.selectedCardIds || [], n = be({
769
+ const e = a.selectedCardIds || [], n = ge({
743
770
  controlType: a.control.type,
744
771
  participants: g || [],
745
772
  selectedCardIds: e
@@ -758,20 +785,20 @@ function xa({
758
785
  b,
759
786
  v,
760
787
  a,
761
- q,
788
+ _,
762
789
  g
763
790
  ]);
764
- ie(() => {
791
+ de(() => {
765
792
  N == null || N(!!a);
766
- }, [a, N]), ie(() => {
767
- const e = h && !R.current;
768
- R.current = h, e && (T({
793
+ }, [a, N]), de(() => {
794
+ const e = h && !j.current;
795
+ j.current = h, e && (T({
769
796
  step: 1,
770
- control: re(s, r, Array.from(_))
771
- }), O(null), H(null));
772
- }, [r, h, _, s]);
797
+ control: se(s, r, Array.from(q))
798
+ }), M(null), G(null));
799
+ }, [r, h, q, s]);
773
800
  const dt = (e) => {
774
- if (!q(e.type))
801
+ if (!_(e.type))
775
802
  return {
776
803
  fields: b || [],
777
804
  metrics: v || []
@@ -782,7 +809,7 @@ function xa({
782
809
  fields: b || [],
783
810
  metrics: v || []
784
811
  };
785
- const l = be({
812
+ const l = ge({
786
813
  controlType: e.type,
787
814
  participants: g || [],
788
815
  selectedCardIds: n
@@ -798,12 +825,12 @@ function xa({
798
825
  })) : []
799
826
  };
800
827
  }, Te = (e) => {
801
- if (!q(e.control.type))
828
+ if (!_(e.control.type))
802
829
  return {
803
830
  nextControl: e.control,
804
831
  cardBindingsById: void 0
805
832
  };
806
- const n = (m == null ? void 0 : m[e.control.id]) || [], l = be({
833
+ const n = (m == null ? void 0 : m[e.control.id]) || [], l = ge({
807
834
  controlType: e.control.type,
808
835
  participants: g || [],
809
836
  selectedCardIds: e.nextSelectedCardIds
@@ -815,7 +842,7 @@ function xa({
815
842
  );
816
843
  return e.nextSelectedCardIds.length > 0 && c.source.kind === "manual" && c.source.options.length > 0 && Object.assign(
817
844
  C,
818
- je({
845
+ Qe({
819
846
  control: c,
820
847
  participants: g || [],
821
848
  selectedCardIds: e.nextSelectedCardIds
@@ -824,9 +851,9 @@ function xa({
824
851
  nextControl: c,
825
852
  cardBindingsById: C
826
853
  };
827
- }, A = M(
854
+ }, A = O(
828
855
  (e, n = i, l = { type: "update" }) => {
829
- const c = e.map((C) => (ge({
856
+ const c = e.map((C) => (ye({
830
857
  control: C,
831
858
  defaultValues: n
832
859
  }), kt(
@@ -835,7 +862,7 @@ function xa({
835
862
  p(c, n, l);
836
863
  },
837
864
  [i, p]
838
- ), Z = (e, n) => {
865
+ ), W = (e, n) => {
839
866
  const l = r.find(
840
867
  (I) => I.id === e
841
868
  );
@@ -845,17 +872,17 @@ function xa({
845
872
  );
846
873
  let k, f;
847
874
  if (C && s === "dashboard" && (C.type === "field_selector" || C.type === "metric_selector")) {
848
- const I = (m == null ? void 0 : m[C.id]) || [], K = Te({
875
+ const I = (m == null ? void 0 : m[C.id]) || [], P = Te({
849
876
  control: C,
850
877
  nextSelectedCardIds: I
851
878
  });
852
879
  c = c.map(
853
- (P) => P.id === e ? K.nextControl : P
854
- ), k = K.cardBindingsById, f = [C.id];
880
+ ($) => $.id === e ? P.nextControl : $
881
+ ), k = P.cardBindingsById, f = [C.id];
855
882
  } else if (l && s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector")) {
856
883
  const I = (m == null ? void 0 : m[l.id]) || [];
857
884
  k = Object.fromEntries(
858
- I.map((K) => [K, void 0])
885
+ I.map((P) => [P, void 0])
859
886
  ), f = [l.id];
860
887
  }
861
888
  const w = c.find(
@@ -863,18 +890,18 @@ function xa({
863
890
  );
864
891
  let F = i;
865
892
  if (l && w) {
866
- const I = ge({
893
+ const I = ye({
867
894
  control: l,
868
895
  defaultValues: i
869
896
  });
870
897
  l.source.kind === "manual" && w.source.kind === "sql_query" && (E.current[e] = I);
871
- const K = I === void 0 && l.source.kind === "sql_query" && w.source.kind === "manual" ? E.current[e] : I, P = Qe({
898
+ const P = I === void 0 && l.source.kind === "sql_query" && w.source.kind === "manual" ? E.current[e] : I, $ = Re({
872
899
  previousControl: l,
873
900
  nextControl: w,
874
- currentDefaultValue: K
901
+ currentDefaultValue: P
875
902
  });
876
- w.source.kind === "manual" && (E.current[e] = P), i && (F = { ...i }, P === void 0 ? delete F[e] : F[e] = P), c = c.map(
877
- (Le) => Le.id === e ? { ...w, defaultValue: P } : Le
903
+ w.source.kind === "manual" && (E.current[e] = $), i && (F = { ...i }, $ === void 0 ? delete F[e] : F[e] = $), c = c.map(
904
+ (Le) => Le.id === e ? { ...w, defaultValue: $ } : Le
878
905
  );
879
906
  }
880
907
  A(c, F, {
@@ -885,8 +912,8 @@ function xa({
885
912
  }, ct = (e, n) => {
886
913
  if (!n.trim())
887
914
  return;
888
- const l = Ht(n);
889
- if (l === e || _.has(l) || r.some(
915
+ const l = Gt(n);
916
+ if (l === e || q.has(l) || r.some(
890
917
  (k) => k.id === l && k.id !== e
891
918
  ))
892
919
  return;
@@ -915,17 +942,17 @@ function xa({
915
942
  }
916
943
  const l = { ...i };
917
944
  delete l[e], A(n, l, { type: "remove", controlId: e });
918
- }, pt = M(() => {
945
+ }, pt = O(() => {
919
946
  B.current = void 0, T({
920
947
  step: 1,
921
- control: re(s, r, Array.from(_))
922
- }), O(null), H(null);
923
- }, [r, _, s]), ee = (e) => {
948
+ control: se(s, r, Array.from(q))
949
+ }), M(null), G(null);
950
+ }, [r, q, s]), ee = (e) => {
924
951
  T(
925
952
  (n) => n && (() => {
926
953
  const l = e(n.control);
927
954
  n.control.source.kind === "manual" && l.source.kind === "sql_query" && (B.current = n.defaultValue);
928
- const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? B.current : n.defaultValue, C = Qe({
955
+ const c = n.defaultValue === void 0 && n.control.source.kind === "sql_query" && l.source.kind === "manual" ? B.current : n.defaultValue, C = Re({
929
956
  previousControl: n.control,
930
957
  nextControl: l,
931
958
  currentDefaultValue: c
@@ -944,14 +971,14 @@ function xa({
944
971
  defaultValue: e
945
972
  })
946
973
  );
947
- }, pe = (() => {
974
+ }, me = (() => {
948
975
  if (!a)
949
976
  return !1;
950
- if (a.step === 2 && q(a.control.type))
977
+ if (a.step === 2 && _(a.control.type))
951
978
  return (a.selectedCardIds || []).length > 0;
952
979
  if (a.step !== 2 && a.step !== 3 || !a.control.label.trim())
953
980
  return !1;
954
- const n = a.control.source.kind === "sql_query" ? a.control : Oe(a.control);
981
+ const n = a.control.source.kind === "sql_query" ? a.control : Me(a.control);
955
982
  if (n.source.kind === "manual" && (Nt(n) && n.source.options.length === 0 || n.source.options.some(
956
983
  (c) => c.label.trim().length === 0 || c.value.trim().length === 0
957
984
  )))
@@ -961,25 +988,25 @@ function xa({
961
988
  return l.trim().length > 0 && c.trim().length > 0 && C.trim().length > 0;
962
989
  }
963
990
  return St(
964
- se(n, a.defaultValue)
991
+ le(n, a.defaultValue)
965
992
  );
966
993
  })(), Ve = () => {
967
994
  var k;
968
995
  if (!a)
969
996
  return;
970
- const e = Oe(a.control), n = Tt({
997
+ const e = Me(a.control), n = Tt({
971
998
  label: e.label,
972
999
  fallbackId: e.id,
973
1000
  existingControls: r,
974
- reservedIds: Array.from(_)
1001
+ reservedIds: Array.from(q)
975
1002
  }), l = {
976
1003
  ...e,
977
1004
  id: n
978
- }, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((k = a.selectedCardIds) != null && k.length) ? je({
1005
+ }, c = s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") && ((k = a.selectedCardIds) != null && k.length) ? Qe({
979
1006
  control: l,
980
1007
  participants: g || [],
981
1008
  selectedCardIds: a.selectedCardIds
982
- }) : void 0, C = se(
1009
+ }) : void 0, C = le(
983
1010
  l,
984
1011
  a.defaultValue
985
1012
  );
@@ -991,14 +1018,14 @@ function xa({
991
1018
  selectedCardIds: a.selectedCardIds,
992
1019
  cardBindingsById: c
993
1020
  });
994
- }, me = M(() => {
1021
+ }, fe = O(() => {
995
1022
  T(null);
996
- }, []), qe = M(() => {
1023
+ }, []), _e = O(() => {
997
1024
  if (!(a != null && a.createdControlId)) {
998
1025
  T(null);
999
1026
  return;
1000
1027
  }
1001
- const e = a.control, n = a.createdControlId, l = se(
1028
+ const e = a.control, n = a.createdControlId, l = le(
1002
1029
  e,
1003
1030
  a.defaultValue
1004
1031
  );
@@ -1033,12 +1060,12 @@ function xa({
1033
1060
  cardBindingsById: a.cardBindingsById
1034
1061
  }
1035
1062
  );
1036
- O(n), T(null), D == null || D();
1037
- }, [r, a, i, A, D]), mt = a ? q(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], _e = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Dt(a.control.label) || a.control.id}]]` : "", fe = Me({
1063
+ M(n), T(null), D == null || D();
1064
+ }, [r, a, i, A, D]), mt = a ? _(a.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], qe = a != null && a.createdControlId ? `[[param.${a.createdControlId}]]` : a ? `[[param.${Dt(a.control.label) || a.control.id}]]` : "", he = Oe({
1038
1065
  controls: r,
1039
1066
  defaultValues: i
1040
- }), he = a ? [...r, a.control] : r, Fe = a ? Me({
1041
- controls: he,
1067
+ }), be = a ? [...r, a.control] : r, Fe = a ? Oe({
1068
+ controls: be,
1042
1069
  defaultValues: i,
1043
1070
  overrides: [
1044
1071
  {
@@ -1046,7 +1073,7 @@ function xa({
1046
1073
  value: a.defaultValue
1047
1074
  }
1048
1075
  ]
1049
- }) : fe;
1076
+ }) : he;
1050
1077
  return /* @__PURE__ */ d("div", { className: "space-y-4", children: [
1051
1078
  a ? /* @__PURE__ */ d("div", { className: "space-y-4 pb-1", children: [
1052
1079
  /* @__PURE__ */ t(
@@ -1067,9 +1094,9 @@ function xa({
1067
1094
  // keeping the shared definitions for existing controls.
1068
1095
  "date",
1069
1096
  "text"
1070
- ]), l = J.filter(
1097
+ ]), l = Z.filter(
1071
1098
  (k) => !e.has(k.value) && !n.has(k.value)
1072
- ), c = J.filter(
1099
+ ), c = Z.filter(
1073
1100
  (k) => e.has(k.value)
1074
1101
  ), C = (k) => /* @__PURE__ */ d(
1075
1102
  "button",
@@ -1080,7 +1107,7 @@ function xa({
1080
1107
  sa({
1081
1108
  scope: s,
1082
1109
  existingControls: r,
1083
- reservedIds: Array.from(_),
1110
+ reservedIds: Array.from(q),
1084
1111
  type: k.value
1085
1112
  })
1086
1113
  ),
@@ -1102,7 +1129,7 @@ function xa({
1102
1129
  /* @__PURE__ */ t("div", { className: "grid gap-1.5 sm:grid-cols-2", children: c.map(C) })
1103
1130
  ] }),
1104
1131
  /* @__PURE__ */ t(
1105
- de,
1132
+ ce,
1106
1133
  {
1107
1134
  secondary: /* @__PURE__ */ t(
1108
1135
  V,
@@ -1110,7 +1137,7 @@ function xa({
1110
1137
  type: "button",
1111
1138
  variant: "outline",
1112
1139
  size: "xs",
1113
- onClick: me,
1140
+ onClick: fe,
1114
1141
  children: "Back to controls"
1115
1142
  }
1116
1143
  )
@@ -1118,7 +1145,7 @@ function xa({
1118
1145
  )
1119
1146
  ] });
1120
1147
  })(),
1121
- a.step === 2 && q(a.control.type) && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1148
+ a.step === 2 && _(a.control.type) && /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1122
1149
  /* @__PURE__ */ d("div", { className: "space-y-3", children: [
1123
1150
  /* @__PURE__ */ t(
1124
1151
  it,
@@ -1132,7 +1159,7 @@ function xa({
1132
1159
  ),
1133
1160
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
1134
1161
  ] }),
1135
- W.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: W.map((e) => {
1162
+ J.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: J.map((e) => {
1136
1163
  const n = (a.selectedCardIds || []).includes(e.cardId);
1137
1164
  return /* @__PURE__ */ d(
1138
1165
  "label",
@@ -1140,7 +1167,7 @@ function xa({
1140
1167
  className: "flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",
1141
1168
  children: [
1142
1169
  /* @__PURE__ */ t(
1143
- jt,
1170
+ Qt,
1144
1171
  {
1145
1172
  checked: n,
1146
1173
  onCheckedChange: (l) => T(
@@ -1166,7 +1193,7 @@ function xa({
1166
1193
  );
1167
1194
  }) }),
1168
1195
  /* @__PURE__ */ t(
1169
- de,
1196
+ ce,
1170
1197
  {
1171
1198
  secondary: /* @__PURE__ */ t(
1172
1199
  V,
@@ -1195,21 +1222,21 @@ function xa({
1195
1222
  step: 3
1196
1223
  }
1197
1224
  ),
1198
- disabled: !pe,
1225
+ disabled: !me,
1199
1226
  children: "Next"
1200
1227
  }
1201
1228
  )
1202
1229
  }
1203
1230
  )
1204
1231
  ] }),
1205
- a.step === 2 && !q(a.control.type) && /* @__PURE__ */ t(
1232
+ a.step === 2 && !_(a.control.type) && /* @__PURE__ */ t(
1206
1233
  Ue,
1207
1234
  {
1208
1235
  control: a.control,
1209
1236
  defaultValue: a.defaultValue,
1210
1237
  availableFieldChoices: U.fields,
1211
1238
  availableMetricChoices: U.metrics,
1212
- previewControlDefinitions: he,
1239
+ previewControlDefinitions: be,
1213
1240
  previewControlValues: Fe,
1214
1241
  onControlChange: (e) => ee(() => e),
1215
1242
  onLabelChange: (e) => ee((n) => ({
@@ -1224,17 +1251,17 @@ function xa({
1224
1251
  }
1225
1252
  ),
1226
1253
  onNext: Ve,
1227
- nextDisabled: !pe
1254
+ nextDisabled: !me
1228
1255
  }
1229
1256
  ),
1230
- a.step === 3 && q(a.control.type) && /* @__PURE__ */ t(
1257
+ a.step === 3 && _(a.control.type) && /* @__PURE__ */ t(
1231
1258
  Ue,
1232
1259
  {
1233
1260
  control: a.control,
1234
1261
  defaultValue: a.defaultValue,
1235
1262
  availableFieldChoices: U.fields,
1236
1263
  availableMetricChoices: U.metrics,
1237
- previewControlDefinitions: he,
1264
+ previewControlDefinitions: be,
1238
1265
  previewControlValues: Fe,
1239
1266
  onControlChange: (e) => ee(() => e),
1240
1267
  onLabelChange: (e) => ee((n) => ({
@@ -1249,16 +1276,16 @@ function xa({
1249
1276
  }
1250
1277
  ),
1251
1278
  onNext: Ve,
1252
- nextDisabled: !pe
1279
+ nextDisabled: !me
1253
1280
  }
1254
1281
  ),
1255
- a.step === 3 && !q(a.control.type) && /* @__PURE__ */ t(
1256
- $e,
1282
+ a.step === 3 && !_(a.control.type) && /* @__PURE__ */ t(
1283
+ He,
1257
1284
  {
1258
1285
  control: a.control,
1259
1286
  scope: s,
1260
- createdReference: _e,
1261
- explorerContent: /* @__PURE__ */ d($, { children: [
1287
+ createdReference: qe,
1288
+ explorerContent: /* @__PURE__ */ d(H, { children: [
1262
1289
  "Open the card and use",
1263
1290
  " ",
1264
1291
  /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
@@ -1272,23 +1299,23 @@ function xa({
1272
1299
  step: 2
1273
1300
  }
1274
1301
  ),
1275
- onCancel: me,
1276
- onDone: qe
1302
+ onCancel: fe,
1303
+ onDone: _e
1277
1304
  }
1278
1305
  ),
1279
- a.step === 4 && q(a.control.type) && /* @__PURE__ */ t(
1280
- $e,
1306
+ a.step === 4 && _(a.control.type) && /* @__PURE__ */ t(
1307
+ He,
1281
1308
  {
1282
1309
  control: a.control,
1283
1310
  scope: s,
1284
- createdReference: _e,
1285
- summaryDetail: /* @__PURE__ */ d($, { children: [
1311
+ createdReference: qe,
1312
+ summaryDetail: /* @__PURE__ */ d(H, { children: [
1286
1313
  "Used by ",
1287
1314
  (a.selectedCardIds || []).length,
1288
1315
  " selected card",
1289
1316
  (a.selectedCardIds || []).length === 1 ? "" : "s"
1290
1317
  ] }),
1291
- explorerContent: /* @__PURE__ */ t($, { children: "Selected cards have been set up to respond to this control automatically." }),
1318
+ explorerContent: /* @__PURE__ */ t(H, { children: "Selected cards have been set up to respond to this control automatically." }),
1292
1319
  sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
1293
1320
  onBack: () => T(
1294
1321
  (e) => e && {
@@ -1296,17 +1323,17 @@ function xa({
1296
1323
  step: 3
1297
1324
  }
1298
1325
  ),
1299
- onCancel: me,
1300
- onDone: qe
1326
+ onCancel: fe,
1327
+ onDone: _e
1301
1328
  }
1302
1329
  )
1303
1330
  ] }) : null,
1304
1331
  !a && r.length === 0 ? /* @__PURE__ */ t("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: u }) : null,
1305
1332
  !a && r.map((e) => {
1306
- const n = dt(e), l = y == null ? void 0 : y[e.id], c = ge({
1333
+ const n = dt(e), l = y == null ? void 0 : y[e.id], c = ye({
1307
1334
  control: e,
1308
1335
  defaultValues: i
1309
- }), C = ue === e.id, k = "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";
1336
+ }), C = pe === e.id, k = "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";
1310
1337
  return /* @__PURE__ */ d(
1311
1338
  "div",
1312
1339
  {
@@ -1318,19 +1345,19 @@ function xa({
1318
1345
  {
1319
1346
  type: "button",
1320
1347
  className: "flex min-w-0 flex-1 items-start gap-2 rounded-control text-left focus:outline-none focus-visible:bg-muted/40",
1321
- onClick: () => O(
1348
+ onClick: () => M(
1322
1349
  (f) => f === e.id ? null : e.id
1323
1350
  ),
1324
1351
  children: [
1325
- C ? /* @__PURE__ */ t(Be, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(Re, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1352
+ C ? /* @__PURE__ */ t(Be, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ t(je, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1326
1353
  /* @__PURE__ */ d("div", { className: "min-w-0", children: [
1327
1354
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1328
1355
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
1329
1356
  /* @__PURE__ */ t("span", { className: k, children: Xe(e.type).label }),
1330
- /* @__PURE__ */ t("span", { className: k, children: He(s, e.placement) })
1357
+ /* @__PURE__ */ t("span", { className: k, children: Ge(s, e.placement) })
1331
1358
  ] }),
1332
1359
  /* @__PURE__ */ d("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
1333
- Je(e),
1360
+ Ze(e),
1334
1361
  l != null && l.status ? ` · ${l.status}` : ""
1335
1362
  ] })
1336
1363
  ] })
@@ -1346,7 +1373,7 @@ function xa({
1346
1373
  className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
1347
1374
  onClick: () => ut(e.id),
1348
1375
  "aria-label": `Remove ${e.label}`,
1349
- children: /* @__PURE__ */ t(Rt, { className: "h-3.5 w-3.5" })
1376
+ children: /* @__PURE__ */ t(jt, { className: "h-3.5 w-3.5" })
1350
1377
  }
1351
1378
  )
1352
1379
  ] }),
@@ -1355,12 +1382,12 @@ function xa({
1355
1382
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1356
1383
  /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1357
1384
  /* @__PURE__ */ t(
1358
- We,
1385
+ Je,
1359
1386
  {
1360
1387
  size: "xs",
1361
1388
  value: e.label,
1362
1389
  placeholder: "Control label",
1363
- onChange: (f) => Z(e.id, (w) => ({
1390
+ onChange: (f) => W(e.id, (w) => ({
1364
1391
  ...w,
1365
1392
  label: f.target.value
1366
1393
  }))
@@ -1370,11 +1397,11 @@ function xa({
1370
1397
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1371
1398
  /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1372
1399
  /* @__PURE__ */ d(
1373
- ye,
1400
+ xe,
1374
1401
  {
1375
1402
  value: e.type,
1376
1403
  onValueChange: (f) => {
1377
- const w = Ze({
1404
+ const w = We({
1378
1405
  controls: r,
1379
1406
  controlId: e.id,
1380
1407
  nextType: f,
@@ -1383,10 +1410,10 @@ function xa({
1383
1410
  A(w.controls, w.defaultValues);
1384
1411
  },
1385
1412
  children: [
1386
- /* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(ve, {}) }),
1387
- /* @__PURE__ */ t(Ce, { children: ae(e.type).map(
1413
+ /* @__PURE__ */ t(ve, { size: "xs", children: /* @__PURE__ */ t(Ce, {}) }),
1414
+ /* @__PURE__ */ t(ke, { children: re(e.type).map(
1388
1415
  (f) => /* @__PURE__ */ t(
1389
- ke,
1416
+ Ne,
1390
1417
  {
1391
1418
  value: f.value,
1392
1419
  children: f.label
@@ -1401,22 +1428,22 @@ function xa({
1401
1428
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1402
1429
  /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1403
1430
  /* @__PURE__ */ d(
1404
- ye,
1431
+ xe,
1405
1432
  {
1406
1433
  value: e.placement || X,
1407
- onValueChange: (f) => Z(e.id, (w) => ({
1434
+ onValueChange: (f) => W(e.id, (w) => ({
1408
1435
  ...w,
1409
1436
  placement: f
1410
1437
  })),
1411
1438
  children: [
1412
- /* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(ve, {}) }),
1413
- /* @__PURE__ */ t(Ce, { children: G.map((f) => /* @__PURE__ */ t(ke, { value: f.value, children: f.label }, f.value)) })
1439
+ /* @__PURE__ */ t(ve, { size: "xs", children: /* @__PURE__ */ t(Ce, {}) }),
1440
+ /* @__PURE__ */ t(ke, { children: K.map((f) => /* @__PURE__ */ t(Ne, { value: f.value, children: f.label }, f.value)) })
1414
1441
  ]
1415
1442
  }
1416
1443
  )
1417
1444
  ] })
1418
1445
  ] }),
1419
- q(e.type) ? /* @__PURE__ */ t(
1446
+ _(e.type) ? /* @__PURE__ */ t(
1420
1447
  Ut,
1421
1448
  {
1422
1449
  type: e.type,
@@ -1450,9 +1477,9 @@ function xa({
1450
1477
  availableFieldChoices: n.fields,
1451
1478
  availableMetricChoices: n.metrics,
1452
1479
  previewControlDefinitions: r,
1453
- previewControlValues: fe,
1480
+ previewControlValues: he,
1454
1481
  controlLifecycle: "edit",
1455
- onChange: (f) => Z(e.id, () => f)
1482
+ onChange: (f) => W(e.id, () => f)
1456
1483
  }
1457
1484
  ),
1458
1485
  e.initialValueStrategy === "saved_default" && /* @__PURE__ */ t(
@@ -1463,7 +1490,7 @@ function xa({
1463
1490
  allowNoDefault: !0,
1464
1491
  allowCardDefault: !0,
1465
1492
  previewControlDefinitions: r,
1466
- previewControlValues: fe,
1493
+ previewControlValues: he,
1467
1494
  onChange: (f) => {
1468
1495
  const w = r.map(
1469
1496
  (F) => F.id === e.id ? { ...F, defaultValue: f } : F
@@ -1478,12 +1505,12 @@ function xa({
1478
1505
  }
1479
1506
  ),
1480
1507
  /* @__PURE__ */ d(
1481
- Pt,
1508
+ $t,
1482
1509
  {
1483
- open: te === e.id,
1484
- onOpenChange: (f) => H(f ? e.id : null),
1510
+ open: ae === e.id,
1511
+ onOpenChange: (f) => G(f ? e.id : null),
1485
1512
  children: [
1486
- /* @__PURE__ */ t($t, { asChild: !0, children: /* @__PURE__ */ d(
1513
+ /* @__PURE__ */ t(Ht, { asChild: !0, children: /* @__PURE__ */ d(
1487
1514
  V,
1488
1515
  {
1489
1516
  type: "button",
@@ -1491,12 +1518,12 @@ function xa({
1491
1518
  size: "xs",
1492
1519
  className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
1493
1520
  children: [
1494
- te === e.id ? /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(Re, { className: "h-3.5 w-3.5" }),
1521
+ ae === e.id ? /* @__PURE__ */ t(Be, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ t(je, { className: "h-3.5 w-3.5" }),
1495
1522
  "Advanced"
1496
1523
  ]
1497
1524
  }
1498
1525
  ) }),
1499
- /* @__PURE__ */ d(Kt, { className: "space-y-3 pt-2", children: [
1526
+ /* @__PURE__ */ d(Pt, { className: "space-y-3 pt-2", children: [
1500
1527
  /* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
1501
1528
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1502
1529
  /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
@@ -1512,17 +1539,17 @@ function xa({
1512
1539
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1513
1540
  /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1514
1541
  /* @__PURE__ */ d(
1515
- ye,
1542
+ xe,
1516
1543
  {
1517
1544
  value: e.initialValueStrategy,
1518
- onValueChange: (f) => Z(e.id, (w) => ({
1545
+ onValueChange: (f) => W(e.id, (w) => ({
1519
1546
  ...w,
1520
1547
  initialValueStrategy: f
1521
1548
  })),
1522
1549
  children: [
1523
- /* @__PURE__ */ t(xe, { size: "xs", children: /* @__PURE__ */ t(ve, {}) }),
1524
- /* @__PURE__ */ t(Ce, { children: It.map((f) => /* @__PURE__ */ t(
1525
- ke,
1550
+ /* @__PURE__ */ t(ve, { size: "xs", children: /* @__PURE__ */ t(Ce, {}) }),
1551
+ /* @__PURE__ */ t(ke, { children: It.map((f) => /* @__PURE__ */ t(
1552
+ Ne,
1526
1553
  {
1527
1554
  value: f.value,
1528
1555
  children: f.label
@@ -1535,10 +1562,10 @@ function xa({
1535
1562
  ] })
1536
1563
  ] }),
1537
1564
  /* @__PURE__ */ t(
1538
- Gt,
1565
+ Kt,
1539
1566
  {
1540
1567
  control: e,
1541
- onChange: (f) => Z(e.id, () => f)
1568
+ onChange: (f) => W(e.id, () => f)
1542
1569
  }
1543
1570
  )
1544
1571
  ] })
@@ -1566,26 +1593,26 @@ function xa({
1566
1593
  )
1567
1594
  ] });
1568
1595
  }
1569
- function va(s) {
1596
+ function ka(s) {
1570
1597
  const {
1571
1598
  open: r,
1572
1599
  onOpenChange: o,
1573
1600
  initialCreateFlowActive: i = !1,
1574
1601
  dismissMode: p = "passive"
1575
- } = s, u = r !== void 0, [h, y] = j(!1), [b, v] = j(
1602
+ } = s, u = r !== void 0, [h, y] = Q(!1), [b, v] = Q(
1576
1603
  i
1577
- ), g = u ? r : h, m = M(
1604
+ ), g = u ? r : h, m = O(
1578
1605
  (N) => {
1579
1606
  !N && b && p === "passive" || (u || y(N), N || v(!1), o == null || o(N));
1580
1607
  },
1581
1608
  [u, b, p, o]
1582
- ), x = M(() => {
1609
+ ), x = O(() => {
1583
1610
  u || y(!1), v(!1), o == null || o(!1);
1584
1611
  }, [u, o]);
1585
- ie(() => {
1612
+ de(() => {
1586
1613
  g || v(!1);
1587
1614
  }, [g]);
1588
- const S = M(
1615
+ const S = O(
1589
1616
  (N) => {
1590
1617
  b && N.preventDefault();
1591
1618
  },
@@ -1602,16 +1629,18 @@ function va(s) {
1602
1629
  }
1603
1630
  export {
1604
1631
  ua as C,
1605
- fa as E,
1606
- Wt as L,
1607
- ma as V,
1608
- ga as a,
1609
- ha as b,
1610
- ba as c,
1611
- Zt as d,
1612
- xa as e,
1613
- pa as f,
1632
+ ba as E,
1633
+ Jt as L,
1634
+ pa as R,
1635
+ ma as S,
1636
+ ha as V,
1637
+ xa as a,
1638
+ ga as b,
1639
+ ya as c,
1640
+ Wt as d,
1641
+ Ca as e,
1642
+ fa as f,
1614
1643
  ot as g,
1615
- ya as h,
1616
- va as u
1644
+ va as h,
1645
+ ka as u
1617
1646
  };