react-semaphor 0.1.319 → 0.1.321

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.cjs +1 -1
  2. package/dist/brand-studio/index.js +4 -4
  3. package/dist/briefings/index.cjs +1 -1
  4. package/dist/briefings/index.js +657 -227
  5. package/dist/chunks/{braces-NfG5hX2c.js → braces-C7BeIXvM.js} +1 -1
  6. package/dist/chunks/{braces-CDPz6CF2.js → braces-Cy5NEBa8.js} +1 -1
  7. package/dist/chunks/{calendar-preferences-dialog-DLKB05SY.js → calendar-preferences-dialog-CzoSmQNw.js} +1 -1
  8. package/dist/chunks/{calendar-preferences-dialog-DPaVsZlk.js → calendar-preferences-dialog-D-0W76fR.js} +3 -3
  9. package/dist/chunks/{chevrons-up-down-DiWloubI.js → chevrons-up-down-Cuilz9aY.js} +1 -1
  10. package/dist/chunks/{chevrons-up-down-BsdQRmJL.js → chevrons-up-down-DZTs1oVD.js} +1 -1
  11. package/dist/chunks/dashboard-briefing-launcher-Cqm8NnVb.js +106 -0
  12. package/dist/chunks/{dashboard-briefing-launcher-DR_i0anv.js → dashboard-briefing-launcher-D5z1kf6J.js} +2238 -2139
  13. package/dist/chunks/{dashboard-controls-8J06Ot-K.js → dashboard-controls-CRIwHD59.js} +94 -94
  14. package/dist/chunks/{dashboard-controls-BNAIucBl.js → dashboard-controls-DSt7iwFC.js} +1 -1
  15. package/dist/chunks/{dashboard-json-DIsACFCO.js → dashboard-json-BRx9CbrK.js} +2 -2
  16. package/dist/chunks/{dashboard-json-B_Li7wO5.js → dashboard-json-ezFjz7Fc.js} +1 -1
  17. package/dist/chunks/{edit-dashboard-visual-2CBS2I52.js → edit-dashboard-visual-Cw0KmT4i.js} +1 -1
  18. package/dist/chunks/{edit-dashboard-visual-BGnC2DH7.js → edit-dashboard-visual-sI6ds8MP.js} +616 -616
  19. package/dist/chunks/{index-DYycYzpZ.js → index-BZg7rVe-.js} +27161 -26641
  20. package/dist/chunks/{index-cxoegFH9.js → index-DX6Krdga.js} +215 -210
  21. package/dist/chunks/{palette-BlxLchHy.js → palette-Bc-vOLSt.js} +1 -1
  22. package/dist/chunks/{palette-CJTdBzJB.js → palette-CanPG11m.js} +1 -1
  23. package/dist/chunks/resource-management-panel-CRRUcnVu.js +6 -0
  24. package/dist/chunks/{resource-management-panel-YtbKp2kW.js → resource-management-panel-pN81x7Gw.js} +451 -369
  25. package/dist/chunks/{save-DVRQBMeb.js → save-CXa6cKaY.js} +1 -1
  26. package/dist/chunks/{save-B8x5Vi0W.js → save-CqrBQKG6.js} +1 -1
  27. package/dist/chunks/{switch-DPaKnsb8.js → switch-BXICAlvS.js} +2 -2
  28. package/dist/chunks/{switch-sauemjyY.js → switch-DdTUsWgd.js} +127 -127
  29. package/dist/chunks/{use-create-flow-overlay-state-Qnd7FF6L.js → use-create-flow-overlay-state-B9ujZUon.js} +104 -104
  30. package/dist/chunks/{use-create-flow-overlay-state-DQZneUXL.js → use-create-flow-overlay-state-BfV5187a.js} +1 -1
  31. package/dist/chunks/{use-visual-utils-BdMhr0YR.js → use-visual-utils-D_uHFfTn.js} +1 -1
  32. package/dist/chunks/{use-visual-utils-t73RlvjS.js → use-visual-utils-PxijRlpS.js} +2 -2
  33. package/dist/dashboard/index.cjs +1 -1
  34. package/dist/dashboard/index.js +1 -1
  35. package/dist/dashboard-authoring/index.cjs +3 -0
  36. package/dist/dashboard-authoring/index.js +532 -0
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +7 -7
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.cjs +1 -1
  41. package/dist/surfboard/index.js +2 -2
  42. package/dist/types/briefings.d.ts +111 -0
  43. package/dist/types/dashboard-authoring.d.ts +2703 -0
  44. package/package.json +6 -1
  45. package/dist/chunks/dashboard-briefing-launcher-F3qKyuGr.js +0 -106
  46. package/dist/chunks/resource-management-panel-BwNGxqrB.js +0 -6
@@ -1,9 +1,9 @@
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";
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, a8 as yt, B as V, e as xt, X as $e, E as Ke, f as Ye, a9 as vt, aa as Ct, ab as se, ac as Ae, ad as ze, ae as ge, af as ye, ag as kt, ah as Me, ai as Nt, aj as St, ak as le, al as Dt, am as Oe, g as Be, an as Ge, ao as Xe, ap as Je, L as K, a1 as Ze, a2 as xe, a3 as ve, a4 as Ce, a5 as ke, a6 as Ne, aq as We, ar as wt, as as It, at as Re, au as Et, av as Qe, aw as Tt, ax as Se } from "./switch-DdTUsWgd.js";
2
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-DYycYzpZ.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-t73RlvjS.js";
6
- import { S as nt } from "./save-DVRQBMeb.js";
3
+ import { aj as _t, ak as et, al as qt, am as Ft, an as Lt, ao as At, ap as zt, x as Mt, aq as Ot, ac as ue, ar as tt, ae as at, as as rt, at as Bt, o as R, au as Rt, av as Qt, aw as je, ax as jt, ay as Ut, az as st, aA as lt, aB as Ht, aC as Pt, aD as $t, aE as Kt, aF as Yt, aG as Gt, aH as Xt, aI as Jt } from "./index-BZg7rVe-.js";
4
+ import { jsx as t, jsxs as d, Fragment as P } from "react/jsx-runtime";
5
+ import { u as we } from "./use-visual-utils-PxijRlpS.js";
6
+ import { S as nt } from "./save-CXa6cKaY.js";
7
7
  /**
8
8
  * @license lucide-react v0.453.0 - ISC
9
9
  *
@@ -21,7 +21,7 @@ const ua = te("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 Jt = te("Library", [
24
+ const Zt = 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" }],
@@ -168,7 +168,7 @@ function ha({
168
168
  }, S = {
169
169
  local: /* @__PURE__ */ t("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
170
170
  linked: /* @__PURE__ */ t(Wt, { className: "h-3.5 w-3.5" }),
171
- library: /* @__PURE__ */ t(Jt, { className: "h-3.5 w-3.5" })
171
+ library: /* @__PURE__ */ t(Zt, { className: "h-3.5 w-3.5" })
172
172
  }, N = {
173
173
  local: "Local",
174
174
  linked: "Linked",
@@ -252,7 +252,7 @@ function ga({
252
252
  }) {
253
253
  const o = ue(), [i, p] = Q(!1), u = oe(
254
254
  (x) => x.actions.setIsDashboardPanelOpen
255
- ), { setIsVisualEditing: h } = Ye(), { getUpdatedFrame: y } = we(), b = at(), v = L((x) => x.frame), g = rt();
255
+ ), { setIsVisualEditing: h } = Ke(), { getUpdatedFrame: y } = we(), b = at(), v = L((x) => x.frame), g = rt();
256
256
  return /* @__PURE__ */ t(
257
257
  V,
258
258
  {
@@ -288,10 +288,10 @@ function ga({
288
288
  className: s,
289
289
  size: "xs",
290
290
  variant: r,
291
- children: i ? /* @__PURE__ */ d(H, { children: [
292
- /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5 animate-spin" }),
291
+ children: i ? /* @__PURE__ */ d(P, { children: [
292
+ /* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5 animate-spin" }),
293
293
  "Saving"
294
- ] }) : /* @__PURE__ */ d(H, { children: [
294
+ ] }) : /* @__PURE__ */ d(P, { children: [
295
295
  /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
296
296
  "Save to Library"
297
297
  ] })
@@ -301,7 +301,7 @@ function ga({
301
301
  function ya({
302
302
  className: s
303
303
  }) {
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();
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 } = Ke(), { getUpdatedFrame: g } = we(), m = rt(), x = Bt();
305
305
  return /* @__PURE__ */ t(
306
306
  V,
307
307
  {
@@ -326,8 +326,8 @@ function ya({
326
326
  ...D,
327
327
  visualId: N
328
328
  // Keep the link to library visual
329
- }, K = Rt(y, q.id), X = await x(q, {
330
- previousFrame: K
329
+ }, Y = Rt(y, q.id), G = await x(q, {
330
+ previousFrame: Y
331
331
  });
332
332
  await m.mutateAsync({
333
333
  visualId: N,
@@ -335,7 +335,7 @@ function ya({
335
335
  frameObject: D
336
336
  }
337
337
  }), b(h, q, {
338
- semanticExecutionPayload: X
338
+ semanticExecutionPayload: G
339
339
  }), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", N] }), R.success("Saved to library and applied locally"), setTimeout(() => {
340
340
  v(!1);
341
341
  }, 300);
@@ -351,10 +351,10 @@ function ya({
351
351
  size: "xs",
352
352
  variant: "default",
353
353
  disabled: o,
354
- children: o ? /* @__PURE__ */ d(H, { children: [
355
- /* @__PURE__ */ t(Ke, { className: "h-3.5 w-3.5 animate-spin" }),
354
+ children: o ? /* @__PURE__ */ d(P, { children: [
355
+ /* @__PURE__ */ t(Ye, { className: "h-3.5 w-3.5 animate-spin" }),
356
356
  "Saving..."
357
- ] }) : /* @__PURE__ */ d(H, { children: [
357
+ ] }) : /* @__PURE__ */ d(P, { children: [
358
358
  /* @__PURE__ */ t(nt, { className: "h-3.5 w-3.5" }),
359
359
  "Save & Apply"
360
360
  ] })
@@ -378,7 +378,7 @@ function xa({ className: s }) {
378
378
  size: "xs",
379
379
  variant: "outline",
380
380
  children: [
381
- /* @__PURE__ */ t(Pe, { className: "h-3.5 w-3.5" }),
381
+ /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
382
382
  "Close"
383
383
  ]
384
384
  }
@@ -397,25 +397,25 @@ function va({
397
397
  setCardPreferences: N,
398
398
  clearQueryConfig: D,
399
399
  setCardConfig: q,
400
- setCardType: K,
401
- setFrame: X,
400
+ setCardType: Y,
401
+ setFrame: G,
402
402
  setCard: ae,
403
- setActiveTabCardId: G
403
+ setActiveTabCardId: X
404
404
  } = ne();
405
405
  function pe() {
406
- var Z, re, _, J;
406
+ var J, re, _, Z;
407
407
  const M = p.getQueryData(v);
408
408
  u != null && u.queryData || i({
409
409
  queryKey: v,
410
410
  queryData: M
411
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);
413
- X({
412
+ const a = L.getState().frame, E = L.getState().card, T = et(a, E), B = ((J = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((re = T == null ? void 0 : T.customCardPreferences) != null && re.dataInputCardIds) || (((_ = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : _.minInputs) || 0) > 1 || (((Z = T == null ? void 0 : T.customCardPreferences) == null ? void 0 : Z.maxInputs) || 0) > 1, j = ea(E, B);
413
+ G({
414
414
  ...a,
415
415
  cards: a.cards.map(
416
416
  (U) => U.id === j.id ? j : U
417
417
  )
418
- }), G(j.id), ae(j), B || K("bar");
418
+ }), X(j.id), ae(j), B || Y("bar");
419
419
  }
420
420
  return /* @__PURE__ */ d(
421
421
  V,
@@ -425,7 +425,7 @@ function va({
425
425
  size: "xs",
426
426
  variant: r,
427
427
  children: [
428
- /* @__PURE__ */ t(Pe, { className: "h-3.5 w-3.5" }),
428
+ /* @__PURE__ */ t($e, { className: "h-3.5 w-3.5" }),
429
429
  s
430
430
  ]
431
431
  }
@@ -434,9 +434,9 @@ function va({
434
434
  function it(s) {
435
435
  const { control: r, onChange: o } = s;
436
436
  return /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
437
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
437
+ /* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
438
438
  /* @__PURE__ */ t(
439
- Je,
439
+ Ze,
440
440
  {
441
441
  size: "xs",
442
442
  value: r.label,
@@ -494,17 +494,17 @@ function ce(s) {
494
494
  function aa(s) {
495
495
  const { control: r, scope: o, detail: i } = s;
496
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: [
497
- /* @__PURE__ */ t(Zt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
497
+ /* @__PURE__ */ t(Jt, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
498
498
  /* @__PURE__ */ d("div", { className: "min-w-0 space-y-0.5", children: [
499
499
  /* @__PURE__ */ t("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
500
500
  /* @__PURE__ */ d("div", { className: "text-[12px] text-muted-foreground", children: [
501
- Xe(r.type).label,
501
+ Ge(r.type).label,
502
502
  " ·",
503
503
  " ",
504
- Ze(r),
504
+ Je(r),
505
505
  " ·",
506
506
  " ",
507
- Ge(o, r.placement)
507
+ Xe(o, r.placement)
508
508
  ] }),
509
509
  i ? /* @__PURE__ */ t("div", { className: "text-[12px] text-muted-foreground", children: i }) : null
510
510
  ] })
@@ -576,7 +576,7 @@ const ra = /* @__PURE__ */ new Set([
576
576
  "field_selector",
577
577
  "metric_selector"
578
578
  ]);
579
- function $e(s) {
579
+ function He(s) {
580
580
  const { text: r, ariaLabel: o } = s, [i, p] = Q(!1);
581
581
  return /* @__PURE__ */ d(
582
582
  "button",
@@ -598,7 +598,7 @@ function $e(s) {
598
598
  }
599
599
  );
600
600
  }
601
- function He(s) {
601
+ function Pe(s) {
602
602
  const {
603
603
  control: r,
604
604
  scope: o,
@@ -629,14 +629,14 @@ function He(s) {
629
629
  /* @__PURE__ */ d("div", { className: "space-y-1.5 px-3 py-2.5", children: [
630
630
  /* @__PURE__ */ t("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
631
631
  /* @__PURE__ */ t(
632
- $e,
632
+ He,
633
633
  {
634
634
  text: i,
635
635
  ariaLabel: "Copy SQL control reference"
636
636
  }
637
637
  ),
638
638
  x ? /* @__PURE__ */ t(
639
- $e,
639
+ He,
640
640
  {
641
641
  text: x,
642
642
  ariaLabel: "Copy Jinja control reference"
@@ -718,16 +718,16 @@ function Ca({
718
718
  const q = z(
719
719
  () => new Set(o || []),
720
720
  [o]
721
- ), K = wt(s), X = Ct(s), [ae, G] = Q(
721
+ ), Y = wt(s), G = Ct(s), [ae, X] = Q(
722
722
  null
723
723
  ), [pe, M] = Q(
724
724
  null
725
- ), [a, T] = Q(
725
+ ), [a, E] = Q(
726
726
  () => h ? {
727
727
  step: 1,
728
728
  control: se(s, r, Array.from(q))
729
729
  } : null
730
- ), E = De({}), B = De(void 0), j = De(h), Z = z(() => {
730
+ ), T = De({}), B = De(void 0), j = De(h), J = z(() => {
731
731
  const e = Ae({ scope: s, card: x });
732
732
  if (!S)
733
733
  return e;
@@ -749,7 +749,7 @@ function Ca({
749
749
  ), _ = O(
750
750
  (e) => s === "dashboard" && (e === "field_selector" || e === "metric_selector"),
751
751
  [s]
752
- ), J = z(
752
+ ), Z = z(
753
753
  () => a ? ze(
754
754
  g || [],
755
755
  a.control.type
@@ -792,10 +792,10 @@ function Ca({
792
792
  N == null || N(!!a);
793
793
  }, [a, N]), de(() => {
794
794
  const e = h && !j.current;
795
- j.current = h, e && (T({
795
+ j.current = h, e && (E({
796
796
  step: 1,
797
797
  control: se(s, r, Array.from(q))
798
- }), M(null), G(null));
798
+ }), M(null), X(null));
799
799
  }, [r, h, q, s]);
800
800
  const dt = (e) => {
801
801
  if (!_(e.type))
@@ -824,7 +824,7 @@ function Ca({
824
824
  target: l.metricTargetMap[c.value]
825
825
  })) : []
826
826
  };
827
- }, Te = (e) => {
827
+ }, Ee = (e) => {
828
828
  if (!_(e.control.type))
829
829
  return {
830
830
  nextControl: e.control,
@@ -834,7 +834,7 @@ function Ca({
834
834
  controlType: e.control.type,
835
835
  participants: g || [],
836
836
  selectedCardIds: e.nextSelectedCardIds
837
- }), c = Et({
837
+ }), c = Tt({
838
838
  control: e.control,
839
839
  choices: l.choices
840
840
  }), C = Object.fromEntries(
@@ -872,17 +872,17 @@ function Ca({
872
872
  );
873
873
  let k, f;
874
874
  if (C && s === "dashboard" && (C.type === "field_selector" || C.type === "metric_selector")) {
875
- const I = (m == null ? void 0 : m[C.id]) || [], P = Te({
875
+ const I = (m == null ? void 0 : m[C.id]) || [], $ = Ee({
876
876
  control: C,
877
877
  nextSelectedCardIds: I
878
878
  });
879
879
  c = c.map(
880
- ($) => $.id === e ? P.nextControl : $
881
- ), k = P.cardBindingsById, f = [C.id];
880
+ (H) => H.id === e ? $.nextControl : H
881
+ ), k = $.cardBindingsById, f = [C.id];
882
882
  } else if (l && s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector")) {
883
883
  const I = (m == null ? void 0 : m[l.id]) || [];
884
884
  k = Object.fromEntries(
885
- I.map((P) => [P, void 0])
885
+ I.map(($) => [$, void 0])
886
886
  ), f = [l.id];
887
887
  }
888
888
  const w = c.find(
@@ -894,14 +894,14 @@ function Ca({
894
894
  control: l,
895
895
  defaultValues: i
896
896
  });
897
- l.source.kind === "manual" && w.source.kind === "sql_query" && (E.current[e] = I);
898
- const P = I === void 0 && l.source.kind === "sql_query" && w.source.kind === "manual" ? E.current[e] : I, $ = Re({
897
+ l.source.kind === "manual" && w.source.kind === "sql_query" && (T.current[e] = I);
898
+ const $ = I === void 0 && l.source.kind === "sql_query" && w.source.kind === "manual" ? T.current[e] : I, H = Re({
899
899
  previousControl: l,
900
900
  nextControl: w,
901
- currentDefaultValue: P
901
+ currentDefaultValue: $
902
902
  });
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
903
+ w.source.kind === "manual" && (T.current[e] = H), i && (F = { ...i }, H === void 0 ? delete F[e] : F[e] = H), c = c.map(
904
+ (Le) => Le.id === e ? { ...w, defaultValue: H } : Le
905
905
  );
906
906
  }
907
907
  A(c, F, {
@@ -912,7 +912,7 @@ function Ca({
912
912
  }, ct = (e, n) => {
913
913
  if (!n.trim())
914
914
  return;
915
- const l = Gt(n);
915
+ const l = Xt(n);
916
916
  if (l === e || q.has(l) || r.some(
917
917
  (k) => k.id === l && k.id !== e
918
918
  ))
@@ -943,12 +943,12 @@ function Ca({
943
943
  const l = { ...i };
944
944
  delete l[e], A(n, l, { type: "remove", controlId: e });
945
945
  }, pt = O(() => {
946
- B.current = void 0, T({
946
+ B.current = void 0, E({
947
947
  step: 1,
948
948
  control: se(s, r, Array.from(q))
949
- }), M(null), G(null);
949
+ }), M(null), X(null);
950
950
  }, [r, q, s]), ee = (e) => {
951
- T(
951
+ E(
952
952
  (n) => n && (() => {
953
953
  const l = e(n.control);
954
954
  n.control.source.kind === "manual" && l.source.kind === "sql_query" && (B.current = n.defaultValue);
@@ -964,8 +964,8 @@ function Ca({
964
964
  };
965
965
  })()
966
966
  );
967
- }, Ee = (e) => {
968
- T(
967
+ }, Te = (e) => {
968
+ E(
969
969
  (n) => n && (n.control.source.kind === "manual" && (B.current = e), {
970
970
  ...n,
971
971
  defaultValue: e
@@ -994,7 +994,7 @@ function Ca({
994
994
  var k;
995
995
  if (!a)
996
996
  return;
997
- const e = Me(a.control), n = Tt({
997
+ const e = Me(a.control), n = Et({
998
998
  label: e.label,
999
999
  fallbackId: e.id,
1000
1000
  existingControls: r,
@@ -1010,7 +1010,7 @@ function Ca({
1010
1010
  l,
1011
1011
  a.defaultValue
1012
1012
  );
1013
- T({
1013
+ E({
1014
1014
  step: s === "dashboard" && (l.type === "field_selector" || l.type === "metric_selector") ? 4 : 3,
1015
1015
  control: l,
1016
1016
  defaultValue: C,
@@ -1019,10 +1019,10 @@ function Ca({
1019
1019
  cardBindingsById: c
1020
1020
  });
1021
1021
  }, fe = O(() => {
1022
- T(null);
1022
+ E(null);
1023
1023
  }, []), _e = O(() => {
1024
1024
  if (!(a != null && a.createdControlId)) {
1025
- T(null);
1025
+ E(null);
1026
1026
  return;
1027
1027
  }
1028
1028
  const e = a.control, n = a.createdControlId, l = le(
@@ -1060,7 +1060,7 @@ function Ca({
1060
1060
  cardBindingsById: a.cardBindingsById
1061
1061
  }
1062
1062
  );
1063
- M(n), T(null), D == null || D();
1063
+ M(n), E(null), D == null || D();
1064
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({
1065
1065
  controls: r,
1066
1066
  defaultValues: i
@@ -1094,16 +1094,16 @@ function Ca({
1094
1094
  // keeping the shared definitions for existing controls.
1095
1095
  "date",
1096
1096
  "text"
1097
- ]), l = Z.filter(
1097
+ ]), l = J.filter(
1098
1098
  (k) => !e.has(k.value) && !n.has(k.value)
1099
- ), c = Z.filter(
1099
+ ), c = J.filter(
1100
1100
  (k) => e.has(k.value)
1101
1101
  ), C = (k) => /* @__PURE__ */ d(
1102
1102
  "button",
1103
1103
  {
1104
1104
  type: "button",
1105
1105
  className: "rounded-control border border-border/60 bg-background px-3 py-2.5 text-left transition-colors hover:bg-muted/40 focus-visible:bg-muted/40 focus-visible:outline-none",
1106
- onClick: () => T(
1106
+ onClick: () => E(
1107
1107
  sa({
1108
1108
  scope: s,
1109
1109
  existingControls: r,
@@ -1159,7 +1159,7 @@ function Ca({
1159
1159
  ),
1160
1160
  /* @__PURE__ */ t("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
1161
1161
  ] }),
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) => {
1162
+ Z.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: Z.map((e) => {
1163
1163
  const n = (a.selectedCardIds || []).includes(e.cardId);
1164
1164
  return /* @__PURE__ */ d(
1165
1165
  "label",
@@ -1170,7 +1170,7 @@ function Ca({
1170
1170
  Qt,
1171
1171
  {
1172
1172
  checked: n,
1173
- onCheckedChange: (l) => T(
1173
+ onCheckedChange: (l) => E(
1174
1174
  (c) => c && {
1175
1175
  ...c,
1176
1176
  selectedCardIds: l === !0 ? [
@@ -1201,7 +1201,7 @@ function Ca({
1201
1201
  type: "button",
1202
1202
  variant: "outline",
1203
1203
  size: "xs",
1204
- onClick: () => T(
1204
+ onClick: () => E(
1205
1205
  (e) => e && {
1206
1206
  ...e,
1207
1207
  step: 1,
@@ -1216,7 +1216,7 @@ function Ca({
1216
1216
  {
1217
1217
  type: "button",
1218
1218
  size: "xs",
1219
- onClick: () => T(
1219
+ onClick: () => E(
1220
1220
  (e) => e && {
1221
1221
  ...e,
1222
1222
  step: 3
@@ -1243,8 +1243,8 @@ function Ca({
1243
1243
  ...n,
1244
1244
  label: e
1245
1245
  })),
1246
- onDefaultValueChange: Ee,
1247
- onBack: () => T(
1246
+ onDefaultValueChange: Te,
1247
+ onBack: () => E(
1248
1248
  (e) => e && {
1249
1249
  ...e,
1250
1250
  step: 1
@@ -1268,8 +1268,8 @@ function Ca({
1268
1268
  ...n,
1269
1269
  label: e
1270
1270
  })),
1271
- onDefaultValueChange: Ee,
1272
- onBack: () => T(
1271
+ onDefaultValueChange: Te,
1272
+ onBack: () => E(
1273
1273
  (e) => e && {
1274
1274
  ...e,
1275
1275
  step: 2
@@ -1280,12 +1280,12 @@ function Ca({
1280
1280
  }
1281
1281
  ),
1282
1282
  a.step === 3 && !_(a.control.type) && /* @__PURE__ */ t(
1283
- He,
1283
+ Pe,
1284
1284
  {
1285
1285
  control: a.control,
1286
1286
  scope: s,
1287
1287
  createdReference: qe,
1288
- explorerContent: /* @__PURE__ */ d(H, { children: [
1288
+ explorerContent: /* @__PURE__ */ d(P, { children: [
1289
1289
  "Open the card and use",
1290
1290
  " ",
1291
1291
  /* @__PURE__ */ t("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
@@ -1293,7 +1293,7 @@ function Ca({
1293
1293
  "to choose what this control changes."
1294
1294
  ] }),
1295
1295
  sqlDescription: "Reference this control directly in the SQL editor.",
1296
- onBack: () => T(
1296
+ onBack: () => E(
1297
1297
  (e) => e && {
1298
1298
  ...e,
1299
1299
  step: 2
@@ -1304,20 +1304,20 @@ function Ca({
1304
1304
  }
1305
1305
  ),
1306
1306
  a.step === 4 && _(a.control.type) && /* @__PURE__ */ t(
1307
- He,
1307
+ Pe,
1308
1308
  {
1309
1309
  control: a.control,
1310
1310
  scope: s,
1311
1311
  createdReference: qe,
1312
- summaryDetail: /* @__PURE__ */ d(H, { children: [
1312
+ summaryDetail: /* @__PURE__ */ d(P, { children: [
1313
1313
  "Used by ",
1314
1314
  (a.selectedCardIds || []).length,
1315
1315
  " selected card",
1316
1316
  (a.selectedCardIds || []).length === 1 ? "" : "s"
1317
1317
  ] }),
1318
- explorerContent: /* @__PURE__ */ t(H, { children: "Selected cards have been set up to respond to this control automatically." }),
1318
+ explorerContent: /* @__PURE__ */ t(P, { children: "Selected cards have been set up to respond to this control automatically." }),
1319
1319
  sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
1320
- onBack: () => T(
1320
+ onBack: () => E(
1321
1321
  (e) => e && {
1322
1322
  ...e,
1323
1323
  step: 3
@@ -1353,11 +1353,11 @@ function Ca({
1353
1353
  /* @__PURE__ */ d("div", { className: "min-w-0", children: [
1354
1354
  /* @__PURE__ */ d("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1355
1355
  /* @__PURE__ */ t("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
1356
- /* @__PURE__ */ t("span", { className: k, children: Xe(e.type).label }),
1357
- /* @__PURE__ */ t("span", { className: k, children: Ge(s, e.placement) })
1356
+ /* @__PURE__ */ t("span", { className: k, children: Ge(e.type).label }),
1357
+ /* @__PURE__ */ t("span", { className: k, children: Xe(s, e.placement) })
1358
1358
  ] }),
1359
1359
  /* @__PURE__ */ d("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
1360
- Ze(e),
1360
+ Je(e),
1361
1361
  l != null && l.status ? ` · ${l.status}` : ""
1362
1362
  ] })
1363
1363
  ] })
@@ -1380,9 +1380,9 @@ function Ca({
1380
1380
  C && /* @__PURE__ */ d("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
1381
1381
  /* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-3", children: [
1382
1382
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1383
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1383
+ /* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1384
1384
  /* @__PURE__ */ t(
1385
- Je,
1385
+ Ze,
1386
1386
  {
1387
1387
  size: "xs",
1388
1388
  value: e.label,
@@ -1395,7 +1395,7 @@ function Ca({
1395
1395
  )
1396
1396
  ] }),
1397
1397
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1398
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1398
+ /* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1399
1399
  /* @__PURE__ */ d(
1400
1400
  xe,
1401
1401
  {
@@ -1426,18 +1426,18 @@ function Ca({
1426
1426
  )
1427
1427
  ] }),
1428
1428
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1429
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1429
+ /* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1430
1430
  /* @__PURE__ */ d(
1431
1431
  xe,
1432
1432
  {
1433
- value: e.placement || X,
1433
+ value: e.placement || G,
1434
1434
  onValueChange: (f) => W(e.id, (w) => ({
1435
1435
  ...w,
1436
1436
  placement: f
1437
1437
  })),
1438
1438
  children: [
1439
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)) })
1440
+ /* @__PURE__ */ t(ke, { children: Y.map((f) => /* @__PURE__ */ t(Ne, { value: f.value, children: f.label }, f.value)) })
1441
1441
  ]
1442
1442
  }
1443
1443
  )
@@ -1457,7 +1457,7 @@ function Ca({
1457
1457
  })),
1458
1458
  selectedCardIds: (m == null ? void 0 : m[e.id]) || [],
1459
1459
  onChange: (f) => {
1460
- const w = Te({
1460
+ const w = Ee({
1461
1461
  control: e,
1462
1462
  nextSelectedCardIds: f
1463
1463
  }), F = r.map(
@@ -1495,7 +1495,7 @@ function Ca({
1495
1495
  const w = r.map(
1496
1496
  (F) => F.id === e.id ? { ...F, defaultValue: f } : F
1497
1497
  );
1498
- if (e.source.kind === "manual" && (E.current[e.id] = f), i) {
1498
+ if (e.source.kind === "manual" && (T.current[e.id] = f), i) {
1499
1499
  const F = { ...i };
1500
1500
  f === void 0 ? delete F[e.id] : F[e.id] = f, A(w, F);
1501
1501
  return;
@@ -1505,12 +1505,12 @@ function Ca({
1505
1505
  }
1506
1506
  ),
1507
1507
  /* @__PURE__ */ d(
1508
- $t,
1508
+ Ht,
1509
1509
  {
1510
1510
  open: ae === e.id,
1511
- onOpenChange: (f) => G(f ? e.id : null),
1511
+ onOpenChange: (f) => X(f ? e.id : null),
1512
1512
  children: [
1513
- /* @__PURE__ */ t(Ht, { asChild: !0, children: /* @__PURE__ */ d(
1513
+ /* @__PURE__ */ t(Pt, { asChild: !0, children: /* @__PURE__ */ d(
1514
1514
  V,
1515
1515
  {
1516
1516
  type: "button",
@@ -1523,12 +1523,12 @@ function Ca({
1523
1523
  ]
1524
1524
  }
1525
1525
  ) }),
1526
- /* @__PURE__ */ d(Pt, { className: "space-y-3 pt-2", children: [
1526
+ /* @__PURE__ */ d($t, { className: "space-y-3 pt-2", children: [
1527
1527
  /* @__PURE__ */ d("div", { className: "grid gap-3 md:grid-cols-2", children: [
1528
1528
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1529
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
1529
+ /* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
1530
1530
  /* @__PURE__ */ t(
1531
- Yt,
1531
+ Kt,
1532
1532
  {
1533
1533
  controlId: e.id,
1534
1534
  onCommit: (f) => ct(e.id, f)
@@ -1537,7 +1537,7 @@ function Ca({
1537
1537
  )
1538
1538
  ] }),
1539
1539
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1.5", children: [
1540
- /* @__PURE__ */ t(Y, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1540
+ /* @__PURE__ */ t(K, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1541
1541
  /* @__PURE__ */ d(
1542
1542
  xe,
1543
1543
  {
@@ -1562,7 +1562,7 @@ function Ca({
1562
1562
  ] })
1563
1563
  ] }),
1564
1564
  /* @__PURE__ */ t(
1565
- Kt,
1565
+ Yt,
1566
1566
  {
1567
1567
  control: e,
1568
1568
  onChange: (f) => W(e.id, () => f)
@@ -1586,7 +1586,7 @@ function Ca({
1586
1586
  size: "xs",
1587
1587
  onClick: pt,
1588
1588
  children: [
1589
- /* @__PURE__ */ t(Xt, { className: "h-3.5 w-3.5" }),
1589
+ /* @__PURE__ */ t(Gt, { className: "h-3.5 w-3.5" }),
1590
1590
  "Add control"
1591
1591
  ]
1592
1592
  }
@@ -1630,7 +1630,7 @@ function ka(s) {
1630
1630
  export {
1631
1631
  ua as C,
1632
1632
  ba as E,
1633
- Jt as L,
1633
+ Zt as L,
1634
1634
  pa as R,
1635
1635
  ma as S,
1636
1636
  ha as V,
@@ -1,4 +1,4 @@
1
- "use strict";const s=require("./switch-DPaKnsb8.js"),v=require("react"),p=require("./index-cxoegFH9.js"),e=require("react/jsx-runtime"),re=require("./use-visual-utils-BdMhr0YR.js"),he=require("./save-B8x5Vi0W.js");/**
1
+ "use strict";const s=require("./switch-BXICAlvS.js"),v=require("react"),p=require("./index-DX6Krdga.js"),e=require("react/jsx-runtime"),re=require("./use-visual-utils-D_uHFfTn.js"),he=require("./save-CqrBQKG6.js");/**
2
2
  * @license lucide-react v0.453.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.