react-semaphor 0.0.174 → 0.0.175

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.
@@ -1,12 +1,12 @@
1
- import { P as T, b as k, j as e, Q as is, R as os, U as w, V as cs, W as ds, X as hs, Y as us, Z as B, _ as W, $ as $s, J as Ks, O as Oe, a0 as Dt, a1 as It, a2 as qt, a3 as Vt, a4 as Rt, a5 as _t, a6 as Fs, a7 as Le, a8 as Qe, a9 as $e, T as We, e as ms, g as Pe, aa as xs, ab as ps, f as G, ac as fs, ad as gs, ae as js, af as Ke, ag as pe, ah as bs, G as i, ai as qe, aj as Ve, ak as Ht, al as Re, w as Gs, v as Us, t as de, am as Bt, r as $t, N as Js, s as Kt, an as Gt, B as Ut, ao as Qs, ap as Jt, L as De, S as ys, z as Qt, n as Os, A as as, u as Ye, aq as Se, ar as ze, as as Wt, at as Pt, au as Yt, av as Ws, aw as Ps, ax as Ys, ay as Xs, az as Zs, aA as Xt, aB as et, aC as st, aD as Zt, aE as ea, aF as sa, aG as ta, aH as aa, aI as ns, aJ as na, aK as Be, aL as Ms, aM as ra, aN as la, aO as ia, aP as oa, aQ as ca, aR as ts, aS as da, aT as Ts, aU as ha, aV as As, aW as ua, aX as ma, aY as xa, aZ as tt, l as pa, C as fa, E as Es, d as ga, h as ja, i as ba, o as ya, a_ as va, m as Na, a$ as Ca, b0 as Sa, b1 as ka, b2 as Ls, b3 as wa, b4 as Ds, b5 as Is, K as za, b6 as at, b7 as Fa, b8 as nt, b9 as Ge, ba as rt, bb as Oa, bc as Ma, bd as Ta, be as Aa, bf as Ea, bg as La, bh as ke, bi as q, bj as V, bk as vs, bl as R, bm as Da, bn as Ia, bo as qa, bp as qs, bq as Va, br as Ra, bs as _a, bt as Ha, bu as Ba } from "./index-5sxgge2v.js";
2
- import he, { useState as M, useEffect as K, useMemo as $a, useRef as Ie } from "react";
1
+ import { P as T, b as k, j as e, Q as ls, R as os, U as w, V as cs, W as ds, X as hs, Y as ms, Z as B, _ as Q, $ as Ks, J as Us, O as Oe, a0 as It, a1 as qt, a2 as Vt, a3 as Rt, a4 as _t, a5 as Ht, a6 as Fs, a7 as Le, a8 as Qe, a9 as $e, T as We, e as us, g as Pe, aa as xs, ab as ps, f as Y, ac as fs, ad as gs, ae as js, af as Ke, ag as pe, ah as bs, G as l, ai as qe, aj as Ve, ak as Bt, al as Re, w as Js, v as Gs, t as de, am as $t, r as Kt, N as Qs, s as Ut, an as Jt, B as Gt, ao as Ws, ap as Qt, L as De, S as ys, z as Wt, n as Os, aq as Ms, A as as, u as Ye, ar as Se, as as ze, at as Ps, au as Ys, av as Xs, aw as Zs, ax as et, ay as Pt, az as st, aA as tt, aB as Yt, aC as Xt, aD as Zt, aE as ea, aF as sa, aG as ns, aH as ta, aI as Be, aJ as rs, aK as Fe, aL as is, aM as Ts, aN as aa, aO as na, aP as ra, aQ as ia, aR as la, aS as ts, aT as oa, aU as As, aV as ca, aW as Es, aX as da, aY as ha, aZ as ma, a_ as at, l as ua, C as xa, E as Ls, d as pa, h as fa, i as ga, o as ja, a$ as ba, m as ya, b0 as va, b1 as Na, b2 as Ca, b3 as Ds, b4 as Sa, b5 as Is, b6 as qs, K as ka, b7 as nt, b8 as wa, b9 as rt, ba as Ue, bb as it, bc as za, bd as Fa, be as Oa, bf as Ma, bg as Ta, bh as Aa, bi as ke, bj as q, bk as V, bl as vs, bm as R, bn as Ea, bo as La, bp as Da, bq as Vs, br as Ia, bs as qa, bt as Va, bu as Ra, bv as _a, bw as Ha } from "./index-a_OFIKki.js";
2
+ import he, { useState as M, useEffect as K, useMemo as Ba, useRef as Ie } from "react";
3
3
  /**
4
4
  * @license lucide-react v0.379.0 - ISC
5
5
  *
6
6
  * This source code is licensed under the ISC license.
7
7
  * See the LICENSE file in the root directory of this source tree.
8
8
  */
9
- const Ka = T("Activity", [
9
+ const $a = T("Activity", [
10
10
  [
11
11
  "path",
12
12
  {
@@ -21,7 +21,7 @@ const Ka = T("Activity", [
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 Ga = T("AreaChart", [
24
+ const Ka = T("AreaChart", [
25
25
  ["path", { d: "M3 3v18h18", key: "1s2lah" }],
26
26
  ["path", { d: "M7 12v5h12V8l-5 5-4-4Z", key: "zxz28u" }]
27
27
  ]);
@@ -65,7 +65,7 @@ const Ja = T("Database", [
65
65
  * This source code is licensed under the ISC license.
66
66
  * See the LICENSE file in the root directory of this source tree.
67
67
  */
68
- const Qa = T("Eraser", [
68
+ const Ga = T("Eraser", [
69
69
  [
70
70
  "path",
71
71
  {
@@ -91,7 +91,7 @@ const lt = T("Filter", [
91
91
  * This source code is licensed under the ISC license.
92
92
  * See the LICENSE file in the root directory of this source tree.
93
93
  */
94
- const Wa = T("Glasses", [
94
+ const Qa = T("Glasses", [
95
95
  ["circle", { cx: "6", cy: "15", r: "4", key: "vux9w4" }],
96
96
  ["circle", { cx: "18", cy: "15", r: "4", key: "18o8ve" }],
97
97
  ["path", { d: "M14 15a2 2 0 0 0-2-2 2 2 0 0 0-2 2", key: "1ag4bs" }],
@@ -104,21 +104,7 @@ const Wa = T("Glasses", [
104
104
  * This source code is licensed under the ISC license.
105
105
  * See the LICENSE file in the root directory of this source tree.
106
106
  */
107
- const Pa = T("GripVertical", [
108
- ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
109
- ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
110
- ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
111
- ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
112
- ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
113
- ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
114
- ]);
115
- /**
116
- * @license lucide-react v0.379.0 - ISC
117
- *
118
- * This source code is licensed under the ISC license.
119
- * See the LICENSE file in the root directory of this source tree.
120
- */
121
- const Ya = T("Hammer", [
107
+ const Wa = T("Hammer", [
122
108
  ["path", { d: "m15 12-8.373 8.373a1 1 0 1 1-3-3L12 9", key: "eefl8a" }],
123
109
  ["path", { d: "m18 15 4-4", key: "16gjal" }],
124
110
  [
@@ -135,7 +121,7 @@ const Ya = T("Hammer", [
135
121
  * This source code is licensed under the ISC license.
136
122
  * See the LICENSE file in the root directory of this source tree.
137
123
  */
138
- const Xa = T("Hash", [
124
+ const Pa = T("Hash", [
139
125
  ["line", { x1: "4", x2: "20", y1: "9", y2: "9", key: "4lhtct" }],
140
126
  ["line", { x1: "4", x2: "20", y1: "15", y2: "15", key: "vyu0kd" }],
141
127
  ["line", { x1: "10", x2: "8", y1: "3", y2: "21", key: "1ggp8o" }],
@@ -147,7 +133,7 @@ const Xa = T("Hash", [
147
133
  * This source code is licensed under the ISC license.
148
134
  * See the LICENSE file in the root directory of this source tree.
149
135
  */
150
- const Za = T("Key", [
136
+ const Ya = T("Key", [
151
137
  ["path", { d: "m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4", key: "g0fldk" }],
152
138
  ["path", { d: "m21 2-9.6 9.6", key: "1j0ho8" }],
153
139
  ["circle", { cx: "7.5", cy: "15.5", r: "5.5", key: "yqb3hr" }]
@@ -168,7 +154,7 @@ const Cs = T("LineChart", [
168
154
  * This source code is licensed under the ISC license.
169
155
  * See the LICENSE file in the root directory of this source tree.
170
156
  */
171
- const en = T("ListEnd", [
157
+ const Xa = T("ListEnd", [
172
158
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
173
159
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
174
160
  ["path", { d: "M10 18H3", key: "13769t" }],
@@ -181,7 +167,7 @@ const en = T("ListEnd", [
181
167
  * This source code is licensed under the ISC license.
182
168
  * See the LICENSE file in the root directory of this source tree.
183
169
  */
184
- const sn = T("ListStart", [
170
+ const Za = T("ListStart", [
185
171
  ["path", { d: "M16 12H3", key: "1a2rj7" }],
186
172
  ["path", { d: "M16 18H3", key: "12xzn7" }],
187
173
  ["path", { d: "M10 6H3", key: "lf8lx7" }],
@@ -194,7 +180,7 @@ const sn = T("ListStart", [
194
180
  * This source code is licensed under the ISC license.
195
181
  * See the LICENSE file in the root directory of this source tree.
196
182
  */
197
- const tn = T("ListX", [
183
+ const en = T("ListX", [
198
184
  ["path", { d: "M11 12H3", key: "51ecnj" }],
199
185
  ["path", { d: "M16 6H3", key: "1wxfjs" }],
200
186
  ["path", { d: "M16 18H3", key: "12xzn7" }],
@@ -207,7 +193,7 @@ const tn = T("ListX", [
207
193
  * This source code is licensed under the ISC license.
208
194
  * See the LICENSE file in the root directory of this source tree.
209
195
  */
210
- const an = T("MessageSquareMore", [
196
+ const sn = T("MessageSquareMore", [
211
197
  ["path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z", key: "1lielz" }],
212
198
  ["path", { d: "M8 10h.01", key: "19clt8" }],
213
199
  ["path", { d: "M12 10h.01", key: "1nrarc" }],
@@ -219,7 +205,7 @@ const an = T("MessageSquareMore", [
219
205
  * This source code is licensed under the ISC license.
220
206
  * See the LICENSE file in the root directory of this source tree.
221
207
  */
222
- const nn = T("Network", [
208
+ const tn = T("Network", [
223
209
  ["rect", { x: "16", y: "16", width: "6", height: "6", rx: "1", key: "4q2zg0" }],
224
210
  ["rect", { x: "2", y: "16", width: "6", height: "6", rx: "1", key: "8cvhb9" }],
225
211
  ["rect", { x: "9", y: "2", width: "6", height: "6", rx: "1", key: "1egb70" }],
@@ -232,7 +218,7 @@ const nn = T("Network", [
232
218
  * This source code is licensed under the ISC license.
233
219
  * See the LICENSE file in the root directory of this source tree.
234
220
  */
235
- const it = T("Pencil", [
221
+ const ot = T("Pencil", [
236
222
  ["path", { d: "M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z", key: "5qss01" }],
237
223
  ["path", { d: "m15 5 4 4", key: "1mk7zo" }]
238
224
  ]);
@@ -242,7 +228,7 @@ const it = T("Pencil", [
242
228
  * This source code is licensed under the ISC license.
243
229
  * See the LICENSE file in the root directory of this source tree.
244
230
  */
245
- const ot = T("PieChart", [
231
+ const ct = T("PieChart", [
246
232
  ["path", { d: "M21.21 15.89A10 10 0 1 1 8 2.83", key: "k2fpak" }],
247
233
  ["path", { d: "M22 12A10 10 0 0 0 12 2v10z", key: "1rfc4y" }]
248
234
  ]);
@@ -252,7 +238,7 @@ const ot = T("PieChart", [
252
238
  * This source code is licensed under the ISC license.
253
239
  * See the LICENSE file in the root directory of this source tree.
254
240
  */
255
- const rn = T("Play", [
241
+ const an = T("Play", [
256
242
  ["polygon", { points: "6 3 20 12 6 21 6 3", key: "1oa8hb" }]
257
243
  ]);
258
244
  /**
@@ -261,7 +247,7 @@ const rn = T("Play", [
261
247
  * This source code is licensed under the ISC license.
262
248
  * See the LICENSE file in the root directory of this source tree.
263
249
  */
264
- const ln = T("Plug2", [
250
+ const nn = T("Plug2", [
265
251
  ["path", { d: "M9 2v6", key: "17ngun" }],
266
252
  ["path", { d: "M15 2v6", key: "s7yy2p" }],
267
253
  ["path", { d: "M12 17v5", key: "bb1du9" }],
@@ -274,7 +260,7 @@ const ln = T("Plug2", [
274
260
  * This source code is licensed under the ISC license.
275
261
  * See the LICENSE file in the root directory of this source tree.
276
262
  */
277
- const ct = T("Plus", [
263
+ const dt = T("Plus", [
278
264
  ["path", { d: "M5 12h14", key: "1ays0h" }],
279
265
  ["path", { d: "M12 5v14", key: "s699le" }]
280
266
  ]);
@@ -284,7 +270,7 @@ const ct = T("Plus", [
284
270
  * This source code is licensed under the ISC license.
285
271
  * See the LICENSE file in the root directory of this source tree.
286
272
  */
287
- const on = T("Save", [
273
+ const rn = T("Save", [
288
274
  [
289
275
  "path",
290
276
  {
@@ -301,7 +287,7 @@ const on = T("Save", [
301
287
  * This source code is licensed under the ISC license.
302
288
  * See the LICENSE file in the root directory of this source tree.
303
289
  */
304
- const dt = T("ScatterChart", [
290
+ const ht = T("ScatterChart", [
305
291
  ["circle", { cx: "7.5", cy: "7.5", r: ".5", fill: "currentColor", key: "kqv944" }],
306
292
  ["circle", { cx: "18.5", cy: "5.5", r: ".5", fill: "currentColor", key: "lysivs" }],
307
293
  ["circle", { cx: "11.5", cy: "11.5", r: ".5", fill: "currentColor", key: "byv1b8" }],
@@ -315,7 +301,7 @@ const dt = T("ScatterChart", [
315
301
  * This source code is licensed under the ISC license.
316
302
  * See the LICENSE file in the root directory of this source tree.
317
303
  */
318
- const cn = T("ShieldQuestion", [
304
+ const ln = T("ShieldQuestion", [
319
305
  [
320
306
  "path",
321
307
  {
@@ -326,6 +312,33 @@ const cn = T("ShieldQuestion", [
326
312
  ["path", { d: "M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3", key: "mhlwft" }],
327
313
  ["path", { d: "M12 17h.01", key: "p32p05" }]
328
314
  ]);
315
+ /**
316
+ * @license lucide-react v0.379.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */
321
+ const on = T("Sigma", [
322
+ ["path", { d: "M18 7V4H6l6 8-6 8h12v-3", key: "zis8ev" }]
323
+ ]);
324
+ /**
325
+ * @license lucide-react v0.379.0 - ISC
326
+ *
327
+ * This source code is licensed under the ISC license.
328
+ * See the LICENSE file in the root directory of this source tree.
329
+ */
330
+ const cn = T("SwatchBook", [
331
+ ["path", { d: "M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z", key: "1ldrpk" }],
332
+ ["path", { d: "M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7", key: "11i5po" }],
333
+ ["path", { d: "M 7 17h0.01", key: "10821z" }],
334
+ [
335
+ "path",
336
+ {
337
+ d: "m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8",
338
+ key: "o2gii7"
339
+ }
340
+ ]
341
+ ]);
329
342
  /**
330
343
  * @license lucide-react v0.379.0 - ISC
331
344
  *
@@ -358,7 +371,7 @@ const hn = T("ToggleLeft", [
358
371
  * This source code is licensed under the ISC license.
359
372
  * See the LICENSE file in the root directory of this source tree.
360
373
  */
361
- const un = T("Type", [
374
+ const mn = T("Type", [
362
375
  ["polyline", { points: "4 7 4 4 20 4 20 7", key: "1nosan" }],
363
376
  ["line", { x1: "9", x2: "15", y1: "20", y2: "20", key: "swin9y" }],
364
377
  ["line", { x1: "12", x2: "12", y1: "4", y2: "20", key: "1tx1rr" }]
@@ -369,26 +382,26 @@ const un = T("Type", [
369
382
  * This source code is licensed under the ISC license.
370
383
  * See the LICENSE file in the root directory of this source tree.
371
384
  */
372
- const mn = T("User", [
385
+ const un = T("User", [
373
386
  ["path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2", key: "975kel" }],
374
387
  ["circle", { cx: "12", cy: "7", r: "4", key: "17ys0d" }]
375
388
  ]);
376
389
  function xn() {
377
- const [s, a] = M(""), [t, n] = M(!1), [o, l] = M(!1), r = k((d) => d.dashboard);
390
+ const [s, n] = M(""), [t, a] = M(!1), [o, i] = M(!1), r = k((d) => d.dashboard);
378
391
  function c() {
379
- const d = Ks(r), m = Oe(r.id), h = JSON.parse(localStorage.getItem(m) || "[]");
392
+ const d = Us(r), u = Oe(r.id), h = JSON.parse(localStorage.getItem(u) || "[]");
380
393
  if (h.some(
381
394
  (f) => f.name === s
382
395
  )) {
383
- n(!0);
396
+ a(!0);
384
397
  return;
385
398
  }
386
399
  h.push({
387
400
  name: s,
388
401
  template: d
389
- }), localStorage.setItem(m, JSON.stringify(h)), l(!1);
402
+ }), localStorage.setItem(u, JSON.stringify(h)), i(!1);
390
403
  }
391
- return /* @__PURE__ */ e.jsxs(is, { open: o, onOpenChange: l, children: [
404
+ return /* @__PURE__ */ e.jsxs(ls, { open: o, onOpenChange: i, children: [
392
405
  /* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
393
406
  w,
394
407
  {
@@ -396,7 +409,7 @@ function xn() {
396
409
  className: "h-7 p-2",
397
410
  size: "sm",
398
411
  children: [
399
- /* @__PURE__ */ e.jsx(ct, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
412
+ /* @__PURE__ */ e.jsx(dt, { className: " mr-2 h-4 w-4", strokeWidth: 1.5 }),
400
413
  "Add Lens"
401
414
  ]
402
415
  }
@@ -404,16 +417,16 @@ function xn() {
404
417
  /* @__PURE__ */ e.jsxs(cs, { className: "sm:max-w-[425px]", children: [
405
418
  /* @__PURE__ */ e.jsxs(ds, { children: [
406
419
  /* @__PURE__ */ e.jsx(hs, { children: "Add a Lens" }),
407
- /* @__PURE__ */ e.jsx(us, { children: "Lenses are private by default and are only visible to you." })
420
+ /* @__PURE__ */ e.jsx(ms, { children: "Lenses are private by default and are only visible to you." })
408
421
  ] }),
409
422
  /* @__PURE__ */ e.jsx("div", { className: "grid gap-4 py-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-8 items-center gap-4", children: [
410
423
  /* @__PURE__ */ e.jsx(B, { className: "text-right", children: "Name" }),
411
424
  /* @__PURE__ */ e.jsx(
412
- W,
425
+ Q,
413
426
  {
414
427
  value: s,
415
428
  onChange: (d) => {
416
- t && n(!1), a(d.target.value);
429
+ t && a(!1), n(d.target.value);
417
430
  },
418
431
  id: "name",
419
432
  className: "col-span-7 focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -421,7 +434,7 @@ function xn() {
421
434
  )
422
435
  ] }) }),
423
436
  t && /* @__PURE__ */ e.jsx("p", { className: "text-sm", children: "The bookmark name already exists. Use a differnet name." }),
424
- /* @__PURE__ */ e.jsx($s, { children: /* @__PURE__ */ e.jsx(
437
+ /* @__PURE__ */ e.jsx(Ks, { children: /* @__PURE__ */ e.jsx(
425
438
  w,
426
439
  {
427
440
  variant: "outline",
@@ -435,7 +448,7 @@ function xn() {
435
448
  ] });
436
449
  }
437
450
  function pn() {
438
- const [s, a] = M(!1), [t, n] = M(""), o = k((p) => p.dashboard), l = k((p) => p.bookmarkKey), [r, c] = M([]), d = k((p) => p.actions.setDashboard), m = k(
451
+ const [s, n] = M(!1), [t, a] = M(""), o = k((p) => p.dashboard), i = k((p) => p.bookmarkKey), [r, c] = M([]), d = k((p) => p.actions.setDashboard), u = k(
439
452
  (p) => p.actions.setFilterValues
440
453
  ), h = k(
441
454
  (p) => p.actions.setBookmarkKey
@@ -446,13 +459,13 @@ function pn() {
446
459
  const S = g.find(
447
460
  (N) => N.default
448
461
  );
449
- S && S.name === l && n(S.name);
450
- }, [s, o, l]);
451
- function u(p) {
462
+ S && S.name === i && a(S.name);
463
+ }, [s, o, i]);
464
+ function m(p) {
452
465
  if (p === t)
453
466
  return;
454
467
  const g = r.find((N) => N.name === p), S = g == null ? void 0 : g.template;
455
- S && (d(S), m(g.filterValues || []), h(p === "Original" ? "" : p)), n(p);
468
+ S && (d(S), u(g.filterValues || []), h(p === "Original" ? "" : p)), a(p);
456
469
  }
457
470
  function f(p) {
458
471
  const g = Oe(o.id), N = JSON.parse(localStorage.getItem(g) || "[]").filter(
@@ -460,16 +473,16 @@ function pn() {
460
473
  );
461
474
  localStorage.setItem(g, JSON.stringify(N)), c(N);
462
475
  }
463
- return /* @__PURE__ */ e.jsxs(Dt, { open: s, onOpenChange: a, children: [
464
- /* @__PURE__ */ e.jsx(It, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Wa, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
465
- /* @__PURE__ */ e.jsxs(qt, { className: "w-56", children: [
466
- /* @__PURE__ */ e.jsx(Vt, { children: "Lenses" }),
467
- /* @__PURE__ */ e.jsx(Rt, {}),
476
+ return /* @__PURE__ */ e.jsxs(It, { open: s, onOpenChange: n, children: [
477
+ /* @__PURE__ */ e.jsx(qt, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "outline", className: "h-7 p-2", children: /* @__PURE__ */ e.jsx(Qa, { className: "h-4 w-4", strokeWidth: 1.5 }) }) }),
478
+ /* @__PURE__ */ e.jsxs(Vt, { className: "w-56", children: [
479
+ /* @__PURE__ */ e.jsx(Rt, { children: "Lenses" }),
480
+ /* @__PURE__ */ e.jsx(_t, {}),
468
481
  /* @__PURE__ */ e.jsxs(
469
- _t,
482
+ Ht,
470
483
  {
471
484
  value: t,
472
- onValueChange: u,
485
+ onValueChange: m,
473
486
  children: [
474
487
  /* @__PURE__ */ e.jsx(Fs, { value: "Original", children: "Original" }),
475
488
  r.filter((p) => p.name != "Original").map((p, g) => /* @__PURE__ */ e.jsxs(
@@ -477,7 +490,7 @@ function pn() {
477
490
  {
478
491
  className: "xbg-red-100 flex justify-between",
479
492
  value: p.name,
480
- defaultChecked: p.name === l,
493
+ defaultChecked: p.name === i,
481
494
  children: [
482
495
  /* @__PURE__ */ e.jsx("p", { children: p.name }),
483
496
  /* @__PURE__ */ e.jsx(
@@ -501,25 +514,25 @@ function pn() {
501
514
  ] });
502
515
  }
503
516
  function fn() {
504
- const [s, a] = M(!1), t = k((l) => l.dashboard), n = k((l) => l.bookmarkKey);
517
+ const [s, n] = M(!1), t = k((i) => i.dashboard), a = k((i) => i.bookmarkKey);
505
518
  K(() => {
506
- if (!n) {
507
- a(!1);
519
+ if (!a) {
520
+ n(!1);
508
521
  return;
509
522
  }
510
- const l = Oe(t.id), c = JSON.parse(
511
- localStorage.getItem(l) || "[]"
523
+ const i = Oe(t.id), c = JSON.parse(
524
+ localStorage.getItem(i) || "[]"
512
525
  ).find(
513
- (d) => d.name === n
526
+ (d) => d.name === a
514
527
  );
515
- a(c ? c.default : !1);
516
- }, [n, t.id]);
517
- function o(l) {
518
- if (a(l), !n)
528
+ n(c ? c.default : !1);
529
+ }, [a, t.id]);
530
+ function o(i) {
531
+ if (n(i), !a)
519
532
  return;
520
533
  const r = Oe(t.id), d = JSON.parse(
521
534
  localStorage.getItem(r) || "[]"
522
- ).map((m) => (m.name === n ? m.default = l : m.default = !1, m));
535
+ ).map((u) => (u.name === a ? u.default = i : u.default = !1, u));
523
536
  console.log(d), localStorage.setItem(r, JSON.stringify(d));
524
537
  }
525
538
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
@@ -542,19 +555,19 @@ function fn() {
542
555
  ] });
543
556
  }
544
557
  function gn() {
545
- const s = k((j) => j.bookmarkKey), a = k((j) => j.dashboard);
558
+ const s = k((j) => j.bookmarkKey), n = k((j) => j.dashboard);
546
559
  k((j) => j.selectedSheetId);
547
560
  const t = k(
548
561
  (j) => j.isDashboardEditing
549
- ), n = k((j) => j.filterValues), o = k((j) => j.isVisualEditing), l = k((j) => j.showFilters);
562
+ ), a = k((j) => j.filterValues), o = k((j) => j.isVisualEditing), i = k((j) => j.showFilters);
550
563
  k(
551
564
  (j) => j.showDashboardJSON
552
565
  );
553
566
  const r = k((j) => j.onSaveFunction), c = k(
554
567
  (j) => j.actions.setShowFilters
555
- ), { addFrame: d, setSelectedFrameId: m } = k(
568
+ ), { addFrame: d, setSelectedFrameId: u } = k(
556
569
  (j) => j.actions
557
- ), { getSelectedSheet: h, setIsDashboardEditing: u, setShowDashboardJSON: f } = k((j) => j.actions), p = h(), g = () => {
570
+ ), { getSelectedSheet: h, setIsDashboardEditing: m, setShowDashboardJSON: f } = k((j) => j.actions), p = h(), g = () => {
558
571
  if (!t || !p)
559
572
  return;
560
573
  const j = {
@@ -577,31 +590,31 @@ function gn() {
577
590
  cards: [j],
578
591
  activeCardId: j.id
579
592
  };
580
- d(p.id, L), m(L.id);
593
+ d(p.id, L), u(L.id);
581
594
  }, S = () => {
582
- u(!0);
595
+ m(!0);
583
596
  };
584
597
  function N() {
585
598
  if (!s || s === "")
586
599
  return;
587
- const j = Ks(a), L = Oe(a.id), A = JSON.parse(localStorage.getItem(L) || "[]"), O = A.findIndex(
600
+ const j = Us(n), L = Oe(n.id), A = JSON.parse(localStorage.getItem(L) || "[]"), O = A.findIndex(
588
601
  (y) => y.name === s
589
602
  );
590
603
  O !== -1 ? A[O] = {
591
604
  name: s,
592
605
  template: j,
593
606
  default: A[O].default,
594
- filterValues: n
607
+ filterValues: a
595
608
  } : A.push({
596
609
  name: s,
597
610
  template: j,
598
- filterValues: n
611
+ filterValues: a
599
612
  }), localStorage.setItem(L, JSON.stringify(A)), r == null || r(j);
600
613
  }
601
614
  return o ? null : /* @__PURE__ */ e.jsxs(
602
615
  "div",
603
616
  {
604
- className: "flex items-center justify-between gap-2 px-2 pt-2",
617
+ className: "flex items-center justify-between gap-2 border-b bg-muted/50 px-2 py-2",
605
618
  role: "dashboard-controls",
606
619
  children: [
607
620
  !o && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-3", children: [
@@ -623,7 +636,7 @@ function gn() {
623
636
  disabled: !t,
624
637
  onClick: g,
625
638
  children: [
626
- /* @__PURE__ */ e.jsx(ct, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
639
+ /* @__PURE__ */ e.jsx(dt, { className: "mr-2 h-4 w-4", strokeWidth: 1.5 }),
627
640
  "Add Frame"
628
641
  ]
629
642
  }
@@ -635,7 +648,7 @@ function gn() {
635
648
  className: "h-7 p-2",
636
649
  onClick: S,
637
650
  size: "sm",
638
- children: /* @__PURE__ */ e.jsx(it, { className: "h-4 w-4", strokeWidth: 1.5 })
651
+ children: /* @__PURE__ */ e.jsx(ot, { className: "h-4 w-4", strokeWidth: 1.5 })
639
652
  }
640
653
  ),
641
654
  t && !o && /* @__PURE__ */ e.jsx(
@@ -645,7 +658,7 @@ function gn() {
645
658
  role: "close",
646
659
  className: "h-7 p-2",
647
660
  onClick: () => {
648
- u(!1), f(!1);
661
+ m(!1), f(!1);
649
662
  },
650
663
  size: "sm",
651
664
  children: /* @__PURE__ */ e.jsx(Le, { className: "h-4 w-4", strokeWidth: 1.5 })
@@ -658,10 +671,10 @@ function gn() {
658
671
  variant: "outline",
659
672
  onClick: N,
660
673
  size: "sm",
661
- children: /* @__PURE__ */ e.jsx(on, { className: "h-4 w-4", strokeWidth: 1.5 })
674
+ children: /* @__PURE__ */ e.jsx(rn, { className: "h-4 w-4", strokeWidth: 1.5 })
662
675
  }
663
676
  ),
664
- !l && !o && t && /* @__PURE__ */ e.jsx(
677
+ !i && !o && t && /* @__PURE__ */ e.jsx(
665
678
  w,
666
679
  {
667
680
  className: "h-7 p-2",
@@ -680,72 +693,72 @@ function gn() {
680
693
  }
681
694
  function He({
682
695
  title: s,
683
- items: a,
696
+ items: n,
684
697
  value: t,
685
- isLoading: n,
698
+ isLoading: a,
686
699
  isError: o,
687
- connectionTooltip: l,
700
+ connectionTooltip: i,
688
701
  onChange: r,
689
702
  className: c,
690
703
  showIcon: d = !0,
691
- disabled: m = !1
704
+ disabled: u = !1
692
705
  }) {
693
- const h = n ? "Loading..." : o ? "Error" : t;
694
- function u() {
706
+ const h = a ? "Loading..." : o ? "Error" : t;
707
+ function m() {
695
708
  if (s === "Connection")
696
- return /* @__PURE__ */ e.jsx(ln, { className: "size-4 rotate-90" });
709
+ return /* @__PURE__ */ e.jsx(nn, { className: "size-4 rotate-90" });
697
710
  if (s === "Database")
698
711
  return /* @__PURE__ */ e.jsx(Ja, { className: "size-4" });
699
712
  if (s === "Schema")
700
- return /* @__PURE__ */ e.jsx(nn, { className: "size-4" });
713
+ return /* @__PURE__ */ e.jsx(tn, { className: "size-4" });
701
714
  if (s === "Table")
702
715
  return /* @__PURE__ */ e.jsx(bs, { className: "size-4" });
703
716
  }
704
717
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
705
- d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: l ? /* @__PURE__ */ e.jsxs(We, { children: [
706
- /* @__PURE__ */ e.jsx(ms, { children: u() }),
707
- /* @__PURE__ */ e.jsx(Pe, { className: "text-xs", align: "start", children: l })
708
- ] }) : u() }),
709
- /* @__PURE__ */ e.jsxs(xs, { disabled: m, value: h, onValueChange: r, children: [
718
+ d && /* @__PURE__ */ e.jsx("div", { className: "shrink-0", children: i ? /* @__PURE__ */ e.jsxs(We, { children: [
719
+ /* @__PURE__ */ e.jsx(us, { children: m() }),
720
+ /* @__PURE__ */ e.jsx(Pe, { className: "text-xs", align: "start", children: i })
721
+ ] }) : m() }),
722
+ /* @__PURE__ */ e.jsxs(xs, { disabled: u, value: h, onValueChange: r, children: [
710
723
  /* @__PURE__ */ e.jsx(
711
724
  ps,
712
725
  {
713
- className: G(
714
- "h-9 w-[190px] focus:ring-1 focus:ring-offset-0",
726
+ className: Y(
727
+ "h-9 w-full focus:ring-1 focus:ring-offset-0",
715
728
  c
716
729
  ),
717
730
  children: /* @__PURE__ */ e.jsx(
718
731
  fs,
719
732
  {
720
- placeholder: n ? "Loading..." : o ? "Error" : `Select ${s}`
733
+ placeholder: a ? "Loading..." : o ? "Error" : `Select ${s}`
721
734
  }
722
735
  )
723
736
  }
724
737
  ),
725
738
  /* @__PURE__ */ e.jsx(gs, { children: /* @__PURE__ */ e.jsxs(js, { children: [
726
- n ? /* @__PURE__ */ e.jsx(Ke, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ke, { children: s }),
727
- /* @__PURE__ */ e.jsx(e.Fragment, { children: a && a.map((f, p) => /* @__PURE__ */ e.jsx(pe, { value: f.id, children: f.name }, p)) }),
728
- (n || o) && /* @__PURE__ */ e.jsx(pe, { value: h, children: h })
739
+ a ? /* @__PURE__ */ e.jsx(Ke, { children: "Loading..." }) : /* @__PURE__ */ e.jsx(Ke, { children: s }),
740
+ /* @__PURE__ */ e.jsx(e.Fragment, { children: n && n.map((f, p) => /* @__PURE__ */ e.jsx(pe, { value: f.id, children: f.name }, p)) }),
741
+ (a || o) && /* @__PURE__ */ e.jsx(pe, { value: h, children: h })
729
742
  ] }) })
730
743
  ] })
731
744
  ] });
732
745
  }
733
746
  function jn({ column: s }) {
734
- const [a, t] = M(!1), n = i((h) => h.selectedTableName), o = i(
747
+ const [n, t] = M(!1), a = l((h) => h.selectedTableName), o = l(
735
748
  (h) => h.selectedSchemaName
736
- ), l = i((h) => h.sqlGen), r = i((h) => h.actions.setSqlGen), c = i((h) => h.actions.setCardSql), d = i((h) => h.actions.setRunSql);
737
- function m(h, u) {
738
- const f = Gs(h, l, u);
749
+ ), i = l((h) => h.sqlGen), r = l((h) => h.actions.setSqlGen), c = l((h) => h.actions.setCardSql), d = l((h) => h.actions.setRunSql);
750
+ function u(h, m) {
751
+ const f = Js(h, i, m);
739
752
  r(f);
740
- const p = Us(
753
+ const p = Gs(
741
754
  f,
742
755
  de(o || ""),
743
- de(n)
756
+ de(a)
744
757
  );
745
758
  p && (c(p), d(!0)), t(!1);
746
759
  }
747
- return /* @__PURE__ */ e.jsxs(qe, { open: a, onOpenChange: t, children: [
748
- /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Ht, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
760
+ return /* @__PURE__ */ e.jsxs(qe, { open: n, onOpenChange: t, children: [
761
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Bt, { className: "h-4 w-4 cursor-pointer text-foreground/40" }) }),
749
762
  /* @__PURE__ */ e.jsx(
750
763
  Re,
751
764
  {
@@ -755,7 +768,7 @@ function jn({ column: s }) {
755
768
  /* @__PURE__ */ e.jsx(
756
769
  "li",
757
770
  {
758
- onClick: () => m(s, "COUNT"),
771
+ onClick: () => u(s, "COUNT"),
759
772
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
760
773
  children: "Count"
761
774
  }
@@ -763,7 +776,7 @@ function jn({ column: s }) {
763
776
  /* @__PURE__ */ e.jsx(
764
777
  "li",
765
778
  {
766
- onClick: () => m(s, "AVG"),
779
+ onClick: () => u(s, "AVG"),
767
780
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
768
781
  children: "Avg"
769
782
  }
@@ -771,7 +784,7 @@ function jn({ column: s }) {
771
784
  /* @__PURE__ */ e.jsx(
772
785
  "li",
773
786
  {
774
- onClick: () => m(s, "SUM"),
787
+ onClick: () => u(s, "SUM"),
775
788
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
776
789
  children: "Sum"
777
790
  }
@@ -779,7 +792,7 @@ function jn({ column: s }) {
779
792
  /* @__PURE__ */ e.jsx(
780
793
  "li",
781
794
  {
782
- onClick: () => m(s, "MAX"),
795
+ onClick: () => u(s, "MAX"),
783
796
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
784
797
  children: "Max"
785
798
  }
@@ -787,7 +800,7 @@ function jn({ column: s }) {
787
800
  /* @__PURE__ */ e.jsx(
788
801
  "li",
789
802
  {
790
- onClick: () => m(s, "MIN"),
803
+ onClick: () => u(s, "MIN"),
791
804
  className: "cursor-pointer p-1 px-3 transition-colors hover:bg-muted",
792
805
  children: "Min"
793
806
  }
@@ -797,79 +810,87 @@ function jn({ column: s }) {
797
810
  )
798
811
  ] });
799
812
  }
800
- function ht({ column: s }) {
813
+ function mt({ column: s }) {
801
814
  return /* @__PURE__ */ e.jsxs(We, { children: [
802
- /* @__PURE__ */ e.jsx(Bt, { asChild: !0, children: $t.includes(s.data_type.toLowerCase()) ? (
815
+ /* @__PURE__ */ e.jsx($t, { asChild: !0, children: Kt.includes(s.data_type.toLowerCase()) ? (
803
816
  // <span className=" font-thin">T</span>
804
- /* @__PURE__ */ e.jsx(un, { className: "size-3" })
805
- ) : Js.includes(s.data_type.toLowerCase()) ? (
817
+ /* @__PURE__ */ e.jsx(mn, { className: "size-3" })
818
+ ) : Qs.includes(s.data_type.toLowerCase()) ? (
806
819
  //
807
- /* @__PURE__ */ e.jsx(Xa, { className: "size-3" })
808
- ) : Kt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Gt, { className: "size-3" }) : Ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(cn, { className: "size-3" }) }),
820
+ /* @__PURE__ */ e.jsx(Pa, { className: "size-3" })
821
+ ) : Ut.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(Jt, { className: "size-3" }) : Gt.includes(s.data_type.toLowerCase()) ? /* @__PURE__ */ e.jsx(hn, { className: "size-3" }) : /* @__PURE__ */ e.jsx(ln, { className: "size-3" }) }),
809
822
  /* @__PURE__ */ e.jsx(Pe, { children: /* @__PURE__ */ e.jsx("p", { className: "font-mono text-xs", children: s.data_type }) })
810
823
  ] });
811
824
  }
812
825
  function bn({
813
826
  schemaName: s,
814
- tableName: a,
827
+ tableName: n,
815
828
  columns: t,
816
- status: n
829
+ status: a
817
830
  }) {
818
- const o = i((y) => y.sqlGen), l = i(
831
+ const o = l((y) => y.sqlGen), i = l(
819
832
  (y) => y.selectedConnectionId
820
- ), r = i(
833
+ ), r = l(
821
834
  (y) => y.selectedDatabaseName
822
- ), c = i(
835
+ ), c = l(
823
836
  (y) => y.selectedSchemaName
824
- ), d = i((y) => y.selectedTableName), m = k(
837
+ ), d = l((y) => y.selectedTableName), u = k(
825
838
  (y) => y.dashboard.aiScopeTables
826
- ), { setAIScopeTables: h } = k((y) => y.actions), u = i((y) => y.actions.setRunSql), f = i((y) => y.actions.setSqlGen), p = i(
839
+ ), { setAIScopeTables: h } = k((y) => y.actions), m = l((y) => y.actions.setRunSql), f = l((y) => y.actions.setSqlGen), p = l(
827
840
  (y) => y.actions.setIsShowingVisual
828
- ), g = i((y) => y.actions.setCardSql), { connectionType: S } = ut();
841
+ ), g = l((y) => y.actions.setCardSql), { connectionType: S } = ut();
829
842
  function N(y) {
830
- const z = Gs(y, o);
843
+ const z = Js(y, o);
831
844
  f(z);
832
- const E = Us(z, de(s), de(a));
833
- E && (g(E), u(!0));
845
+ const E = Gs(z, de(s), de(n));
846
+ E && (g(E), m(!0));
834
847
  }
835
848
  function j() {
836
- return (m == null ? void 0 : m.find(
837
- (y) => y.connectinonId === l && y.tableName === d
849
+ return (u == null ? void 0 : u.find(
850
+ (y) => y.connectinonId === i && y.tableName === d
838
851
  )) !== void 0;
839
852
  }
840
853
  function L(y) {
841
- if (y === !0 && d && l) {
854
+ if (y === !0 && d && i) {
842
855
  const z = {
843
- connectinonId: l,
856
+ connectinonId: i,
844
857
  connectionType: S,
845
858
  databaseName: r,
846
859
  schemaName: c,
847
860
  tableName: d
848
- }, _ = [...m || [], z].filter(
861
+ }, _ = [...u || [], z].filter(
849
862
  (X, $, U) => U.findIndex(
850
863
  (D) => D.connectinonId === X.connectinonId && D.tableName === X.tableName
851
864
  ) === $
852
865
  );
853
- h(_);
866
+ h(_), Ms.success(`Added '${d}' to AI Scope`, {
867
+ position: "top-right",
868
+ duration: 2500,
869
+ richColors: !0
870
+ });
854
871
  } else {
855
- const z = (m || []).filter(
856
- (E) => E.connectinonId !== l && E.tableName !== d
872
+ const z = (u || []).filter(
873
+ (E) => E.connectinonId !== i && E.tableName !== d
857
874
  );
858
- h(z);
875
+ h(z), Ms(`Removed '${d}' from AI Scope`, {
876
+ position: "top-right",
877
+ duration: 2e3,
878
+ richColors: !0
879
+ });
859
880
  }
860
881
  }
861
882
  function A() {
862
- let z = as(s, a);
863
- ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(a) && (z = `"${a}"`), p(!1), g(`SELECT * FROM ${z} LIMIT 10`), u(!0);
883
+ let z = as(s, n);
884
+ ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(n) && (z = `"${n}"`), p(!1), g(`SELECT * FROM ${z} LIMIT 10`), m(!0);
864
885
  }
865
886
  function O() {
866
- let z = as(s, a);
867
- ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(a) && (z = `"${a}"`), p(!1), g(`SELECT COUNT(*) FROM ${z}`), u(!0);
887
+ let z = as(s, n);
888
+ ((_) => _.charAt(0) === _.charAt(0).toUpperCase())(n) && (z = `"${n}"`), p(!1), g(`SELECT COUNT(*) FROM ${z}`), m(!0);
868
889
  }
869
- return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-6", children: [
870
- /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
890
+ return /* @__PURE__ */ e.jsxs("div", { className: "flex grow flex-col space-y-4 px-4", children: [
891
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center gap-1", children: [
871
892
  /* @__PURE__ */ e.jsx(
872
- Qs,
893
+ Ws,
873
894
  {
874
895
  title: `${j() ? "Remove from" : "Add to"} AI Scope`,
875
896
  pressed: j(),
@@ -877,9 +898,9 @@ function bn({
877
898
  variant: "outline",
878
899
  className: "h-9 px-2",
879
900
  children: /* @__PURE__ */ e.jsx(
880
- Jt,
901
+ Qt,
881
902
  {
882
- className: G("size-4", {
903
+ className: Y("size-4", {
883
904
  "text-primary": j(),
884
905
  "text-muted-foreground": !j()
885
906
  })
@@ -890,13 +911,13 @@ function bn({
890
911
  /* @__PURE__ */ e.jsxs(
891
912
  w,
892
913
  {
893
- disabled: n !== "Success",
914
+ disabled: a !== "Success",
894
915
  onClick: A,
895
916
  size: "sm",
896
917
  variant: "secondary",
897
- className: "flex w-full",
918
+ className: "flex",
898
919
  children: [
899
- n !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
920
+ a !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(cn, { className: "mr-2 size-4" }),
900
921
  "Top 10"
901
922
  ]
902
923
  }
@@ -904,13 +925,13 @@ function bn({
904
925
  /* @__PURE__ */ e.jsxs(
905
926
  w,
906
927
  {
907
- disabled: n !== "Success",
928
+ disabled: a !== "Success",
908
929
  onClick: O,
909
930
  size: "sm",
910
931
  variant: "secondary",
911
- className: "flex w-full",
932
+ className: "flex",
912
933
  children: [
913
- n !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : null,
934
+ a !== "Success" ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(on, { className: "mr-2 size-4" }),
914
935
  "Count"
915
936
  ]
916
937
  }
@@ -925,18 +946,18 @@ function bn({
925
946
  "div",
926
947
  {
927
948
  onClick: () => N(y),
928
- className: G(
949
+ className: Y(
929
950
  "mx-3 flex cursor-pointer items-center justify-between rounded px-2 py-[6px] text-sm transition-colors hover:bg-muted/50",
930
951
  {
931
- "bg-muted": Qt(y, o)
952
+ "bg-muted": Wt(y, o)
932
953
  }
933
954
  ),
934
955
  children: [
935
956
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
936
- /* @__PURE__ */ e.jsx(ht, { column: y }),
957
+ /* @__PURE__ */ e.jsx(mt, { column: y }),
937
958
  /* @__PURE__ */ e.jsx("span", { children: y.column_name })
938
959
  ] }),
939
- Js.includes(y.data_type) && /* @__PURE__ */ e.jsx(
960
+ Qs.includes(y.data_type) && /* @__PURE__ */ e.jsx(
940
961
  "div",
941
962
  {
942
963
  onClick: (z) => z.stopPropagation(),
@@ -955,31 +976,31 @@ function bn({
955
976
  )
956
977
  ] });
957
978
  }
958
- function ut(s, a) {
979
+ function ut(s, n) {
959
980
  var Xe, ve, _e, Ae;
960
- let t = $a(() => [], []);
961
- const n = Ye().authToken || s, o = i(
981
+ let t = Ba(() => [], []);
982
+ const a = Ye().authToken || s, o = l(
962
983
  (C) => C.selectedConnectionId
963
- ), l = i(
984
+ ), i = l(
964
985
  (C) => C.selectedDatabaseName
965
- ), r = i(
986
+ ), r = l(
966
987
  (C) => C.selectedSchemaName
967
- ), c = i((C) => C.selectedTableName), d = i(
988
+ ), c = l((C) => C.selectedTableName), d = l(
968
989
  (C) => C.actions.setCurrentColumns
969
- ), m = i(
990
+ ), u = l(
970
991
  (C) => C.actions.setSelectedConnectionId
971
- ), h = i(
992
+ ), h = l(
972
993
  (C) => C.actions.setSelectedDatabaseName
973
- ), u = i(
994
+ ), m = l(
974
995
  (C) => C.actions.setSelectedSchemaName
975
- ), f = i(
996
+ ), f = l(
976
997
  (C) => C.actions.setSelectedTableName
977
- ), p = i((C) => C.actions.setCardSql);
998
+ ), p = l((C) => C.actions.setCardSql);
978
999
  function g(C) {
979
- return o && l && r && l !== "NA" ? !0 : o && C === "API" ? !1 : !!(o && C === "S3");
1000
+ return o && i && r && i !== "NA" ? !0 : o && C === "API" ? !1 : !!(o && C === "S3");
980
1001
  }
981
1002
  function S(C) {
982
- return !!(o && l && l !== "NA" && r && c || o && (C === "S3" || C === "API"));
1003
+ return !!(o && i && i !== "NA" && r && c || o && (C === "S3" || C === "API"));
983
1004
  }
984
1005
  function N(C) {
985
1006
  return o && C ? !(C === "API" || C === "S3") : !1;
@@ -992,9 +1013,9 @@ function ut(s, a) {
992
1013
  queryKey: ["connections"],
993
1014
  queryFn: () => ze(
994
1015
  "https://semaphor.cloud/api/v1/connections",
995
- (n == null ? void 0 : n.accessToken) || ""
1016
+ (a == null ? void 0 : a.accessToken) || ""
996
1017
  ),
997
- enabled: !!(n != null && n.accessToken)
1018
+ enabled: !!(a != null && a.accessToken)
998
1019
  // Only fetch if authToken is present
999
1020
  }), O = j == null ? void 0 : j.connections.find(
1000
1021
  (C) => C.id === o
@@ -1008,7 +1029,7 @@ function ut(s, a) {
1008
1029
  queryKey: ["databases", o],
1009
1030
  queryFn: () => ze(
1010
1031
  "https://semaphor.cloud/api/v1/databases",
1011
- (n == null ? void 0 : n.accessToken) || "",
1032
+ (a == null ? void 0 : a.accessToken) || "",
1012
1033
  {
1013
1034
  connection_id: o
1014
1035
  }
@@ -1018,20 +1039,20 @@ function ut(s, a) {
1018
1039
  }), {
1019
1040
  data: D,
1020
1041
  isLoading: te,
1021
- isFetching: P,
1042
+ isFetching: W,
1022
1043
  isError: ee,
1023
1044
  refetch: Z
1024
1045
  } = Se({
1025
- queryKey: ["schemas", o, l],
1046
+ queryKey: ["schemas", o, i],
1026
1047
  queryFn: () => ze(
1027
1048
  "https://semaphor.cloud/api/v1/schemas",
1028
- (n == null ? void 0 : n.accessToken) || "",
1049
+ (a == null ? void 0 : a.accessToken) || "",
1029
1050
  {
1030
1051
  connection_id: o,
1031
- database_name: l
1052
+ database_name: i
1032
1053
  }
1033
1054
  ),
1034
- enabled: !!o && !!l && !z && l !== "NA"
1055
+ enabled: !!o && !!i && !z && i !== "NA"
1035
1056
  //currentConnection?.type !== 'API', // Only fetch if connectionId and database is present
1036
1057
  }), {
1037
1058
  data: J,
@@ -1043,38 +1064,38 @@ function ut(s, a) {
1043
1064
  queryKey: [
1044
1065
  "tables",
1045
1066
  o,
1046
- l,
1067
+ i,
1047
1068
  r
1048
1069
  ],
1049
1070
  queryFn: () => ze(
1050
1071
  "https://semaphor.cloud/api/v1/tables",
1051
- (n == null ? void 0 : n.accessToken) || "",
1072
+ (a == null ? void 0 : a.accessToken) || "",
1052
1073
  {
1053
1074
  connection_id: o,
1054
- database_name: l,
1075
+ database_name: i,
1055
1076
  schema_name: r
1056
1077
  }
1057
1078
  ),
1058
1079
  enabled: g(y)
1059
1080
  }), {
1060
1081
  data: H,
1061
- isLoading: ue,
1082
+ isLoading: me,
1062
1083
  isFetching: se,
1063
1084
  isError: ge
1064
1085
  } = Se({
1065
1086
  queryKey: [
1066
1087
  "columns",
1067
1088
  o,
1068
- l,
1089
+ i,
1069
1090
  r,
1070
1091
  c
1071
1092
  ],
1072
1093
  queryFn: () => ze(
1073
1094
  "https://semaphor.cloud/api/v1/columns",
1074
- (n == null ? void 0 : n.accessToken) || "",
1095
+ (a == null ? void 0 : a.accessToken) || "",
1075
1096
  {
1076
1097
  connection_id: o,
1077
- database_name: l,
1098
+ database_name: i,
1078
1099
  schema_name: r,
1079
1100
  table_name: c
1080
1101
  }
@@ -1095,19 +1116,19 @@ function ut(s, a) {
1095
1116
  z,
1096
1117
  p,
1097
1118
  f,
1098
- u,
1119
+ m,
1099
1120
  h,
1100
1121
  O
1101
1122
  ]);
1102
1123
  const je = (O == null ? void 0 : O.type) === "API" ? (Xe = O == null ? void 0 : O.type) == null ? void 0 : Xe.toLowerCase() : c || "", be = z ? "" : r || "";
1103
- function me(C) {
1104
- u(C), f("");
1124
+ function ue(C) {
1125
+ m(C), f("");
1105
1126
  }
1106
- function Q(C) {
1107
- h(C), u(""), f("");
1127
+ function G(C) {
1128
+ h(C), m(""), f("");
1108
1129
  }
1109
1130
  function ae(C) {
1110
- m(C);
1131
+ u(C);
1111
1132
  }
1112
1133
  E && ((ve = E == null ? void 0 : E.databases) == null ? void 0 : ve.length) > 0, D && ((_e = D == null ? void 0 : D.schemas) == null ? void 0 : _e.length) > 0, H && ((Ae = H == null ? void 0 : H.columns) == null ? void 0 : Ae.length) > 0 && (t = H.columns.map((C) => ({
1113
1134
  ...C,
@@ -1137,42 +1158,42 @@ function ut(s, a) {
1137
1158
  isDatabasesLoadingOrFetching: _ || X,
1138
1159
  isDatabaseError: $,
1139
1160
  schemaItems: re,
1140
- isSchemaLoadingOrFetching: te || P,
1161
+ isSchemaLoadingOrFetching: te || W,
1141
1162
  isSchemaError: ee,
1142
1163
  tableItems: Te,
1143
1164
  isTableLoadingOrFetching: I || v,
1144
1165
  isTableError: b,
1145
1166
  columns: t,
1146
- isColumnsLoadingOrFetching: ue || se,
1167
+ isColumnsLoadingOrFetching: me || se,
1147
1168
  isColumnsError: ge,
1148
1169
  isNonDbConnection: z,
1149
1170
  connectionType: y,
1150
1171
  tableName: je,
1151
1172
  schemaName: be,
1152
1173
  handleConnectionChange: ae,
1153
- handleDatabaseChange: Q,
1154
- handleSchemaChange: me
1174
+ handleDatabaseChange: G,
1175
+ handleSchemaChange: ue
1155
1176
  };
1156
1177
  }
1157
- function mt({
1178
+ function xt({
1158
1179
  ColumnsComponent: s
1159
1180
  }) {
1160
1181
  var J;
1161
- const a = i(
1182
+ const n = l(
1162
1183
  (I) => I.selectedConnectionId
1163
- ), t = i(
1184
+ ), t = l(
1164
1185
  (I) => I.selectedDatabaseName
1165
- ), n = i(
1186
+ ), a = l(
1166
1187
  (I) => I.selectedSchemaName
1167
- ), o = i((I) => I.selectedTableName), l = i(
1188
+ ), o = l((I) => I.selectedTableName), i = l(
1168
1189
  (I) => I.actions.setSelectedTableName
1169
1190
  ), {
1170
1191
  connectionItems: r,
1171
1192
  schemaItems: c,
1172
1193
  databaseItems: d,
1173
- tableItems: m,
1194
+ tableItems: u,
1174
1195
  columns: h,
1175
- isConnectionsLoading: u,
1196
+ isConnectionsLoading: m,
1176
1197
  isConnectionsError: f,
1177
1198
  isDatabasesLoadingOrFetching: p,
1178
1199
  isDatabaseError: g,
@@ -1204,7 +1225,7 @@ function mt({
1204
1225
  function te() {
1205
1226
  window.location.href = "mailto:support@semaphor.cloud?subject=Help&body=I need help with...";
1206
1227
  }
1207
- function P() {
1228
+ function W() {
1208
1229
  return y === "S3" || y === "API" ? null : /* @__PURE__ */ e.jsx(
1209
1230
  He,
1210
1231
  {
@@ -1225,7 +1246,7 @@ function mt({
1225
1246
  isError: N,
1226
1247
  isLoading: S,
1227
1248
  items: c,
1228
- value: n || "",
1249
+ value: a || "",
1229
1250
  title: "Schema"
1230
1251
  }
1231
1252
  );
@@ -1234,9 +1255,9 @@ function mt({
1234
1255
  return y === "API" ? null : /* @__PURE__ */ e.jsx(
1235
1256
  He,
1236
1257
  {
1237
- onChange: l,
1258
+ onChange: i,
1238
1259
  isError: O,
1239
- items: m,
1260
+ items: u,
1240
1261
  isLoading: A,
1241
1262
  value: o || "",
1242
1263
  title: "Table"
@@ -1250,16 +1271,16 @@ function mt({
1250
1271
  {
1251
1272
  items: r,
1252
1273
  title: "Connection",
1253
- value: a || "",
1274
+ value: n || "",
1254
1275
  onChange: E,
1255
- isLoading: u,
1276
+ isLoading: m,
1256
1277
  isError: f,
1257
1278
  connectionTooltip: ((J = r == null ? void 0 : r.find(
1258
- (I) => I.id === a
1279
+ (I) => I.id === n
1259
1280
  )) == null ? void 0 : J.type) || ""
1260
1281
  }
1261
1282
  ),
1262
- P(),
1283
+ W(),
1263
1284
  ee(),
1264
1285
  Z()
1265
1286
  ] }),
@@ -1272,45 +1293,18 @@ function mt({
1272
1293
  variant: "secondary",
1273
1294
  className: "w-full",
1274
1295
  children: [
1275
- /* @__PURE__ */ e.jsx(an, { className: "mr-2 size-4" }),
1296
+ /* @__PURE__ */ e.jsx(sn, { className: "mr-2 size-4" }),
1276
1297
  "Help"
1277
1298
  ]
1278
1299
  }
1279
1300
  ) })
1280
1301
  ] });
1281
1302
  }
1282
- const rs = ({
1283
- className: s,
1284
- ...a
1285
- }) => /* @__PURE__ */ e.jsx(
1286
- Wt,
1287
- {
1288
- className: G(
1289
- "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
1290
- s
1291
- ),
1292
- ...a
1293
- }
1294
- ), Fe = Pt, ls = ({
1295
- withHandle: s,
1296
- className: a,
1297
- ...t
1298
- }) => /* @__PURE__ */ e.jsx(
1299
- Yt,
1300
- {
1301
- className: G(
1302
- "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
1303
- a
1304
- ),
1305
- ...t,
1306
- children: s && /* @__PURE__ */ e.jsx("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ e.jsx(Pa, { className: "h-2.5 w-2.5" }) })
1307
- }
1308
- );
1309
1303
  function yn(s) {
1310
- const a = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), n = s.toUpperCase().indexOf("LIMIT"), o = s.toUpperCase().indexOf("ORDER BY");
1311
- let l = s.length;
1312
- if (o !== -1 && (l = o), n !== -1 && n < l && (l = n), a !== -1) {
1313
- const r = s.substring(0, a), c = s.substring(a);
1304
+ const n = s.toUpperCase().indexOf("WHERE"), t = s.toUpperCase().indexOf("GROUP BY"), a = s.toUpperCase().indexOf("LIMIT"), o = s.toUpperCase().indexOf("ORDER BY");
1305
+ let i = s.length;
1306
+ if (o !== -1 && (i = o), a !== -1 && a < i && (i = a), n !== -1) {
1307
+ const r = s.substring(0, n), c = s.substring(n);
1314
1308
  return `${r} {{ filters | where }} AND ${c.substring(
1315
1309
  6
1316
1310
  )}`;
@@ -1318,29 +1312,29 @@ function yn(s) {
1318
1312
  const r = s.substring(0, t), c = s.substring(t);
1319
1313
  return `${r} {{ filters | where }} ${c}`;
1320
1314
  } else {
1321
- const r = s.substring(0, l), c = s.substring(l);
1315
+ const r = s.substring(0, i), c = s.substring(i);
1322
1316
  return `${r} {{ filters | where }} ${c}`;
1323
1317
  }
1324
1318
  }
1325
1319
  function vn({
1326
1320
  error: s,
1327
- setShowAIDialog: a,
1321
+ setShowAIDialog: n,
1328
1322
  setUserInputforAI: t,
1329
- setTriggerAIRun: n
1323
+ setTriggerAIRun: a
1330
1324
  }) {
1331
- return /* @__PURE__ */ e.jsxs(Ws, { openDelay: 0, children: [
1332
- /* @__PURE__ */ e.jsx(Ps, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Ua, { className: "h-4 w-4 text-red-500" }) }) }),
1333
- /* @__PURE__ */ e.jsx(Ys, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1325
+ return /* @__PURE__ */ e.jsxs(Ps, { openDelay: 0, children: [
1326
+ /* @__PURE__ */ e.jsx(Ys, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { variant: "link", className: " p-0 h-5", children: /* @__PURE__ */ e.jsx(Ua, { className: "h-4 w-4 text-red-500" }) }) }),
1327
+ /* @__PURE__ */ e.jsx(Xs, { align: "start", className: " min-w-fit max-w-[500px]", children: /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsxs("div", { className: "grow space-y-1 flex flex-col ", children: [
1334
1328
  /* @__PURE__ */ e.jsxs(
1335
1329
  w,
1336
1330
  {
1337
1331
  onClick: () => {
1338
- a(!0), t(s), n(!0);
1332
+ n(!0), t(s), a(!0);
1339
1333
  },
1340
1334
  size: "sm",
1341
1335
  variant: "outline",
1342
1336
  children: [
1343
- /* @__PURE__ */ e.jsx(Ya, { className: "h-4 w-4 mr-2" }),
1337
+ /* @__PURE__ */ e.jsx(Wa, { className: "h-4 w-4 mr-2" }),
1344
1338
  "Fix It"
1345
1339
  ]
1346
1340
  }
@@ -1351,49 +1345,49 @@ function vn({
1351
1345
  }
1352
1346
  function Nn({
1353
1347
  text: s,
1354
- onCheckedChange: a,
1348
+ onCheckedChange: n,
1355
1349
  checked: t
1356
1350
  }) {
1357
1351
  return /* @__PURE__ */ e.jsxs("div", { className: "xbg-red-100 ml-6 flex items-center gap-2", children: [
1358
- /* @__PURE__ */ e.jsx(Qe, { checked: t, onCheckedChange: a }),
1352
+ /* @__PURE__ */ e.jsx(Qe, { checked: t, onCheckedChange: n }),
1359
1353
  /* @__PURE__ */ e.jsx("label", { className: "text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: s })
1360
1354
  ] });
1361
1355
  }
1362
1356
  function Cn() {
1363
- const { authToken: s } = Ye(), a = Ie(null), t = i((c) => c.applyFilters), [n, o] = M(""), l = i((c) => c.filterValues), r = i((c) => c.card.sql);
1357
+ const { authToken: s } = Ye(), n = Ie(null), t = l((c) => c.applyFilters), [a, o] = M(""), i = l((c) => c.filterValues), r = l((c) => c.card.sql);
1364
1358
  return /* @__PURE__ */ e.jsxs(
1365
- Ws,
1359
+ Ps,
1366
1360
  {
1367
1361
  openDelay: 0,
1368
1362
  onOpenChange: async (c) => {
1369
1363
  if (!c)
1370
1364
  return;
1371
1365
  console.log("onOpenChange");
1372
- const d = await Xs(
1366
+ const d = await Zs(
1373
1367
  "https://semaphor.cloud/api/v1/filter-sql",
1374
1368
  (s == null ? void 0 : s.accessToken) || "",
1375
1369
  {
1376
1370
  sql: r,
1377
- active_filters: l
1371
+ active_filters: i
1378
1372
  }
1379
1373
  );
1380
1374
  console.log(d), d.sql ? (console.log(d.records), o(d.sql)) : o("Error");
1381
1375
  },
1382
1376
  children: [
1383
- /* @__PURE__ */ e.jsx(Ps, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1384
- /* @__PURE__ */ e.jsxs(Ys, { align: "end", className: "w-[600px]", children: [
1385
- /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: a, className: "font-mono text-sm", children: [
1386
- n,
1377
+ /* @__PURE__ */ e.jsx(Ys, { asChild: !0, children: t && /* @__PURE__ */ e.jsx("p", { className: "p-0 text-xs hover:cursor-pointer", children: "|  Filter Query" }) }),
1378
+ /* @__PURE__ */ e.jsxs(Xs, { align: "end", className: "w-[600px]", children: [
1379
+ /* @__PURE__ */ e.jsx("div", { className: "flex justify-between space-x-4", children: /* @__PURE__ */ e.jsx("div", { className: "rounded-sm bg-muted p-2", children: /* @__PURE__ */ e.jsxs("code", { ref: n, className: "font-mono text-sm", children: [
1380
+ a,
1387
1381
  /* @__PURE__ */ e.jsx(
1388
- Zs,
1382
+ et,
1389
1383
  {
1390
- onClick: () => Xt(a),
1384
+ onClick: () => Pt(n),
1391
1385
  className: "ml-3 inline-block h-4 w-4 opacity-70 hover:cursor-pointer hover:opacity-100"
1392
1386
  }
1393
1387
  )
1394
1388
  ] }) }) }),
1395
1389
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 pt-2", children: [
1396
- /* @__PURE__ */ e.jsx(et, { className: "h-4 w-4 opacity-70" }),
1390
+ /* @__PURE__ */ e.jsx(st, { className: "h-4 w-4 opacity-70" }),
1397
1391
  /* @__PURE__ */ e.jsx("span", { className: "text-xs text-muted-foreground", children: "A preview of the query with filters applied." })
1398
1392
  ] })
1399
1393
  ] })
@@ -1450,13 +1444,13 @@ SELECT label, measure FROM table
1450
1444
  `;
1451
1445
  function kn({
1452
1446
  open: s,
1453
- setOpen: a,
1447
+ setOpen: n,
1454
1448
  userInput: t,
1455
- setUserInput: n,
1449
+ setUserInput: a,
1456
1450
  triggerAIRun: o,
1457
- setTriggerAIRun: l
1451
+ setTriggerAIRun: i
1458
1452
  }) {
1459
- const r = Ie(null), c = Ie(null), { authToken: d } = Ye(), [m, h] = M(!1), u = i((v) => v.actions.setCardSql), f = k((v) => v.dashboard.baseQueries), p = i((v) => v.actions.setRunSql), g = i((v) => v.actions.setCardType), [S, N] = M([]), j = i((v) => v.currentColumns), L = i((v) => v.card.sql), A = i((v) => v.selectedTableName), O = `
1453
+ const r = Ie(null), c = Ie(null), { authToken: d } = Ye(), [u, h] = M(!1), m = l((v) => v.actions.setCardSql), f = k((v) => v.dashboard.baseQueries), p = l((v) => v.actions.setRunSql), g = l((v) => v.actions.setCardType), [S, N] = M([]), j = l((v) => v.currentColumns), L = l((v) => v.card.sql), A = l((v) => v.selectedTableName), O = `
1460
1454
  ${t}
1461
1455
 
1462
1456
  Database Query Dialect: ${A === "api" || A === "s3" ? "DuckDb" : ""}
@@ -1470,7 +1464,7 @@ function kn({
1470
1464
  "https://semaphor.cloud/api/v1/ai",
1471
1465
  (d == null ? void 0 : d.accessToken) || "",
1472
1466
  {
1473
- user_content: `userContent: ${O} ${m ? y : ""}`
1467
+ user_content: `userContent: ${O} ${u ? y : ""}`
1474
1468
  }
1475
1469
  ),
1476
1470
  enabled: !1
@@ -1510,11 +1504,11 @@ function kn({
1510
1504
  return () => clearTimeout(v);
1511
1505
  }, [S]);
1512
1506
  function D() {
1513
- t && (N((v) => [...v, { role: "user", content: t }]), U(t) && h(!0), n(""), $());
1507
+ t && (N((v) => [...v, { role: "user", content: t }]), U(t) && h(!0), a(""), $());
1514
1508
  }
1515
1509
  K(() => {
1516
- o && (D(), l(!1));
1517
- }, [o, l]);
1510
+ o && (D(), i(!1));
1511
+ }, [o, i]);
1518
1512
  const te = {
1519
1513
  //seleect a darker color
1520
1514
  // color: '#000',
@@ -1523,7 +1517,7 @@ function kn({
1523
1517
  fontSize: 15,
1524
1518
  // padding: '5px',
1525
1519
  width: "100%"
1526
- }, P = {
1520
+ }, W = {
1527
1521
  // background: '#f6f8fa',
1528
1522
  // color: '#000',
1529
1523
  fontFamily: "monospace",
@@ -1544,20 +1538,20 @@ function kn({
1544
1538
  // Override how paragraphs are rendered
1545
1539
  p: ({ node: v, ...b }) => /* @__PURE__ */ e.jsx("p", { style: te, ...b }),
1546
1540
  code: ({ node: v, ...b }) => /* @__PURE__ */ e.jsx("code", { className: "rounded-sm bg-muted px-2 py-1 text-sm", ...b }),
1547
- pre: ({ node: v, ...b }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: P, children: [
1541
+ pre: ({ node: v, ...b }) => /* @__PURE__ */ e.jsxs("pre", { className: "space-y-2 rounded-sm bg-muted/50 p-3", style: W, children: [
1548
1542
  /* @__PURE__ */ e.jsx("code", { className: "whitespace-normal text-sm", children: b.children }),
1549
1543
  /* @__PURE__ */ e.jsxs("div", { className: "flex justify-start gap-2", children: [
1550
- /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Zs, {}) }),
1544
+ /* @__PURE__ */ e.jsx(w, { onClick: J, size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(et, {}) }),
1551
1545
  /* @__PURE__ */ e.jsx(
1552
1546
  w,
1553
1547
  {
1554
1548
  onClick: (F) => {
1555
1549
  const H = J(F);
1556
- H && (a(!1), u(H), p(!0));
1550
+ H && (n(!1), m(H), p(!0));
1557
1551
  },
1558
1552
  size: "sm",
1559
1553
  variant: "outline",
1560
- children: /* @__PURE__ */ e.jsx(sa, {})
1554
+ children: /* @__PURE__ */ e.jsx(Zt, {})
1561
1555
  }
1562
1556
  )
1563
1557
  ] })
@@ -1578,13 +1572,13 @@ function kn({
1578
1572
  {
1579
1573
  className: "flex items-start rounded-md bg-muted p-3 text-sm",
1580
1574
  children: [
1581
- /* @__PURE__ */ e.jsx(mn, { className: "mr-2 h-5 w-5" }),
1575
+ /* @__PURE__ */ e.jsx(un, { className: "mr-2 h-5 w-5" }),
1582
1576
  /* @__PURE__ */ e.jsx("div", { children: v.content })
1583
1577
  ]
1584
1578
  },
1585
1579
  b
1586
1580
  ) : v.role === "ai" ? /* @__PURE__ */ e.jsx(
1587
- ea,
1581
+ Xt,
1588
1582
  {
1589
1583
  className: "w-full overflow-auto py-1",
1590
1584
  components: Z,
@@ -1593,7 +1587,7 @@ function kn({
1593
1587
  b
1594
1588
  ) : /* @__PURE__ */ e.jsx("div", {}, b));
1595
1589
  }
1596
- return /* @__PURE__ */ e.jsxs(is, { open: s, onOpenChange: a, children: [
1590
+ return /* @__PURE__ */ e.jsxs(ls, { open: s, onOpenChange: n, children: [
1597
1591
  /* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1598
1592
  w,
1599
1593
  {
@@ -1610,7 +1604,7 @@ function kn({
1610
1604
  children: [
1611
1605
  /* @__PURE__ */ e.jsxs(ds, { children: [
1612
1606
  /* @__PURE__ */ e.jsx(hs, { children: "Assistant" }),
1613
- /* @__PURE__ */ e.jsx(us, { children: "What can I help you with?" })
1607
+ /* @__PURE__ */ e.jsx(ms, { children: "What can I help you with?" })
1614
1608
  ] }),
1615
1609
  /* @__PURE__ */ e.jsx(
1616
1610
  "div",
@@ -1625,24 +1619,24 @@ function kn({
1625
1619
  {
1626
1620
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex w-full items-center rounded-md border", children: [
1627
1621
  /* @__PURE__ */ e.jsx(
1628
- st,
1622
+ tt,
1629
1623
  {
1630
1624
  autoFocus: !0,
1631
1625
  ref: r,
1632
1626
  onKeyDown: (v) => {
1633
- v.key === "Enter" && !v.shiftKey && (v.preventDefault(), n(""), D());
1627
+ v.key === "Enter" && !v.shiftKey && (v.preventDefault(), a(""), D());
1634
1628
  },
1635
1629
  placeholder: "Type your question here...",
1636
1630
  onFocus: (v) => {
1637
1631
  const b = v.target, F = b.value.length;
1638
1632
  b.setSelectionRange(F, F);
1639
1633
  },
1640
- className: G(
1634
+ className: Y(
1641
1635
  "max-h-10 min-h-7 resize-none border-none focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0"
1642
1636
  ),
1643
1637
  disabled: E || _,
1644
1638
  value: t,
1645
- onChange: (v) => n(v.target.value)
1639
+ onChange: (v) => a(v.target.value)
1646
1640
  }
1647
1641
  ),
1648
1642
  " ",
@@ -1653,7 +1647,7 @@ function kn({
1653
1647
  size: "sm",
1654
1648
  variant: "ghost",
1655
1649
  onClick: D,
1656
- children: !E && !_ ? /* @__PURE__ */ e.jsx(Zt, {}) : /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1650
+ children: !E && !_ ? /* @__PURE__ */ e.jsx(Yt, {}) : /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" })
1657
1651
  }
1658
1652
  )
1659
1653
  ] })
@@ -1664,146 +1658,146 @@ function kn({
1664
1658
  )
1665
1659
  ] });
1666
1660
  }
1667
- var xt = {
1661
+ var pt = {
1668
1662
  color: void 0,
1669
1663
  size: void 0,
1670
1664
  className: void 0,
1671
1665
  style: void 0,
1672
1666
  attr: void 0
1673
- }, Vs = he.createContext && /* @__PURE__ */ he.createContext(xt), wn = ["attr", "size", "title"];
1674
- function zn(s, a) {
1667
+ }, Rs = he.createContext && /* @__PURE__ */ he.createContext(pt), wn = ["attr", "size", "title"];
1668
+ function zn(s, n) {
1675
1669
  if (s == null)
1676
1670
  return {};
1677
- var t = Fn(s, a), n, o;
1671
+ var t = Fn(s, n), a, o;
1678
1672
  if (Object.getOwnPropertySymbols) {
1679
- var l = Object.getOwnPropertySymbols(s);
1680
- for (o = 0; o < l.length; o++)
1681
- n = l[o], !(a.indexOf(n) >= 0) && Object.prototype.propertyIsEnumerable.call(s, n) && (t[n] = s[n]);
1673
+ var i = Object.getOwnPropertySymbols(s);
1674
+ for (o = 0; o < i.length; o++)
1675
+ a = i[o], !(n.indexOf(a) >= 0) && Object.prototype.propertyIsEnumerable.call(s, a) && (t[a] = s[a]);
1682
1676
  }
1683
1677
  return t;
1684
1678
  }
1685
- function Fn(s, a) {
1679
+ function Fn(s, n) {
1686
1680
  if (s == null)
1687
1681
  return {};
1688
- var t = {}, n = Object.keys(s), o, l;
1689
- for (l = 0; l < n.length; l++)
1690
- o = n[l], !(a.indexOf(o) >= 0) && (t[o] = s[o]);
1682
+ var t = {}, a = Object.keys(s), o, i;
1683
+ for (i = 0; i < a.length; i++)
1684
+ o = a[i], !(n.indexOf(o) >= 0) && (t[o] = s[o]);
1691
1685
  return t;
1692
1686
  }
1693
- function Ue() {
1694
- return Ue = Object.assign ? Object.assign.bind() : function(s) {
1695
- for (var a = 1; a < arguments.length; a++) {
1696
- var t = arguments[a];
1697
- for (var n in t)
1698
- Object.prototype.hasOwnProperty.call(t, n) && (s[n] = t[n]);
1687
+ function Je() {
1688
+ return Je = Object.assign ? Object.assign.bind() : function(s) {
1689
+ for (var n = 1; n < arguments.length; n++) {
1690
+ var t = arguments[n];
1691
+ for (var a in t)
1692
+ Object.prototype.hasOwnProperty.call(t, a) && (s[a] = t[a]);
1699
1693
  }
1700
1694
  return s;
1701
- }, Ue.apply(this, arguments);
1695
+ }, Je.apply(this, arguments);
1702
1696
  }
1703
- function Rs(s, a) {
1697
+ function _s(s, n) {
1704
1698
  var t = Object.keys(s);
1705
1699
  if (Object.getOwnPropertySymbols) {
1706
- var n = Object.getOwnPropertySymbols(s);
1707
- a && (n = n.filter(function(o) {
1700
+ var a = Object.getOwnPropertySymbols(s);
1701
+ n && (a = a.filter(function(o) {
1708
1702
  return Object.getOwnPropertyDescriptor(s, o).enumerable;
1709
- })), t.push.apply(t, n);
1703
+ })), t.push.apply(t, a);
1710
1704
  }
1711
1705
  return t;
1712
1706
  }
1713
- function Je(s) {
1714
- for (var a = 1; a < arguments.length; a++) {
1715
- var t = arguments[a] != null ? arguments[a] : {};
1716
- a % 2 ? Rs(Object(t), !0).forEach(function(n) {
1717
- On(s, n, t[n]);
1718
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : Rs(Object(t)).forEach(function(n) {
1719
- Object.defineProperty(s, n, Object.getOwnPropertyDescriptor(t, n));
1707
+ function Ge(s) {
1708
+ for (var n = 1; n < arguments.length; n++) {
1709
+ var t = arguments[n] != null ? arguments[n] : {};
1710
+ n % 2 ? _s(Object(t), !0).forEach(function(a) {
1711
+ On(s, a, t[a]);
1712
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(s, Object.getOwnPropertyDescriptors(t)) : _s(Object(t)).forEach(function(a) {
1713
+ Object.defineProperty(s, a, Object.getOwnPropertyDescriptor(t, a));
1720
1714
  });
1721
1715
  }
1722
1716
  return s;
1723
1717
  }
1724
- function On(s, a, t) {
1725
- return a = Mn(a), a in s ? Object.defineProperty(s, a, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[a] = t, s;
1718
+ function On(s, n, t) {
1719
+ return n = Mn(n), n in s ? Object.defineProperty(s, n, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : s[n] = t, s;
1726
1720
  }
1727
1721
  function Mn(s) {
1728
- var a = Tn(s, "string");
1729
- return typeof a == "symbol" ? a : String(a);
1722
+ var n = Tn(s, "string");
1723
+ return typeof n == "symbol" ? n : String(n);
1730
1724
  }
1731
- function Tn(s, a) {
1725
+ function Tn(s, n) {
1732
1726
  if (typeof s != "object" || s === null)
1733
1727
  return s;
1734
1728
  var t = s[Symbol.toPrimitive];
1735
1729
  if (t !== void 0) {
1736
- var n = t.call(s, a || "default");
1737
- if (typeof n != "object")
1738
- return n;
1730
+ var a = t.call(s, n || "default");
1731
+ if (typeof a != "object")
1732
+ return a;
1739
1733
  throw new TypeError("@@toPrimitive must return a primitive value.");
1740
1734
  }
1741
- return (a === "string" ? String : Number)(s);
1735
+ return (n === "string" ? String : Number)(s);
1742
1736
  }
1743
- function pt(s) {
1744
- return s && s.map((a, t) => /* @__PURE__ */ he.createElement(a.tag, Je({
1737
+ function ft(s) {
1738
+ return s && s.map((n, t) => /* @__PURE__ */ he.createElement(n.tag, Ge({
1745
1739
  key: t
1746
- }, a.attr), pt(a.child)));
1740
+ }, n.attr), ft(n.child)));
1747
1741
  }
1748
1742
  function fe(s) {
1749
- return (a) => /* @__PURE__ */ he.createElement(An, Ue({
1750
- attr: Je({}, s.attr)
1751
- }, a), pt(s.child));
1743
+ return (n) => /* @__PURE__ */ he.createElement(An, Je({
1744
+ attr: Ge({}, s.attr)
1745
+ }, n), ft(s.child));
1752
1746
  }
1753
1747
  function An(s) {
1754
- var a = (t) => {
1748
+ var n = (t) => {
1755
1749
  var {
1756
- attr: n,
1750
+ attr: a,
1757
1751
  size: o,
1758
- title: l
1752
+ title: i
1759
1753
  } = s, r = zn(s, wn), c = o || t.size || "1em", d;
1760
- return t.className && (d = t.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ he.createElement("svg", Ue({
1754
+ return t.className && (d = t.className), s.className && (d = (d ? d + " " : "") + s.className), /* @__PURE__ */ he.createElement("svg", Je({
1761
1755
  stroke: "currentColor",
1762
1756
  fill: "currentColor",
1763
1757
  strokeWidth: "0"
1764
- }, t.attr, n, r, {
1758
+ }, t.attr, a, r, {
1765
1759
  className: d,
1766
- style: Je(Je({
1760
+ style: Ge(Ge({
1767
1761
  color: s.color || t.color
1768
1762
  }, t.style), s.style),
1769
1763
  height: c,
1770
1764
  width: c,
1771
1765
  xmlns: "http://www.w3.org/2000/svg"
1772
- }), l && /* @__PURE__ */ he.createElement("title", null, l), s.children);
1766
+ }), i && /* @__PURE__ */ he.createElement("title", null, i), s.children);
1773
1767
  };
1774
- return Vs !== void 0 ? /* @__PURE__ */ he.createElement(Vs.Consumer, null, (t) => a(t)) : a(xt);
1768
+ return Rs !== void 0 ? /* @__PURE__ */ he.createElement(Rs.Consumer, null, (t) => n(t)) : n(pt);
1775
1769
  }
1776
1770
  function En(s) {
1777
1771
  return fe({ tag: "svg", attr: { viewBox: "0 0 448 512" }, child: [{ tag: "path", attr: { d: "M439.8 200.5c-7.7-30.9-22.3-54.2-53.4-54.2h-40.1v47.4c0 36.8-31.2 67.8-66.8 67.8H172.7c-29.2 0-53.4 25-53.4 54.3v101.8c0 29 25.2 46 53.4 54.3 33.8 9.9 66.3 11.7 106.8 0 26.9-7.8 53.4-23.5 53.4-54.3v-40.7H226.2v-13.6h160.2c31.1 0 42.6-21.7 53.4-54.2 11.2-33.5 10.7-65.7 0-108.6zM286.2 404c11.1 0 20.1 9.1 20.1 20.3 0 11.3-9 20.4-20.1 20.4-11 0-20.1-9.2-20.1-20.4.1-11.3 9.1-20.3 20.1-20.3zM167.8 248.1h106.8c29.7 0 53.4-24.5 53.4-54.3V91.9c0-29-24.4-50.7-53.4-55.6-35.8-5.9-74.7-5.6-106.8.1-45.2 8-53.4 24.7-53.4 55.6v40.7h106.9v13.6h-147c-31.1 0-58.3 18.7-66.8 54.2-9.8 40.7-10.2 66.1 0 108.6 7.6 31.6 25.7 54.2 56.8 54.2H101v-48.8c0-35.3 30.5-66.4 66.8-66.4zm-6.7-142.6c-11.1 0-20.1-9.1-20.1-20.3.1-11.3 9-20.4 20.1-20.4 11 0 20.1 9.2 20.1 20.4s-9 20.3-20.1 20.3z" }, child: [] }] })(s);
1778
1772
  }
1779
1773
  function Ln() {
1780
- const { theme: s } = ta(), a = Ie(), t = Ie(), [n, o] = M(!1), [l, r] = M(!1), [c, d] = M(!1), [m, h] = M(""), [u, f] = M(!1), { authToken: p } = Ye();
1774
+ const { theme: s } = ea(), n = Ie(), t = Ie(), [a, o] = M(!1), [i, r] = M(!1), [c, d] = M(!1), [u, h] = M(""), [m, f] = M(!1), { authToken: p } = Ye();
1781
1775
  k((x) => x.selectedSheetId);
1782
- const g = k((x) => x.dashboard.baseQueries), S = i((x) => x.card), N = k((x) => x.theme), j = i((x) => x.isShowingVisual), L = i(
1776
+ const g = k((x) => x.dashboard.baseQueries), S = l((x) => x.card), N = k((x) => x.theme), j = l((x) => x.isShowingVisual), L = l(
1783
1777
  (x) => x.selectedConnectionId
1784
- ), A = i(
1778
+ ), A = l(
1785
1779
  (x) => x.selectedDatabaseName
1786
- ), O = i(
1780
+ ), O = l(
1787
1781
  (x) => x.selectedSchemaName
1788
1782
  );
1789
1783
  k(
1790
1784
  (x) => x.actions.updateFrameCard
1791
1785
  );
1792
- const y = i((x) => x.selectedTableName), z = i((x) => x.card.sql), E = i((x) => x.card.python), _ = aa(z, g), X = i((x) => x.selectedConnectionId), $ = i((x) => x.frame), U = i((x) => x.filterValues), D = i((x) => x.applyFilters), {
1786
+ const y = l((x) => x.selectedTableName), z = l((x) => x.card.sql), E = l((x) => x.card.python), _ = sa(z, g), X = l((x) => x.selectedConnectionId), $ = l((x) => x.frame), U = l((x) => x.filterValues), D = l((x) => x.applyFilters), {
1793
1787
  setCardCustomCfg: te,
1794
- setQueryResultColumns: P,
1788
+ setQueryResultColumns: W,
1795
1789
  setFilterValues: ee,
1796
1790
  setCardSql: Z,
1797
1791
  setCardPython: J,
1798
1792
  setQueryError: I,
1799
1793
  setPythonStdOut: v,
1800
1794
  setCardPreferences: b
1801
- } = i((x) => x.actions), F = i((x) => x.onSave), H = i(
1795
+ } = l((x) => x.actions), F = l((x) => x.onSave), H = l(
1802
1796
  (x) => x.actions.setApplyFilters
1803
- ), ue = i((x) => x.onClose), se = i((x) => x.actions.setCardData), ge = i((x) => x.actions.setSqlGen), je = i((x) => x.runSql), be = i((x) => x.actions.setRunSql), me = i(
1797
+ ), me = l((x) => x.onClose), se = l((x) => x.actions.setCardData), ge = l((x) => x.actions.setSqlGen), je = l((x) => x.runSql), be = l((x) => x.actions.setRunSql), ue = l(
1804
1798
  (x) => x.actions.setIsSqlRunning
1805
1799
  ), {
1806
- data: Q,
1800
+ data: G,
1807
1801
  isLoading: ae,
1808
1802
  isFetching: ne,
1809
1803
  isSuccess: ye,
@@ -1813,13 +1807,13 @@ function Ln() {
1813
1807
  refetch: ve
1814
1808
  } = Se({
1815
1809
  queryKey: [_, E],
1816
- queryFn: () => Xs(
1810
+ queryFn: () => Zs(
1817
1811
  "https://semaphor.cloud/api/v1/query",
1818
1812
  (p == null ? void 0 : p.accessToken) || "",
1819
1813
  {
1820
1814
  connection_id: X,
1821
1815
  sql: _,
1822
- python: E === Ms ? "" : E,
1816
+ python: E === Ts ? "" : E,
1823
1817
  active_filters: D ? U : []
1824
1818
  }
1825
1819
  ),
@@ -1827,24 +1821,24 @@ function Ln() {
1827
1821
  retry: !1
1828
1822
  });
1829
1823
  K(() => {
1830
- if (Q && (se(Q.records), v((Q == null ? void 0 : Q.output) || ""), Q.records.length > 0)) {
1831
- const { dimensionKeys: x } = ns(Q.records);
1832
- P(x);
1824
+ if (G && (se(G.records), v((G == null ? void 0 : G.output) || ""), G.records.length > 0)) {
1825
+ const { dimensionKeys: x } = ns(G.records);
1826
+ W(x);
1833
1827
  }
1834
- }, [Q, se, P, v]), K(() => {
1828
+ }, [G, se, W, v]), K(() => {
1835
1829
  je && (ve(), be(!1));
1836
1830
  }, [je, ve, be]), K(() => {
1837
- (ae || ne) && me(!0), (re || ye) && me(!1), re ? (I(Te.message), se([]), P([]), v("")) : I("");
1831
+ (ae || ne) && ue(!0), (re || ye) && ue(!1), re ? (I(Te.message), se([]), W([]), v("")) : I("");
1838
1832
  }, [
1839
1833
  ae,
1840
1834
  ne,
1841
- Q,
1835
+ G,
1842
1836
  v,
1843
1837
  re,
1844
1838
  ye,
1845
- me,
1839
+ ue,
1846
1840
  se,
1847
- P,
1841
+ W,
1848
1842
  I,
1849
1843
  Te
1850
1844
  ]);
@@ -1857,7 +1851,7 @@ function Ln() {
1857
1851
  function C() {
1858
1852
  let x = z;
1859
1853
  z && !z.includes("{{") && (x = yn(z), Z(x));
1860
- const le = {
1854
+ const ie = {
1861
1855
  ...S,
1862
1856
  lastSelectedSchema: O,
1863
1857
  lastSelectedDatabase: A,
@@ -1867,34 +1861,34 @@ function Ln() {
1867
1861
  sql: x,
1868
1862
  customCfg: j ? S.customCfg : null
1869
1863
  }, Ee = $.cards.map(
1870
- (Ne) => Ne.id === S.id ? le : Ne
1864
+ (Ne) => Ne.id === S.id ? ie : Ne
1871
1865
  );
1872
1866
  F == null || F({
1873
1867
  ...$,
1874
1868
  cards: Ee
1875
1869
  });
1876
1870
  }
1877
- function wt() {
1878
- ue == null || ue();
1871
+ function zt() {
1872
+ me == null || me();
1879
1873
  }
1880
- function zt(x) {
1881
- const le = getComputedStyle(
1874
+ function Ft(x) {
1875
+ const ie = getComputedStyle(
1882
1876
  document.documentElement
1883
1877
  ).getPropertyValue(x);
1884
- return Ft(le);
1878
+ return Ot(ie);
1885
1879
  }
1886
- function Ft(x) {
1887
- const [le, Ee, Ne] = x.split(" "), Y = parseFloat(le), Tt = parseFloat(Ee), At = parseFloat(Ne), Et = Tt / 100, zs = At / 100, xe = (1 - Math.abs(2 * zs - 1)) * Et, we = xe * (1 - Math.abs(Y / 60 % 2 - 1)), Ze = zs - xe / 2;
1888
- let ie = 0, oe = 0, ce = 0;
1889
- 0 <= Y && Y < 60 ? (ie = xe, oe = we, ce = 0) : 60 <= Y && Y < 120 ? (ie = we, oe = xe, ce = 0) : 120 <= Y && Y < 180 ? (ie = 0, oe = xe, ce = we) : 180 <= Y && Y < 240 ? (ie = 0, oe = we, ce = xe) : 240 <= Y && Y < 300 ? (ie = we, oe = 0, ce = xe) : 300 <= Y && Y < 360 && (ie = xe, oe = 0, ce = we), ie = Math.round((ie + Ze) * 255), oe = Math.round((oe + Ze) * 255), ce = Math.round((ce + Ze) * 255);
1890
- const es = (Lt) => {
1891
- const ss = Lt.toString(16);
1880
+ function Ot(x) {
1881
+ const [ie, Ee, Ne] = x.split(" "), P = parseFloat(ie), At = parseFloat(Ee), Et = parseFloat(Ne), Lt = At / 100, zs = Et / 100, xe = (1 - Math.abs(2 * zs - 1)) * Lt, we = xe * (1 - Math.abs(P / 60 % 2 - 1)), Ze = zs - xe / 2;
1882
+ let le = 0, oe = 0, ce = 0;
1883
+ 0 <= P && P < 60 ? (le = xe, oe = we, ce = 0) : 60 <= P && P < 120 ? (le = we, oe = xe, ce = 0) : 120 <= P && P < 180 ? (le = 0, oe = xe, ce = we) : 180 <= P && P < 240 ? (le = 0, oe = we, ce = xe) : 240 <= P && P < 300 ? (le = we, oe = 0, ce = xe) : 300 <= P && P < 360 && (le = xe, oe = 0, ce = we), le = Math.round((le + Ze) * 255), oe = Math.round((oe + Ze) * 255), ce = Math.round((ce + Ze) * 255);
1884
+ const es = (Dt) => {
1885
+ const ss = Dt.toString(16);
1892
1886
  return ss.length == 1 ? "0" + ss : ss;
1893
1887
  };
1894
- return `#${es(ie)}${es(oe)}${es(ce)}`;
1888
+ return `#${es(le)}${es(oe)}${es(ce)}`;
1895
1889
  }
1896
1890
  K(() => {
1897
- const x = a.current, le = t.current;
1891
+ const x = n.current, ie = t.current;
1898
1892
  if (x) {
1899
1893
  const Ee = window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light", Ne = N === "system" ? Ee : N;
1900
1894
  x.editor.defineTheme("default", {
@@ -1904,24 +1898,24 @@ function Ln() {
1904
1898
  rules: [],
1905
1899
  colors: {
1906
1900
  // 'editor.background': activeTheme === 'light' ? '#ffffff' : '#020817',
1907
- "editor.background": Ne === "light" ? "#ffffff" : zt("--background")
1901
+ "editor.background": Ne === "light" ? "#ffffff" : Ft("--background")
1908
1902
  }
1909
1903
  }), x.editor.setTheme("default");
1910
1904
  }
1911
- return le && x && le.addCommand(
1905
+ return ie && x && ie.addCommand(
1912
1906
  x.KeyMod.Shift | x.KeyCode.Enter,
1913
1907
  function() {
1914
1908
  return console.log("Executing query..."), ve(), !1;
1915
1909
  }
1916
1910
  ), () => {
1917
1911
  };
1918
- }, [s, N, a.current]);
1912
+ }, [s, N, n.current]);
1919
1913
  function ws(x) {
1920
- a.current = x;
1914
+ n.current = x;
1921
1915
  }
1922
- function Ot() {
1916
+ function Mt() {
1923
1917
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1924
- l && /* @__PURE__ */ e.jsx(
1918
+ i && /* @__PURE__ */ e.jsx(
1925
1919
  "div",
1926
1920
  {
1927
1921
  className: "xbg-yellow-100 relative flex w-1/3 min-w-0 grow overflow-hidden border-l p-1 text-xs",
@@ -1937,7 +1931,7 @@ function Ln() {
1937
1931
  }
1938
1932
  ),
1939
1933
  /* @__PURE__ */ e.jsx(Cn, {}),
1940
- U && l && /* @__PURE__ */ e.jsx(
1934
+ U && i && /* @__PURE__ */ e.jsx(
1941
1935
  Le,
1942
1936
  {
1943
1937
  onClick: () => r(!1),
@@ -1979,11 +1973,11 @@ function Ln() {
1979
1973
  ] })
1980
1974
  }
1981
1975
  ),
1982
- U && !l && /* @__PURE__ */ e.jsx(
1976
+ U && !i && /* @__PURE__ */ e.jsx(
1983
1977
  lt,
1984
1978
  {
1985
1979
  onClick: () => r(!0),
1986
- className: G(
1980
+ className: Y(
1987
1981
  "absolute bottom-4 right-6 h-3 w-3 text-foreground/50 hover:cursor-pointer hover:text-foreground",
1988
1982
  {
1989
1983
  "font-bold text-red-800": D
@@ -1993,7 +1987,7 @@ function Ln() {
1993
1987
  )
1994
1988
  ] });
1995
1989
  }
1996
- function Mt() {
1990
+ function Tt() {
1997
1991
  return /* @__PURE__ */ e.jsxs(
1998
1992
  rs,
1999
1993
  {
@@ -2006,7 +2000,7 @@ function Ln() {
2006
2000
  {
2007
2001
  id: "1",
2008
2002
  order: 1,
2009
- defaultSize: n ? 20 : 100,
2003
+ defaultSize: a ? 20 : 100,
2010
2004
  className: "relative flex grow",
2011
2005
  children: [
2012
2006
  /* @__PURE__ */ e.jsx(
@@ -2043,12 +2037,12 @@ function Ln() {
2043
2037
  )
2044
2038
  }
2045
2039
  ),
2046
- n && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
2040
+ a && /* @__PURE__ */ e.jsx("code", { className: "absolute right-6 top-3 text-sm text-muted-foreground/70", children: "sql" })
2047
2041
  ]
2048
2042
  }
2049
2043
  ),
2050
- n && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2051
- /* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border" }),
2044
+ a && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2045
+ /* @__PURE__ */ e.jsx(is, { withHandle: !0, className: "border" }),
2052
2046
  /* @__PURE__ */ e.jsxs(
2053
2047
  Fe,
2054
2048
  {
@@ -2070,7 +2064,7 @@ function Ln() {
2070
2064
  onChange: (x) => {
2071
2065
  J(x && x.trim() || "");
2072
2066
  },
2073
- value: E || Ms,
2067
+ value: E || Ts,
2074
2068
  options: {
2075
2069
  minimap: {
2076
2070
  enabled: !1
@@ -2113,8 +2107,8 @@ function Ln() {
2113
2107
  role: "sql-editor",
2114
2108
  className: "relative flex grow justify-between overflow-y-scroll",
2115
2109
  children: [
2116
- Mt(),
2117
- Ot()
2110
+ Tt(),
2111
+ Mt()
2118
2112
  ]
2119
2113
  }
2120
2114
  ),
@@ -2137,7 +2131,7 @@ function Ln() {
2137
2131
  size: "sm",
2138
2132
  variant: "outline",
2139
2133
  children: [
2140
- ae || ne ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(rn, { className: "mr-2 h-4 w-4" }),
2134
+ ae || ne ? /* @__PURE__ */ e.jsx(De, { className: "mr-2 h-4 w-4 animate-spin text-foreground/50" }) : /* @__PURE__ */ e.jsx(an, { className: "mr-2 h-4 w-4" }),
2141
2135
  "Run"
2142
2136
  ]
2143
2137
  }
@@ -2159,15 +2153,15 @@ function Ln() {
2159
2153
  size: "sm",
2160
2154
  variant: "outline",
2161
2155
  children: [
2162
- /* @__PURE__ */ e.jsx(Qa, { className: "mr-2 size-4" }),
2156
+ /* @__PURE__ */ e.jsx(Ga, { className: "mr-2 size-4" }),
2163
2157
  "Clear"
2164
2158
  ]
2165
2159
  }
2166
2160
  ),
2167
2161
  /* @__PURE__ */ e.jsx(
2168
- Qs,
2162
+ Ws,
2169
2163
  {
2170
- pressed: n,
2164
+ pressed: a,
2171
2165
  onPressedChange: (x) => o(x),
2172
2166
  className: "",
2173
2167
  size: "sm",
@@ -2180,8 +2174,8 @@ function Ln() {
2180
2174
  {
2181
2175
  open: c,
2182
2176
  setOpen: d,
2183
- userInput: m,
2184
- triggerAIRun: u,
2177
+ userInput: u,
2178
+ triggerAIRun: m,
2185
2179
  setTriggerAIRun: f,
2186
2180
  setUserInput: (x) => h(x)
2187
2181
  }
@@ -2195,7 +2189,7 @@ function Ln() {
2195
2189
  size: "sm",
2196
2190
  variant: "outline",
2197
2191
  children: [
2198
- /* @__PURE__ */ e.jsx(na, { className: "mr-2 size-4 font-bold text-green-600" }),
2192
+ /* @__PURE__ */ e.jsx(ta, { className: "mr-2 size-4 font-bold text-green-600" }),
2199
2193
  "Accept"
2200
2194
  ]
2201
2195
  }
@@ -2203,7 +2197,7 @@ function Ln() {
2203
2197
  /* @__PURE__ */ e.jsxs(
2204
2198
  w,
2205
2199
  {
2206
- onClick: wt,
2200
+ onClick: zt,
2207
2201
  className: "w-full",
2208
2202
  size: "sm",
2209
2203
  variant: "outline",
@@ -2224,11 +2218,11 @@ function Ln() {
2224
2218
  }
2225
2219
  function Dn({ data: s }) {
2226
2220
  var r;
2227
- const [a, t] = he.useState([]), o = Object.keys(s[0]).map((c) => ({
2221
+ const [n, t] = he.useState([]), o = Object.keys(s[0]).map((c) => ({
2228
2222
  // header: key,
2229
2223
  accessorKey: c,
2230
2224
  header: ({ column: d }) => {
2231
- const m = d.getIsSorted();
2225
+ const u = d.getIsSorted();
2232
2226
  return /* @__PURE__ */ e.jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ e.jsxs(
2233
2227
  "div",
2234
2228
  {
@@ -2236,116 +2230,116 @@ function Dn({ data: s }) {
2236
2230
  onClick: () => d.toggleSorting(d.getIsSorted() === "asc"),
2237
2231
  children: [
2238
2232
  c,
2239
- m === "asc" ? /* @__PURE__ */ e.jsx(ra, { className: "ml-2 h-5 w-5" }) : m === "desc" ? /* @__PURE__ */ e.jsx(la, { className: "ml-2 h-5 w-5" }) : null
2233
+ u === "asc" ? /* @__PURE__ */ e.jsx(aa, { className: "ml-2 h-5 w-5" }) : u === "desc" ? /* @__PURE__ */ e.jsx(na, { className: "ml-2 h-5 w-5" }) : null
2240
2234
  ]
2241
2235
  }
2242
2236
  ) });
2243
2237
  }
2244
- })), l = ia({
2238
+ })), i = ra({
2245
2239
  data: s,
2246
2240
  columns: o,
2247
- getCoreRowModel: ua(),
2248
- getPaginationRowModel: ma(),
2241
+ getCoreRowModel: da(),
2242
+ getPaginationRowModel: ha(),
2249
2243
  onSortingChange: t,
2250
- getSortedRowModel: xa(),
2244
+ getSortedRowModel: ma(),
2251
2245
  manualPagination: !0,
2252
2246
  state: {
2253
- sorting: a
2247
+ sorting: n
2254
2248
  }
2255
2249
  });
2256
- return /* @__PURE__ */ e.jsxs(oa, { children: [
2257
- /* @__PURE__ */ e.jsx(ca, { children: l.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ts, { children: c.headers.map((d) => /* @__PURE__ */ e.jsx(da, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : Ts(
2250
+ return /* @__PURE__ */ e.jsxs(ia, { children: [
2251
+ /* @__PURE__ */ e.jsx(la, { children: i.getHeaderGroups().map((c) => /* @__PURE__ */ e.jsx(ts, { children: c.headers.map((d) => /* @__PURE__ */ e.jsx(oa, { className: "sticky top-0 bg-muted", children: d.isPlaceholder ? null : As(
2258
2252
  d.column.columnDef.header,
2259
2253
  d.getContext()
2260
2254
  ) }, d.id)) }, c.id)) }),
2261
- /* @__PURE__ */ e.jsx(ha, { children: (r = l.getRowModel().rows) != null && r.length ? l.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2255
+ /* @__PURE__ */ e.jsx(ca, { children: (r = i.getRowModel().rows) != null && r.length ? i.getRowModel().rows.map((c) => /* @__PURE__ */ e.jsx(
2262
2256
  ts,
2263
2257
  {
2264
2258
  className: "whitespace-nowrap py-2",
2265
2259
  "data-state": c.getIsSelected() && "selected",
2266
- children: c.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(As, { children: Ts(d.column.columnDef.cell, d.getContext()) }, d.id))
2260
+ children: c.getVisibleCells().map((d) => /* @__PURE__ */ e.jsx(Es, { children: As(d.column.columnDef.cell, d.getContext()) }, d.id))
2267
2261
  },
2268
2262
  c.id
2269
- )) : /* @__PURE__ */ e.jsx(ts, { children: /* @__PURE__ */ e.jsx(As, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
2263
+ )) : /* @__PURE__ */ e.jsx(ts, { children: /* @__PURE__ */ e.jsx(Es, { colSpan: o.length, className: "h-24 text-center", children: "No results." }) }) })
2270
2264
  ] });
2271
2265
  }
2272
- function ft({
2266
+ function gt({
2273
2267
  // card,
2274
2268
  className: s,
2275
- ...a
2269
+ ...n
2276
2270
  }) {
2277
2271
  he.useState(0);
2278
- const t = k((r) => r.themeStyle), n = i((r) => r.card), o = i((r) => r.actions.setCard);
2272
+ const t = k((r) => r.themeStyle), a = l((r) => r.card), o = l((r) => r.actions.setCard);
2279
2273
  if (K(() => {
2280
2274
  }, [
2281
- n.data,
2282
- n.type,
2283
- n.cfg,
2284
- n.customCfg,
2275
+ a.data,
2276
+ a.type,
2277
+ a.cfg,
2278
+ a.customCfg,
2285
2279
  t,
2286
- n.preferences
2287
- ]), !n.id)
2280
+ a.preferences
2281
+ ]), !a.id)
2288
2282
  return null;
2289
- let l;
2290
- return n.data && n.data.length > 0 && (l = tt({
2291
- data: n.data,
2292
- cardType: n.type,
2293
- cfg: n.cfg,
2294
- customCfg: n.customCfg,
2295
- preferences: n.preferences
2283
+ let i;
2284
+ return a.data && a.data.length > 0 && (i = at({
2285
+ data: a.data,
2286
+ cardType: a.type,
2287
+ cfg: a.cfg,
2288
+ customCfg: a.customCfg,
2289
+ preferences: a.preferences
2296
2290
  })), /* @__PURE__ */ e.jsxs(
2297
- pa,
2291
+ ua,
2298
2292
  {
2299
2293
  role: "editor-visual-card",
2300
- className: G("relative flex h-full flex-col rounded-none", s),
2301
- ...a,
2294
+ className: Y("relative flex h-full flex-col rounded-none", s),
2295
+ ...n,
2302
2296
  children: [
2303
- /* @__PURE__ */ e.jsxs(fa, { className: "py-4", children: [
2297
+ /* @__PURE__ */ e.jsxs(xa, { className: "py-4", children: [
2304
2298
  /* @__PURE__ */ e.jsx(
2305
- Es,
2299
+ Ls,
2306
2300
  {
2307
- text: n.title,
2308
- onSave: (r) => o({ ...n, title: r }),
2309
- children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(ga, { className: "text-base", children: n.title }) })
2301
+ text: a.title,
2302
+ onSave: (r) => o({ ...a, title: r }),
2303
+ children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ e.jsx(pa, { className: "text-base", children: a.title }) })
2310
2304
  },
2311
- n.title
2305
+ a.title
2312
2306
  ),
2313
2307
  /* @__PURE__ */ e.jsx(
2314
- Es,
2308
+ Ls,
2315
2309
  {
2316
- text: n.description || "",
2317
- onSave: (r) => o({ ...n, description: r }),
2318
- children: /* @__PURE__ */ e.jsxs(ja, { children: [
2310
+ text: a.description || "",
2311
+ onSave: (r) => o({ ...a, description: r }),
2312
+ children: /* @__PURE__ */ e.jsxs(fa, { children: [
2319
2313
  " ",
2320
- n.description
2314
+ a.description
2321
2315
  ] })
2322
2316
  },
2323
- n.description
2317
+ a.description
2324
2318
  )
2325
2319
  ] }),
2326
- /* @__PURE__ */ e.jsxs(ba, { className: "flex grow flex-col pb-3", children: [
2327
- n.type !== "table" && l && // <ChartJsVisual key={visualKey} cfg={cfg} />
2320
+ /* @__PURE__ */ e.jsxs(ga, { className: "flex grow flex-col pb-3", children: [
2321
+ a.type !== "table" && i && // <ChartJsVisual key={visualKey} cfg={cfg} />
2328
2322
  /* @__PURE__ */ e.jsx(
2329
- ya,
2323
+ ja,
2330
2324
  {
2331
- cfg: l
2325
+ cfg: i
2332
2326
  },
2333
- JSON.stringify(l) + JSON.stringify(n.preferences)
2327
+ JSON.stringify(i) + JSON.stringify(a.preferences)
2334
2328
  ),
2335
- n.type === "table" && n.data && n.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2336
- /* @__PURE__ */ e.jsx(va, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(Na, { card: n, data: n == null ? void 0 : n.data }) })
2329
+ a.type === "table" && a.data && a.data.length > 0 && // All of the below css classes are #IMPORTANT for the table to scroll properly
2330
+ /* @__PURE__ */ e.jsx(ba, { className: "flex min-h-0 flex-1 grow basis-0", children: /* @__PURE__ */ e.jsx(ya, { card: a, data: a == null ? void 0 : a.data }) })
2337
2331
  ] })
2338
2332
  ]
2339
2333
  }
2340
2334
  );
2341
2335
  }
2342
2336
  function In() {
2343
- const [s, a] = M(!1), [t, n] = M(""), [o, l] = M(""), [r, c] = M(""), d = i((N) => N.card), m = i(
2337
+ const [s, n] = M(!1), [t, a] = M(""), [o, i] = M(""), [r, c] = M(""), d = l((N) => N.card), u = l(
2344
2338
  (N) => N.card.customCfg
2345
- ), h = i(
2339
+ ), h = l(
2346
2340
  (N) => N.actions.setCardCustomCfg
2347
2341
  );
2348
- function u(N) {
2342
+ function m(N) {
2349
2343
  var A, O;
2350
2344
  const j = {
2351
2345
  ...N,
@@ -2362,43 +2356,43 @@ function In() {
2362
2356
  function f() {
2363
2357
  if (!d.data || d.data.length === 0)
2364
2358
  return;
2365
- const N = tt({
2359
+ const N = at({
2366
2360
  data: d.data,
2367
2361
  cardType: d.type,
2368
2362
  cfg: d.cfg,
2369
2363
  preferences: d.preferences
2370
2364
  });
2371
- N && (n(JSON.stringify(N, null, 1)), m && l(JSON.stringify(m, null, 1)));
2365
+ N && (a(JSON.stringify(N, null, 1)), u && i(JSON.stringify(u, null, 1)));
2372
2366
  }
2373
2367
  function p() {
2374
2368
  if (o)
2375
2369
  try {
2376
2370
  const N = JSON.parse(o);
2377
- return N ? (h(N), c(""), l(""), N) : void 0;
2371
+ return N ? (h(N), c(""), i(""), N) : void 0;
2378
2372
  } catch (N) {
2379
2373
  console.log(N), c("Invalid JSON");
2380
2374
  }
2381
2375
  }
2382
2376
  function g() {
2383
- l(""), h(null);
2377
+ i(""), h(null);
2384
2378
  }
2385
2379
  function S() {
2386
2380
  let N;
2387
- if (m) {
2388
- const j = Is.cloneDeep(d.cfg), L = Is.merge(j, m);
2389
- return N = u(L), N;
2381
+ if (u) {
2382
+ const j = qs.cloneDeep(d.cfg), L = qs.merge(j, u);
2383
+ return N = m(L), N;
2390
2384
  }
2391
- return t ? (N = u(JSON.parse(t)), N) : "";
2385
+ return t ? (N = m(JSON.parse(t)), N) : "";
2392
2386
  }
2393
- return /* @__PURE__ */ e.jsxs(is, { open: s, onOpenChange: a, children: [
2387
+ return /* @__PURE__ */ e.jsxs(ls, { open: s, onOpenChange: n, children: [
2394
2388
  /* @__PURE__ */ e.jsx(os, { asChild: !0, children: /* @__PURE__ */ e.jsx(
2395
2389
  w,
2396
2390
  {
2397
2391
  onClick: f,
2398
- className: ` ${m && "border-foreground/50 dark:border-foreground/70"}`,
2392
+ className: ` ${u && "border-foreground/50 dark:border-foreground/70"}`,
2399
2393
  size: "sm",
2400
2394
  variant: "outline",
2401
- children: /* @__PURE__ */ e.jsx(Ca, { className: "h-4 w-4" })
2395
+ children: /* @__PURE__ */ e.jsx(va, { className: "h-4 w-4" })
2402
2396
  }
2403
2397
  ) }),
2404
2398
  /* @__PURE__ */ e.jsxs(
@@ -2410,8 +2404,8 @@ function In() {
2410
2404
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
2411
2405
  /* @__PURE__ */ e.jsx(hs, { children: "Customize Card" }),
2412
2406
  /* @__PURE__ */ e.jsxs(We, { children: [
2413
- /* @__PURE__ */ e.jsx(ms, { children: /* @__PURE__ */ e.jsx(
2414
- Za,
2407
+ /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(
2408
+ Ya,
2415
2409
  {
2416
2410
  onClick: () => {
2417
2411
  navigator.clipboard.writeText(d.id);
@@ -2422,7 +2416,7 @@ function In() {
2422
2416
  /* @__PURE__ */ e.jsx(Pe, { side: "right", align: "center", children: /* @__PURE__ */ e.jsx("p", { className: "text-xs", children: "Copy Card ID" }) })
2423
2417
  ] })
2424
2418
  ] }),
2425
- /* @__PURE__ */ e.jsxs(us, { children: [
2419
+ /* @__PURE__ */ e.jsxs(ms, { children: [
2426
2420
  "See the configuration options and documentation",
2427
2421
  /* @__PURE__ */ e.jsx(
2428
2422
  "a",
@@ -2436,22 +2430,22 @@ function In() {
2436
2430
  ] })
2437
2431
  ] }),
2438
2432
  /* @__PURE__ */ e.jsxs("div", { className: "flex grow gap-2", children: [
2439
- /* @__PURE__ */ e.jsx(ft, { className: "w-1/2 rounded shadow-none" }),
2440
- /* @__PURE__ */ e.jsxs(Sa, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2441
- /* @__PURE__ */ e.jsxs(ka, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2442
- /* @__PURE__ */ e.jsxs(Ls, { value: "custom-config", children: [
2443
- m && /* @__PURE__ */ e.jsx(wa, { className: "mr-1 h-5 w-5 text-green-600" }),
2444
- m ? "Custom Config" : "Default Config"
2433
+ /* @__PURE__ */ e.jsx(gt, { className: "w-1/2 rounded shadow-none" }),
2434
+ /* @__PURE__ */ e.jsxs(Na, { defaultValue: "custom-config", className: "flex w-1/2 flex-col", children: [
2435
+ /* @__PURE__ */ e.jsxs(Ca, { className: "justify-start rounded-sm rounded-b-none border border-b-0", children: [
2436
+ /* @__PURE__ */ e.jsxs(Ds, { value: "custom-config", children: [
2437
+ u && /* @__PURE__ */ e.jsx(Sa, { className: "mr-1 h-5 w-5 text-green-600" }),
2438
+ u ? "Custom Config" : "Default Config"
2445
2439
  ] }),
2446
- /* @__PURE__ */ e.jsx(Ls, { className: "", value: "output", children: "Output" })
2440
+ /* @__PURE__ */ e.jsx(Ds, { className: "", value: "output", children: "Output" })
2447
2441
  ] }),
2448
2442
  /* @__PURE__ */ e.jsx(
2449
- Ds,
2443
+ Is,
2450
2444
  {
2451
2445
  className: "bg-red-x mt-0 grow rounded-b border border-t-0 p-2",
2452
2446
  value: "output",
2453
2447
  children: /* @__PURE__ */ e.jsx(
2454
- st,
2448
+ tt,
2455
2449
  {
2456
2450
  disabled: !0,
2457
2451
  value: t,
@@ -2461,7 +2455,7 @@ function In() {
2461
2455
  }
2462
2456
  ),
2463
2457
  /* @__PURE__ */ e.jsx(
2464
- Ds,
2458
+ Is,
2465
2459
  {
2466
2460
  className: "mt-0 grow rounded-b border border-t-0",
2467
2461
  value: "custom-config",
@@ -2484,63 +2478,63 @@ function In() {
2484
2478
  },
2485
2479
  defaultLanguage: "json",
2486
2480
  value: S(),
2487
- onChange: (N) => l(N)
2481
+ onChange: (N) => i(N)
2488
2482
  }
2489
2483
  )
2490
2484
  }
2491
2485
  )
2492
2486
  ] })
2493
2487
  ] }),
2494
- /* @__PURE__ */ e.jsxs($s, { className: "flex items-center", children: [
2488
+ /* @__PURE__ */ e.jsxs(Ks, { className: "flex items-center", children: [
2495
2489
  /* @__PURE__ */ e.jsx(B, { className: "mr-2 text-red-500", children: r }),
2496
2490
  /* @__PURE__ */ e.jsx(
2497
2491
  w,
2498
2492
  {
2499
- disabled: !m,
2493
+ disabled: !u,
2500
2494
  onClick: g,
2501
2495
  variant: "outline",
2502
2496
  children: "Reset"
2503
2497
  }
2504
2498
  ),
2505
2499
  /* @__PURE__ */ e.jsx(w, { onClick: p, variant: "outline", children: "Apply" }),
2506
- /* @__PURE__ */ e.jsx(w, { onClick: () => a(!1), variant: "outline", children: "Close" })
2500
+ /* @__PURE__ */ e.jsx(w, { onClick: () => n(!1), variant: "outline", children: "Close" })
2507
2501
  ] })
2508
2502
  ]
2509
2503
  }
2510
2504
  )
2511
2505
  ] });
2512
2506
  }
2513
- function gt(s) {
2507
+ function jt(s) {
2514
2508
  return fe({ tag: "svg", attr: { viewBox: "0 0 1024 1024" }, child: [{ tag: "path", attr: { d: "M926.8 397.1l-396-288a31.81 31.81 0 0 0-37.6 0l-396 288a31.99 31.99 0 0 0-11.6 35.8l151.3 466a32 32 0 0 0 30.4 22.1h489.5c13.9 0 26.1-8.9 30.4-22.1l151.3-466c4.2-13.2-.5-27.6-11.7-35.8zM838.6 417l-98.5 32-200-144.7V199.9L838.6 417zM466 567.2l-89.1 122.3-55.2-169.2L466 567.2zm-116.3-96.8L484 373.3v140.8l-134.3-43.7zM512 599.2l93.9 128.9H418.1L512 599.2zm28.1-225.9l134.2 97.1L540.1 514V373.3zM558 567.2l144.3-46.9-55.2 169.2L558 567.2zm-74-367.3v104.4L283.9 449l-98.5-32L484 199.9zM169.3 470.8l86.5 28.1 80.4 246.4-53.8 73.9-113.1-348.4zM327.1 853l50.3-69h269.3l50.3 69H327.1zm414.5-33.8l-53.8-73.9 80.4-246.4 86.5-28.1-113.1 348.4z" }, child: [] }] })(s);
2515
2509
  }
2516
- function jt(s) {
2510
+ function bt(s) {
2517
2511
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M137.39,24.06A16,16,0,0,0,120,40V80.67a15.86,15.86,0,0,0,13.25,15.76A32,32,0,1,1,96,129.68c-.41-8.22,1.27-15,5-20.26h0a15.86,15.86,0,0,0-1.69-20.47L71.69,60.68a16,16,0,0,0-23.63,1.1A103.6,103.6,0,0,0,55,202.05,103.24,103.24,0,0,0,128,232h1.49A104.3,104.3,0,0,0,232,129.48C232.75,75.18,191.19,28.88,137.39,24.06ZM60.32,71.94l27.61,28.19,0,.06A43.29,43.29,0,0,0,80.44,120H40.36A87.13,87.13,0,0,1,60.32,71.94ZM40.37,136h40.3A48,48,0,0,0,120,175.34v40.3A88,88,0,0,1,40.37,136Zm149.77,54.14A87.45,87.45,0,0,1,136,215.61V175.34a47.55,47.55,0,0,0,24.73-12.23A48,48,0,0,0,136,80.66L136,40c45.52,4.08,80.67,43.28,80,89.25A87.45,87.45,0,0,1,190.14,190.14Z" }, child: [] }] })(s);
2518
2512
  }
2519
- function bt(s) {
2513
+ function yt(s) {
2520
2514
  return fe({ tag: "svg", attr: { viewBox: "0 0 256 256", fill: "currentColor" }, child: [{ tag: "path", attr: { d: "M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm87.63,96H191.48A64.1,64.1,0,0,0,136,64.52V40.37A88.13,88.13,0,0,1,215.63,120ZM120,120H80.68A48.09,48.09,0,0,1,120,80.68Zm0,16v39.32A48.09,48.09,0,0,1,80.68,136Zm16,0h39.32A48.09,48.09,0,0,1,136,175.32Zm0-16V80.68A48.09,48.09,0,0,1,175.32,120ZM120,40.37V64.52A64.1,64.1,0,0,0,64.52,120H40.37A88.13,88.13,0,0,1,120,40.37ZM40.37,136H64.52A64.1,64.1,0,0,0,120,191.48v24.15A88.13,88.13,0,0,1,40.37,136ZM136,215.63V191.48A64.1,64.1,0,0,0,191.48,136h24.15A88.13,88.13,0,0,1,136,215.63Z" }, child: [] }] })(s);
2521
2515
  }
2522
- function yt(s) {
2516
+ function vt(s) {
2523
2517
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24", strokeWidth: "2", stroke: "currentColor", fill: "none", strokeLinecap: "round", strokeLinejoin: "round" }, child: [{ tag: "path", attr: { stroke: "none", d: "M0 0h24v24H0z", fill: "none" }, child: [] }, { tag: "path", attr: { d: "M6 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0" }, child: [] }, { tag: "path", attr: { d: "M16 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0" }, child: [] }, { tag: "path", attr: { d: "M14.5 7.5m-4.5 0a4.5 4.5 0 1 0 9 0a4.5 4.5 0 1 0 -9 0" }, child: [] }] })(s);
2524
2518
  }
2525
- function vt(s) {
2519
+ function Nt(s) {
2526
2520
  return fe({ tag: "svg", attr: { viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { fill: "none", d: "M0 0h24v24H0z" }, child: [] }, { tag: "path", attr: { d: "M4 9h4v11H4zM4 4h4v4H4zM10 7h4v4h-4zM16 10h4v4h-4zM16 15h4v5h-4zM10 12h4v8h-4z" }, child: [] }] })(s);
2527
2521
  }
2528
- function Nt(s) {
2522
+ function Ct(s) {
2529
2523
  return fe({ tag: "svg", attr: { version: "1.2", baseProfile: "tiny", viewBox: "0 0 24 24" }, child: [{ tag: "path", attr: { d: "M4 18c-.552 0-1-.448-1-1v-6.382l-.553.276c-.495.248-1.095.046-1.342-.447-.247-.494-.046-1.094.448-1.342l2-1c.31-.155.678-.139.973.044.294.183.474.504.474.851v8c0 .552-.448 1-1 1zM13 18h-5c-.404 0-.769-.244-.924-.617-.155-.374-.069-.804.217-1.09l4-4c.254-.254.394-.591.394-.95 0-.358-.14-.695-.394-.949-.508-.508-1.39-.508-1.9.001-.253.252-.393.589-.393.948 0 .552-.448 1-1 1s-1-.448-1-1c0-.894.348-1.733.98-2.364 1.265-1.263 3.464-1.263 4.727.001.632.631.979 1.471.979 2.363 0 .893-.348 1.733-.979 2.364l-2.293 2.293h2.586c.552 0 1 .448 1 1s-.448 1-1 1zM20.955 12.377c.338-.457.545-1.016.545-1.627 0-1.517-1.234-2.75-2.75-2.75-1.031 0-1.966.569-2.44 1.484-.254.49-.063 1.094.428 1.348.49.254 1.094.062 1.348-.428.128-.249.383-.404.664-.404.414 0 .75.336.75.75s-.336.75-.75.75c-.552 0-1 .448-1 1s.448 1 1 1c.689 0 1.25.561 1.25 1.25s-.561 1.25-1.25 1.25-1.25-.561-1.25-1.25c0-.552-.448-1-1-1s-1 .448-1 1c0 1.792 1.458 3.25 3.25 3.25s3.25-1.458 3.25-3.25c0-.939-.406-1.779-1.045-2.373z" }, child: [] }] })(s);
2530
2524
  }
2531
- function Ct(s) {
2525
+ function St(s) {
2532
2526
  return fe({ tag: "svg", attr: { viewBox: "0 0 512 512" }, child: [{ tag: "path", attr: { d: "M217 25v14h78V25h-78zm0 32v46h14V71h50v32h14V57h-78zm32 32v14h14V89h-14zm-64 32v46h30v-46h-30zm48 0v14h46v-14h-46zm64 0v46h30v-46h-30zm-64 32v14h46v-14h-46zm-80 32v46h62v-46h-62zm80 0v14h46v-14h-46zm64 0v46h62v-46h-62zm-64 32v14h46v-14h-46zm-112 32v46h94v-46h-94zm112 0v14h46v-14h-46zm64 0v46h94v-46h-94zm-64 32v14h46v-14h-46zM89 313v46h126v-46H89zm144 0v14h46v-14h-46zm64 0v46h126v-46H297zm-64 32v14h46v-14h-46zM57 377v46h158v-46H57zm176 0v14h46v-14h-46zm64 0v46h158v-46H297zm-64 32v14h46v-14h-46zM25 441v46h190v-46H25zm208 0v14h46v-14h-46zm64 0v46h190v-46H297zm-64 32v14h46v-14h-46z" }, child: [] }] })(s);
2533
2527
  }
2534
2528
  function qn() {
2535
- const [s, a] = M(!1), t = i((c) => c.card.type), { setCardType: n, setCardPreferences: o } = i(
2529
+ const [s, n] = M(!1), t = l((c) => c.card.type), { setCardType: a, setCardPreferences: o } = l(
2536
2530
  (c) => c.actions
2537
- ), l = i(
2531
+ ), i = l(
2538
2532
  (c) => c.actions.setCardCustomCfg
2539
2533
  );
2540
2534
  function r(c) {
2541
- n(c), l(null), o({}), a(!1);
2535
+ a(c), i(null), o({}), n(!1);
2542
2536
  }
2543
- return /* @__PURE__ */ e.jsxs(qe, { open: s, onOpenChange: a, children: [
2537
+ return /* @__PURE__ */ e.jsxs(qe, { open: s, onOpenChange: n, children: [
2544
2538
  /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Vn, { className: "h-4 w-4", chartType: t }) }) }),
2545
2539
  /* @__PURE__ */ e.jsx(Re, { className: "w-50", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 place-items-center", children: [
2546
2540
  /* @__PURE__ */ e.jsx(
@@ -2565,7 +2559,7 @@ function qn() {
2565
2559
  {
2566
2560
  onClick: () => r("stackedBar"),
2567
2561
  variant: "ghost",
2568
- children: /* @__PURE__ */ e.jsx(vt, { className: "size-5", strokeWidth: 0 })
2562
+ children: /* @__PURE__ */ e.jsx(Nt, { className: "size-5", strokeWidth: 0 })
2569
2563
  }
2570
2564
  ),
2571
2565
  /* @__PURE__ */ e.jsx(
@@ -2573,7 +2567,7 @@ function qn() {
2573
2567
  {
2574
2568
  onClick: () => r("scatter"),
2575
2569
  variant: "ghost",
2576
- children: /* @__PURE__ */ e.jsx(dt, { className: "size-5" })
2570
+ children: /* @__PURE__ */ e.jsx(ht, { className: "size-5" })
2577
2571
  }
2578
2572
  ),
2579
2573
  /* @__PURE__ */ e.jsx(
@@ -2581,7 +2575,7 @@ function qn() {
2581
2575
  {
2582
2576
  onClick: () => r("bubble"),
2583
2577
  variant: "ghost",
2584
- children: /* @__PURE__ */ e.jsx(yt, { className: "size-4" })
2578
+ children: /* @__PURE__ */ e.jsx(vt, { className: "size-4" })
2585
2579
  }
2586
2580
  ),
2587
2581
  /* @__PURE__ */ e.jsx(
@@ -2589,7 +2583,7 @@ function qn() {
2589
2583
  {
2590
2584
  onClick: () => r("pie"),
2591
2585
  variant: "ghost",
2592
- children: /* @__PURE__ */ e.jsx(ot, { className: "size-5" })
2586
+ children: /* @__PURE__ */ e.jsx(ct, { className: "size-5" })
2593
2587
  }
2594
2588
  ),
2595
2589
  /* @__PURE__ */ e.jsx(
@@ -2597,7 +2591,7 @@ function qn() {
2597
2591
  {
2598
2592
  onClick: () => r("doughnut"),
2599
2593
  variant: "ghost",
2600
- children: /* @__PURE__ */ e.jsx(jt, { className: "size-5", strokeWidth: 1 })
2594
+ children: /* @__PURE__ */ e.jsx(bt, { className: "size-5", strokeWidth: 1 })
2601
2595
  }
2602
2596
  ),
2603
2597
  /* @__PURE__ */ e.jsx(
@@ -2606,7 +2600,7 @@ function qn() {
2606
2600
  onClick: () => r("radar"),
2607
2601
  variant: "ghost",
2608
2602
  children: /* @__PURE__ */ e.jsx(
2609
- gt,
2603
+ jt,
2610
2604
  {
2611
2605
  className: "size-5 font-extralight",
2612
2606
  strokeWidth: 0.5
@@ -2619,7 +2613,7 @@ function qn() {
2619
2613
  {
2620
2614
  onClick: () => r("polarArea"),
2621
2615
  variant: "ghost",
2622
- children: /* @__PURE__ */ e.jsx(bt, { className: "size-5" })
2616
+ children: /* @__PURE__ */ e.jsx(yt, { className: "size-5" })
2623
2617
  }
2624
2618
  ),
2625
2619
  /* @__PURE__ */ e.jsx(
@@ -2627,7 +2621,7 @@ function qn() {
2627
2621
  {
2628
2622
  onClick: () => r("pyramid"),
2629
2623
  variant: "ghost",
2630
- children: /* @__PURE__ */ e.jsx(Ct, { className: "size-5" })
2624
+ children: /* @__PURE__ */ e.jsx(St, { className: "size-5" })
2631
2625
  }
2632
2626
  ),
2633
2627
  /* @__PURE__ */ e.jsx(
@@ -2643,55 +2637,55 @@ function qn() {
2643
2637
  {
2644
2638
  onClick: () => r("kpi"),
2645
2639
  variant: "ghost",
2646
- children: /* @__PURE__ */ e.jsx(Nt, { className: "size-6" })
2640
+ children: /* @__PURE__ */ e.jsx(Ct, { className: "size-6" })
2647
2641
  }
2648
2642
  )
2649
2643
  ] }) })
2650
2644
  ] });
2651
2645
  }
2652
- function Vn({ chartType: s, className: a }) {
2646
+ function Vn({ chartType: s, className: n }) {
2653
2647
  switch (s) {
2654
2648
  case "bar":
2655
- return /* @__PURE__ */ e.jsx(Ns, { className: a });
2649
+ return /* @__PURE__ */ e.jsx(Ns, { className: n });
2656
2650
  case "line":
2657
- return /* @__PURE__ */ e.jsx(Cs, { className: a });
2651
+ return /* @__PURE__ */ e.jsx(Cs, { className: n });
2658
2652
  case "pie":
2659
- return /* @__PURE__ */ e.jsx(ot, { className: a });
2653
+ return /* @__PURE__ */ e.jsx(ct, { className: n });
2660
2654
  case "radar":
2661
- return /* @__PURE__ */ e.jsx(gt, { className: a });
2655
+ return /* @__PURE__ */ e.jsx(jt, { className: n });
2662
2656
  case "scatter":
2663
- return /* @__PURE__ */ e.jsx(dt, { className: a });
2657
+ return /* @__PURE__ */ e.jsx(ht, { className: n });
2664
2658
  case "bubble":
2665
- return /* @__PURE__ */ e.jsx(yt, { className: a });
2659
+ return /* @__PURE__ */ e.jsx(vt, { className: n });
2666
2660
  case "doughnut":
2667
- return /* @__PURE__ */ e.jsx(jt, { className: a });
2661
+ return /* @__PURE__ */ e.jsx(bt, { className: n });
2668
2662
  case "stackedBar":
2669
- return /* @__PURE__ */ e.jsx(vt, { className: "size-4 text-foreground/70" });
2663
+ return /* @__PURE__ */ e.jsx(Nt, { className: "size-4 text-foreground/70" });
2670
2664
  case "polarArea":
2671
- return /* @__PURE__ */ e.jsx(bt, { className: a });
2665
+ return /* @__PURE__ */ e.jsx(yt, { className: n });
2672
2666
  case "pyramid":
2673
- return /* @__PURE__ */ e.jsx(Ct, { className: a });
2667
+ return /* @__PURE__ */ e.jsx(St, { className: n });
2674
2668
  case "kpi":
2675
- return /* @__PURE__ */ e.jsx(Nt, { className: a });
2669
+ return /* @__PURE__ */ e.jsx(Ct, { className: n });
2676
2670
  default:
2677
- return /* @__PURE__ */ e.jsx(bs, { className: a });
2671
+ return /* @__PURE__ */ e.jsx(bs, { className: n });
2678
2672
  }
2679
2673
  }
2680
2674
  function Rn() {
2681
- const s = i(
2675
+ const s = l(
2682
2676
  (t) => t.card.refreshInterval
2683
- ), a = i(
2677
+ ), n = l(
2684
2678
  (t) => t.actions.setCardRefreshInterval
2685
2679
  );
2686
2680
  return /* @__PURE__ */ e.jsxs(qe, { children: [
2687
- /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx(Ka, { className: "w-4 h-4" }) }) }),
2681
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(w, { size: "sm", variant: "outline", children: /* @__PURE__ */ e.jsx($a, { className: "w-4 h-4" }) }) }),
2688
2682
  /* @__PURE__ */ e.jsx(Re, { className: "w-[200px]", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-4", children: /* @__PURE__ */ e.jsx("div", { className: "grid gap-2", children: /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-5 items-center gap-1", children: [
2689
2683
  /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "width", children: "Refresh Every" }),
2690
2684
  /* @__PURE__ */ e.jsx(
2691
- W,
2685
+ Q,
2692
2686
  {
2693
2687
  value: s || "",
2694
- onChange: (t) => a(t.target.value),
2688
+ onChange: (t) => n(t.target.value),
2695
2689
  id: "width",
2696
2690
  placeholder: "30s",
2697
2691
  className: "col-span-2 h-7 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-0"
@@ -2700,11 +2694,11 @@ function Rn() {
2700
2694
  ] }) }) }) })
2701
2695
  ] });
2702
2696
  }
2703
- function _s() {
2704
- i((r) => r.frame);
2705
- const s = i((r) => r.card), a = i((r) => r.card.data), t = i((r) => r.isShowingVisual), n = i((r) => r.isSqlRunning), o = i((r) => r.queryError), l = i((r) => r.pythonStdOut);
2706
- return i((r) => r.onSave), i((r) => r.onClose), i((r) => r.actions.setCardSql), i((r) => r.actions.setCardType), i((r) => r.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2707
- n && /* @__PURE__ */ e.jsx(De, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2697
+ function Hs() {
2698
+ l((r) => r.frame);
2699
+ const s = l((r) => r.card), n = l((r) => r.card.data), t = l((r) => r.isShowingVisual), a = l((r) => r.isSqlRunning), o = l((r) => r.queryError), i = l((r) => r.pythonStdOut);
2700
+ return l((r) => r.onSave), l((r) => r.onClose), l((r) => r.actions.setCardSql), l((r) => r.actions.setCardType), l((r) => r.actions.setSqlGen), s ? /* @__PURE__ */ e.jsxs("div", { className: "relative flex h-full flex-col pt-3", children: [
2701
+ a && /* @__PURE__ */ e.jsx(De, { className: "absolute bottom-0 left-0 right-0 top-0 z-10 m-auto h-10 w-10 animate-spin text-foreground/10" }),
2708
2702
  /* @__PURE__ */ e.jsxs("div", { className: "mb-0 flex min-h-10 items-center justify-end gap-2 px-6", children: [
2709
2703
  t && /* @__PURE__ */ e.jsxs("div", { className: "flex grow items-center gap-2", children: [
2710
2704
  /* @__PURE__ */ e.jsx(qn, {}),
@@ -2713,41 +2707,41 @@ function _s() {
2713
2707
  ] }),
2714
2708
  /* @__PURE__ */ e.jsx(Hn, {})
2715
2709
  ] }),
2716
- t ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(za, { isLoading: n, card: s }) }) }) : /* @__PURE__ */ e.jsx(ft, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2717
- l && /* @__PURE__ */ e.jsx(_n, {}),
2718
- s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Dn, { data: a || [] }),
2710
+ t ? s.type === "kpi" ? /* @__PURE__ */ e.jsx("div", { className: "flex grow items-center justify-center", children: /* @__PURE__ */ e.jsx("div", { className: "w-1/2 rounded-md border", children: /* @__PURE__ */ e.jsx(ka, { isLoading: a, card: s }) }) }) : /* @__PURE__ */ e.jsx(gt, { className: "grow border-none shadow-none" }) : /* @__PURE__ */ e.jsxs("div", { className: "flex min-h-0 w-full flex-1 grow basis-0 px-6", children: [
2711
+ i && /* @__PURE__ */ e.jsx(_n, {}),
2712
+ s.data && s.data.length > 0 && /* @__PURE__ */ e.jsx(Dn, { data: n || [] }),
2719
2713
  o && /* @__PURE__ */ e.jsx("span", { className: "font-mono text-sm", children: o })
2720
2714
  ] })
2721
2715
  ] }) : /* @__PURE__ */ e.jsx(e.Fragment, { children: "No Active Card" });
2722
2716
  }
2723
2717
  function _n() {
2724
- const s = i((t) => t.pythonStdOut);
2718
+ const s = l((t) => t.pythonStdOut);
2725
2719
  if (!s)
2726
2720
  return null;
2727
- const a = s.replace(/\n/g, "<br>");
2721
+ const n = s.replace(/\n/g, "<br>");
2728
2722
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
2729
2723
  /* @__PURE__ */ e.jsx("p", { className: "font-mono text-sm", children: "Output:" }),
2730
2724
  /* @__PURE__ */ e.jsx(
2731
2725
  "div",
2732
2726
  {
2733
- dangerouslySetInnerHTML: { __html: a },
2727
+ dangerouslySetInnerHTML: { __html: n },
2734
2728
  className: "bg-muted p-2 font-mono text-sm"
2735
2729
  }
2736
2730
  ),
2737
- /* @__PURE__ */ e.jsx(at, { className: "mb-2" })
2731
+ /* @__PURE__ */ e.jsx(nt, { className: "mb-2" })
2738
2732
  ] });
2739
2733
  }
2740
2734
  function Hn() {
2741
- const s = i((t) => t.isShowingVisual), a = i(
2735
+ const s = l((t) => t.isShowingVisual), n = l(
2742
2736
  (t) => t.actions.setIsShowingVisual
2743
2737
  );
2744
2738
  return /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2745
2739
  /* @__PURE__ */ e.jsx(B, { htmlFor: "visualize", children: "Chart" }),
2746
2740
  /* @__PURE__ */ e.jsx(
2747
- Fa,
2741
+ wa,
2748
2742
  {
2749
2743
  checked: s,
2750
- onCheckedChange: () => a(!s),
2744
+ onCheckedChange: () => n(!s),
2751
2745
  id: "visualize",
2752
2746
  className: "data-[state=checked]:bg-foreground/50"
2753
2747
  }
@@ -2755,24 +2749,24 @@ function Hn() {
2755
2749
  ] });
2756
2750
  }
2757
2751
  function Me() {
2758
- const [s, a] = M([]);
2759
- i(
2752
+ const [s, n] = M([]);
2753
+ l(
2760
2754
  (h) => h.card.cfg
2761
2755
  );
2762
- const t = i((h) => h.card.preferences), { setCardCfg: n, setFilterOnClickColumnIndex: o, setCardPreferences: l } = i((h) => h.actions), r = i(
2756
+ const t = l((h) => h.card.preferences), { setCardCfg: a, setFilterOnClickColumnIndex: o, setCardPreferences: i } = l((h) => h.actions), r = l(
2763
2757
  (h) => h.queryResultColumns
2764
2758
  );
2765
- i(
2759
+ l(
2766
2760
  (h) => {
2767
- var u;
2768
- return (u = h.card.preferences) == null ? void 0 : u.filterOnClickColumnIndex;
2761
+ var m;
2762
+ return (m = h.card.preferences) == null ? void 0 : m.filterOnClickColumnIndex;
2769
2763
  }
2770
2764
  ), K(() => {
2771
- r && a(new Array(r.length).fill(!1));
2765
+ r && n(new Array(r.length).fill(!1));
2772
2766
  }, [r]);
2773
- function c(h, u) {
2767
+ function c(h, m) {
2774
2768
  var f, p;
2775
- u ? t != null && t.onClickFilter && ((f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.length) > 0 ? l({
2769
+ m ? t != null && t.onClickFilter && ((f = t == null ? void 0 : t.onClickFilter) == null ? void 0 : f.length) > 0 ? i({
2776
2770
  ...t,
2777
2771
  onClickFilter: [
2778
2772
  ...t.onClickFilter,
@@ -2781,7 +2775,7 @@ function Me() {
2781
2775
  expression: ""
2782
2776
  }
2783
2777
  ]
2784
- }) : l({
2778
+ }) : i({
2785
2779
  ...t,
2786
2780
  onClickFilter: [
2787
2781
  {
@@ -2789,32 +2783,32 @@ function Me() {
2789
2783
  expression: ""
2790
2784
  }
2791
2785
  ]
2792
- }) : (l({
2786
+ }) : (i({
2793
2787
  ...t,
2794
2788
  onClickFilter: (p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.filter(
2795
2789
  (g) => g.columnIndex !== h
2796
2790
  )
2797
- }), a((g) => {
2791
+ }), n((g) => {
2798
2792
  const S = [...g];
2799
2793
  return S[h] = !1, S;
2800
2794
  }));
2801
2795
  }
2802
- function d(h, u) {
2796
+ function d(h, m) {
2803
2797
  var p;
2804
2798
  const f = (p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.map((g) => g.columnIndex === h ? {
2805
2799
  ...g,
2806
- expression: u.target.value
2800
+ expression: m.target.value
2807
2801
  } : g);
2808
- l({
2802
+ i({
2809
2803
  ...t,
2810
2804
  onClickFilter: f
2811
2805
  });
2812
2806
  }
2813
- function m(h) {
2814
- var u, f, p, g;
2815
- if (s != null && s[h] || (f = (u = t == null ? void 0 : t.onClickFilter) == null ? void 0 : u.find((S) => S.columnIndex === h)) != null && f.expression)
2807
+ function u(h) {
2808
+ var m, f, p, g;
2809
+ if (s != null && s[h] || (f = (m = t == null ? void 0 : t.onClickFilter) == null ? void 0 : m.find((S) => S.columnIndex === h)) != null && f.expression)
2816
2810
  return /* @__PURE__ */ e.jsx(
2817
- W,
2811
+ Q,
2818
2812
  {
2819
2813
  value: (g = (p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.find((S) => S.columnIndex === h)) == null ? void 0 : g.expression,
2820
2814
  onChange: (S) => d(h, S),
@@ -2824,7 +2818,7 @@ function Me() {
2824
2818
  }
2825
2819
  );
2826
2820
  }
2827
- return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((h, u) => {
2821
+ return /* @__PURE__ */ e.jsx(e.Fragment, { children: r == null ? void 0 : r.map((h, m) => {
2828
2822
  var f, p;
2829
2823
  return /* @__PURE__ */ e.jsx(
2830
2824
  "div",
@@ -2836,9 +2830,9 @@ function Me() {
2836
2830
  Qe,
2837
2831
  {
2838
2832
  checked: !!((f = t == null ? void 0 : t.onClickFilter) != null && f.find(
2839
- (g) => g.columnIndex === u
2833
+ (g) => g.columnIndex === m
2840
2834
  )),
2841
- onCheckedChange: (g) => c(u, g)
2835
+ onCheckedChange: (g) => c(m, g)
2842
2836
  }
2843
2837
  ),
2844
2838
  /* @__PURE__ */ e.jsx(
@@ -2849,21 +2843,21 @@ function Me() {
2849
2843
  }
2850
2844
  ),
2851
2845
  /* @__PURE__ */ e.jsx("div", { className: "flex gap-2 items-center ", children: ((p = t == null ? void 0 : t.onClickFilter) == null ? void 0 : p.find(
2852
- (g) => g.columnIndex === u
2846
+ (g) => g.columnIndex === m
2853
2847
  )) && /* @__PURE__ */ e.jsx(
2854
- it,
2848
+ ot,
2855
2849
  {
2856
2850
  onClick: () => {
2857
- a((g) => {
2851
+ n((g) => {
2858
2852
  const S = [...g];
2859
- return S[u] = !g[u], S;
2853
+ return S[m] = !g[m], S;
2860
2854
  });
2861
2855
  },
2862
2856
  className: " invisible group-hover:visible size-3 text-gray-400 cursor-pointer"
2863
2857
  }
2864
2858
  ) })
2865
2859
  ] }),
2866
- m(u)
2860
+ u(m)
2867
2861
  ] })
2868
2862
  },
2869
2863
  h
@@ -2871,21 +2865,21 @@ function Me() {
2871
2865
  }) });
2872
2866
  }
2873
2867
  function Ss() {
2874
- var l, r;
2875
- const s = i((c) => c.card.preferences), a = i(
2868
+ var i, r;
2869
+ const s = l((c) => c.card.preferences), n = l(
2876
2870
  (c) => c.card.cfg
2877
- ), { setCardCfg: t, setCardPreferences: n } = i(
2871
+ ), { setCardCfg: t, setCardPreferences: a } = l(
2878
2872
  (c) => c.actions
2879
2873
  );
2880
- (l = a == null ? void 0 : a.options) != null && l.indexAxis;
2874
+ (i = n == null ? void 0 : n.options) != null && i.indexAxis;
2881
2875
  function o(c) {
2882
- var h, u, f, p, g, S;
2876
+ var h, m, f, p, g, S;
2883
2877
  let d = {};
2884
2878
  (h = s == null ? void 0 : s.chartOptions) != null && h.scales && (d = {
2885
- x: (f = (u = s == null ? void 0 : s.chartOptions) == null ? void 0 : u.scales) == null ? void 0 : f.y,
2879
+ x: (f = (m = s == null ? void 0 : s.chartOptions) == null ? void 0 : m.scales) == null ? void 0 : f.y,
2886
2880
  y: (g = (p = s == null ? void 0 : s.chartOptions) == null ? void 0 : p.scales) == null ? void 0 : g.x
2887
2881
  });
2888
- const m = {
2882
+ const u = {
2889
2883
  ...s,
2890
2884
  chartOptions: {
2891
2885
  ...s == null ? void 0 : s.chartOptions,
@@ -2896,10 +2890,10 @@ function Ss() {
2896
2890
  indexAxis: c
2897
2891
  }
2898
2892
  };
2899
- n(m);
2893
+ a(u);
2900
2894
  }
2901
2895
  return /* @__PURE__ */ e.jsxs(
2902
- nt,
2896
+ rt,
2903
2897
  {
2904
2898
  value: ((r = s == null ? void 0 : s.chartOptions) == null ? void 0 : r.indexAxis) || "x",
2905
2899
  onValueChange: o,
@@ -2907,11 +2901,11 @@ function Ss() {
2907
2901
  defaultValue: "x",
2908
2902
  children: [
2909
2903
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2910
- /* @__PURE__ */ e.jsx(Ge, { value: "x", id: "r1" }),
2904
+ /* @__PURE__ */ e.jsx(Ue, { value: "x", id: "r1" }),
2911
2905
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Vertical" })
2912
2906
  ] }),
2913
2907
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
2914
- /* @__PURE__ */ e.jsx(Ge, { value: "y", id: "r2" }),
2908
+ /* @__PURE__ */ e.jsx(Ue, { value: "y", id: "r2" }),
2915
2909
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Horizontal" })
2916
2910
  ] })
2917
2911
  ]
@@ -2919,37 +2913,37 @@ function Ss() {
2919
2913
  );
2920
2914
  }
2921
2915
  const Ce = "focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0";
2922
- function Hs(s, a) {
2923
- var n, o, l;
2924
- const t = rt(s, a);
2925
- return ((l = (o = (n = s == null ? void 0 : s.chartOptions) == null ? void 0 : n.scales) == null ? void 0 : o[t]) == null ? void 0 : l.type) || "linear";
2916
+ function Bs(s, n) {
2917
+ var a, o, i;
2918
+ const t = it(s, n);
2919
+ return ((i = (o = (a = s == null ? void 0 : s.chartOptions) == null ? void 0 : a.scales) == null ? void 0 : o[t]) == null ? void 0 : i.type) || "linear";
2926
2920
  }
2927
- function St() {
2928
- var P, ee, Z, J, I, v;
2929
- const [s, a] = M(!1), t = i((b) => {
2921
+ function kt() {
2922
+ var W, ee, Z, J, I, v;
2923
+ const [s, n] = M(!1), t = l((b) => {
2930
2924
  var F;
2931
2925
  return (F = b.card) == null ? void 0 : F.preferences;
2932
- }), n = i((b) => {
2926
+ }), a = l((b) => {
2933
2927
  var F;
2934
2928
  return (F = b.card) == null ? void 0 : F.cfg;
2935
- }), o = rt(t, n), [l, r] = M(
2936
- Hs(t)
2929
+ }), o = it(t, a), [i, r] = M(
2930
+ Bs(t)
2937
2931
  ), [c, d] = M(
2938
- ((Z = (ee = (P = t == null ? void 0 : t.chartOptions) == null ? void 0 : P.scales) == null ? void 0 : ee[o]) == null ? void 0 : Z.min) || ""
2939
- ), [m, h] = M(
2932
+ ((Z = (ee = (W = t == null ? void 0 : t.chartOptions) == null ? void 0 : W.scales) == null ? void 0 : ee[o]) == null ? void 0 : Z.min) || ""
2933
+ ), [u, h] = M(
2940
2934
  ((v = (I = (J = t == null ? void 0 : t.chartOptions) == null ? void 0 : J.scales) == null ? void 0 : I[o]) == null ? void 0 : v.max) || ""
2941
- ), [u, f] = M(c || m ? "custom" : "auto"), [p, g] = M(""), [S, N] = M(""), [j, L] = M(""), [A, O] = M(""), [y, z] = M(""), E = i(
2935
+ ), [m, f] = M(c || u ? "custom" : "auto"), [p, g] = M(""), [S, N] = M(""), [j, L] = M(""), [A, O] = M(""), [y, z] = M(""), E = l(
2942
2936
  (b) => b.actions.setCardPreferences
2943
- ), _ = i((b) => {
2937
+ ), _ = l((b) => {
2944
2938
  var F;
2945
2939
  return (F = b.card) == null ? void 0 : F.type;
2946
2940
  }), X = ["pie", "doughnut", "polarArea"].includes(_);
2947
2941
  K(() => {
2948
- var b, F, H, ue, se, ge, je, be, me, Q, ae, ne, ye, re;
2949
- r(Hs(t)), d(
2942
+ var b, F, H, me, se, ge, je, be, ue, G, ae, ne, ye, re;
2943
+ r(Bs(t)), d(
2950
2944
  ((H = (F = (b = t == null ? void 0 : t.chartOptions) == null ? void 0 : b.scales) == null ? void 0 : F[o]) == null ? void 0 : H.min) === 0 ? 0 : ""
2951
- ), h(((ge = (se = (ue = t == null ? void 0 : t.chartOptions) == null ? void 0 : ue.scales) == null ? void 0 : se[o]) == null ? void 0 : ge.max) || ""), g(
2952
- ((Q = (me = (be = (je = t == null ? void 0 : t.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[o]) == null ? void 0 : me.ticks) == null ? void 0 : Q.stepSize) || ""
2945
+ ), h(((ge = (se = (me = t == null ? void 0 : t.chartOptions) == null ? void 0 : me.scales) == null ? void 0 : se[o]) == null ? void 0 : ge.max) || ""), g(
2946
+ ((G = (ue = (be = (je = t == null ? void 0 : t.chartOptions) == null ? void 0 : je.scales) == null ? void 0 : be[o]) == null ? void 0 : ue.ticks) == null ? void 0 : G.stepSize) || ""
2953
2947
  ), N(((ae = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ae.format) || ""), L(((ne = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ne.suffix) || ""), O(((ye = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : ye.currency) || ""), z(((re = t == null ? void 0 : t.numberAxisFormat) == null ? void 0 : re.locale) || "");
2954
2948
  }, [s, t, o]);
2955
2949
  function $(b, F) {
@@ -2960,7 +2954,7 @@ function St() {
2960
2954
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-9 items-center gap-2", children: [
2961
2955
  /* @__PURE__ */ e.jsx(B, { className: "col-span-3", htmlFor: "format", children: "Format" }),
2962
2956
  /* @__PURE__ */ e.jsx(
2963
- W,
2957
+ Q,
2964
2958
  {
2965
2959
  value: S,
2966
2960
  placeholder: "000,0.00",
@@ -2970,7 +2964,7 @@ function St() {
2970
2964
  }
2971
2965
  ),
2972
2966
  /* @__PURE__ */ e.jsx(
2973
- W,
2967
+ Q,
2974
2968
  {
2975
2969
  value: j,
2976
2970
  placeholder: "M",
@@ -2997,7 +2991,7 @@ function St() {
2997
2991
  }
2998
2992
  ),
2999
2993
  /* @__PURE__ */ e.jsx(
3000
- W,
2994
+ Q,
3001
2995
  {
3002
2996
  value: A,
3003
2997
  placeholder: "USD",
@@ -3007,7 +3001,7 @@ function St() {
3007
3001
  }
3008
3002
  ),
3009
3003
  /* @__PURE__ */ e.jsx(
3010
- W,
3004
+ Q,
3011
3005
  {
3012
3006
  value: y,
3013
3007
  placeholder: "en-US",
@@ -3024,7 +3018,7 @@ function St() {
3024
3018
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3025
3019
  /* @__PURE__ */ e.jsx(B, { htmlFor: "range", children: "Range" }),
3026
3020
  /* @__PURE__ */ e.jsx(
3027
- W,
3021
+ Q,
3028
3022
  {
3029
3023
  id: "min",
3030
3024
  value: c,
@@ -3033,9 +3027,9 @@ function St() {
3033
3027
  }
3034
3028
  ),
3035
3029
  /* @__PURE__ */ e.jsx(
3036
- W,
3030
+ Q,
3037
3031
  {
3038
- value: m,
3032
+ value: u,
3039
3033
  onChange: (b) => h((F) => $(F, b.target.value)),
3040
3034
  id: "max",
3041
3035
  className: `col-span-1 h-8 w-full ${Ce}`
@@ -3045,7 +3039,7 @@ function St() {
3045
3039
  /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2", children: [
3046
3040
  /* @__PURE__ */ e.jsx(B, { htmlFor: "step-size", children: "Step Size" }),
3047
3041
  /* @__PURE__ */ e.jsx(
3048
- W,
3042
+ Q,
3049
3043
  {
3050
3044
  value: p,
3051
3045
  onChange: (b) => g((F) => $(F, b.target.value)),
@@ -3059,9 +3053,9 @@ function St() {
3059
3053
  function te() {
3060
3054
  var H;
3061
3055
  let b = {};
3062
- u === "custom" && (b = {
3056
+ m === "custom" && (b = {
3063
3057
  min: c,
3064
- max: m,
3058
+ max: u,
3065
3059
  ticks: {
3066
3060
  stepSize: p
3067
3061
  }
@@ -3074,8 +3068,8 @@ function St() {
3074
3068
  ...(H = t == null ? void 0 : t.chartOptions) == null ? void 0 : H.scales,
3075
3069
  [o]: {
3076
3070
  // ...cardPreferences?.chartOptions?.scales?.[axis],
3077
- type: l,
3078
- ...l === "linear" ? b : {}
3071
+ type: i,
3072
+ ...i === "linear" ? b : {}
3079
3073
  }
3080
3074
  }
3081
3075
  },
@@ -3088,8 +3082,8 @@ function St() {
3088
3082
  };
3089
3083
  E(F);
3090
3084
  }
3091
- return /* @__PURE__ */ e.jsxs(qe, { onOpenChange: (b) => a(b), children: [
3092
- /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(Oa, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3085
+ return /* @__PURE__ */ e.jsxs(qe, { onOpenChange: (b) => n(b), children: [
3086
+ /* @__PURE__ */ e.jsx(Ve, { asChild: !0, children: /* @__PURE__ */ e.jsx(za, { className: "size-4 cursor-pointer text-muted-foreground hover:text-foreground" }) }),
3093
3087
  /* @__PURE__ */ e.jsx(Re, { align: "center", className: "max-w-65", children: /* @__PURE__ */ e.jsxs("div", { className: "grid gap-4", children: [
3094
3088
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3095
3089
  /* @__PURE__ */ e.jsx("h4", { className: "font-medium leading-none", children: "Scale Options" }),
@@ -3102,7 +3096,7 @@ function St() {
3102
3096
  xs,
3103
3097
  {
3104
3098
  disabled: X,
3105
- value: l,
3099
+ value: i,
3106
3100
  onValueChange: (b) => r(b),
3107
3101
  children: [
3108
3102
  /* @__PURE__ */ e.jsx(ps, { className: "col-span-2 h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, {}) }),
@@ -3115,33 +3109,33 @@ function St() {
3115
3109
  }
3116
3110
  )
3117
3111
  ] }),
3118
- l == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3112
+ i == "linear" && /* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-3 items-center gap-2 py-1", children: [
3119
3113
  /* @__PURE__ */ e.jsx(B, { htmlFor: "scale-option", children: "Setup" }),
3120
3114
  /* @__PURE__ */ e.jsxs(
3121
- nt,
3115
+ rt,
3122
3116
  {
3123
3117
  disabled: X,
3124
3118
  id: "scale-option",
3125
- value: u,
3119
+ value: m,
3126
3120
  onValueChange: (b) => f(b),
3127
3121
  className: "col-span-2 flex gap-3",
3128
3122
  defaultValue: "x",
3129
3123
  children: [
3130
3124
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3131
- /* @__PURE__ */ e.jsx(Ge, { value: "auto", id: "r1" }),
3125
+ /* @__PURE__ */ e.jsx(Ue, { value: "auto", id: "r1" }),
3132
3126
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r1", children: "Auto" })
3133
3127
  ] }),
3134
3128
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
3135
- /* @__PURE__ */ e.jsx(Ge, { value: "custom", id: "r2" }),
3129
+ /* @__PURE__ */ e.jsx(Ue, { value: "custom", id: "r2" }),
3136
3130
  /* @__PURE__ */ e.jsx("label", { className: "text-sm", htmlFor: "r2", children: "Custom" })
3137
3131
  ] })
3138
3132
  ]
3139
3133
  }
3140
3134
  )
3141
3135
  ] }),
3142
- u === "custom" && l == "linear" && D(),
3136
+ m === "custom" && i == "linear" && D(),
3143
3137
  U(),
3144
- /* @__PURE__ */ e.jsx(Ma, {}),
3138
+ /* @__PURE__ */ e.jsx(Fa, {}),
3145
3139
  /* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-3", children: /* @__PURE__ */ e.jsx(
3146
3140
  w,
3147
3141
  {
@@ -3157,44 +3151,44 @@ function St() {
3157
3151
  }
3158
3152
  function Bn({ idx: s }) {
3159
3153
  var c;
3160
- const a = i((d) => {
3161
- var m;
3162
- return (m = d.card) == null ? void 0 : m.preferences;
3163
- }), t = i(
3154
+ const n = l((d) => {
3155
+ var u;
3156
+ return (u = d.card) == null ? void 0 : u.preferences;
3157
+ }), t = l(
3164
3158
  (d) => {
3165
- var m;
3166
- return (m = d.card.preferences) == null ? void 0 : m.datasetOptions;
3159
+ var u;
3160
+ return (u = d.card.preferences) == null ? void 0 : u.datasetOptions;
3167
3161
  }
3168
- ), n = i(
3162
+ ), a = l(
3169
3163
  (d) => d.actions.setCardPreferences
3170
- ), o = (c = a == null ? void 0 : a.chartOptions) == null ? void 0 : c.indexAxis, l = t == null ? void 0 : t.find((d) => d.idx === s);
3171
- function r(d, m) {
3172
- (d === "end" || d === "start") && Aa(Ea());
3164
+ ), o = (c = n == null ? void 0 : n.chartOptions) == null ? void 0 : c.indexAxis, i = t == null ? void 0 : t.find((d) => d.idx === s);
3165
+ function r(d, u) {
3166
+ (d === "end" || d === "start") && Ma(Ta());
3173
3167
  const h = {
3174
3168
  display: d !== "none",
3175
3169
  align: d,
3176
3170
  anchor: d,
3177
3171
  clamp: !0
3178
3172
  };
3179
- if (!l)
3180
- n({
3181
- ...a,
3173
+ if (!i)
3174
+ a({
3175
+ ...n,
3182
3176
  datasetOptions: [
3183
3177
  ...t || [],
3184
3178
  {
3185
- idx: m,
3179
+ idx: u,
3186
3180
  datalabels: h
3187
3181
  }
3188
3182
  ]
3189
3183
  });
3190
3184
  else {
3191
- const u = { ...l };
3192
- u.datalabels = h;
3185
+ const m = { ...i };
3186
+ m.datalabels = h;
3193
3187
  const f = t == null ? void 0 : t.map(
3194
- (p) => p.idx === m ? u : p
3188
+ (p) => p.idx === u ? m : p
3195
3189
  );
3196
- n({
3197
- ...a,
3190
+ a({
3191
+ ...n,
3198
3192
  datasetOptions: f
3199
3193
  });
3200
3194
  }
@@ -3209,7 +3203,7 @@ function Bn({ idx: s }) {
3209
3203
  size: "sm",
3210
3204
  variant: "secondary",
3211
3205
  className: "h-7 p-1 text-xs font-normal",
3212
- children: /* @__PURE__ */ e.jsx(Ta, { className: "size-4" })
3206
+ children: /* @__PURE__ */ e.jsx(Oa, { className: "size-4" })
3213
3207
  }
3214
3208
  ),
3215
3209
  /* @__PURE__ */ e.jsx(
@@ -3220,9 +3214,9 @@ function Bn({ idx: s }) {
3220
3214
  variant: "secondary",
3221
3215
  className: "h-7 p-1 text-xs font-normal",
3222
3216
  children: /* @__PURE__ */ e.jsx(
3223
- en,
3217
+ Xa,
3224
3218
  {
3225
- className: G("h-4 w-4", {
3219
+ className: Y("h-4 w-4", {
3226
3220
  "rotate-90": o === "y"
3227
3221
  })
3228
3222
  }
@@ -3237,9 +3231,9 @@ function Bn({ idx: s }) {
3237
3231
  variant: "secondary",
3238
3232
  className: "h-7 p-1 text-xs font-normal",
3239
3233
  children: /* @__PURE__ */ e.jsx(
3240
- tn,
3234
+ en,
3241
3235
  {
3242
- className: G("h-4 w-4", {
3236
+ className: Y("h-4 w-4", {
3243
3237
  "rotate-90": o === "y"
3244
3238
  })
3245
3239
  }
@@ -3254,9 +3248,9 @@ function Bn({ idx: s }) {
3254
3248
  variant: "secondary",
3255
3249
  className: "h-7 p-1 text-xs font-normal",
3256
3250
  children: /* @__PURE__ */ e.jsx(
3257
- sn,
3251
+ Za,
3258
3252
  {
3259
- className: G("h-4 w-4", {
3253
+ className: Y("h-4 w-4", {
3260
3254
  "rotate-90": o === "y"
3261
3255
  })
3262
3256
  }
@@ -3266,26 +3260,26 @@ function Bn({ idx: s }) {
3266
3260
  ] }) })
3267
3261
  ] });
3268
3262
  }
3269
- function kt() {
3270
- const s = i((d) => d.card), a = i(
3263
+ function wt() {
3264
+ const s = l((d) => d.card), n = l(
3271
3265
  (d) => {
3272
- var m, h, u;
3273
- return (u = (h = (m = d == null ? void 0 : d.card) == null ? void 0 : m.preferences) == null ? void 0 : h.chartOptions) == null ? void 0 : u.indexAxis;
3266
+ var u, h, m;
3267
+ return (m = (h = (u = d == null ? void 0 : d.card) == null ? void 0 : u.preferences) == null ? void 0 : h.chartOptions) == null ? void 0 : m.indexAxis;
3274
3268
  }
3275
- ), t = a === "y" ? "Y axis" : "X axis", n = a === "y" ? "X axis" : "Y axis", {
3269
+ ), t = n === "y" ? "Y axis" : "X axis", a = n === "y" ? "X axis" : "Y axis", {
3276
3270
  keys: o,
3277
- metricKeys: l,
3271
+ metricKeys: i,
3278
3272
  dimensionKeys: r
3279
3273
  } = ns(s.data || []);
3280
- let c = l;
3274
+ let c = i;
3281
3275
  if (s.type === "stackedBar") {
3282
- const d = La({
3276
+ const d = Aa({
3283
3277
  dataArray: s.data || [],
3284
3278
  groupKey: r[0],
3285
3279
  pivotKey: r[1],
3286
3280
  valueKey: c[0]
3287
- }), { metricKeys: m } = ns(d);
3288
- c = m;
3281
+ }), { metricKeys: u } = ns(d);
3282
+ c = u;
3289
3283
  }
3290
3284
  return o.length === 0 ? null : /* @__PURE__ */ e.jsxs("div", { className: "space-y-4", children: [
3291
3285
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
@@ -3294,31 +3288,31 @@ function kt() {
3294
3288
  ] }),
3295
3289
  /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3296
3290
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-5", children: [
3297
- /* @__PURE__ */ e.jsx(B, { children: n }),
3298
- /* @__PURE__ */ e.jsx(St, {})
3291
+ /* @__PURE__ */ e.jsx(B, { children: a }),
3292
+ /* @__PURE__ */ e.jsx(kt, {})
3299
3293
  ] }),
3300
- /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((d, m) => /* @__PURE__ */ e.jsx($n, { col: d, idx: m }, d)) })
3294
+ /* @__PURE__ */ e.jsx("div", { className: "my-1 space-y-1", children: c.map((d, u) => /* @__PURE__ */ e.jsx($n, { col: d, idx: u }, d)) })
3301
3295
  ] })
3302
3296
  ] });
3303
3297
  }
3304
- function $n({ col: s, idx: a }) {
3305
- const t = i((c) => {
3298
+ function $n({ col: s, idx: n }) {
3299
+ const t = l((c) => {
3306
3300
  var d;
3307
3301
  return (d = c.card) == null ? void 0 : d.preferences;
3308
- }), n = i(
3302
+ }), a = l(
3309
3303
  (c) => {
3310
3304
  var d;
3311
3305
  return (d = c.card.preferences) == null ? void 0 : d.datasetOptions;
3312
3306
  }
3313
- ), o = n == null ? void 0 : n.find((c) => c.idx === a), { setCardPreferences: l } = i((c) => c.actions);
3307
+ ), o = a == null ? void 0 : a.find((c) => c.idx === n), { setCardPreferences: i } = l((c) => c.actions);
3314
3308
  function r(c) {
3315
3309
  if (!o)
3316
- l({
3310
+ i({
3317
3311
  ...t,
3318
3312
  datasetOptions: [
3319
- ...n || [],
3313
+ ...a || [],
3320
3314
  {
3321
- idx: a,
3315
+ idx: n,
3322
3316
  type: c === "area" ? "line" : c,
3323
3317
  fill: c === "area" ? "origin" : ""
3324
3318
  }
@@ -3327,12 +3321,12 @@ function $n({ col: s, idx: a }) {
3327
3321
  else {
3328
3322
  const d = { ...o };
3329
3323
  d.type = c === "area" ? "line" : c, d.fill = c === "area" ? "origin" : "";
3330
- const m = n == null ? void 0 : n.map(
3331
- (h) => h.idx === a ? d : h
3324
+ const u = a == null ? void 0 : a.map(
3325
+ (h) => h.idx === n ? d : h
3332
3326
  );
3333
- l({
3327
+ i({
3334
3328
  ...t,
3335
- datasetOptions: m
3329
+ datasetOptions: u
3336
3330
  });
3337
3331
  }
3338
3332
  }
@@ -3354,20 +3348,20 @@ function $n({ col: s, idx: a }) {
3354
3348
  }
3355
3349
  ),
3356
3350
  /* @__PURE__ */ e.jsx(
3357
- Ga,
3351
+ Ka,
3358
3352
  {
3359
3353
  onClick: () => r("area"),
3360
3354
  className: "invisible size-4 cursor-pointer text-muted-foreground hover:text-foreground group-hover:visible"
3361
3355
  }
3362
3356
  ),
3363
3357
  /* @__PURE__ */ e.jsx(
3364
- at,
3358
+ nt,
3365
3359
  {
3366
3360
  orientation: "vertical",
3367
3361
  className: "invisible size-4 cursor-pointer py-2 text-muted-foreground hover:text-foreground group-hover:visible"
3368
3362
  }
3369
3363
  ),
3370
- /* @__PURE__ */ e.jsx(Bn, { idx: a })
3364
+ /* @__PURE__ */ e.jsx(Bn, { idx: n })
3371
3365
  ] })
3372
3366
  ] });
3373
3367
  }
@@ -3390,7 +3384,7 @@ function Kn({
3390
3384
  "a",
3391
3385
  {
3392
3386
  target: "_blank",
3393
- onClick: (a) => a.stopPropagation(),
3387
+ onClick: (n) => n.stopPropagation(),
3394
3388
  className: "text-blue-700",
3395
3389
  href: "https://docs.semaphor.cloud/concepts/visuals#line-chart",
3396
3390
  children: "example"
@@ -3404,7 +3398,7 @@ function Kn({
3404
3398
  /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3405
3399
  /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3406
3400
  /* @__PURE__ */ e.jsx(Ss, {}),
3407
- /* @__PURE__ */ e.jsx(kt, {})
3401
+ /* @__PURE__ */ e.jsx(wt, {})
3408
3402
  ] })
3409
3403
  ] }),
3410
3404
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
@@ -3414,11 +3408,11 @@ function Kn({
3414
3408
  ] }) });
3415
3409
  }
3416
3410
  function ks() {
3417
- var o, l, r;
3418
- const s = i(
3411
+ var o, i, r;
3412
+ const s = l(
3419
3413
  (c) => c.card.cfg
3420
- ), a = i((c) => c.actions.setCardCfg), t = i((c) => c.card.type);
3421
- function n(c) {
3414
+ ), n = l((c) => c.actions.setCardCfg), t = l((c) => c.card.type);
3415
+ function a(c) {
3422
3416
  var h;
3423
3417
  const d = {
3424
3418
  datalabels: {
@@ -3427,7 +3421,7 @@ function ks() {
3427
3421
  anchor: c,
3428
3422
  clamp: !0
3429
3423
  }
3430
- }, m = {
3424
+ }, u = {
3431
3425
  ...s,
3432
3426
  options: {
3433
3427
  ...s == null ? void 0 : s.options,
@@ -3437,18 +3431,18 @@ function ks() {
3437
3431
  }
3438
3432
  }
3439
3433
  };
3440
- a(m), console.log(c);
3434
+ n(u), console.log(c);
3441
3435
  }
3442
3436
  return /* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
3443
3437
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
3444
3438
  /* @__PURE__ */ e.jsx("label", { className: "font-medium", children: "Data Labels" }),
3445
- t !== "pyramid" && /* @__PURE__ */ e.jsx(St, {})
3439
+ t !== "pyramid" && /* @__PURE__ */ e.jsx(kt, {})
3446
3440
  ] }),
3447
3441
  /* @__PURE__ */ e.jsxs(
3448
3442
  xs,
3449
3443
  {
3450
- value: (r = (l = (o = s == null ? void 0 : s.options) == null ? void 0 : o.plugins) == null ? void 0 : l.datalabels) == null ? void 0 : r.anchor,
3451
- onValueChange: n,
3444
+ value: (r = (i = (o = s == null ? void 0 : s.options) == null ? void 0 : o.plugins) == null ? void 0 : i.datalabels) == null ? void 0 : r.anchor,
3445
+ onValueChange: a,
3452
3446
  defaultValue: "none",
3453
3447
  children: [
3454
3448
  /* @__PURE__ */ e.jsx(ps, { className: "h-8 w-full focus:ring-1 focus:ring-offset-0", children: /* @__PURE__ */ e.jsx(fs, { placeholder: "Select position" }) }),
@@ -3464,13 +3458,13 @@ function ks() {
3464
3458
  )
3465
3459
  ] });
3466
3460
  }
3467
- function Gn({
3461
+ function Un({
3468
3462
  cardType: s
3469
3463
  }) {
3470
- function a(t) {
3471
- const n = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
3464
+ function n(t) {
3465
+ const a = "SELECT label, [group], x-axis, y-axis, radius FROM table", o = "SELECT label, [group], x-axis, y-axis FROM table";
3472
3466
  return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
3473
- /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? n : o }),
3467
+ /* @__PURE__ */ e.jsx("div", { className: "bg-muted px-2 py-1 rounded text-xs", children: t === "bubble" ? a : o }),
3474
3468
  /* @__PURE__ */ e.jsxs("ul", { className: " ml-6 list-disc [&>li]:mt-2 text-xs", children: [
3475
3469
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
3476
3470
  /* @__PURE__ */ e.jsx("li", { children: "group - category" }),
@@ -3484,7 +3478,7 @@ function Gn({
3484
3478
  "a",
3485
3479
  {
3486
3480
  target: "_blank",
3487
- onClick: (l) => l.stopPropagation(),
3481
+ onClick: (i) => i.stopPropagation(),
3488
3482
  className: "text-blue-700",
3489
3483
  href: "https://docs.semaphor.cloud/concepts/visuals#pie-chart",
3490
3484
  children: "example"
@@ -3497,7 +3491,7 @@ function Gn({
3497
3491
  return /* @__PURE__ */ e.jsx("div", { className: "px-6 py-2 space-y-6", children: /* @__PURE__ */ e.jsxs(ke, { defaultValue: ["item-2"], type: "multiple", children: [
3498
3492
  /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3499
3493
  /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3500
- /* @__PURE__ */ e.jsx(R, { className: " space-y-4 font-mono text-xs ", children: a(s) })
3494
+ /* @__PURE__ */ e.jsx(R, { className: " space-y-4 font-mono text-xs ", children: n(s) })
3501
3495
  ] }),
3502
3496
  /* @__PURE__ */ e.jsxs(q, { value: "item-2", children: [
3503
3497
  /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
@@ -3509,7 +3503,7 @@ function Gn({
3509
3503
  ] })
3510
3504
  ] }) });
3511
3505
  }
3512
- const Un = {
3506
+ const Jn = {
3513
3507
  datasets: [
3514
3508
  {
3515
3509
  type: "line",
@@ -3522,7 +3516,7 @@ const Un = {
3522
3516
  data: []
3523
3517
  }
3524
3518
  ]
3525
- }, Jn = {
3519
+ }, Gn = {
3526
3520
  datasets: [
3527
3521
  {
3528
3522
  fill: "origin",
@@ -3533,7 +3527,7 @@ const Un = {
3533
3527
  ]
3534
3528
  };
3535
3529
  function Qn() {
3536
- const s = i((a) => a.card.type);
3530
+ const s = l((n) => n.card.type);
3537
3531
  return /* @__PURE__ */ e.jsxs("div", { className: "p-6 space-y-6", children: [
3538
3532
  /* @__PURE__ */ e.jsx(
3539
3533
  ke,
@@ -3570,7 +3564,7 @@ function Wn(s) {
3570
3564
  /* @__PURE__ */ e.jsx("b", { children: "Customize" }),
3571
3565
  " and change the `type` property in the dataset."
3572
3566
  ] }),
3573
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Un, null, 2) })
3567
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Jn, null, 2) })
3574
3568
  ] })
3575
3569
  ] }),
3576
3570
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
@@ -3591,7 +3585,7 @@ function Wn(s) {
3591
3585
  ),
3592
3586
  "for more options."
3593
3587
  ] }),
3594
- /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Jn, null, 2) })
3588
+ /* @__PURE__ */ e.jsx("pre", { children: JSON.stringify(Gn, null, 2) })
3595
3589
  ] })
3596
3590
  ] })
3597
3591
  ] });
@@ -3648,40 +3642,40 @@ function Wn(s) {
3648
3642
  }
3649
3643
  function Pn() {
3650
3644
  var r, c, d;
3651
- const s = i((m) => m.card.preferences), a = i(
3652
- (m) => m.actions.setCardPreferences
3653
- ), t = i(
3654
- (m) => m.actions.setNumberFormat
3655
- ), n = i(
3656
- (m) => {
3657
- var h, u;
3658
- return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.format;
3645
+ const s = l((u) => u.card.preferences), n = l(
3646
+ (u) => u.actions.setCardPreferences
3647
+ ), t = l(
3648
+ (u) => u.actions.setNumberFormat
3649
+ ), a = l(
3650
+ (u) => {
3651
+ var h, m;
3652
+ return (m = (h = u.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : m.format;
3659
3653
  }
3660
- ), o = i(
3661
- (m) => {
3662
- var h, u;
3663
- return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.locale;
3654
+ ), o = l(
3655
+ (u) => {
3656
+ var h, m;
3657
+ return (m = (h = u.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : m.locale;
3664
3658
  }
3665
- ), l = i(
3666
- (m) => {
3667
- var h, u;
3668
- return (u = (h = m.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : u.currency;
3659
+ ), i = l(
3660
+ (u) => {
3661
+ var h, m;
3662
+ return (m = (h = u.card.preferences) == null ? void 0 : h.formatNumber) == null ? void 0 : m.currency;
3669
3663
  }
3670
3664
  );
3671
- return i(
3672
- (m) => m.actions.setFilterOnClickField
3665
+ return l(
3666
+ (u) => u.actions.setFilterOnClickField
3673
3667
  ), /* @__PURE__ */ e.jsxs("div", { children: [
3674
3668
  /* @__PURE__ */ e.jsxs("div", { className: "mb-3 flex items-center gap-2", children: [
3675
3669
  /* @__PURE__ */ e.jsx(
3676
3670
  Qe,
3677
3671
  {
3678
3672
  checked: !!((r = s == null ? void 0 : s.formatNumber) != null && r.enabled),
3679
- onCheckedChange: (m) => {
3680
- a({
3673
+ onCheckedChange: (u) => {
3674
+ n({
3681
3675
  ...s,
3682
3676
  formatNumber: {
3683
3677
  ...s == null ? void 0 : s.formatNumber,
3684
- enabled: m
3678
+ enabled: u
3685
3679
  }
3686
3680
  });
3687
3681
  }
@@ -3694,34 +3688,34 @@ function Pn() {
3694
3688
  /* @__PURE__ */ e.jsx(B, { className: "text-xs", children: "Currency" }),
3695
3689
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3696
3690
  /* @__PURE__ */ e.jsx(
3697
- W,
3691
+ Q,
3698
3692
  {
3699
- value: l || "",
3693
+ value: i || "",
3700
3694
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3701
3695
  placeholder: "USD",
3702
- onChange: (m) => {
3703
- var h, u, f;
3696
+ onChange: (u) => {
3697
+ var h, m, f;
3704
3698
  return t(
3705
3699
  ((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
3706
- m.target.value,
3707
- ((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
3700
+ u.target.value,
3701
+ ((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.locale) || "",
3708
3702
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || ""
3709
3703
  );
3710
3704
  }
3711
3705
  }
3712
3706
  ),
3713
3707
  /* @__PURE__ */ e.jsx(
3714
- W,
3708
+ Q,
3715
3709
  {
3716
3710
  value: o || "",
3717
3711
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3718
3712
  placeholder: "en-US",
3719
- onChange: (m) => {
3720
- var h, u, f;
3713
+ onChange: (u) => {
3714
+ var h, m, f;
3721
3715
  return t(
3722
3716
  ((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
3723
- ((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
3724
- m.target.value,
3717
+ ((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.currency) || "",
3718
+ u.target.value,
3725
3719
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || ""
3726
3720
  );
3727
3721
  }
@@ -3733,8 +3727,8 @@ function Pn() {
3733
3727
  /* @__PURE__ */ e.jsxs("div", { className: "flex gap-1", children: [
3734
3728
  /* @__PURE__ */ e.jsx(B, { className: "text-xs", children: "Format" }),
3735
3729
  /* @__PURE__ */ e.jsxs(We, { children: [
3736
- /* @__PURE__ */ e.jsx(ms, { children: /* @__PURE__ */ e.jsx(
3737
- et,
3730
+ /* @__PURE__ */ e.jsx(us, { children: /* @__PURE__ */ e.jsx(
3731
+ st,
3738
3732
  {
3739
3733
  strokeWidth: 1,
3740
3734
  className: "h-3 w-3 opacity-70"
@@ -3747,17 +3741,17 @@ function Pn() {
3747
3741
  ] })
3748
3742
  ] }),
3749
3743
  /* @__PURE__ */ e.jsx("div", { children: /* @__PURE__ */ e.jsx(
3750
- W,
3744
+ Q,
3751
3745
  {
3752
- value: n || "",
3746
+ value: a || "",
3753
3747
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3754
3748
  placeholder: "###,###.##",
3755
- onChange: (m) => {
3756
- var h, u, f;
3749
+ onChange: (u) => {
3750
+ var h, m, f;
3757
3751
  return t(
3758
- m.target.value,
3752
+ u.target.value,
3759
3753
  ((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.currency) || "",
3760
- ((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.locale) || "",
3754
+ ((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.locale) || "",
3761
3755
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.suffix) || ""
3762
3756
  );
3763
3757
  }
@@ -3767,18 +3761,18 @@ function Pn() {
3767
3761
  /* @__PURE__ */ e.jsxs("div", { children: [
3768
3762
  /* @__PURE__ */ e.jsx(B, { className: "text-xs", children: "Suffix" }),
3769
3763
  /* @__PURE__ */ e.jsx(
3770
- W,
3764
+ Q,
3771
3765
  {
3772
3766
  value: ((d = s == null ? void 0 : s.formatNumber) == null ? void 0 : d.suffix) || "",
3773
3767
  className: "h-7 font-mono text-xs focus-visible:ring-0 focus-visible:ring-ring focus-visible:ring-offset-0",
3774
3768
  placeholder: "K, M, B",
3775
- onChange: (m) => {
3776
- var h, u, f;
3769
+ onChange: (u) => {
3770
+ var h, m, f;
3777
3771
  return t(
3778
3772
  ((h = s == null ? void 0 : s.formatNumber) == null ? void 0 : h.format) || "",
3779
- ((u = s == null ? void 0 : s.formatNumber) == null ? void 0 : u.currency) || "",
3773
+ ((m = s == null ? void 0 : s.formatNumber) == null ? void 0 : m.currency) || "",
3780
3774
  ((f = s == null ? void 0 : s.formatNumber) == null ? void 0 : f.locale) || "",
3781
- m.target.value
3775
+ u.target.value
3782
3776
  );
3783
3777
  }
3784
3778
  }
@@ -3818,14 +3812,14 @@ function Yn() {
3818
3812
  /* @__PURE__ */ e.jsx("div", {})
3819
3813
  ] });
3820
3814
  }
3821
- function Bs({
3815
+ function $s({
3822
3816
  cardType: s,
3823
- docContent: a
3817
+ docContent: n
3824
3818
  }) {
3825
3819
  return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsxs(ke, { defaultValue: ["item-2"], type: "multiple", children: [
3826
3820
  /* @__PURE__ */ e.jsxs(q, { value: "item-1", children: [
3827
3821
  /* @__PURE__ */ e.jsx(V, { children: `${vs(s)} Chart` }),
3828
- /* @__PURE__ */ e.jsx(R, { children: a || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3822
+ /* @__PURE__ */ e.jsx(R, { children: n || /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-xs", children: [
3829
3823
  /* @__PURE__ */ e.jsx("div", { className: "rounded bg-muted px-2 py-1 text-xs", children: "SELECT label, measure FROM table" }),
3830
3824
  /* @__PURE__ */ e.jsxs("ul", { className: "ml-6 list-disc text-xs [&>li]:mt-2", children: [
3831
3825
  /* @__PURE__ */ e.jsx("li", { children: "label - category" }),
@@ -3888,7 +3882,7 @@ function Xn() {
3888
3882
  /* @__PURE__ */ e.jsx(V, { children: "Settings" }),
3889
3883
  /* @__PURE__ */ e.jsxs(R, { className: "space-y-4 px-2", children: [
3890
3884
  /* @__PURE__ */ e.jsx(Ss, {}),
3891
- /* @__PURE__ */ e.jsx(kt, {})
3885
+ /* @__PURE__ */ e.jsx(wt, {})
3892
3886
  ] })
3893
3887
  ] }),
3894
3888
  /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
@@ -3897,10 +3891,8 @@ function Xn() {
3897
3891
  ] })
3898
3892
  ] }) });
3899
3893
  }
3900
- function Zn({
3901
- cardType: s
3902
- }) {
3903
- return console.log("TableVisualSettings", s), /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(ke, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3894
+ function Zn({}) {
3895
+ return /* @__PURE__ */ e.jsx("div", { className: "space-y-6 px-6 py-2", children: /* @__PURE__ */ e.jsx(ke, { defaultValue: ["item-3"], type: "multiple", children: /* @__PURE__ */ e.jsxs(q, { value: "item-3", children: [
3904
3896
  /* @__PURE__ */ e.jsx(V, { children: "Filter on click" }),
3905
3897
  /* @__PURE__ */ e.jsx(R, { className: "px-2", children: /* @__PURE__ */ e.jsx(Me, {}) })
3906
3898
  ] }) }) });
@@ -3923,14 +3915,14 @@ const er = /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 font-mono text-
3923
3915
  ] })
3924
3916
  ] });
3925
3917
  function sr() {
3926
- const s = i((t) => t.card.type);
3927
- function a(t) {
3918
+ const s = l((t) => t.card.type);
3919
+ function n(t) {
3928
3920
  switch (t) {
3929
3921
  case "stackedBar":
3930
3922
  return /* @__PURE__ */ e.jsx(Xn, {});
3931
3923
  case "pyramid":
3932
3924
  return /* @__PURE__ */ e.jsx(
3933
- Bs,
3925
+ $s,
3934
3926
  {
3935
3927
  docContent: er,
3936
3928
  cardType: t
@@ -3945,20 +3937,20 @@ function sr() {
3945
3937
  case "doughnut":
3946
3938
  case "polarArea":
3947
3939
  case "radar":
3948
- return /* @__PURE__ */ e.jsx(Bs, { cardType: t });
3940
+ return /* @__PURE__ */ e.jsx($s, { cardType: t });
3949
3941
  case "bubble":
3950
3942
  case "scatter":
3951
- return /* @__PURE__ */ e.jsx(Gn, { cardType: t });
3943
+ return /* @__PURE__ */ e.jsx(Un, { cardType: t });
3952
3944
  case "table":
3953
3945
  return /* @__PURE__ */ e.jsx(Zn, { cardType: t });
3954
3946
  default:
3955
3947
  return /* @__PURE__ */ e.jsx(Qn, {});
3956
3948
  }
3957
3949
  }
3958
- return /* @__PURE__ */ e.jsx(ys, { className: "h-full w-full text-sm", children: a(s) });
3950
+ return /* @__PURE__ */ e.jsx(ys, { className: "h-full w-full text-sm", children: n(s) });
3959
3951
  }
3960
3952
  function tr() {
3961
- const s = i((a) => a.isShowingVisual);
3953
+ const s = l((n) => n.isShowingVisual);
3962
3954
  return /* @__PURE__ */ e.jsxs(
3963
3955
  rs,
3964
3956
  {
@@ -3975,7 +3967,7 @@ function tr() {
3975
3967
  children: /* @__PURE__ */ e.jsx(Ln, {})
3976
3968
  }
3977
3969
  ),
3978
- /* @__PURE__ */ e.jsx(ls, { withHandle: !0, className: "border " }),
3970
+ /* @__PURE__ */ e.jsx(is, { withHandle: !0, className: "border " }),
3979
3971
  /* @__PURE__ */ e.jsx(
3980
3972
  Fe,
3981
3973
  {
@@ -3994,56 +3986,56 @@ function tr() {
3994
3986
  children: /* @__PURE__ */ e.jsx(sr, {})
3995
3987
  }
3996
3988
  ) }),
3997
- /* @__PURE__ */ e.jsx(ls, { className: "border " }),
3998
- /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(_s, {}) })
3999
- ] }) : /* @__PURE__ */ e.jsx(_s, {})
3989
+ /* @__PURE__ */ e.jsx(is, { className: "border " }),
3990
+ /* @__PURE__ */ e.jsx(Fe, { minSize: 40, defaultSize: 75, maxSize: 100, children: /* @__PURE__ */ e.jsx(Hs, {}) })
3991
+ ] }) : /* @__PURE__ */ e.jsx(Hs, {})
4000
3992
  }
4001
3993
  )
4002
3994
  ]
4003
3995
  }
4004
3996
  );
4005
3997
  }
4006
- function ar({ authToken: s, onSave: a, onClose: t }) {
4007
- const n = i((r) => r.actions.setOnSave), o = i((r) => r.actions.setOnClose), l = k((r) => r.actions.setAuthToken);
3998
+ function ar({ authToken: s, onSave: n, onClose: t }) {
3999
+ const a = l((r) => r.actions.setOnSave), o = l((r) => r.actions.setOnClose), i = k((r) => r.actions.setAuthToken);
4008
4000
  return K(() => {
4009
- a && n(a), t && o(t);
4010
- }, [a, n, t, o]), K(() => {
4011
- s && s.accessToken && l(s);
4012
- }, [s, l]), /* @__PURE__ */ e.jsxs(Da, { className: "rounded-none", role: "editor-panel", children: [
4013
- /* @__PURE__ */ e.jsx(Ia, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(mt, {}) }),
4014
- /* @__PURE__ */ e.jsx(qa, { children: /* @__PURE__ */ e.jsx(tr, {}) })
4001
+ n && a(n), t && o(t);
4002
+ }, [n, a, t, o]), K(() => {
4003
+ s && s.accessToken && i(s);
4004
+ }, [s, i]), /* @__PURE__ */ e.jsxs(Ea, { className: "rounded-none", role: "editor-panel", children: [
4005
+ /* @__PURE__ */ e.jsx(La, { className: "rounded-none border-r-[1.5px]", children: /* @__PURE__ */ e.jsx(xt, {}) }),
4006
+ /* @__PURE__ */ e.jsx(Da, { children: /* @__PURE__ */ e.jsx(tr, {}) })
4015
4007
  ] });
4016
4008
  }
4017
4009
  function nr() {
4018
4010
  k((r) => r.selectedCardId);
4019
- const s = k((r) => r.selectedSheetId), { setIsVisualEditing: a } = k((r) => r.actions), t = k((r) => r.isVisualEditing), n = k((r) => r.actions.updateFrame);
4011
+ const s = k((r) => r.selectedSheetId), { setIsVisualEditing: n } = k((r) => r.actions), t = k((r) => r.isVisualEditing), a = k((r) => r.actions.updateFrame);
4020
4012
  function o(r) {
4021
- s && (n(s, r), a(!1));
4013
+ s && (a(s, r), n(!1));
4022
4014
  }
4023
- function l() {
4024
- a(!1);
4015
+ function i() {
4016
+ n(!1);
4025
4017
  }
4026
4018
  return /* @__PURE__ */ e.jsx(
4027
4019
  "div",
4028
4020
  {
4029
4021
  role: "editor-container",
4030
- className: G("flex grow", {
4022
+ className: Y("flex grow", {
4031
4023
  block: t,
4032
4024
  hidden: !t
4033
4025
  }),
4034
- children: /* @__PURE__ */ e.jsx(ar, { onSave: o, onClose: l })
4026
+ children: /* @__PURE__ */ e.jsx(ar, { onSave: o, onClose: i })
4035
4027
  }
4036
4028
  );
4037
4029
  }
4038
4030
  function rr({
4039
4031
  columns: s,
4040
- tableName: a
4032
+ tableName: n
4041
4033
  }) {
4042
- const t = i((u) => u.selectedConnectionId), n = i((u) => u.selectedDatabaseName), o = i((u) => u.selectedSchemaName), l = i((u) => u.selectedTableName), r = k((u) => u.dashboard.filters) || [], c = k((u) => u.actions.addFilter), d = k((u) => u.actions.removeFilter), m = k(
4043
- (u) => u.actions.removeFilterValue
4034
+ const t = l((m) => m.selectedConnectionId), a = l((m) => m.selectedDatabaseName), o = l((m) => m.selectedSchemaName), i = l((m) => m.selectedTableName), r = k((m) => m.dashboard.filters) || [], c = k((m) => m.actions.addFilter), d = k((m) => m.actions.removeFilter), u = k(
4035
+ (m) => m.actions.removeFilterValue
4044
4036
  );
4045
- function h(u) {
4046
- const f = de(u.column_name), p = de(n || ""), g = de(o || ""), S = de(a), N = as(
4037
+ function h(m) {
4038
+ const f = de(m.column_name), p = de(a || ""), g = de(o || ""), S = de(n), N = as(
4047
4039
  g,
4048
4040
  S
4049
4041
  ), j = `${N}.${f}`;
@@ -4054,24 +4046,24 @@ function rr({
4054
4046
  p
4055
4047
  );
4056
4048
  const L = r == null ? void 0 : r.find(
4057
- (A) => A.column === j && A.table === S && (A.database === p || A.database === n)
4049
+ (A) => A.column === j && A.table === S && (A.database === p || A.database === a)
4058
4050
  );
4059
4051
  if (L)
4060
- m(L.id), d(L.id);
4052
+ u(L.id), d(L.id);
4061
4053
  else {
4062
- if (a === "api" && t) {
4054
+ if (n === "api" && t) {
4063
4055
  c({
4064
4056
  id: $e(),
4065
4057
  column: j,
4066
- title: u.column_name,
4067
- dataType: u.data_type,
4058
+ title: m.column_name,
4059
+ dataType: m.data_type,
4068
4060
  table: "api",
4069
4061
  database: "",
4070
4062
  // database: 'NA',
4071
4063
  connectionId: t,
4072
4064
  operation: "in",
4073
- sql: qs(
4074
- u.data_type,
4065
+ sql: Vs(
4066
+ m.data_type,
4075
4067
  N,
4076
4068
  f
4077
4069
  )
@@ -4082,14 +4074,14 @@ function rr({
4082
4074
  c({
4083
4075
  id: $e(),
4084
4076
  column: `${N}.${f}`,
4085
- title: u.column_name,
4086
- dataType: u.data_type,
4087
- table: l || "",
4088
- database: n || "",
4077
+ title: m.column_name,
4078
+ dataType: m.data_type,
4079
+ table: i || "",
4080
+ database: a || "",
4089
4081
  connectionId: t || "",
4090
4082
  operation: "in",
4091
- sql: qs(
4092
- u.data_type,
4083
+ sql: Vs(
4084
+ m.data_type,
4093
4085
  N,
4094
4086
  f
4095
4087
  )
@@ -4097,33 +4089,33 @@ function rr({
4097
4089
  });
4098
4090
  }
4099
4091
  }
4100
- return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((u) => {
4092
+ return /* @__PURE__ */ e.jsx("div", { className: "xbg-red-100 flex-1 basis-0 flex-col overflow-scroll px-3", children: s == null ? void 0 : s.map((m) => {
4101
4093
  const f = r == null ? void 0 : r.find(
4102
- (p) => p.column === de(u.column_name) && p.table === l && p.database === n
4094
+ (p) => p.column === de(m.column_name) && p.table === i && p.database === a
4103
4095
  );
4104
4096
  return /* @__PURE__ */ e.jsx(
4105
4097
  "div",
4106
4098
  {
4107
- onClick: () => h(u),
4108
- className: G(
4099
+ onClick: () => h(m),
4100
+ className: Y(
4109
4101
  "group flex cursor-pointer items-center justify-between border border-dashed border-background px-3 py-[6px] text-sm transition-colors hover:bg-muted/50",
4110
4102
  {
4111
4103
  "bg-muted": f
4112
4104
  }
4113
4105
  ),
4114
4106
  children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
4115
- /* @__PURE__ */ e.jsx(ht, { column: u }),
4116
- /* @__PURE__ */ e.jsx("span", { children: u.column_name })
4107
+ /* @__PURE__ */ e.jsx(mt, { column: m }),
4108
+ /* @__PURE__ */ e.jsx("span", { children: m.column_name })
4117
4109
  ] })
4118
4110
  },
4119
- u.column_name
4111
+ m.column_name
4120
4112
  );
4121
4113
  }) });
4122
4114
  }
4123
- function lr() {
4124
- k((a) => a.showFilters);
4115
+ function ir() {
4116
+ k((n) => n.showFilters);
4125
4117
  const s = k(
4126
- (a) => a.actions.setShowFilters
4118
+ (n) => n.actions.setShowFilters
4127
4119
  );
4128
4120
  return /* @__PURE__ */ e.jsxs("section", { className: "relative flex grow flex-col border-l px-4", children: [
4129
4121
  /* @__PURE__ */ e.jsxs("div", { className: "mt-4 flex items-center justify-between gap-2 px-3", children: [
@@ -4139,57 +4131,57 @@ function lr() {
4139
4131
  )
4140
4132
  ] }),
4141
4133
  /* @__PURE__ */ e.jsx("div", { className: "flex grow", children: /* @__PURE__ */ e.jsx(
4142
- mt,
4134
+ xt,
4143
4135
  {
4144
- ColumnsComponent: (a, t, n) => /* @__PURE__ */ e.jsx(
4136
+ ColumnsComponent: (n, t, a) => /* @__PURE__ */ e.jsx(
4145
4137
  rr,
4146
4138
  {
4147
- schemaName: a,
4139
+ schemaName: n,
4148
4140
  tableName: t,
4149
- columns: n
4141
+ columns: a
4150
4142
  }
4151
4143
  )
4152
4144
  }
4153
4145
  ) })
4154
4146
  ] });
4155
4147
  }
4156
- function ir() {
4148
+ function lr() {
4157
4149
  k((t) => t.dashboard);
4158
- const s = k((t) => t.showFilters), a = k((t) => t.isVisualEditing);
4150
+ const s = k((t) => t.showFilters), n = k((t) => t.isVisualEditing);
4159
4151
  return k((t) => t.bookmarkKey), /* @__PURE__ */ e.jsxs(
4160
4152
  "div",
4161
4153
  {
4162
4154
  role: "dashboard-plus-main",
4163
- className: G("grow", {
4164
- hidden: a,
4165
- flex: !a
4155
+ className: Y("grow", {
4156
+ hidden: n,
4157
+ flex: !n
4166
4158
  }),
4167
4159
  children: [
4168
- /* @__PURE__ */ e.jsx(Va, {}),
4169
- s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(lr, {}) })
4160
+ /* @__PURE__ */ e.jsx(Ia, {}),
4161
+ s && /* @__PURE__ */ e.jsx("div", { role: "filter-aside-container", className: "flex", children: /* @__PURE__ */ e.jsx(ir, {}) })
4170
4162
  ]
4171
4163
  }
4172
4164
  );
4173
4165
  }
4174
4166
  function or() {
4175
- const s = k((n) => n.dashboard), a = k((n) => n.actions.setDashboard), t = k(
4176
- (n) => n.showDashboardJSON
4167
+ const s = k((a) => a.dashboard), n = k((a) => a.actions.setDashboard), t = k(
4168
+ (a) => a.showDashboardJSON
4177
4169
  );
4178
4170
  return k(
4179
- (n) => n.actions.setShowDashboardJSON
4171
+ (a) => a.actions.setShowDashboardJSON
4180
4172
  ), /* @__PURE__ */ e.jsx(
4181
4173
  "div",
4182
4174
  {
4183
- className: G(" p-2", {
4175
+ className: Y(" p-2", {
4184
4176
  hidden: !t
4185
4177
  }),
4186
4178
  children: /* @__PURE__ */ e.jsx(
4187
- Ra,
4179
+ qa,
4188
4180
  {
4189
- onChange: (n) => {
4190
- if (n)
4181
+ onChange: (a) => {
4182
+ if (a)
4191
4183
  try {
4192
- JSON.parse(n), a(JSON.parse(n));
4184
+ JSON.parse(a), n(JSON.parse(a));
4193
4185
  } catch {
4194
4186
  }
4195
4187
  },
@@ -4217,17 +4209,20 @@ function or() {
4217
4209
  }
4218
4210
  function hr({
4219
4211
  showControls: s = !1,
4220
- showFooter: a = !0,
4212
+ showFooter: n = !0,
4221
4213
  ...t
4222
4214
  }) {
4223
- return /* @__PURE__ */ e.jsx(_a, { dashboardProps: t, children: /* @__PURE__ */ e.jsxs(Ha, { children: [
4224
- /* @__PURE__ */ e.jsx(or, {}),
4225
- /* @__PURE__ */ e.jsxs(Ba, { ...t, children: [
4226
- s && /* @__PURE__ */ e.jsx(gn, {}),
4227
- /* @__PURE__ */ e.jsx(nr, {}),
4228
- /* @__PURE__ */ e.jsx(ir, {})
4215
+ return /* @__PURE__ */ e.jsxs(Va, { dashboardProps: t, children: [
4216
+ /* @__PURE__ */ e.jsx(Ra, {}),
4217
+ /* @__PURE__ */ e.jsxs(_a, { children: [
4218
+ /* @__PURE__ */ e.jsx(or, {}),
4219
+ /* @__PURE__ */ e.jsxs(Ha, { ...t, children: [
4220
+ s && /* @__PURE__ */ e.jsx(gn, {}),
4221
+ /* @__PURE__ */ e.jsx(nr, {}),
4222
+ /* @__PURE__ */ e.jsx(lr, {})
4223
+ ] })
4229
4224
  ] })
4230
- ] }) });
4225
+ ] });
4231
4226
  }
4232
4227
  export {
4233
4228
  hr as D,