react-semaphor 0.1.421 → 0.1.423

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 (67) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +2 -2
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +913 -712
  7. package/dist/chunks/{analyze-result-contract-sWcmvBOA.js → analyze-result-contract-D7pjjYPy.js} +45 -46
  8. package/dist/chunks/{analyze-result-contract-B5Eeu7vD.js → analyze-result-contract-DpDcImgk.js} +1 -1
  9. package/dist/chunks/{calendar-preferences-dialog-CscmhyuZ.js → calendar-preferences-dialog-CTmeASaM.js} +1 -1
  10. package/dist/chunks/{calendar-preferences-dialog-cN3_2C-u.js → calendar-preferences-dialog-t5ET6MON.js} +3 -3
  11. package/dist/chunks/card-config-utils-15sRtebL.js +1 -0
  12. package/dist/chunks/card-config-utils-BYZ5MJOh.js +16 -0
  13. package/dist/chunks/dashboard-briefing-launcher-Cavd0QJb.js +3401 -0
  14. package/dist/chunks/dashboard-briefing-launcher-S2akO-ub.js +26 -0
  15. package/dist/chunks/dashboard-controls-BJLrErjW.js +2322 -0
  16. package/dist/chunks/dashboard-controls-DzbP8AXA.js +52 -0
  17. package/dist/chunks/dashboard-json-5tWb5KD6.js +1 -0
  18. package/dist/chunks/{dashboard-json-Cxhw2TZc.js → dashboard-json-Do2-pdPZ.js} +12 -11
  19. package/dist/chunks/{edit-dashboard-visual-BigSJ3-x.js → edit-dashboard-visual-Cw6bq4_w.js} +7058 -6989
  20. package/dist/chunks/edit-dashboard-visual-Yh5YFgMF.js +178 -0
  21. package/dist/chunks/index-BPM3gDRw.js +1406 -0
  22. package/dist/chunks/{index-CH2ZzQo4.js → index-yHe0SeLO.js} +81534 -75430
  23. package/dist/chunks/{switch-TbCsyhv9.js → switch-2bh3Hka1.js} +620 -633
  24. package/dist/chunks/{switch-CiOjVyVI.js → switch-DMT7qf_R.js} +24 -24
  25. package/dist/chunks/{update-policy-2MZ-Vf7v.js → update-policy-BCJc0oI5.js} +1 -1
  26. package/dist/chunks/{update-policy-qpyAkOyO.js → update-policy-C1pmhLz9.js} +1 -1
  27. package/dist/chunks/{use-create-flow-overlay-state-BzcJWNzh.js → use-create-flow-overlay-state-5MDbZcs1.js} +515 -544
  28. package/dist/chunks/use-create-flow-overlay-state-BNczg9Gj.js +11 -0
  29. package/dist/chunks/{validators-Dj1Y-46V.js → validators-DMlVbd1p.js} +1 -1
  30. package/dist/chunks/{validators-D0pfj3jJ.js → validators-PXkij33j.js} +1 -1
  31. package/dist/dashboard/index.cjs +1 -1
  32. package/dist/dashboard/index.js +1 -1
  33. package/dist/dashboard-authoring/index.cjs +1 -1
  34. package/dist/dashboard-authoring/index.js +2 -2
  35. package/dist/data-app-builder/index.cjs +1 -1
  36. package/dist/data-app-builder/index.js +108 -108
  37. package/dist/data-app-codegen/index.cjs +1 -1
  38. package/dist/data-app-codegen/index.js +2 -2
  39. package/dist/data-app-codegen-node/index.cjs +165 -340
  40. package/dist/data-app-codegen-node/index.js +761 -952
  41. package/dist/data-app-sdk/index.cjs +2 -2
  42. package/dist/data-app-sdk/index.js +91 -95
  43. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  44. package/dist/data-app-sdk-adapters/index.js +1 -1
  45. package/dist/data-app-sdk-validation/index.cjs +1 -1
  46. package/dist/data-app-sdk-validation/index.js +2 -2
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.js +168 -164
  49. package/dist/style.css +1 -1
  50. package/dist/surfboard/index.cjs +1 -1
  51. package/dist/surfboard/index.js +2 -2
  52. package/dist/types/analytics-protocol.d.ts +0 -4
  53. package/dist/types/briefings.d.ts +2388 -7
  54. package/dist/types/dashboard-assistant.d.ts +0 -1
  55. package/dist/types/data-app-sdk-validation.d.ts +0 -1
  56. package/dist/types/data-app-sdk.d.ts +0 -2
  57. package/dist/types/main.d.ts +70 -10
  58. package/dist/types/types.d.ts +4 -8
  59. package/package.json +1 -1
  60. package/dist/chunks/dashboard-briefing-launcher-BYTBNetR.js +0 -9077
  61. package/dist/chunks/dashboard-briefing-launcher-DmZkzIC3.js +0 -80
  62. package/dist/chunks/dashboard-controls-9DFeKIP4.js +0 -52
  63. package/dist/chunks/dashboard-controls-PhzuaTBj.js +0 -2280
  64. package/dist/chunks/dashboard-json-DyRHI3mL.js +0 -1
  65. package/dist/chunks/edit-dashboard-visual-3_jiBXsu.js +0 -178
  66. package/dist/chunks/index-BKDQw0aK.js +0 -1346
  67. package/dist/chunks/use-create-flow-overlay-state-DUQmgb9H.js +0 -21
@@ -1,18 +1,18 @@
1
- import { c as ge, X as et, C as je } from "./x-CXDkqdur.js";
2
- import { useState as K, useEffect as ie, useCallback as B, useMemo as P, useRef as Se, Fragment as bt } from "react";
3
- import { F as de, A as Le, u as Z, E as M, a4 as yt, Q as vt, V as xt, W as Ct, c as fe, Y as kt, a5 as St, B as q, d as Nt, e as tt, a6 as wt, a7 as Dt, a8 as pe, a9 as Qe, aa as $e, ab as Ne, ac as we, ad as Et, ae as Pe, af as It, ag as Ft, ah as me, ai as Vt, aj as He, ak as at, al as rt, am as st, L as oe, Z as nt, _ as De, $ as Ee, a0 as Ie, a1 as Fe, a2 as Ve, an as ot, ao as Tt, ap as _t, aq as We, ar as Lt, as as Ke, at as At, au as Te } from "./switch-TbCsyhv9.js";
4
- import { aB as qt, u as Mt, aC as ce, aD as Ot, aE as Ae, aF as zt, aG as Ut, aH as Bt, p as R, aI as Rt, aJ as jt, aK as lt, aL as Qt, aM as $t, aN as Pt, aO as Ht, aP as Wt, y as Kt, aQ as Yt, aR as it, aS as dt, aT as Gt, aU as Jt, aV as Xt, aW as Zt, aX as ea, aY as ct, aZ as ut, a_ as ta, a$ as aa, b0 as ra, b1 as sa, b2 as na, ar as oa, b3 as la, b4 as ia } from "./index-CH2ZzQo4.js";
5
- import { jsx as a, jsxs as m, Fragment as re } from "react/jsx-runtime";
6
- import "./analyze-result-contract-sWcmvBOA.js";
1
+ import { useState as H, useEffect as ie, useCallback as B, useMemo as P, useRef as Se, Fragment as gt } from "react";
2
+ import { F as de, A as _e, u as Z, E as M, a4 as yt, Q as vt, V as xt, W as Ct, c as fe, Y as St, a5 as kt, B as q, d as Nt, e as Ze, a6 as wt, a7 as Dt, a8 as pe, a9 as je, aa as Re, ab as ke, ac as Ne, ad as Et, ae as Qe, af as It, ag as Ft, ah as me, ai as Vt, aj as $e, ak as et, al as tt, am as rt, L as oe, Z as at, _ as we, $ as De, a0 as Ee, a1 as Ie, a2 as Fe, an as st, ao as Tt, ap as _t, aq as Pe, ar as At, as as We, at as Lt, au as Ve } from "./switch-2bh3Hka1.js";
3
+ import { b5 as qt, u as Mt, b6 as ce, b7 as Ot, b8 as Ae, b9 as Ut, ba as zt, bb as Bt, p as j, bc as jt, bd as Rt, be as nt, bf as Qt, bg as $t, bh as Pt, bi as Wt, bj as Kt, y as Ht, bk as Yt, bl as ot, bm as lt, bn as Gt, bo as Xt, bp as Jt, bq as Zt, br as er, bs as it, bt as dt, bu as tr, bv as rr, bw as ar, bx as sr, by as nr, aX as or, bz as lr, bA as ir } from "./index-yHe0SeLO.js";
4
+ import { jsx as r, jsxs as m, Fragment as ae } from "react/jsx-runtime";
5
+ import { c as ct, X as ut, C as Ke } from "./x-CXDkqdur.js";
6
+ import "./analyze-result-contract-D7pjjYPy.js";
7
7
  import { S as pt } from "./save-DgMfP0j8.js";
8
- import { C as Ye } from "./search-BHsQIWBV.js";
8
+ import { C as He } from "./search-BHsQIWBV.js";
9
9
  /**
10
10
  * @license lucide-react v0.453.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- const da = ge("Library", [
15
+ const dr = ct("Library", [
16
16
  ["path", { d: "m16 6 4 14", key: "ji33uf" }],
17
17
  ["path", { d: "M12 6v14", key: "1n7gus" }],
18
18
  ["path", { d: "M8 8v12", key: "1gg7y9" }],
@@ -24,40 +24,13 @@ const da = ge("Library", [
24
24
  * This source code is licensed under the ISC license.
25
25
  * See the LICENSE file in the root directory of this source tree.
26
26
  */
27
- const ca = ge("Link2", [
27
+ const cr = ct("Link2", [
28
28
  ["path", { d: "M9 17H7A5 5 0 0 1 7 7h2", key: "8i5ue5" }],
29
29
  ["path", { d: "M15 7h2a5 5 0 1 1 0 10h-2", key: "1b9ql8" }],
30
30
  ["line", { x1: "8", x2: "16", y1: "12", y2: "12", key: "1jonct" }]
31
31
  ]);
32
- /**
33
- * @license lucide-react v0.453.0 - ISC
34
- *
35
- * This source code is licensed under the ISC license.
36
- * See the LICENSE file in the root directory of this source tree.
37
- */
38
- const Va = ge("Rows3", [
39
- ["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }],
40
- ["path", { d: "M21 9H3", key: "1338ky" }],
41
- ["path", { d: "M21 15H3", key: "9uk58r" }]
42
- ]);
43
- /**
44
- * @license lucide-react v0.453.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */
49
- const Ta = ge("SendHorizontal", [
50
- [
51
- "path",
52
- {
53
- 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",
54
- key: "117uat"
55
- }
56
- ],
57
- ["path", { d: "M6 12h16", key: "s4cdu5" }]
58
- ]);
59
- function ua(t) {
60
- const [r, n] = K(null), [s, l] = K(null), d = qt();
32
+ function ur(t) {
33
+ const [a, n] = H(null), [s, l] = H(null), d = qt();
61
34
  return ie(() => {
62
35
  if (!t || t.trim() === "") {
63
36
  n(null), l(null);
@@ -93,9 +66,9 @@ function ua(t) {
93
66
  console.error("Failed to load remote chart store:", u), l(u), n(null);
94
67
  }
95
68
  })();
96
- }, [t, d]), r;
69
+ }, [t, d]), a;
97
70
  }
98
- function pa(t, r) {
71
+ function pr(t, a) {
99
72
  if (t.length === 0)
100
73
  return "";
101
74
  const n = t.find(
@@ -106,8 +79,8 @@ function pa(t, r) {
106
79
  );
107
80
  if (n)
108
81
  return n.id;
109
- if (r) {
110
- const s = t.find((l) => l.id === r);
82
+ if (a) {
83
+ const s = t.find((l) => l.id === a);
111
84
  if (s) {
112
85
  const l = s.tabTitle;
113
86
  if (l == "All__Header")
@@ -118,36 +91,36 @@ function pa(t, r) {
118
91
  );
119
92
  return f ? f.id : t[0].id;
120
93
  }
121
- return r;
94
+ return a;
122
95
  }
123
96
  }
124
97
  return t[0].id;
125
98
  }
126
- const _e = /* @__PURE__ */ new Set();
127
- function _a(t) {
128
- return _e.add(t), () => {
129
- _e.delete(t);
99
+ const Te = /* @__PURE__ */ new Set();
100
+ function Vr(t) {
101
+ return Te.add(t), () => {
102
+ Te.delete(t);
130
103
  };
131
104
  }
132
- function ma() {
133
- _e.forEach((t) => {
105
+ function mr() {
106
+ Te.forEach((t) => {
134
107
  t();
135
108
  });
136
109
  }
137
- const fa = (t) => {
110
+ const fr = (t) => {
138
111
  if (!t || !("detailTableBackup" in t))
139
112
  return t;
140
- const { detailTableBackup: r, ...n } = t;
113
+ const { detailTableBackup: a, ...n } = t;
141
114
  return n;
142
115
  };
143
- async function Ge(t, r, n, s, l = "Opening library visual...") {
144
- if (!r || !n)
116
+ async function Ye(t, a, n, s, l = "Opening library visual...") {
117
+ if (!a || !n)
145
118
  throw new Error("Missing auth token or visual ID");
146
119
  const d = ["resource-by-id", "visual", n], p = s.getQueryData(d);
147
120
  if (p)
148
121
  return console.log("Using cached visual data for:", n), { data: p, fromCache: !0 };
149
122
  console.log("Fetching visual data from network for:", n);
150
- const f = R.loading(l, {
123
+ const f = j.loading(l, {
151
124
  position: "top-center"
152
125
  });
153
126
  try {
@@ -155,16 +128,16 @@ async function Ge(t, r, n, s, l = "Opening library visual...") {
155
128
  `${t}/management/v1/visuals/${n}`,
156
129
  {
157
130
  headers: {
158
- Authorization: `Bearer ${r}`
131
+ Authorization: `Bearer ${a}`
159
132
  }
160
133
  }
161
134
  );
162
135
  if (!u.ok)
163
136
  throw new Error("Failed to load visual");
164
137
  const v = await u.json();
165
- return s.setQueryData(d, v), R.dismiss(f), { data: v, fromCache: !1 };
138
+ return s.setQueryData(d, v), j.dismiss(f), { data: v, fromCache: !1 };
166
139
  } catch (u) {
167
- throw R.dismiss(f), u;
140
+ throw j.dismiss(f), u;
168
141
  }
169
142
  }
170
143
  function mt(t) {
@@ -174,7 +147,7 @@ function mt(t) {
174
147
  return t;
175
148
  throw new Error("Invalid frame object format");
176
149
  }
177
- function ha(t, r) {
150
+ function hr(t, a) {
178
151
  var d, p;
179
152
  const n = (t == null ? void 0 : t.frameObject) ?? ((d = t == null ? void 0 : t.visual) == null ? void 0 : d.frameObject);
180
153
  if (!n)
@@ -185,23 +158,23 @@ function ha(t, r) {
185
158
  const l = (p = s.cards) == null ? void 0 : p.find(
186
159
  (f) => f.id === s.activeCardId
187
160
  );
188
- return l ? (Rt({
189
- ...r,
161
+ return l ? (jt({
162
+ ...a,
190
163
  frame: s,
191
164
  card: l,
192
165
  visualId: (t == null ? void 0 : t.id) || s.visualId
193
166
  }), !0) : !1;
194
167
  }
195
- function ga() {
168
+ function br() {
196
169
  const t = M(
197
170
  (s) => {
198
171
  var l;
199
172
  return ((l = s.card.customCardPreferences) == null ? void 0 : l.url) || "";
200
173
  }
201
- ), r = ua(t);
174
+ ), a = ur(t);
202
175
  return { getUpdatedFrame: B(() => {
203
176
  var F;
204
- ma();
177
+ mr();
205
178
  const {
206
179
  frame: s,
207
180
  card: l,
@@ -210,100 +183,100 @@ function ga() {
210
183
  selectedSchemaName: f,
211
184
  selectedDatamodelId: u,
212
185
  selectedDatabaseName: v,
213
- selectedTableName: b,
186
+ selectedTableName: g,
214
187
  selectedConnectionId: h
215
- } = M.getState(), x = l.sql, w = (F = r == null ? void 0 : r.getState()) == null ? void 0 : F.settings, k = yt(l, {
188
+ } = M.getState(), x = l.sql, w = (F = a == null ? void 0 : a.getState()) == null ? void 0 : F.settings, S = yt(l, {
216
189
  isDevMode: d,
217
190
  cardSql: x,
218
191
  isShowingVisual: p,
219
192
  selectedSchemaName: f,
220
193
  selectedDatamodelId: u,
221
194
  selectedDatabaseName: v,
222
- selectedTableName: b,
195
+ selectedTableName: g,
223
196
  selectedConnectionId: h,
224
197
  remoteChartSettings: w,
225
- stripConfig: fa
198
+ stripConfig: fr
226
199
  }), N = s.cards.map(
227
- (j) => j.id === l.id ? k : j
200
+ (R) => R.id === l.id ? S : R
228
201
  );
229
202
  return {
230
203
  ...s,
231
204
  cards: N,
232
- activeCardId: pa(N, s.activeCardId)
205
+ activeCardId: pr(N, s.activeCardId)
233
206
  };
234
- }, [r]) };
207
+ }, [a]) };
235
208
  }
236
- function qe() {
237
- const { authToken: t, tokenProps: r } = Mt(), n = ce(), s = Ot(), l = Ae(), { selectVisual: d } = zt(), {
209
+ function Le() {
210
+ const { authToken: t, tokenProps: a } = Mt(), n = ce(), s = Ot(), l = Ae(), { selectVisual: d } = Ut(), {
238
211
  setFrame: p,
239
212
  setCard: f,
240
213
  setIsDevMode: u,
241
214
  initializeModeDrafts: v,
242
- setActiveTabCardId: b,
215
+ setActiveTabCardId: g,
243
216
  updateDataSource: h,
244
217
  setQueryResultColumns: x,
245
218
  setSelectedConnectionId: w,
246
- setSelectedDatabaseName: k,
219
+ setSelectedDatabaseName: S,
247
220
  setSelectedSchemaName: N,
248
221
  setSelectedTableName: F,
249
- setSelectedDatamodelId: j,
222
+ setSelectedDatamodelId: R,
250
223
  setFilterValues: G,
251
224
  setInlineFilterValuesMap: ee,
252
- setApplyFilters: J,
225
+ setApplyFilters: X,
253
226
  clearEditorContext: se
254
227
  } = de(), {
255
228
  setIsDashboardEditing: O,
256
229
  setIsVisualEditing: o,
257
230
  setSelectedFrameId: D,
258
231
  clearSelectedFrameId: V
259
- } = Le(), z = Z((_) => _.selectedSheetId), H = Z((_) => _.selectedFrameId), X = Z((_) => _.dashboard), te = Z((_) => _.filterValues), L = Z(
232
+ } = _e(), U = Z((_) => _.selectedSheetId), W = Z((_) => _.selectedFrameId), J = Z((_) => _.dashboard), te = Z((_) => _.filterValues), A = Z(
260
233
  (_) => _.inlineFilterValuesMap
261
- ), Q = Ut((l == null ? void 0 : l.id) || "", {
234
+ ), Q = zt((l == null ? void 0 : l.id) || "", {
262
235
  enabled: !!(l != null && l.id) && !!(t != null && t.accessToken)
263
236
  }), Y = B(
264
237
  async (_) => {
265
238
  try {
266
239
  d(_), V(), se();
267
- const { data: E, fromCache: W } = await Ge(
268
- r.apiServiceUrl,
240
+ const { data: E, fromCache: K } = await Ye(
241
+ a.apiServiceUrl,
269
242
  (t == null ? void 0 : t.accessToken) || "",
270
243
  _.id,
271
244
  n,
272
245
  "Opening library visual..."
273
246
  );
274
- if (!ha(E, {
247
+ if (!hr(E, {
275
248
  setFrame: p,
276
249
  setCard: f,
277
250
  setIsDevMode: u,
278
251
  initializeModeDrafts: v,
279
- setActiveTabCardId: b,
252
+ setActiveTabCardId: g,
280
253
  updateDataSource: h,
281
254
  setQueryResultColumns: x,
282
255
  setSelectedConnectionId: w,
283
- setSelectedDatabaseName: k,
256
+ setSelectedDatabaseName: S,
284
257
  setSelectedSchemaName: N,
285
258
  setSelectedTableName: F,
286
- setSelectedDatamodelId: j,
259
+ setSelectedDatamodelId: R,
287
260
  setFilterValues: G,
288
261
  setInlineFilterValuesMap: ee,
289
- setApplyFilters: J,
262
+ setApplyFilters: X,
290
263
  setIsDashboardEditing: O,
291
264
  setIsVisualEditing: o,
292
- dashboard: X,
293
- selectedSheetId: z,
294
- selectedFrameId: H,
265
+ dashboard: J,
266
+ selectedSheetId: U,
267
+ selectedFrameId: W,
295
268
  filterValues: te,
296
- inlineFilterValuesMap: L
269
+ inlineFilterValuesMap: A
297
270
  }))
298
271
  throw new Error("Failed to setup editor with visual data");
299
- return { success: !0, fromCache: W };
272
+ return { success: !0, fromCache: K };
300
273
  } catch (E) {
301
274
  return console.error("Error editing visual:", E), { success: !1, error: "Failed to load visual for editing" };
302
275
  }
303
276
  },
304
277
  [
305
278
  t == null ? void 0 : t.accessToken,
306
- r.apiServiceUrl,
279
+ a.apiServiceUrl,
307
280
  n,
308
281
  d,
309
282
  p,
@@ -312,39 +285,39 @@ function qe() {
312
285
  o,
313
286
  u,
314
287
  v,
315
- b,
288
+ g,
316
289
  h,
317
290
  x,
318
291
  w,
319
- k,
292
+ S,
320
293
  N,
321
294
  F,
322
- j,
295
+ R,
323
296
  G,
324
297
  ee,
325
- J,
298
+ X,
326
299
  se,
327
300
  V,
328
- X,
329
- z,
330
- H,
301
+ J,
302
+ U,
303
+ W,
331
304
  te,
332
- L
305
+ A
333
306
  ]
334
307
  ), be = B(
335
308
  async (_) => {
336
- var W;
337
- const E = (A) => (R.error(A), { success: !1, error: A });
309
+ var K;
310
+ const E = (L) => (j.error(L), { success: !1, error: L });
338
311
  try {
339
- if (d(_), !z)
312
+ if (d(_), !U)
340
313
  return E("No sheet selected. Please select a sheet first.");
341
- const { data: A, fromCache: ye } = await Ge(
342
- r.apiServiceUrl,
314
+ const { data: L, fromCache: ge } = await Ye(
315
+ a.apiServiceUrl,
343
316
  (t == null ? void 0 : t.accessToken) || "",
344
317
  _.id,
345
318
  n,
346
319
  "Adding visual to dashboard..."
347
- ), ue = (A == null ? void 0 : A.frameObject) ?? ((W = A == null ? void 0 : A.visual) == null ? void 0 : W.frameObject);
320
+ ), ue = (L == null ? void 0 : L.frameObject) ?? ((K = L == null ? void 0 : L.visual) == null ? void 0 : K.frameObject);
348
321
  if (!ue)
349
322
  return E("Visual has no frame data");
350
323
  const $ = mt(ue);
@@ -356,22 +329,22 @@ function qe() {
356
329
  // Link this frame to the library visual
357
330
  };
358
331
  return await s(
359
- z,
332
+ U,
360
333
  le,
361
334
  "end"
362
- ), O(!0), D(le.id), { success: !0, fromCache: ye };
363
- } catch (A) {
364
- return console.error("Error adding visual:", A), E(
365
- A instanceof Error ? A.message : "Failed to add visual to dashboard"
335
+ ), O(!0), D(le.id), { success: !0, fromCache: ge };
336
+ } catch (L) {
337
+ return console.error("Error adding visual:", L), E(
338
+ L instanceof Error ? L.message : "Failed to add visual to dashboard"
366
339
  );
367
340
  }
368
341
  },
369
342
  [
370
343
  t == null ? void 0 : t.accessToken,
371
- r.apiServiceUrl,
344
+ a.apiServiceUrl,
372
345
  n,
373
346
  d,
374
- z,
347
+ U,
375
348
  O,
376
349
  D,
377
350
  s
@@ -384,13 +357,13 @@ function qe() {
384
357
  error: Q.error,
385
358
  handleEditLibraryVisual: Y,
386
359
  handleAddLibraryVisual: be,
387
- getUpdatedFrame: ga().getUpdatedFrame,
360
+ getUpdatedFrame: br().getUpdatedFrame,
388
361
  refetch: Q.refetch
389
362
  };
390
363
  }
391
- function La() {
364
+ function Tr() {
392
365
  const t = M((p) => p.card.dataSource), {
393
- setSelectedConnectionId: r,
366
+ setSelectedConnectionId: a,
394
367
  setSelectedDatabaseName: n,
395
368
  setSelectedSchemaName: s,
396
369
  setSelectedTableName: l,
@@ -399,11 +372,11 @@ function La() {
399
372
  ie(() => {
400
373
  var w;
401
374
  if (!t) return;
402
- const { tableName: p, schemaName: f, databaseName: u, connectionId: v } = jt(t), b = (w = t.selectedEntities) == null ? void 0 : w[0], x = (b == null ? void 0 : b.type) === "model" && "id" in b ? b.id : "";
403
- r(v || ""), n(u || ""), s(f || ""), l(p || ""), d(x);
375
+ const { tableName: p, schemaName: f, databaseName: u, connectionId: v } = Rt(t), g = (w = t.selectedEntities) == null ? void 0 : w[0], x = (g == null ? void 0 : g.type) === "model" && "id" in g ? g.id : "";
376
+ a(v || ""), n(u || ""), s(f || ""), l(p || ""), d(x);
404
377
  }, [
405
378
  t,
406
- r,
379
+ a,
407
380
  n,
408
381
  s,
409
382
  l,
@@ -412,15 +385,15 @@ function La() {
412
385
  }
413
386
  function ft() {
414
387
  var u, v;
415
- const t = M((b) => b.card), r = M((b) => b.frame), n = P(
416
- () => lt(r, t),
417
- [r, t]
388
+ const t = M((g) => g.card), a = M((g) => g.frame), n = P(
389
+ () => nt(a, t),
390
+ [a, t]
418
391
  ), { manifest: s } = Qt(
419
392
  ((u = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : u.url) || ""
420
393
  ), l = P(
421
394
  () => {
422
- var b;
423
- return (b = s == null ? void 0 : s.visuals) == null ? void 0 : b.find(
395
+ var g;
396
+ return (g = s == null ? void 0 : s.visuals) == null ? void 0 : g.find(
424
397
  (h) => {
425
398
  var x;
426
399
  return h.name === ((x = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : x.componentName);
@@ -430,36 +403,36 @@ function ft() {
430
403
  [s, (v = n == null ? void 0 : n.customCardPreferences) == null ? void 0 : v.componentName]
431
404
  ), d = $t(n, l), p = P(
432
405
  () => Pt({
433
- frame: r,
406
+ frame: a,
434
407
  configCard: n,
435
408
  isMultiInputVisual: d === "multiple"
436
409
  }),
437
- [r, n, d]
410
+ [a, n, d]
438
411
  ), f = P(() => {
439
- const b = p.findIndex(
412
+ const g = p.findIndex(
440
413
  (h) => (h == null ? void 0 : h.id) === t.id
441
414
  );
442
- return b < 0 ? -1 : Ht(t, b);
415
+ return g < 0 ? -1 : Wt(t, g);
443
416
  }, [p, t]);
444
- return P(() => !n || d !== "multiple" || f < 0 ? t.type : Wt(
417
+ return P(() => !n || d !== "multiple" || f < 0 ? t.type : Kt(
445
418
  t,
446
419
  f,
447
420
  l == null ? void 0 : l.slots
448
421
  ) ?? t.type, [n, d, f, t, l == null ? void 0 : l.slots]);
449
422
  }
450
- function Aa({
423
+ function _r({
451
424
  type: t,
452
- isLinked: r,
425
+ isLinked: a,
453
426
  className: n,
454
427
  showLabel: s = !1,
455
428
  showLocal: l = !1
456
429
  }) {
457
- const d = Z((N) => N.selectedFrameId), p = Kt((N) => N.selectedVisual), f = M((N) => N.frame);
430
+ const d = Z((N) => N.selectedFrameId), p = Ht((N) => N.selectedVisual), f = M((N) => N.frame);
458
431
  let u;
459
432
  if (t)
460
433
  u = t;
461
- else if (r !== void 0)
462
- u = r ? "linked" : "library";
434
+ else if (a !== void 0)
435
+ u = a ? "linked" : "library";
463
436
  else if (!!!(f != null && f.visualId || p != null && p.id) && d)
464
437
  u = "local";
465
438
  else if (p && !d)
@@ -476,7 +449,7 @@ function Aa({
476
449
  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",
477
450
  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",
478
451
  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"
479
- }, b = {
452
+ }, g = {
480
453
  local: "Local to this dashboard: Changes made here only affect this dashboard copy.",
481
454
  linked: "Linked to library: Changes made here update the library visual and all linked instances.",
482
455
  library: "Library visual: Share and reuse this visual across multiple dashboards."
@@ -489,16 +462,16 @@ function Aa({
489
462
  linked: "fill-purple-50 dark:fill-purple-950",
490
463
  library: "fill-blue-50 dark:fill-blue-950"
491
464
  }, w = {
492
- local: /* @__PURE__ */ a("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
493
- linked: /* @__PURE__ */ a(ca, { className: "h-3.5 w-3.5" }),
494
- library: /* @__PURE__ */ a(da, { className: "h-3.5 w-3.5" })
495
- }, k = {
465
+ local: /* @__PURE__ */ r("span", { className: "h-2 w-2 rounded-full bg-current/70" }),
466
+ linked: /* @__PURE__ */ r(cr, { className: "h-3.5 w-3.5" }),
467
+ library: /* @__PURE__ */ r(dr, { className: "h-3.5 w-3.5" })
468
+ }, S = {
496
469
  local: "Local",
497
470
  linked: "Linked",
498
471
  library: "Library"
499
472
  };
500
- return /* @__PURE__ */ a(vt, { children: /* @__PURE__ */ m(xt, { delayDuration: 300, children: [
501
- /* @__PURE__ */ a(Ct, { asChild: !0, children: /* @__PURE__ */ m(
473
+ return /* @__PURE__ */ r(vt, { children: /* @__PURE__ */ m(xt, { delayDuration: 300, children: [
474
+ /* @__PURE__ */ r(Ct, { asChild: !0, children: /* @__PURE__ */ m(
502
475
  Yt,
503
476
  {
504
477
  variant: "outline",
@@ -509,24 +482,24 @@ function Aa({
509
482
  ),
510
483
  children: [
511
484
  w[u],
512
- s && /* @__PURE__ */ a("span", { className: "ml-1 text-xs font-medium leading-none", children: k[u] })
485
+ s && /* @__PURE__ */ r("span", { className: "ml-1 text-xs font-medium leading-none", children: S[u] })
513
486
  ]
514
487
  }
515
488
  ) }),
516
489
  /* @__PURE__ */ m(
517
- kt,
490
+ St,
518
491
  {
519
492
  side: "bottom",
520
493
  className: fe("max-w-xs", h[u]),
521
494
  children: [
522
- /* @__PURE__ */ a(St, { className: x[u] }),
523
- /* @__PURE__ */ a("p", { children: b[u] })
495
+ /* @__PURE__ */ r(kt, { className: x[u] }),
496
+ /* @__PURE__ */ r("p", { children: g[u] })
524
497
  ]
525
498
  }
526
499
  )
527
500
  ] }) });
528
501
  }
529
- function ba(t, r) {
502
+ function gr(t, a) {
530
503
  return {
531
504
  ...t,
532
505
  sql: "",
@@ -537,23 +510,23 @@ function ba(t, r) {
537
510
  interactionConfig: void 0,
538
511
  linkedInteractionTargetOverrides: void 0,
539
512
  dynamicCardPreferences: void 0,
540
- customCardPreferences: r ? t.customCardPreferences : void 0,
513
+ customCardPreferences: a ? t.customCardPreferences : void 0,
541
514
  visualizationMode: "builtin",
542
- type: r ? t.type : "bar"
515
+ type: a ? t.type : "bar"
543
516
  };
544
517
  }
545
- function Me(t) {
546
- const r = wt(t);
547
- return r ? (R.error(r), !1) : !0;
518
+ function qe(t) {
519
+ const a = wt(t);
520
+ return a ? (j.error(a), !1) : !0;
548
521
  }
549
- function qa({
522
+ function Ar({
550
523
  className: t,
551
- variant: r = "outline"
524
+ variant: a = "outline"
552
525
  }) {
553
- const n = M((d) => d.onSave), { getUpdatedFrame: s } = qe();
526
+ const n = M((d) => d.onSave), { getUpdatedFrame: s } = Le();
554
527
  function l() {
555
528
  const d = s();
556
- Me(d) && (n == null || n(d));
529
+ qe(d) && (n == null || n(d));
557
530
  }
558
531
  return /* @__PURE__ */ m(
559
532
  q,
@@ -561,29 +534,29 @@ function qa({
561
534
  onClick: l,
562
535
  className: t,
563
536
  size: "xs",
564
- variant: r,
537
+ variant: a,
565
538
  children: [
566
- /* @__PURE__ */ a(Nt, { className: "h-3.5 w-3.5" }),
539
+ /* @__PURE__ */ r(Nt, { className: "h-3.5 w-3.5" }),
567
540
  "Accept"
568
541
  ]
569
542
  }
570
543
  );
571
544
  }
572
- function Ma({
545
+ function Lr({
573
546
  className: t,
574
- variant: r = "default"
547
+ variant: a = "default"
575
548
  }) {
576
- const n = ce(), [s, l] = K(!1), { setIsVisualEditing: d } = Le(), { getUpdatedFrame: p } = qe(), f = Ae(), u = M((h) => h.frame), v = dt();
577
- return /* @__PURE__ */ a(
549
+ const n = ce(), [s, l] = H(!1), { setIsVisualEditing: d } = _e(), { getUpdatedFrame: p } = Le(), f = Ae(), u = M((h) => h.frame), v = lt();
550
+ return /* @__PURE__ */ r(
578
551
  q,
579
552
  {
580
553
  onClick: () => {
581
554
  const h = p();
582
- if (!Me(h))
555
+ if (!qe(h))
583
556
  return;
584
557
  const x = (u == null ? void 0 : u.visualId) || (f == null ? void 0 : f.id);
585
558
  if (!x) {
586
- R.error("No visual to save");
559
+ j.error("No visual to save");
587
560
  return;
588
561
  }
589
562
  l(!0), v.mutate(
@@ -595,73 +568,73 @@ function Ma({
595
568
  },
596
569
  {
597
570
  onSuccess: () => {
598
- l(!1), R.success("Visual updated successfully"), n.invalidateQueries({
571
+ l(!1), j.success("Visual updated successfully"), n.invalidateQueries({
599
572
  queryKey: ["resource-by-id", "visual", x],
600
573
  exact: !0
601
574
  });
602
575
  },
603
576
  onError: () => {
604
- l(!1), R.error("Failed to update visual");
577
+ l(!1), j.error("Failed to update visual");
605
578
  }
606
579
  }
607
580
  );
608
581
  },
609
582
  className: t,
610
583
  size: "xs",
611
- variant: r,
612
- children: s ? /* @__PURE__ */ m(re, { children: [
613
- /* @__PURE__ */ a(tt, { className: "h-3.5 w-3.5 animate-spin" }),
584
+ variant: a,
585
+ children: s ? /* @__PURE__ */ m(ae, { children: [
586
+ /* @__PURE__ */ r(Ze, { className: "h-3.5 w-3.5 animate-spin" }),
614
587
  "Saving"
615
- ] }) : /* @__PURE__ */ m(re, { children: [
616
- /* @__PURE__ */ a(pt, { className: "h-3.5 w-3.5" }),
588
+ ] }) : /* @__PURE__ */ m(ae, { children: [
589
+ /* @__PURE__ */ r(pt, { className: "h-3.5 w-3.5" }),
617
590
  "Save to Library"
618
591
  ] })
619
592
  }
620
593
  );
621
594
  }
622
- function Oa({
595
+ function qr({
623
596
  className: t
624
597
  }) {
625
- const r = ce(), [n, s] = K(!1), l = Ae(), d = M((k) => k.frame), p = Z((k) => k.selectedSheetId), f = Z((k) => k.dashboard), { updateFrame: u, setIsVisualEditing: v } = Le(), { getUpdatedFrame: b } = qe(), h = dt(), x = Gt();
626
- return /* @__PURE__ */ a(
598
+ const a = ce(), [n, s] = H(!1), l = Ae(), d = M((S) => S.frame), p = Z((S) => S.selectedSheetId), f = Z((S) => S.dashboard), { updateFrame: u, setIsVisualEditing: v } = _e(), { getUpdatedFrame: g } = Le(), h = lt(), x = Gt();
599
+ return /* @__PURE__ */ r(
627
600
  q,
628
601
  {
629
602
  onClick: async () => {
630
603
  if (!p) {
631
- R.error("No sheet selected");
604
+ j.error("No sheet selected");
632
605
  return;
633
606
  }
634
- const k = (d == null ? void 0 : d.visualId) || (l == null ? void 0 : l.id);
635
- if (!k) {
636
- R.error("No visual to update");
607
+ const S = (d == null ? void 0 : d.visualId) || (l == null ? void 0 : l.id);
608
+ if (!S) {
609
+ j.error("No visual to update");
637
610
  return;
638
611
  }
639
612
  s(!0);
640
613
  try {
641
- const N = b();
642
- if (!Me(N)) {
614
+ const N = g();
615
+ if (!qe(N)) {
643
616
  s(!1);
644
617
  return;
645
618
  }
646
619
  const F = {
647
620
  ...N,
648
- visualId: k
621
+ visualId: S
649
622
  // Keep the link to library visual
650
- }, j = Jt(f, F.id), G = await x(F, {
651
- previousFrame: j
623
+ }, R = Xt(f, F.id), G = await x(F, {
624
+ previousFrame: R
652
625
  });
653
626
  await h.mutateAsync({
654
- visualId: k,
627
+ visualId: S,
655
628
  data: {
656
629
  frameObject: N
657
630
  }
658
631
  }), u(p, F, {
659
632
  semanticExecutionPayload: G
660
- }), r.invalidateQueries({ queryKey: ["visuals"] }), r.invalidateQueries({ queryKey: ["visual", k] }), R.success("Saved to library and applied locally"), setTimeout(() => {
633
+ }), a.invalidateQueries({ queryKey: ["visuals"] }), a.invalidateQueries({ queryKey: ["visual", S] }), j.success("Saved to library and applied locally"), setTimeout(() => {
661
634
  v(!1);
662
635
  }, 300);
663
636
  } catch (N) {
664
- console.error("Failed to save and apply:", N), R.error(
637
+ console.error("Failed to save and apply:", N), j.error(
665
638
  N instanceof Error ? N.message : "Failed to save and apply changes"
666
639
  );
667
640
  } finally {
@@ -672,19 +645,19 @@ function Oa({
672
645
  size: "xs",
673
646
  variant: "default",
674
647
  disabled: n,
675
- children: n ? /* @__PURE__ */ m(re, { children: [
676
- /* @__PURE__ */ a(tt, { className: "h-3.5 w-3.5 animate-spin" }),
648
+ children: n ? /* @__PURE__ */ m(ae, { children: [
649
+ /* @__PURE__ */ r(Ze, { className: "h-3.5 w-3.5 animate-spin" }),
677
650
  "Saving..."
678
- ] }) : /* @__PURE__ */ m(re, { children: [
679
- /* @__PURE__ */ a(pt, { className: "h-3.5 w-3.5" }),
651
+ ] }) : /* @__PURE__ */ m(ae, { children: [
652
+ /* @__PURE__ */ r(pt, { className: "h-3.5 w-3.5" }),
680
653
  "Save & Apply"
681
654
  ] })
682
655
  }
683
656
  );
684
657
  }
685
- function za({ className: t }) {
686
- const { setTempQueryData: r, setSqlGen: n } = de(), s = ce(), l = M((h) => h.tempQueryData), d = M((h) => h.onClose), p = M((h) => h.card), f = ft(), u = P(() => f !== p.type ? { ...p, type: f } : p, [p, f]), { queryKey: v } = it(u);
687
- function b() {
658
+ function Mr({ className: t }) {
659
+ const { setTempQueryData: a, setSqlGen: n } = de(), s = ce(), l = M((h) => h.tempQueryData), d = M((h) => h.onClose), p = M((h) => h.card), f = ft(), u = P(() => f !== p.type ? { ...p, type: f } : p, [p, f]), { queryKey: v } = ot(u);
660
+ function g() {
688
661
  if (l) {
689
662
  const { queryKey: h, queryData: x } = l;
690
663
  h && x && s.setQueryData(h, x);
@@ -694,49 +667,49 @@ function za({ className: t }) {
694
667
  return /* @__PURE__ */ m(
695
668
  q,
696
669
  {
697
- onClick: b,
670
+ onClick: g,
698
671
  className: t,
699
672
  size: "xs",
700
673
  variant: "outline",
701
674
  children: [
702
- /* @__PURE__ */ a(et, { className: "h-3.5 w-3.5" }),
675
+ /* @__PURE__ */ r(ut, { className: "h-3.5 w-3.5" }),
703
676
  "Close"
704
677
  ]
705
678
  }
706
679
  );
707
680
  }
708
- function Ua({
681
+ function Or({
709
682
  label: t = "Clear",
710
- variant: r = "secondary",
683
+ variant: a = "secondary",
711
684
  className: n
712
685
  } = {}) {
713
- const { setTempQueryData: s } = de(), l = ce(), d = M((O) => O.tempQueryData), p = M((O) => O.card), f = ft(), u = P(() => f !== p.type ? { ...p, type: f } : p, [p, f]), { queryKey: v } = it(u), {
714
- setCardSql: b,
686
+ const { setTempQueryData: s } = de(), l = ce(), d = M((O) => O.tempQueryData), p = M((O) => O.card), f = ft(), u = P(() => f !== p.type ? { ...p, type: f } : p, [p, f]), { queryKey: v } = ot(u), {
687
+ setCardSql: g,
715
688
  setSqlGen: h,
716
689
  setCardPython: x,
717
690
  setCardCustomCfg: w,
718
- setCardPreferences: k,
691
+ setCardPreferences: S,
719
692
  clearQueryConfig: N,
720
693
  setCardConfig: F,
721
- setCardType: j,
694
+ setCardType: R,
722
695
  setFrame: G,
723
696
  setCard: ee,
724
- setActiveTabCardId: J
697
+ setActiveTabCardId: X
725
698
  } = de();
726
699
  function se() {
727
- var X, te, L, Q;
700
+ var J, te, A, Q;
728
701
  const O = l.getQueryData(v);
729
702
  d != null && d.queryData || s({
730
703
  queryKey: v,
731
704
  queryData: O
732
- }), l.setQueryData(v, null), l.removeQueries({ queryKey: v, exact: !0 }), b(""), h({}), N(), F(void 0), x(""), w(""), k({});
733
- const o = M.getState().frame, D = M.getState().card, V = lt(o, D), z = ((X = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : X.visualType) === "multiple" || !!((te = V == null ? void 0 : V.customCardPreferences) != null && te.dataInputCardIds) || (((L = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : L.minInputs) || 0) > 1 || (((Q = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : Q.maxInputs) || 0) > 1, H = ba(D, z);
705
+ }), l.setQueryData(v, null), l.removeQueries({ queryKey: v, exact: !0 }), g(""), h({}), N(), F(void 0), x(""), w(""), S({});
706
+ const o = M.getState().frame, D = M.getState().card, V = nt(o, D), U = ((J = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : J.visualType) === "multiple" || !!((te = V == null ? void 0 : V.customCardPreferences) != null && te.dataInputCardIds) || (((A = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : A.minInputs) || 0) > 1 || (((Q = V == null ? void 0 : V.customCardPreferences) == null ? void 0 : Q.maxInputs) || 0) > 1, W = gr(D, U);
734
707
  G({
735
708
  ...o,
736
709
  cards: o.cards.map(
737
- (Y) => Y.id === H.id ? H : Y
710
+ (Y) => Y.id === W.id ? W : Y
738
711
  )
739
- }), J(H.id), ee(H), z || j("bar");
712
+ }), X(W.id), ee(W), U || R("bar");
740
713
  }
741
714
  return /* @__PURE__ */ m(
742
715
  q,
@@ -744,36 +717,36 @@ function Ua({
744
717
  onClick: se,
745
718
  className: n,
746
719
  size: "xs",
747
- variant: r,
720
+ variant: a,
748
721
  children: [
749
- /* @__PURE__ */ a(et, { className: "h-3.5 w-3.5" }),
722
+ /* @__PURE__ */ r(ut, { className: "h-3.5 w-3.5" }),
750
723
  t
751
724
  ]
752
725
  }
753
726
  );
754
727
  }
755
728
  function ht(t) {
756
- const { control: r, onChange: n } = t;
729
+ const { control: a, onChange: n } = t;
757
730
  return /* @__PURE__ */ m("div", { className: "flex flex-col gap-1.5", children: [
758
- /* @__PURE__ */ a(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
759
- /* @__PURE__ */ a(
760
- nt,
731
+ /* @__PURE__ */ r(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
732
+ /* @__PURE__ */ r(
733
+ at,
761
734
  {
762
735
  size: "xs",
763
- value: r.label,
736
+ value: a.label,
764
737
  placeholder: "Control label",
765
738
  onChange: (s) => n(s.target.value)
766
739
  }
767
740
  )
768
741
  ] });
769
742
  }
770
- function ya(t) {
771
- const { currentStep: r, labels: n } = t;
772
- return /* @__PURE__ */ a("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__ */ a("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: n.map((s, l) => {
773
- const d = l + 1, p = d === r, f = d < r;
774
- return /* @__PURE__ */ m(bt, { children: [
743
+ function yr(t) {
744
+ const { currentStep: a, labels: n } = t;
745
+ return /* @__PURE__ */ r("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__ */ r("div", { className: "flex flex-wrap items-center gap-2 sm:gap-2.5", children: n.map((s, l) => {
746
+ const d = l + 1, p = d === a, f = d < a;
747
+ return /* @__PURE__ */ m(gt, { children: [
775
748
  /* @__PURE__ */ m("div", { className: "flex items-center gap-1.5", children: [
776
- /* @__PURE__ */ a(
749
+ /* @__PURE__ */ r(
777
750
  "span",
778
751
  {
779
752
  className: fe(
@@ -783,7 +756,7 @@ function ya(t) {
783
756
  children: d
784
757
  }
785
758
  ),
786
- /* @__PURE__ */ a(
759
+ /* @__PURE__ */ r(
787
760
  "span",
788
761
  {
789
762
  className: fe(
@@ -794,7 +767,7 @@ function ya(t) {
794
767
  }
795
768
  )
796
769
  ] }),
797
- l < n.length - 1 ? /* @__PURE__ */ a(
770
+ l < n.length - 1 ? /* @__PURE__ */ r(
798
771
  "span",
799
772
  {
800
773
  className: "h-px w-4 bg-border/60 sm:w-6",
@@ -805,35 +778,35 @@ function ya(t) {
805
778
  }) }) });
806
779
  }
807
780
  function he(t) {
808
- const { secondary: r, tertiary: n, primary: s } = t;
781
+ const { secondary: a, tertiary: n, primary: s } = t;
809
782
  return /* @__PURE__ */ m("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: [
810
- r,
783
+ a,
811
784
  n,
812
785
  s
813
786
  ] });
814
787
  }
815
- function va(t) {
816
- const { control: r, scope: n, detail: s } = t;
788
+ function vr(t) {
789
+ const { control: a, scope: n, detail: s } = t;
817
790
  return /* @__PURE__ */ m("div", { className: "flex items-start gap-2.5 rounded-control border border-border/60 bg-muted/30 px-3 py-2.5", children: [
818
- /* @__PURE__ */ a(ia, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
791
+ /* @__PURE__ */ r(ir, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-foreground" }),
819
792
  /* @__PURE__ */ m("div", { className: "min-w-0 space-y-0.5", children: [
820
- /* @__PURE__ */ a("div", { className: "text-[13px] font-medium text-foreground", children: r.label }),
793
+ /* @__PURE__ */ r("div", { className: "text-[13px] font-medium text-foreground", children: a.label }),
821
794
  /* @__PURE__ */ m("div", { className: "text-[12px] text-muted-foreground", children: [
822
- at(r.type).label,
795
+ et(a.type).label,
823
796
  " ·",
824
797
  " ",
825
- st(r),
798
+ rt(a),
826
799
  " ·",
827
800
  " ",
828
- rt(n, r.placement)
801
+ tt(n, a.placement)
829
802
  ] }),
830
- s ? /* @__PURE__ */ a("div", { className: "text-[12px] text-muted-foreground", children: s }) : null
803
+ s ? /* @__PURE__ */ r("div", { className: "text-[12px] text-muted-foreground", children: s }) : null
831
804
  ] })
832
805
  ] });
833
806
  }
834
- function Je(t) {
807
+ function Ge(t) {
835
808
  const {
836
- control: r,
809
+ control: a,
837
810
  defaultValue: n,
838
811
  availableFieldChoices: s,
839
812
  availableMetricChoices: l,
@@ -842,16 +815,16 @@ function Je(t) {
842
815
  onControlChange: f,
843
816
  onLabelChange: u,
844
817
  onDefaultValueChange: v,
845
- onBack: b,
818
+ onBack: g,
846
819
  onNext: h,
847
820
  nextDisabled: x
848
821
  } = t;
849
822
  return /* @__PURE__ */ m("div", { className: "space-y-3", children: [
850
- /* @__PURE__ */ a(ht, { control: r, onChange: u }),
851
- /* @__PURE__ */ a(
852
- ct,
823
+ /* @__PURE__ */ r(ht, { control: a, onChange: u }),
824
+ /* @__PURE__ */ r(
825
+ it,
853
826
  {
854
- control: r,
827
+ control: a,
855
828
  availableFieldChoices: s,
856
829
  availableMetricChoices: l,
857
830
  previewControlDefinitions: d,
@@ -860,10 +833,10 @@ function Je(t) {
860
833
  onChange: f
861
834
  }
862
835
  ),
863
- /* @__PURE__ */ a(
864
- ut,
836
+ /* @__PURE__ */ r(
837
+ dt,
865
838
  {
866
- control: r,
839
+ control: a,
867
840
  value: n,
868
841
  onChange: v,
869
842
  allowNoDefault: !0,
@@ -873,11 +846,11 @@ function Je(t) {
873
846
  previewControlValues: p
874
847
  }
875
848
  ),
876
- /* @__PURE__ */ a(
849
+ /* @__PURE__ */ r(
877
850
  he,
878
851
  {
879
- secondary: /* @__PURE__ */ a(q, { type: "button", variant: "outline", size: "xs", onClick: b, children: "Back" }),
880
- primary: /* @__PURE__ */ a(
852
+ secondary: /* @__PURE__ */ r(q, { type: "button", variant: "outline", size: "xs", onClick: g, children: "Back" }),
853
+ primary: /* @__PURE__ */ r(
881
854
  q,
882
855
  {
883
856
  type: "button",
@@ -891,14 +864,14 @@ function Je(t) {
891
864
  )
892
865
  ] });
893
866
  }
894
- const xa = /* @__PURE__ */ new Set([
867
+ const xr = /* @__PURE__ */ new Set([
895
868
  "grain_selector",
896
869
  "aggregation_selector",
897
870
  "field_selector",
898
871
  "metric_selector"
899
872
  ]);
900
873
  function Xe(t) {
901
- const { text: r, ariaLabel: n } = t, [s, l] = K(!1);
874
+ const { text: a, ariaLabel: n } = t, [s, l] = H(!1);
902
875
  return /* @__PURE__ */ m(
903
876
  "button",
904
877
  {
@@ -906,22 +879,22 @@ function Xe(t) {
906
879
  "aria-label": n,
907
880
  onClick: async () => {
908
881
  try {
909
- await navigator.clipboard.writeText(r), l(!0), setTimeout(() => l(!1), 1200);
882
+ await navigator.clipboard.writeText(a), l(!0), setTimeout(() => l(!1), 1200);
910
883
  } catch (d) {
911
884
  console.error("Failed to copy", d);
912
885
  }
913
886
  },
914
887
  className: "group flex w-full items-center justify-between gap-2 rounded-control bg-muted/40 px-2 py-1 text-left transition-colors hover:bg-muted/60 focus-visible:bg-muted/60 focus-visible:outline-none",
915
888
  children: [
916
- /* @__PURE__ */ a("code", { className: "min-w-0 truncate font-mono text-[12px] text-foreground", children: r }),
917
- /* @__PURE__ */ a("span", { className: "shrink-0 text-[11px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100", children: s ? "Copied" : "Click to copy" })
889
+ /* @__PURE__ */ r("code", { className: "min-w-0 truncate font-mono text-[12px] text-foreground", children: a }),
890
+ /* @__PURE__ */ r("span", { className: "shrink-0 text-[11px] text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100", children: s ? "Copied" : "Click to copy" })
918
891
  ]
919
892
  }
920
893
  );
921
894
  }
922
- function Ze(t) {
895
+ function Je(t) {
923
896
  const {
924
- control: r,
897
+ control: a,
925
898
  scope: n,
926
899
  createdReference: s,
927
900
  explorerContent: l,
@@ -930,33 +903,33 @@ function Ze(t) {
930
903
  onBack: f,
931
904
  onCancel: u,
932
905
  onDone: v
933
- } = t, b = xa.has(r.type), h = s.match(/\[\[param\.(.+?)\]\]/), x = h ? `{{ param('${h[1]}') }}` : "";
906
+ } = t, g = xr.has(a.type), h = s.match(/\[\[param\.(.+?)\]\]/), x = h ? `{{ param('${h[1]}') }}` : "";
934
907
  return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
935
- /* @__PURE__ */ a(
936
- va,
908
+ /* @__PURE__ */ r(
909
+ vr,
937
910
  {
938
- control: r,
911
+ control: a,
939
912
  scope: n,
940
913
  detail: p
941
914
  }
942
915
  ),
943
916
  /* @__PURE__ */ m("div", { className: "space-y-2", children: [
944
- /* @__PURE__ */ a("p", { className: "text-[13px] font-medium text-foreground", children: "How cards use this control" }),
917
+ /* @__PURE__ */ r("p", { className: "text-[13px] font-medium text-foreground", children: "How cards use this control" }),
945
918
  /* @__PURE__ */ m("div", { className: "divide-y divide-border/60 overflow-hidden rounded-control border border-border/60", children: [
946
- b ? /* @__PURE__ */ m("div", { className: "space-y-1 px-3 py-2.5", children: [
947
- /* @__PURE__ */ a("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Explorer cards" }),
948
- /* @__PURE__ */ a("div", { className: "text-[12px] text-muted-foreground", children: l })
919
+ g ? /* @__PURE__ */ m("div", { className: "space-y-1 px-3 py-2.5", children: [
920
+ /* @__PURE__ */ r("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Explorer cards" }),
921
+ /* @__PURE__ */ r("div", { className: "text-[12px] text-muted-foreground", children: l })
949
922
  ] }) : null,
950
923
  /* @__PURE__ */ m("div", { className: "space-y-1.5 px-3 py-2.5", children: [
951
- /* @__PURE__ */ a("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
952
- /* @__PURE__ */ a(
924
+ /* @__PURE__ */ r("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "SQL cards" }),
925
+ /* @__PURE__ */ r(
953
926
  Xe,
954
927
  {
955
928
  text: s,
956
929
  ariaLabel: "Copy SQL control reference"
957
930
  }
958
931
  ),
959
- x ? /* @__PURE__ */ a(
932
+ x ? /* @__PURE__ */ r(
960
933
  Xe,
961
934
  {
962
935
  text: x,
@@ -966,7 +939,7 @@ function Ze(t) {
966
939
  /* @__PURE__ */ m("p", { className: "text-[12px] text-muted-foreground", children: [
967
940
  d,
968
941
  " ",
969
- /* @__PURE__ */ a(
942
+ /* @__PURE__ */ r(
970
943
  "a",
971
944
  {
972
945
  href: "https://docs.semaphor.cloud/docs/concepts/template-expressions",
@@ -981,36 +954,36 @@ function Ze(t) {
981
954
  ] })
982
955
  ] })
983
956
  ] }),
984
- /* @__PURE__ */ a(
957
+ /* @__PURE__ */ r(
985
958
  he,
986
959
  {
987
- secondary: /* @__PURE__ */ a(q, { type: "button", variant: "outline", size: "xs", onClick: f, children: "Back" }),
988
- tertiary: /* @__PURE__ */ a(q, { type: "button", variant: "outline", size: "xs", onClick: u, children: "Cancel" }),
989
- primary: /* @__PURE__ */ a(q, { type: "button", size: "xs", onClick: v, children: "Done" })
960
+ secondary: /* @__PURE__ */ r(q, { type: "button", variant: "outline", size: "xs", onClick: f, children: "Back" }),
961
+ tertiary: /* @__PURE__ */ r(q, { type: "button", variant: "outline", size: "xs", onClick: u, children: "Cancel" }),
962
+ primary: /* @__PURE__ */ r(q, { type: "button", size: "xs", onClick: v, children: "Done" })
990
963
  }
991
964
  )
992
965
  ] });
993
966
  }
994
- function Ca(t) {
995
- const r = pe(
967
+ function Cr(t) {
968
+ const a = pe(
996
969
  t.scope,
997
970
  t.existingControls,
998
971
  t.reservedIds
999
- ), n = t.type === r.type ? {
1000
- ...r,
1001
- label: Te[t.type]
972
+ ), n = t.type === a.type ? {
973
+ ...a,
974
+ label: Ve[t.type]
1002
975
  } : {
1003
- ...ot({
976
+ ...st({
1004
977
  controls: [
1005
978
  {
1006
- ...r,
1007
- label: Te[t.type]
979
+ ...a,
980
+ label: Ve[t.type]
1008
981
  }
1009
982
  ],
1010
- controlId: r.id,
983
+ controlId: a.id,
1011
984
  nextType: t.type
1012
985
  }).controls[0],
1013
- label: Te[t.type]
986
+ label: Ve[t.type]
1014
987
  };
1015
988
  return {
1016
989
  step: 2,
@@ -1018,9 +991,9 @@ function Ca(t) {
1018
991
  defaultValue: me(n, void 0)
1019
992
  };
1020
993
  }
1021
- function Ba({
994
+ function Ur({
1022
995
  scope: t,
1023
- controls: r,
996
+ controls: a,
1024
997
  reservedControlIds: n,
1025
998
  defaultValues: s,
1026
999
  onChange: l,
@@ -1029,34 +1002,34 @@ function Ba({
1029
1002
  usageByControlId: f,
1030
1003
  availableFieldChoices: u,
1031
1004
  availableMetricChoices: v,
1032
- structuralParticipants: b,
1005
+ structuralParticipants: g,
1033
1006
  structuralParticipantIdsByControlId: h,
1034
1007
  card: x,
1035
1008
  allowedControlTypes: w,
1036
- onCreateFlowActiveChange: k,
1009
+ onCreateFlowActiveChange: S,
1037
1010
  onCreateFlowComplete: N
1038
1011
  }) {
1039
1012
  const F = P(
1040
1013
  () => new Set(n || []),
1041
1014
  [n]
1042
- ), j = Tt(t), G = Dt(t), [ee, J] = K(
1015
+ ), R = Tt(t), G = Dt(t), [ee, X] = H(
1043
1016
  null
1044
- ), [se, O] = K(
1017
+ ), [se, O] = H(
1045
1018
  null
1046
- ), [o, D] = K(
1019
+ ), [o, D] = H(
1047
1020
  () => p ? {
1048
1021
  step: 1,
1049
- control: pe(t, r, Array.from(F))
1022
+ control: pe(t, a, Array.from(F))
1050
1023
  } : null
1051
- ), V = Se({}), z = Se(void 0), H = Se(p), X = P(() => {
1052
- const e = Qe({ scope: t, card: x });
1024
+ ), V = Se({}), U = Se(void 0), W = Se(p), J = P(() => {
1025
+ const e = je({ scope: t, card: x });
1053
1026
  if (!w)
1054
1027
  return e;
1055
1028
  const c = new Set(w);
1056
1029
  return e.filter((i) => c.has(i.value));
1057
1030
  }, [w, x, t]), te = B(
1058
1031
  (e) => {
1059
- const c = Qe({
1032
+ const c = je({
1060
1033
  scope: t,
1061
1034
  card: x,
1062
1035
  includeType: w ? void 0 : e
@@ -1064,32 +1037,32 @@ function Ba({
1064
1037
  if (!w)
1065
1038
  return c;
1066
1039
  const i = new Set(w);
1067
- return c.filter((g) => i.has(g.value));
1040
+ return c.filter((b) => i.has(b.value));
1068
1041
  },
1069
1042
  [w, x, t]
1070
- ), L = B(
1043
+ ), A = B(
1071
1044
  (e) => t === "dashboard" && (e === "field_selector" || e === "metric_selector"),
1072
1045
  [t]
1073
1046
  ), Q = P(
1074
- () => o ? $e(
1075
- b || [],
1047
+ () => o ? Re(
1048
+ g || [],
1076
1049
  o.control.type
1077
1050
  ) : [],
1078
- [o, b]
1051
+ [o, g]
1079
1052
  ), Y = P(() => {
1080
1053
  if (!o)
1081
1054
  return {
1082
1055
  fields: u || [],
1083
1056
  metrics: v || []
1084
1057
  };
1085
- if (!L(o.control.type))
1058
+ if (!A(o.control.type))
1086
1059
  return {
1087
1060
  fields: u || [],
1088
1061
  metrics: v || []
1089
1062
  };
1090
- const e = o.selectedCardIds || [], c = Ne({
1063
+ const e = o.selectedCardIds || [], c = ke({
1091
1064
  controlType: o.control.type,
1092
- participants: b || [],
1065
+ participants: g || [],
1093
1066
  selectedCardIds: e
1094
1067
  });
1095
1068
  return {
@@ -1106,20 +1079,20 @@ function Ba({
1106
1079
  u,
1107
1080
  v,
1108
1081
  o,
1109
- L,
1110
- b
1082
+ A,
1083
+ g
1111
1084
  ]);
1112
1085
  ie(() => {
1113
- k == null || k(!!o);
1114
- }, [o, k]), ie(() => {
1115
- const e = p && !H.current;
1116
- H.current = p, e && (D({
1086
+ S == null || S(!!o);
1087
+ }, [o, S]), ie(() => {
1088
+ const e = p && !W.current;
1089
+ W.current = p, e && (D({
1117
1090
  step: 1,
1118
- control: pe(t, r, Array.from(F))
1119
- }), O(null), J(null));
1120
- }, [r, p, F, t]);
1091
+ control: pe(t, a, Array.from(F))
1092
+ }), O(null), X(null));
1093
+ }, [a, p, F, t]);
1121
1094
  const be = (e) => {
1122
- if (!L(e.type))
1095
+ if (!A(e.type))
1123
1096
  return {
1124
1097
  fields: u || [],
1125
1098
  metrics: v || []
@@ -1130,119 +1103,119 @@ function Ba({
1130
1103
  fields: u || [],
1131
1104
  metrics: v || []
1132
1105
  };
1133
- const i = Ne({
1106
+ const i = ke({
1134
1107
  controlType: e.type,
1135
- participants: b || [],
1108
+ participants: g || [],
1136
1109
  selectedCardIds: c
1137
1110
  });
1138
1111
  return {
1139
- fields: e.type === "field_selector" ? i.choices.map((g) => ({
1140
- option: g,
1141
- target: i.fieldTargetMap[g.value]
1112
+ fields: e.type === "field_selector" ? i.choices.map((b) => ({
1113
+ option: b,
1114
+ target: i.fieldTargetMap[b.value]
1142
1115
  })) : [],
1143
- metrics: e.type === "metric_selector" ? i.choices.map((g) => ({
1144
- option: g,
1145
- target: i.metricTargetMap[g.value]
1116
+ metrics: e.type === "metric_selector" ? i.choices.map((b) => ({
1117
+ option: b,
1118
+ target: i.metricTargetMap[b.value]
1146
1119
  })) : []
1147
1120
  };
1148
1121
  }, _ = (e) => {
1149
- if (!L(e.control.type))
1122
+ if (!A(e.control.type))
1150
1123
  return {
1151
1124
  nextControl: e.control,
1152
1125
  cardBindingsById: void 0
1153
1126
  };
1154
- const c = (h == null ? void 0 : h[e.control.id]) || [], i = Ne({
1127
+ const c = (h == null ? void 0 : h[e.control.id]) || [], i = ke({
1155
1128
  controlType: e.control.type,
1156
- participants: b || [],
1129
+ participants: g || [],
1157
1130
  selectedCardIds: e.nextSelectedCardIds
1158
- }), g = At({
1131
+ }), b = Lt({
1159
1132
  control: e.control,
1160
1133
  choices: i.choices
1161
1134
  }), C = Object.fromEntries(
1162
- c.filter((S) => !e.nextSelectedCardIds.includes(S)).map((S) => [S, void 0])
1135
+ c.filter((k) => !e.nextSelectedCardIds.includes(k)).map((k) => [k, void 0])
1163
1136
  );
1164
- return e.nextSelectedCardIds.length > 0 && g.source.kind === "manual" && g.source.options.length > 0 && Object.assign(
1137
+ return e.nextSelectedCardIds.length > 0 && b.source.kind === "manual" && b.source.options.length > 0 && Object.assign(
1165
1138
  C,
1166
- Ke({
1167
- control: g,
1168
- participants: b || [],
1139
+ We({
1140
+ control: b,
1141
+ participants: g || [],
1169
1142
  selectedCardIds: e.nextSelectedCardIds
1170
1143
  })
1171
1144
  ), {
1172
- nextControl: g,
1145
+ nextControl: b,
1173
1146
  cardBindingsById: C
1174
1147
  };
1175
1148
  }, E = B(
1176
1149
  (e, c = s, i = { type: "update" }) => {
1177
- const g = e.map((C) => (we({
1150
+ const b = e.map((C) => (Ne({
1178
1151
  control: C,
1179
1152
  defaultValues: c
1180
1153
  }), Et(
1181
1154
  C
1182
1155
  )));
1183
- l(g, c, i);
1156
+ l(b, c, i);
1184
1157
  },
1185
1158
  [s, l]
1186
- ), W = (e, c) => {
1187
- const i = r.find(
1159
+ ), K = (e, c) => {
1160
+ const i = a.find(
1188
1161
  (T) => T.id === e
1189
1162
  );
1190
- let g = r.map((T) => T.id !== e ? T : c(T));
1191
- const C = g.find(
1163
+ let b = a.map((T) => T.id !== e ? T : c(T));
1164
+ const C = b.find(
1192
1165
  (T) => T.id === e
1193
1166
  );
1194
- let S, y;
1167
+ let k, y;
1195
1168
  if (C && t === "dashboard" && (C.type === "field_selector" || C.type === "metric_selector")) {
1196
1169
  const T = (h == null ? void 0 : h[C.id]) || [], ne = _({
1197
1170
  control: C,
1198
1171
  nextSelectedCardIds: T
1199
1172
  });
1200
- g = g.map(
1201
- (ae) => ae.id === e ? ne.nextControl : ae
1202
- ), S = ne.cardBindingsById, y = [C.id];
1173
+ b = b.map(
1174
+ (re) => re.id === e ? ne.nextControl : re
1175
+ ), k = ne.cardBindingsById, y = [C.id];
1203
1176
  } else if (i && t === "dashboard" && (i.type === "field_selector" || i.type === "metric_selector")) {
1204
1177
  const T = (h == null ? void 0 : h[i.id]) || [];
1205
- S = Object.fromEntries(
1178
+ k = Object.fromEntries(
1206
1179
  T.map((ne) => [ne, void 0])
1207
1180
  ), y = [i.id];
1208
1181
  }
1209
- const I = g.find(
1182
+ const I = b.find(
1210
1183
  (T) => T.id === e
1211
1184
  );
1212
- let U = s;
1185
+ let z = s;
1213
1186
  if (i && I) {
1214
- const T = we({
1187
+ const T = Ne({
1215
1188
  control: i,
1216
1189
  defaultValues: s
1217
1190
  });
1218
1191
  i.source.kind === "manual" && I.source.kind === "sql_query" && (V.current[e] = T);
1219
- const ne = T === void 0 && i.source.kind === "sql_query" && I.source.kind === "manual" ? V.current[e] : T, ae = We({
1192
+ const ne = T === void 0 && i.source.kind === "sql_query" && I.source.kind === "manual" ? V.current[e] : T, re = Pe({
1220
1193
  previousControl: i,
1221
1194
  nextControl: I,
1222
1195
  currentDefaultValue: ne
1223
1196
  });
1224
- I.source.kind === "manual" && (V.current[e] = ae), s && (U = { ...s }, ae === void 0 ? delete U[e] : U[e] = ae), g = g.map(
1225
- (Re) => Re.id === e ? { ...I, defaultValue: ae } : Re
1197
+ I.source.kind === "manual" && (V.current[e] = re), s && (z = { ...s }, re === void 0 ? delete z[e] : z[e] = re), b = b.map(
1198
+ (Be) => Be.id === e ? { ...I, defaultValue: re } : Be
1226
1199
  );
1227
1200
  }
1228
- E(g, U, {
1201
+ E(b, z, {
1229
1202
  type: "update",
1230
- cardBindingsById: S,
1203
+ cardBindingsById: k,
1231
1204
  affectedBindingControlIds: y
1232
1205
  });
1233
- }, A = (e, c) => {
1206
+ }, L = (e, c) => {
1234
1207
  if (!c.trim())
1235
1208
  return;
1236
- const i = la(c);
1237
- if (i === e || F.has(i) || r.some(
1238
- (S) => S.id === i && S.id !== e
1209
+ const i = lr(c);
1210
+ if (i === e || F.has(i) || a.some(
1211
+ (k) => k.id === i && k.id !== e
1239
1212
  ))
1240
1213
  return;
1241
- const g = r.map(
1242
- (S) => S.id === e ? { ...S, id: i } : S
1214
+ const b = a.map(
1215
+ (k) => k.id === e ? { ...k, id: i } : k
1243
1216
  );
1244
1217
  if (!s) {
1245
- E(g, void 0, {
1218
+ E(b, void 0, {
1246
1219
  type: "rename",
1247
1220
  oldId: e,
1248
1221
  newId: i
@@ -1250,13 +1223,13 @@ function Ba({
1250
1223
  return;
1251
1224
  }
1252
1225
  const C = { ...s };
1253
- Object.prototype.hasOwnProperty.call(C, e) && (C[i] = C[e], delete C[e]), E(g, C, {
1226
+ Object.prototype.hasOwnProperty.call(C, e) && (C[i] = C[e], delete C[e]), E(b, C, {
1254
1227
  type: "rename",
1255
1228
  oldId: e,
1256
1229
  newId: i
1257
1230
  });
1258
- }, ye = (e) => {
1259
- const c = r.filter((g) => g.id !== e);
1231
+ }, ge = (e) => {
1232
+ const c = a.filter((b) => b.id !== e);
1260
1233
  if (!s) {
1261
1234
  E(c, void 0, { type: "remove", controlId: e });
1262
1235
  return;
@@ -1264,21 +1237,21 @@ function Ba({
1264
1237
  const i = { ...s };
1265
1238
  delete i[e], E(c, i, { type: "remove", controlId: e });
1266
1239
  }, ue = B(() => {
1267
- z.current = void 0, D({
1240
+ U.current = void 0, D({
1268
1241
  step: 1,
1269
- control: pe(t, r, Array.from(F))
1270
- }), O(null), J(null);
1271
- }, [r, F, t]), $ = (e) => {
1242
+ control: pe(t, a, Array.from(F))
1243
+ }), O(null), X(null);
1244
+ }, [a, F, t]), $ = (e) => {
1272
1245
  D(
1273
1246
  (c) => c && (() => {
1274
1247
  const i = e(c.control);
1275
- c.control.source.kind === "manual" && i.source.kind === "sql_query" && (z.current = c.defaultValue);
1276
- const g = c.defaultValue === void 0 && c.control.source.kind === "sql_query" && i.source.kind === "manual" ? z.current : c.defaultValue, C = We({
1248
+ c.control.source.kind === "manual" && i.source.kind === "sql_query" && (U.current = c.defaultValue);
1249
+ const b = c.defaultValue === void 0 && c.control.source.kind === "sql_query" && i.source.kind === "manual" ? U.current : c.defaultValue, C = Pe({
1277
1250
  previousControl: c.control,
1278
1251
  nextControl: i,
1279
- currentDefaultValue: g
1252
+ currentDefaultValue: b
1280
1253
  });
1281
- return i.source.kind === "manual" && (z.current = C), {
1254
+ return i.source.kind === "manual" && (U.current = C), {
1282
1255
  ...c,
1283
1256
  control: i,
1284
1257
  defaultValue: C
@@ -1287,45 +1260,45 @@ function Ba({
1287
1260
  );
1288
1261
  }, le = (e) => {
1289
1262
  D(
1290
- (c) => c && (c.control.source.kind === "manual" && (z.current = e), {
1263
+ (c) => c && (c.control.source.kind === "manual" && (U.current = e), {
1291
1264
  ...c,
1292
1265
  defaultValue: e
1293
1266
  })
1294
1267
  );
1295
- }, ve = (() => {
1268
+ }, ye = (() => {
1296
1269
  if (!o)
1297
1270
  return !1;
1298
- if (o.step === 2 && L(o.control.type))
1271
+ if (o.step === 2 && A(o.control.type))
1299
1272
  return (o.selectedCardIds || []).length > 0;
1300
1273
  if (o.step !== 2 && o.step !== 3 || !o.control.label.trim())
1301
1274
  return !1;
1302
- const c = o.control.source.kind === "sql_query" ? o.control : Pe(o.control);
1275
+ const c = o.control.source.kind === "sql_query" ? o.control : Qe(o.control);
1303
1276
  if (c.source.kind === "manual" && (It(c) && c.source.options.length === 0 || c.source.options.some(
1304
- (g) => g.label.trim().length === 0 || g.value.trim().length === 0
1277
+ (b) => b.label.trim().length === 0 || b.value.trim().length === 0
1305
1278
  )))
1306
1279
  return !1;
1307
1280
  if (c.source.kind === "sql_query") {
1308
- const { connectionId: i, sql: g, valueColumn: C } = c.source;
1309
- return i.trim().length > 0 && g.trim().length > 0 && C.trim().length > 0;
1281
+ const { connectionId: i, sql: b, valueColumn: C } = c.source;
1282
+ return i.trim().length > 0 && b.trim().length > 0 && C.trim().length > 0;
1310
1283
  }
1311
1284
  return Ft(
1312
1285
  me(c, o.defaultValue)
1313
1286
  );
1314
- })(), Oe = () => {
1315
- var S;
1287
+ })(), Me = () => {
1288
+ var k;
1316
1289
  if (!o)
1317
1290
  return;
1318
- const e = Pe(o.control), c = Lt({
1291
+ const e = Qe(o.control), c = At({
1319
1292
  label: e.label,
1320
1293
  fallbackId: e.id,
1321
- existingControls: r,
1294
+ existingControls: a,
1322
1295
  reservedIds: Array.from(F)
1323
1296
  }), i = {
1324
1297
  ...e,
1325
1298
  id: c
1326
- }, g = t === "dashboard" && (i.type === "field_selector" || i.type === "metric_selector") && ((S = o.selectedCardIds) != null && S.length) ? Ke({
1299
+ }, b = t === "dashboard" && (i.type === "field_selector" || i.type === "metric_selector") && ((k = o.selectedCardIds) != null && k.length) ? We({
1327
1300
  control: i,
1328
- participants: b || [],
1301
+ participants: g || [],
1329
1302
  selectedCardIds: o.selectedCardIds
1330
1303
  }) : void 0, C = me(
1331
1304
  i,
@@ -1337,11 +1310,11 @@ function Ba({
1337
1310
  defaultValue: C,
1338
1311
  createdControlId: c,
1339
1312
  selectedCardIds: o.selectedCardIds,
1340
- cardBindingsById: g
1313
+ cardBindingsById: b
1341
1314
  });
1342
- }, xe = B(() => {
1315
+ }, ve = B(() => {
1343
1316
  D(null);
1344
- }, []), ze = B(() => {
1317
+ }, []), Oe = B(() => {
1345
1318
  if (!(o != null && o.createdControlId)) {
1346
1319
  D(null);
1347
1320
  return;
@@ -1351,16 +1324,16 @@ function Ba({
1351
1324
  o.defaultValue
1352
1325
  );
1353
1326
  if (s) {
1354
- const g = { ...s };
1355
- i === void 0 ? delete g[c] : g[c] = i, E(
1327
+ const b = { ...s };
1328
+ i === void 0 ? delete b[c] : b[c] = i, E(
1356
1329
  [
1357
- ...r,
1330
+ ...a,
1358
1331
  {
1359
1332
  ...e,
1360
1333
  defaultValue: i
1361
1334
  }
1362
1335
  ],
1363
- g,
1336
+ b,
1364
1337
  {
1365
1338
  type: "add",
1366
1339
  cardBindingsById: o.cardBindingsById
@@ -1369,7 +1342,7 @@ function Ba({
1369
1342
  } else
1370
1343
  E(
1371
1344
  [
1372
- ...r,
1345
+ ...a,
1373
1346
  {
1374
1347
  ...e,
1375
1348
  defaultValue: i
@@ -1382,11 +1355,11 @@ function Ba({
1382
1355
  }
1383
1356
  );
1384
1357
  O(c), D(null), N == null || N();
1385
- }, [r, o, s, E, N]), gt = o ? L(o.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ue = o != null && o.createdControlId ? `[[param.${o.createdControlId}]]` : o ? `[[param.${Vt(o.control.label) || o.control.id}]]` : "", Ce = He({
1386
- controls: r,
1358
+ }, [a, o, s, E, N]), bt = o ? A(o.control.type) ? ["Choose type", "Select cards", "Configure", "Finish"] : ["Choose type", "Configure", "Finish"] : [], Ue = o != null && o.createdControlId ? `[[param.${o.createdControlId}]]` : o ? `[[param.${Vt(o.control.label) || o.control.id}]]` : "", xe = $e({
1359
+ controls: a,
1387
1360
  defaultValues: s
1388
- }), ke = o ? [...r, o.control] : r, Be = o ? He({
1389
- controls: ke,
1361
+ }), Ce = o ? [...a, o.control] : a, ze = o ? $e({
1362
+ controls: Ce,
1390
1363
  defaultValues: s,
1391
1364
  overrides: [
1392
1365
  {
@@ -1394,14 +1367,14 @@ function Ba({
1394
1367
  value: o.defaultValue
1395
1368
  }
1396
1369
  ]
1397
- }) : Ce;
1370
+ }) : xe;
1398
1371
  return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
1399
1372
  o ? /* @__PURE__ */ m("div", { className: "space-y-4 pb-1", children: [
1400
- /* @__PURE__ */ a(
1401
- ya,
1373
+ /* @__PURE__ */ r(
1374
+ yr,
1402
1375
  {
1403
1376
  currentStep: o.step,
1404
- labels: gt
1377
+ labels: bt
1405
1378
  }
1406
1379
  ),
1407
1380
  o.step === 1 && (() => {
@@ -1415,50 +1388,50 @@ function Ba({
1415
1388
  // keeping the shared definitions for existing controls.
1416
1389
  "date",
1417
1390
  "text"
1418
- ]), i = X.filter(
1419
- (S) => !e.has(S.value) && !c.has(S.value)
1420
- ), g = X.filter(
1421
- (S) => e.has(S.value)
1422
- ), C = (S) => /* @__PURE__ */ m(
1391
+ ]), i = J.filter(
1392
+ (k) => !e.has(k.value) && !c.has(k.value)
1393
+ ), b = J.filter(
1394
+ (k) => e.has(k.value)
1395
+ ), C = (k) => /* @__PURE__ */ m(
1423
1396
  "button",
1424
1397
  {
1425
1398
  type: "button",
1426
1399
  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",
1427
1400
  onClick: () => D(
1428
- Ca({
1401
+ Cr({
1429
1402
  scope: t,
1430
- existingControls: r,
1403
+ existingControls: a,
1431
1404
  reservedIds: Array.from(F),
1432
- type: S.value
1405
+ type: k.value
1433
1406
  })
1434
1407
  ),
1435
1408
  children: [
1436
- /* @__PURE__ */ a("div", { className: "text-[13px] font-medium text-foreground", children: S.label }),
1437
- /* @__PURE__ */ a("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: S.description })
1409
+ /* @__PURE__ */ r("div", { className: "text-[13px] font-medium text-foreground", children: k.label }),
1410
+ /* @__PURE__ */ r("p", { className: "mt-0.5 text-[12px] text-muted-foreground", children: k.description })
1438
1411
  ]
1439
1412
  },
1440
- S.value
1413
+ k.value
1441
1414
  );
1442
1415
  return /* @__PURE__ */ m("div", { className: "space-y-4", children: [
1443
- t === "card" && (x == null ? void 0 : x.sql) == null ? /* @__PURE__ */ a("p", { className: "text-[12px] text-muted-foreground", children: "Explorer cards support displayed metric, group by field, aggregation, and time grain controls here." }) : null,
1416
+ t === "card" && (x == null ? void 0 : x.sql) == null ? /* @__PURE__ */ r("p", { className: "text-[12px] text-muted-foreground", children: "Explorer cards support displayed metric, group by field, aggregation, and time grain controls here." }) : null,
1444
1417
  i.length > 0 && /* @__PURE__ */ m("div", { className: "space-y-1.5", children: [
1445
- /* @__PURE__ */ a("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input controls" }),
1446
- /* @__PURE__ */ a("div", { className: "grid gap-1.5 sm:grid-cols-2", children: i.map(C) })
1418
+ /* @__PURE__ */ r("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Input controls" }),
1419
+ /* @__PURE__ */ r("div", { className: "grid gap-1.5 sm:grid-cols-2", children: i.map(C) })
1447
1420
  ] }),
1448
- g.length > 0 && /* @__PURE__ */ m("div", { className: "space-y-1.5", children: [
1449
- /* @__PURE__ */ a("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Data-driven controls" }),
1450
- /* @__PURE__ */ a("div", { className: "grid gap-1.5 sm:grid-cols-2", children: g.map(C) })
1421
+ b.length > 0 && /* @__PURE__ */ m("div", { className: "space-y-1.5", children: [
1422
+ /* @__PURE__ */ r("p", { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Data-driven controls" }),
1423
+ /* @__PURE__ */ r("div", { className: "grid gap-1.5 sm:grid-cols-2", children: b.map(C) })
1451
1424
  ] }),
1452
- /* @__PURE__ */ a(
1425
+ /* @__PURE__ */ r(
1453
1426
  he,
1454
1427
  {
1455
- secondary: /* @__PURE__ */ a(
1428
+ secondary: /* @__PURE__ */ r(
1456
1429
  q,
1457
1430
  {
1458
1431
  type: "button",
1459
1432
  variant: "outline",
1460
1433
  size: "xs",
1461
- onClick: xe,
1434
+ onClick: ve,
1462
1435
  children: "Back to controls"
1463
1436
  }
1464
1437
  )
@@ -1466,9 +1439,9 @@ function Ba({
1466
1439
  )
1467
1440
  ] });
1468
1441
  })(),
1469
- o.step === 2 && L(o.control.type) && /* @__PURE__ */ m("div", { className: "space-y-3", children: [
1442
+ o.step === 2 && A(o.control.type) && /* @__PURE__ */ m("div", { className: "space-y-3", children: [
1470
1443
  /* @__PURE__ */ m("div", { className: "space-y-3", children: [
1471
- /* @__PURE__ */ a(
1444
+ /* @__PURE__ */ r(
1472
1445
  ht,
1473
1446
  {
1474
1447
  control: o.control,
@@ -1478,26 +1451,26 @@ function Ba({
1478
1451
  }))
1479
1452
  }
1480
1453
  ),
1481
- /* @__PURE__ */ a("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
1454
+ /* @__PURE__ */ r("p", { className: "text-[12px] text-muted-foreground", children: "Choose which cards should respond to this shared control." })
1482
1455
  ] }),
1483
- Q.length === 0 ? /* @__PURE__ */ a("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__ */ a("div", { className: "space-y-1 rounded-control border border-border/60 bg-background p-2", children: Q.map((e) => {
1456
+ Q.length === 0 ? /* @__PURE__ */ r("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__ */ r("div", { className: "space-y-1 rounded-control border border-border/60 bg-background p-2", children: Q.map((e) => {
1484
1457
  const c = (o.selectedCardIds || []).includes(e.cardId);
1485
1458
  return /* @__PURE__ */ m(
1486
1459
  "label",
1487
1460
  {
1488
1461
  className: "flex items-start gap-2 rounded-control px-1.5 py-1 text-[13px] hover:bg-muted/40",
1489
1462
  children: [
1490
- /* @__PURE__ */ a(
1491
- Xt,
1463
+ /* @__PURE__ */ r(
1464
+ Jt,
1492
1465
  {
1493
1466
  checked: c,
1494
1467
  onCheckedChange: (i) => D(
1495
- (g) => g && {
1496
- ...g,
1468
+ (b) => b && {
1469
+ ...b,
1497
1470
  selectedCardIds: i === !0 ? [
1498
- ...g.selectedCardIds || [],
1471
+ ...b.selectedCardIds || [],
1499
1472
  e.cardId
1500
- ] : (g.selectedCardIds || []).filter(
1473
+ ] : (b.selectedCardIds || []).filter(
1501
1474
  (C) => C !== e.cardId
1502
1475
  )
1503
1476
  }
@@ -1505,18 +1478,18 @@ function Ba({
1505
1478
  }
1506
1479
  ),
1507
1480
  /* @__PURE__ */ m("div", { className: "min-w-0", children: [
1508
- /* @__PURE__ */ a("div", { className: "font-medium text-foreground", children: e.title }),
1509
- /* @__PURE__ */ a("div", { className: "text-[12px] text-muted-foreground", children: o.control.type === "field_selector" ? `${e.fieldChoices.length} compatible group-by fields` : `${e.metricChoices.length} compatible metrics` })
1481
+ /* @__PURE__ */ r("div", { className: "font-medium text-foreground", children: e.title }),
1482
+ /* @__PURE__ */ r("div", { className: "text-[12px] text-muted-foreground", children: o.control.type === "field_selector" ? `${e.fieldChoices.length} compatible group-by fields` : `${e.metricChoices.length} compatible metrics` })
1510
1483
  ] })
1511
1484
  ]
1512
1485
  },
1513
1486
  e.cardId
1514
1487
  );
1515
1488
  }) }),
1516
- /* @__PURE__ */ a(
1489
+ /* @__PURE__ */ r(
1517
1490
  he,
1518
1491
  {
1519
- secondary: /* @__PURE__ */ a(
1492
+ secondary: /* @__PURE__ */ r(
1520
1493
  q,
1521
1494
  {
1522
1495
  type: "button",
@@ -1532,7 +1505,7 @@ function Ba({
1532
1505
  children: "Back"
1533
1506
  }
1534
1507
  ),
1535
- primary: /* @__PURE__ */ a(
1508
+ primary: /* @__PURE__ */ r(
1536
1509
  q,
1537
1510
  {
1538
1511
  type: "button",
@@ -1543,22 +1516,22 @@ function Ba({
1543
1516
  step: 3
1544
1517
  }
1545
1518
  ),
1546
- disabled: !ve,
1519
+ disabled: !ye,
1547
1520
  children: "Next"
1548
1521
  }
1549
1522
  )
1550
1523
  }
1551
1524
  )
1552
1525
  ] }),
1553
- o.step === 2 && !L(o.control.type) && /* @__PURE__ */ a(
1554
- Je,
1526
+ o.step === 2 && !A(o.control.type) && /* @__PURE__ */ r(
1527
+ Ge,
1555
1528
  {
1556
1529
  control: o.control,
1557
1530
  defaultValue: o.defaultValue,
1558
1531
  availableFieldChoices: Y.fields,
1559
1532
  availableMetricChoices: Y.metrics,
1560
- previewControlDefinitions: ke,
1561
- previewControlValues: Be,
1533
+ previewControlDefinitions: Ce,
1534
+ previewControlValues: ze,
1562
1535
  onControlChange: (e) => $(() => e),
1563
1536
  onLabelChange: (e) => $((c) => ({
1564
1537
  ...c,
@@ -1571,19 +1544,19 @@ function Ba({
1571
1544
  step: 1
1572
1545
  }
1573
1546
  ),
1574
- onNext: Oe,
1575
- nextDisabled: !ve
1547
+ onNext: Me,
1548
+ nextDisabled: !ye
1576
1549
  }
1577
1550
  ),
1578
- o.step === 3 && L(o.control.type) && /* @__PURE__ */ a(
1579
- Je,
1551
+ o.step === 3 && A(o.control.type) && /* @__PURE__ */ r(
1552
+ Ge,
1580
1553
  {
1581
1554
  control: o.control,
1582
1555
  defaultValue: o.defaultValue,
1583
1556
  availableFieldChoices: Y.fields,
1584
1557
  availableMetricChoices: Y.metrics,
1585
- previewControlDefinitions: ke,
1586
- previewControlValues: Be,
1558
+ previewControlDefinitions: Ce,
1559
+ previewControlValues: ze,
1587
1560
  onControlChange: (e) => $(() => e),
1588
1561
  onLabelChange: (e) => $((c) => ({
1589
1562
  ...c,
@@ -1596,20 +1569,20 @@ function Ba({
1596
1569
  step: 2
1597
1570
  }
1598
1571
  ),
1599
- onNext: Oe,
1600
- nextDisabled: !ve
1572
+ onNext: Me,
1573
+ nextDisabled: !ye
1601
1574
  }
1602
1575
  ),
1603
- o.step === 3 && !L(o.control.type) && /* @__PURE__ */ a(
1604
- Ze,
1576
+ o.step === 3 && !A(o.control.type) && /* @__PURE__ */ r(
1577
+ Je,
1605
1578
  {
1606
1579
  control: o.control,
1607
1580
  scope: t,
1608
1581
  createdReference: Ue,
1609
- explorerContent: /* @__PURE__ */ m(re, { children: [
1582
+ explorerContent: /* @__PURE__ */ m(ae, { children: [
1610
1583
  "Open the card and use",
1611
1584
  " ",
1612
- /* @__PURE__ */ a("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
1585
+ /* @__PURE__ */ r("span", { className: "font-medium text-foreground", children: "Settings → Controls" }),
1613
1586
  " ",
1614
1587
  "to choose what this control changes."
1615
1588
  ] }),
@@ -1620,23 +1593,23 @@ function Ba({
1620
1593
  step: 2
1621
1594
  }
1622
1595
  ),
1623
- onCancel: xe,
1624
- onDone: ze
1596
+ onCancel: ve,
1597
+ onDone: Oe
1625
1598
  }
1626
1599
  ),
1627
- o.step === 4 && L(o.control.type) && /* @__PURE__ */ a(
1628
- Ze,
1600
+ o.step === 4 && A(o.control.type) && /* @__PURE__ */ r(
1601
+ Je,
1629
1602
  {
1630
1603
  control: o.control,
1631
1604
  scope: t,
1632
1605
  createdReference: Ue,
1633
- summaryDetail: /* @__PURE__ */ m(re, { children: [
1606
+ summaryDetail: /* @__PURE__ */ m(ae, { children: [
1634
1607
  "Used by ",
1635
1608
  (o.selectedCardIds || []).length,
1636
1609
  " selected card",
1637
1610
  (o.selectedCardIds || []).length === 1 ? "" : "s"
1638
1611
  ] }),
1639
- explorerContent: /* @__PURE__ */ a(re, { children: "Selected cards have been set up to respond to this control automatically." }),
1612
+ explorerContent: /* @__PURE__ */ r(ae, { children: "Selected cards have been set up to respond to this control automatically." }),
1640
1613
  sqlDescription: "SQL cards can still reference this control directly in the SQL editor.",
1641
1614
  onBack: () => D(
1642
1615
  (e) => e && {
@@ -1644,17 +1617,17 @@ function Ba({
1644
1617
  step: 3
1645
1618
  }
1646
1619
  ),
1647
- onCancel: xe,
1648
- onDone: ze
1620
+ onCancel: ve,
1621
+ onDone: Oe
1649
1622
  }
1650
1623
  )
1651
1624
  ] }) : null,
1652
- !o && r.length === 0 ? /* @__PURE__ */ a("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: d }) : null,
1653
- !o && r.map((e) => {
1654
- const c = be(e), i = f == null ? void 0 : f[e.id], g = we({
1625
+ !o && a.length === 0 ? /* @__PURE__ */ r("div", { className: "rounded-md border border-dashed p-3 text-sm text-muted-foreground", children: d }) : null,
1626
+ !o && a.map((e) => {
1627
+ const c = be(e), i = f == null ? void 0 : f[e.id], b = Ne({
1655
1628
  control: e,
1656
1629
  defaultValues: s
1657
- }), C = se === e.id, S = "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";
1630
+ }), C = se === 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";
1658
1631
  return /* @__PURE__ */ m(
1659
1632
  "div",
1660
1633
  {
@@ -1670,45 +1643,45 @@ function Ba({
1670
1643
  (y) => y === e.id ? null : e.id
1671
1644
  ),
1672
1645
  children: [
1673
- C ? /* @__PURE__ */ a(je, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ a(Ye, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1646
+ C ? /* @__PURE__ */ r(Ke, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }) : /* @__PURE__ */ r(He, { className: "mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground" }),
1674
1647
  /* @__PURE__ */ m("div", { className: "min-w-0", children: [
1675
1648
  /* @__PURE__ */ m("div", { className: "flex flex-wrap items-center gap-1.5", children: [
1676
- /* @__PURE__ */ a("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
1677
- /* @__PURE__ */ a("span", { className: S, children: at(e.type).label }),
1678
- /* @__PURE__ */ a("span", { className: S, children: rt(t, e.placement) })
1649
+ /* @__PURE__ */ r("span", { className: "truncate text-[13px] font-medium text-foreground", children: e.label || "Untitled control" }),
1650
+ /* @__PURE__ */ r("span", { className: k, children: et(e.type).label }),
1651
+ /* @__PURE__ */ r("span", { className: k, children: tt(t, e.placement) })
1679
1652
  ] }),
1680
1653
  /* @__PURE__ */ m("div", { className: "mt-0.5 text-[12px] text-muted-foreground", children: [
1681
- st(e),
1654
+ rt(e),
1682
1655
  i != null && i.status ? ` · ${i.status}` : ""
1683
1656
  ] })
1684
1657
  ] })
1685
1658
  ]
1686
1659
  }
1687
1660
  ),
1688
- /* @__PURE__ */ a(
1661
+ /* @__PURE__ */ r(
1689
1662
  q,
1690
1663
  {
1691
1664
  type: "button",
1692
1665
  size: "xs",
1693
1666
  variant: "ghost",
1694
1667
  className: "h-7 w-7 shrink-0 p-0 text-muted-foreground",
1695
- onClick: () => ye(e.id),
1668
+ onClick: () => ge(e.id),
1696
1669
  "aria-label": `Remove ${e.label}`,
1697
- children: /* @__PURE__ */ a(Zt, { className: "h-3.5 w-3.5" })
1670
+ children: /* @__PURE__ */ r(Zt, { className: "h-3.5 w-3.5" })
1698
1671
  }
1699
1672
  )
1700
1673
  ] }),
1701
1674
  C && /* @__PURE__ */ m("div", { className: "space-y-4 border-t border-border/60 px-3 py-3", children: [
1702
1675
  /* @__PURE__ */ m("div", { className: "grid gap-3 md:grid-cols-3", children: [
1703
1676
  /* @__PURE__ */ m("div", { className: "flex flex-col gap-1.5", children: [
1704
- /* @__PURE__ */ a(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1705
- /* @__PURE__ */ a(
1706
- nt,
1677
+ /* @__PURE__ */ r(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Label" }),
1678
+ /* @__PURE__ */ r(
1679
+ at,
1707
1680
  {
1708
1681
  size: "xs",
1709
1682
  value: e.label,
1710
1683
  placeholder: "Control label",
1711
- onChange: (y) => W(e.id, (I) => ({
1684
+ onChange: (y) => K(e.id, (I) => ({
1712
1685
  ...I,
1713
1686
  label: y.target.value
1714
1687
  }))
@@ -1716,14 +1689,14 @@ function Ba({
1716
1689
  )
1717
1690
  ] }),
1718
1691
  /* @__PURE__ */ m("div", { className: "flex flex-col gap-1.5", children: [
1719
- /* @__PURE__ */ a(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1692
+ /* @__PURE__ */ r(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Type" }),
1720
1693
  /* @__PURE__ */ m(
1721
- De,
1694
+ we,
1722
1695
  {
1723
1696
  value: e.type,
1724
1697
  onValueChange: (y) => {
1725
- const I = ot({
1726
- controls: r,
1698
+ const I = st({
1699
+ controls: a,
1727
1700
  controlId: e.id,
1728
1701
  nextType: y,
1729
1702
  defaultValues: s
@@ -1731,10 +1704,10 @@ function Ba({
1731
1704
  E(I.controls, I.defaultValues);
1732
1705
  },
1733
1706
  children: [
1734
- /* @__PURE__ */ a(Ee, { size: "xs", children: /* @__PURE__ */ a(Ie, {}) }),
1735
- /* @__PURE__ */ a(Fe, { children: te(e.type).map(
1736
- (y) => /* @__PURE__ */ a(
1737
- Ve,
1707
+ /* @__PURE__ */ r(De, { size: "xs", children: /* @__PURE__ */ r(Ee, {}) }),
1708
+ /* @__PURE__ */ r(Ie, { children: te(e.type).map(
1709
+ (y) => /* @__PURE__ */ r(
1710
+ Fe,
1738
1711
  {
1739
1712
  value: y.value,
1740
1713
  children: y.label
@@ -1747,29 +1720,29 @@ function Ba({
1747
1720
  )
1748
1721
  ] }),
1749
1722
  /* @__PURE__ */ m("div", { className: "flex flex-col gap-1.5", children: [
1750
- /* @__PURE__ */ a(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1723
+ /* @__PURE__ */ r(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Show in" }),
1751
1724
  /* @__PURE__ */ m(
1752
- De,
1725
+ we,
1753
1726
  {
1754
1727
  value: e.placement || G,
1755
- onValueChange: (y) => W(e.id, (I) => ({
1728
+ onValueChange: (y) => K(e.id, (I) => ({
1756
1729
  ...I,
1757
1730
  placement: y
1758
1731
  })),
1759
1732
  children: [
1760
- /* @__PURE__ */ a(Ee, { size: "xs", children: /* @__PURE__ */ a(Ie, {}) }),
1761
- /* @__PURE__ */ a(Fe, { children: j.map((y) => /* @__PURE__ */ a(Ve, { value: y.value, children: y.label }, y.value)) })
1733
+ /* @__PURE__ */ r(De, { size: "xs", children: /* @__PURE__ */ r(Ee, {}) }),
1734
+ /* @__PURE__ */ r(Ie, { children: R.map((y) => /* @__PURE__ */ r(Fe, { value: y.value, children: y.label }, y.value)) })
1762
1735
  ]
1763
1736
  }
1764
1737
  )
1765
1738
  ] })
1766
1739
  ] }),
1767
- L(e.type) ? /* @__PURE__ */ a(
1768
- ea,
1740
+ A(e.type) ? /* @__PURE__ */ r(
1741
+ er,
1769
1742
  {
1770
1743
  type: e.type,
1771
- participants: $e(
1772
- b || [],
1744
+ participants: Re(
1745
+ g || [],
1773
1746
  e.type
1774
1747
  ).map((y) => ({
1775
1748
  cardId: y.cardId,
@@ -1781,44 +1754,44 @@ function Ba({
1781
1754
  const I = _({
1782
1755
  control: e,
1783
1756
  nextSelectedCardIds: y
1784
- }), U = r.map(
1757
+ }), z = a.map(
1785
1758
  (T) => T.id === e.id ? I.nextControl : T
1786
1759
  );
1787
- E(U, s, {
1760
+ E(z, s, {
1788
1761
  type: "update",
1789
1762
  cardBindingsById: I.cardBindingsById
1790
1763
  });
1791
1764
  }
1792
1765
  }
1793
1766
  ) : null,
1794
- /* @__PURE__ */ a(
1795
- ct,
1767
+ /* @__PURE__ */ r(
1768
+ it,
1796
1769
  {
1797
1770
  control: e,
1798
1771
  availableFieldChoices: c.fields,
1799
1772
  availableMetricChoices: c.metrics,
1800
- previewControlDefinitions: r,
1801
- previewControlValues: Ce,
1773
+ previewControlDefinitions: a,
1774
+ previewControlValues: xe,
1802
1775
  controlLifecycle: "edit",
1803
- onChange: (y) => W(e.id, () => y)
1776
+ onChange: (y) => K(e.id, () => y)
1804
1777
  }
1805
1778
  ),
1806
- e.initialValueStrategy === "saved_default" && /* @__PURE__ */ a(
1807
- ut,
1779
+ e.initialValueStrategy === "saved_default" && /* @__PURE__ */ r(
1780
+ dt,
1808
1781
  {
1809
1782
  control: e,
1810
- value: g,
1783
+ value: b,
1811
1784
  allowNoDefault: !0,
1812
1785
  allowCardDefault: !0,
1813
- previewControlDefinitions: r,
1814
- previewControlValues: Ce,
1786
+ previewControlDefinitions: a,
1787
+ previewControlValues: xe,
1815
1788
  onChange: (y) => {
1816
- const I = r.map(
1817
- (U) => U.id === e.id ? { ...U, defaultValue: y } : U
1789
+ const I = a.map(
1790
+ (z) => z.id === e.id ? { ...z, defaultValue: y } : z
1818
1791
  );
1819
1792
  if (e.source.kind === "manual" && (V.current[e.id] = y), s) {
1820
- const U = { ...s };
1821
- y === void 0 ? delete U[e.id] : U[e.id] = y, E(I, U);
1793
+ const z = { ...s };
1794
+ y === void 0 ? delete z[e.id] : z[e.id] = y, E(I, z);
1822
1795
  return;
1823
1796
  }
1824
1797
  E(I, void 0);
@@ -1826,12 +1799,12 @@ function Ba({
1826
1799
  }
1827
1800
  ),
1828
1801
  /* @__PURE__ */ m(
1829
- ta,
1802
+ tr,
1830
1803
  {
1831
1804
  open: ee === e.id,
1832
- onOpenChange: (y) => J(y ? e.id : null),
1805
+ onOpenChange: (y) => X(y ? e.id : null),
1833
1806
  children: [
1834
- /* @__PURE__ */ a(aa, { asChild: !0, children: /* @__PURE__ */ m(
1807
+ /* @__PURE__ */ r(rr, { asChild: !0, children: /* @__PURE__ */ m(
1835
1808
  q,
1836
1809
  {
1837
1810
  type: "button",
@@ -1839,38 +1812,38 @@ function Ba({
1839
1812
  size: "xs",
1840
1813
  className: "-ml-2 gap-1 text-muted-foreground hover:text-foreground",
1841
1814
  children: [
1842
- ee === e.id ? /* @__PURE__ */ a(je, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ a(Ye, { className: "h-3.5 w-3.5" }),
1815
+ ee === e.id ? /* @__PURE__ */ r(Ke, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ r(He, { className: "h-3.5 w-3.5" }),
1843
1816
  "Advanced"
1844
1817
  ]
1845
1818
  }
1846
1819
  ) }),
1847
- /* @__PURE__ */ m(ra, { className: "space-y-3 pt-2", children: [
1820
+ /* @__PURE__ */ m(ar, { className: "space-y-3 pt-2", children: [
1848
1821
  /* @__PURE__ */ m("div", { className: "grid gap-3 md:grid-cols-2", children: [
1849
1822
  /* @__PURE__ */ m("div", { className: "flex flex-col gap-1.5", children: [
1850
- /* @__PURE__ */ a(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
1851
- /* @__PURE__ */ a(
1852
- sa,
1823
+ /* @__PURE__ */ r(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Variable name" }),
1824
+ /* @__PURE__ */ r(
1825
+ sr,
1853
1826
  {
1854
1827
  controlId: e.id,
1855
- onCommit: (y) => A(e.id, y)
1828
+ onCommit: (y) => L(e.id, y)
1856
1829
  },
1857
1830
  e.id
1858
1831
  )
1859
1832
  ] }),
1860
1833
  /* @__PURE__ */ m("div", { className: "flex flex-col gap-1.5", children: [
1861
- /* @__PURE__ */ a(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1834
+ /* @__PURE__ */ r(oe, { className: "text-[10px] font-medium uppercase tracking-[0.08em] text-muted-foreground", children: "Initial value" }),
1862
1835
  /* @__PURE__ */ m(
1863
- De,
1836
+ we,
1864
1837
  {
1865
1838
  value: e.initialValueStrategy,
1866
- onValueChange: (y) => W(e.id, (I) => ({
1839
+ onValueChange: (y) => K(e.id, (I) => ({
1867
1840
  ...I,
1868
1841
  initialValueStrategy: y
1869
1842
  })),
1870
1843
  children: [
1871
- /* @__PURE__ */ a(Ee, { size: "xs", children: /* @__PURE__ */ a(Ie, {}) }),
1872
- /* @__PURE__ */ a(Fe, { children: _t.map((y) => /* @__PURE__ */ a(
1873
- Ve,
1844
+ /* @__PURE__ */ r(De, { size: "xs", children: /* @__PURE__ */ r(Ee, {}) }),
1845
+ /* @__PURE__ */ r(Ie, { children: _t.map((y) => /* @__PURE__ */ r(
1846
+ Fe,
1874
1847
  {
1875
1848
  value: y.value,
1876
1849
  children: y.label
@@ -1882,11 +1855,11 @@ function Ba({
1882
1855
  )
1883
1856
  ] })
1884
1857
  ] }),
1885
- /* @__PURE__ */ a(
1886
- na,
1858
+ /* @__PURE__ */ r(
1859
+ nr,
1887
1860
  {
1888
1861
  control: e,
1889
- onChange: (y) => W(e.id, () => y)
1862
+ onChange: (y) => K(e.id, () => y)
1890
1863
  }
1891
1864
  )
1892
1865
  ] })
@@ -1907,35 +1880,35 @@ function Ba({
1907
1880
  size: "xs",
1908
1881
  onClick: ue,
1909
1882
  children: [
1910
- /* @__PURE__ */ a(oa, { className: "h-3.5 w-3.5" }),
1883
+ /* @__PURE__ */ r(or, { className: "h-3.5 w-3.5" }),
1911
1884
  "Add control"
1912
1885
  ]
1913
1886
  }
1914
1887
  )
1915
1888
  ] });
1916
1889
  }
1917
- function Ra(t) {
1890
+ function zr(t) {
1918
1891
  const {
1919
- open: r,
1892
+ open: a,
1920
1893
  onOpenChange: n,
1921
1894
  initialCreateFlowActive: s = !1,
1922
1895
  dismissMode: l = "passive"
1923
- } = t, d = r !== void 0, [p, f] = K(!1), [u, v] = K(
1896
+ } = t, d = a !== void 0, [p, f] = H(!1), [u, v] = H(
1924
1897
  s
1925
- ), b = d ? r : p, h = B(
1926
- (k) => {
1927
- !k && u && l === "passive" || (d || f(k), k || v(!1), n == null || n(k));
1898
+ ), g = d ? a : p, h = B(
1899
+ (S) => {
1900
+ !S && u && l === "passive" || (d || f(S), S || v(!1), n == null || n(S));
1928
1901
  },
1929
1902
  [d, u, l, n]
1930
1903
  ), x = B(() => {
1931
1904
  d || f(!1), v(!1), n == null || n(!1);
1932
1905
  }, [d, n]);
1933
1906
  ie(() => {
1934
- b || v(!1);
1935
- }, [b]);
1907
+ g || v(!1);
1908
+ }, [g]);
1936
1909
  const w = B(
1937
- (k) => {
1938
- u && k.preventDefault();
1910
+ (S) => {
1911
+ u && S.preventDefault();
1939
1912
  },
1940
1913
  [u]
1941
1914
  );
@@ -1944,26 +1917,24 @@ function Ra(t) {
1944
1917
  handleOpenChange: h,
1945
1918
  isCreateFlowActive: u,
1946
1919
  preventPassiveDismissDuringCreate: w,
1947
- resolvedOpen: b,
1920
+ resolvedOpen: g,
1948
1921
  setIsCreateFlowActive: v
1949
1922
  };
1950
1923
  }
1951
1924
  export {
1952
- Ba as C,
1953
- qa as E,
1954
- da as L,
1955
- Va as R,
1956
- Ta as S,
1957
- Aa as V,
1958
- za as a,
1959
- Ma as b,
1960
- Oa as c,
1961
- ca as d,
1962
- Ra as e,
1963
- La as f,
1925
+ Ur as C,
1926
+ Ar as E,
1927
+ dr as L,
1928
+ _r as V,
1929
+ Mr as a,
1930
+ Lr as b,
1931
+ qr as c,
1932
+ cr as d,
1933
+ zr as e,
1934
+ Tr as f,
1964
1935
  ft as g,
1965
- ma as h,
1966
- Ua as i,
1967
- _a as r,
1968
- qe as u
1936
+ mr as h,
1937
+ Or as i,
1938
+ Vr as r,
1939
+ Le as u
1969
1940
  };